From 7329975eec51d30ada60ef2d2f1ec1f99a88b358 Mon Sep 17 00:00:00 2001 From: hengsin Date: Fri, 8 Dec 2023 20:02:49 +0800 Subject: [PATCH] IDEMPIERE-5838 Base: Improve readability of code (#2129) * IDEMPIERE-5838 Base: Improve readability of code * IDEMPIERE-5838 Base: Improve readability of code --- .../org/adempiere/process/UpdateRoleMenu.java | 1 + .../compiere/process/DistributionCreate.java | 3 +- .../src/org/compiere/process/IssueReport.java | 4 +- .../uk/postcode/AddressInterface.java | 2 + .../akunagroup/uk/postcode/AddressLookup.java | 2 + .../uk/postcode/AddressLookupInterface.java | 2 + .../com/akunagroup/uk/postcode/Postcode.java | 1 + .../adempiere/apps/graph/ChartBuilder.java | 92 +++- .../adempiere/apps/graph/GraphBuilder.java | 3 +- .../org/adempiere/apps/graph/GraphColumn.java | 40 +- .../adempiere/base/AbstractModelFactory.java | 21 + .../AnnotationBasedColumnCalloutFactory.java | 27 ++ .../base/AnnotationBasedEventManager.java | 27 ++ .../base/AnnotationBasedFactory.java | 9 +- .../base/AnnotationBasedModelFactory.java | 12 +- .../base/AnnotationBasedProcessFactory.java | 12 +- .../adempiere/base/ColumnCalloutManager.java | 5 +- .../base/ComponentBlackListService.java | 2 + .../base/DefaultAddressValidationFactory.java | 3 +- .../adempiere/base/DefaultCalloutFactory.java | 8 +- .../base/DefaultColumnCalloutFactory.java | 3 +- .../base/DefaultDocumentFactory.java | 3 +- .../adempiere/base/DefaultLookupFactory.java | 3 +- .../base/DefaultModelValidatorFactory.java | 3 +- .../base/DefaultPaymentExporterFactory.java | 3 +- .../base/DefaultPaymentProcessorFactory.java | 3 +- .../adempiere/base/DefaultProcessFactory.java | 3 +- .../base/DefaultProductPricingFactory.java | 28 ++ .../base/DefaultShipmentProcessorFactory.java | 3 +- .../org/adempiere/base/DefaultTaxLookup.java | 3 +- .../base/DefaultTaxProviderFactory.java | 4 +- .../base/IBankStatementLoaderFactory.java | 2 +- .../base/IBankStatementMatcherFactory.java | 2 +- .../org/adempiere/base/ICalloutFactory.java | 8 +- .../org/adempiere/base/IColumnCallout.java | 8 +- .../adempiere/base/IColumnCalloutFactory.java | 6 +- .../adempiere/base/IDictionaryService.java | 13 +- .../adempiere/base/IDisplayTypeFactory.java | 87 +++- .../src/org/adempiere/base/IDocFactory.java | 3 +- .../org/adempiere/base/IGridTabImporter.java | 9 +- .../src/org/adempiere/base/IKeyStore.java | 4 +- .../org/adempiere/base/ILookupFactory.java | 6 +- .../adempiere/base/IMappedByNameFactory.java | 2 - .../base/IMappedColumnCalloutFactory.java | 5 +- .../base/IMappedDocumentFactory.java | 4 +- .../base/IModelValidatorFactory.java | 4 +- .../base/IPaymentExporterFactory.java | 4 +- .../base/IPaymentProcessorFactory.java | 5 +- .../org/adempiere/base/IProcessFactory.java | 5 +- .../org/adempiere/base/IProductPricing.java | 2 +- .../base/IProductPricingFactory.java | 6 + .../org/adempiere/base/IReplenishFactory.java | 3 +- .../org/adempiere/base/IResourceFinder.java | 7 + .../org/adempiere/base/IServiceHolder.java | 2 +- .../org/adempiere/base/IServiceLocator.java | 21 +- .../base/IServiceReferenceHolder.java | 4 +- .../org/adempiere/base/IServicesHolder.java | 2 +- .../base/IShipmentProcessorFactory.java | 5 +- .../src/org/adempiere/base/ITaxLookup.java | 3 +- .../adempiere/base/ITaxProviderFactory.java | 3 +- .../base/MappedColumnCalloutFactory.java | 6 +- .../adempiere/base/MappedDocumentFactory.java | 11 +- .../src/org/adempiere/base/Model.java | 2 +- .../src/org/adempiere/base/Service.java | 3 +- .../adempiere/base/annotation/Callout.java | 5 +- .../base/annotation/EventTopicDelegate.java | 4 +- .../base/annotation/ImportEventTopic.java | 4 +- .../base/annotation/ModelEventTopic.java | 4 +- .../adempiere/base/annotation/Parameter.java | 6 +- .../adempiere/base/annotation/Process.java | 12 + .../base/annotation/ProcessEventTopic.java | 6 +- .../base/ds/DynamicServiceHolder.java | 2 +- .../base/ds/DynamicServiceLocator.java | 11 +- .../base/ds/DynamicServiceReference.java | 2 +- .../base/ds/ServiceRankingComparator.java | 5 +- .../base/equinox/EquinoxExtensionHolder.java | 1 + .../base/equinox/EquinoxExtensionLocator.java | 17 +- .../adempiere/base/equinox/ExtensionList.java | 48 +- .../equinox/ExtensionPriorityManager.java | 2 +- .../base/equinox/StackTraceCommand.java | 5 +- .../base/event/AbstractEventHandler.java | 5 +- .../org/adempiere/base/event/EventHelper.java | 4 +- .../adempiere/base/event/EventManager.java | 2 +- .../adempiere/base/event/FactsEventData.java | 4 +- .../adempiere/base/event/IEventManager.java | 3 +- .../adempiere/base/event/IEventTopics.java | 5 +- .../adempiere/base/event/ImportEventData.java | 8 +- .../adempiere/base/event/LoginEventData.java | 5 +- .../base/event/ReportSendEMailEventData.java | 54 +++ .../base/event/RequestEventHandler.java | 24 +- .../base/event/RequestPropertyService.java | 17 +- .../base/event/RequestSendEMailEventData.java | 70 ++- .../annotations/AfterLoginEventDelegate.java | 5 +- .../event/annotations/BaseEventHandler.java | 13 +- .../base/event/annotations/EventDelegate.java | 6 +- .../event/annotations/ModelEventDelegate.java | 9 +- .../event/annotations/ModelEventHandler.java | 12 +- .../RequestSendEmailEventDelegate.java | 3 +- .../event/annotations/SimpleEventHandler.java | 4 +- .../doc/FactsValidateDelegate.java | 7 +- .../annotations/imp/ImportEventDelegate.java | 5 +- .../annotations/imp/ImportEventHandler.java | 5 +- .../process/ProcessEventDelegate.java | 5 +- .../process/ProcessEventHandler.java | 6 +- .../delegate/AutoProduceEventDelegate.java | 16 + .../adempiere/base/upload/IUploadHandler.java | 6 +- .../adempiere/base/upload/IUploadService.java | 1 - .../adempiere/base/upload/UploadMedia.java | 6 - .../adempiere/base/upload/UploadResponse.java | 6 +- .../exceptions/AdempiereException.java | 2 +- .../exceptions/BPartnerException.java | 10 +- .../BPartnerNoAddressException.java | 2 +- .../BPartnerNoBillToAddressException.java | 2 +- .../BPartnerNoShipToAddressException.java | 2 +- .../org/adempiere/exceptions/DBException.java | 25 +- .../exceptions/DocTypeNotFoundException.java | 11 +- .../exceptions/FillMandatoryException.java | 11 +- .../InvoiceFullyMatchedException.java | 4 +- .../NegativeInventoryDisallowedException.java | 13 +- .../exceptions/NoUOMConversionException.java | 13 +- .../NoVendorForProductException.java | 4 +- .../exceptions/PORelationException.java | 18 +- .../exceptions/PeriodClosedException.java | 9 +- .../ProductNotOnPriceListException.java | 11 +- .../TaxCriteriaNotFoundException.java | 11 +- .../TaxForChangeNotFoundException.java | 21 +- .../exceptions/TaxNoExemptFoundException.java | 11 + .../exceptions/TaxNotFoundException.java | 23 +- .../WarehouseInvalidForOrgException.java | 3 +- .../WarehouseLocatorConflictException.java | 4 +- .../impexp/AbstractExcelExporter.java | 95 +++- .../impexp/AbstractXLSXExporter.java | 88 +++- .../adempiere/impexp/ArrayExcelExporter.java | 6 +- .../adempiere/impexp/GridTabCSVExporter.java | 41 +- .../adempiere/impexp/GridTabCSVImporter.java | 117 ++++- .../impexp/GridTabExcelExporter.java | 11 +- .../adempiere/impexp/GridTabXLSXExporter.java | 10 +- .../adempiere/model/CalloutInfoWindow.java | 25 +- .../adempiere/model/DocActionDelegate.java | 8 +- .../src/org/adempiere/model/GenericPO.java | 4 +- .../adempiere/model/GenericZoomProvider.java | 17 +- .../org/adempiere/model/GridTabWrapper.java | 20 +- .../adempiere/model/IAddressValidation.java | 7 + .../src/org/adempiere/model/IInfoColumn.java | 8 +- .../adempiere/model/IShipmentProcessor.java | 24 +- .../src/org/adempiere/model/ITaxProvider.java | 4 +- .../org/adempiere/model/IZoomProvider.java | 4 +- .../org/adempiere/model/ImportValidator.java | 8 + .../adempiere/model/MBroadcastMessage.java | 22 +- .../model/MFreightShipmentProcessor.java | 17 + .../src/org/adempiere/model/MInfoProcess.java | 16 +- .../src/org/adempiere/model/MInfoRelated.java | 20 +- .../src/org/adempiere/model/MPromotion.java | 16 + .../model/MPromotionDistribution.java | 16 + .../org/adempiere/model/MPromotionGroup.java | 16 + .../adempiere/model/MPromotionGroupLine.java | 16 + .../org/adempiere/model/MPromotionLine.java | 16 + .../model/MPromotionPreCondition.java | 16 + .../org/adempiere/model/MPromotionReward.java | 16 + .../org/adempiere/model/MRelationType.java | 96 +++- .../org/adempiere/model/MShipperFacade.java | 63 ++- .../adempiere/model/MTabCustomization.java | 52 ++- .../org/adempiere/model/MWizardProcess.java | 28 +- .../model/MWlistboxCustomization.java | 27 +- .../src/org/adempiere/model/POWrapper.java | 28 +- .../model/ProductPriceValidator.java | 8 +- .../org/adempiere/model/PromotionRule.java | 38 +- .../adempiere/model/PromotionValidator.java | 19 + .../org/adempiere/model/ShippingPackage.java | 34 ++ .../org/adempiere/model/ZoomInfoFactory.java | 4 +- .../src/org/adempiere/pdf/Document.java | 25 +- .../print/export/PrintDataExcelExporter.java | 24 + .../print/export/PrintDataXLSXExporter.java | 22 + .../adempiere/process/DepositBatchClose.java | 4 +- .../adempiere/process/Fill1099Extract.java | 8 +- .../process/IPrintShippingLabel.java | 39 ++ .../org/adempiere/process/ImportProcess.java | 24 +- .../adempiere/process/PrintShippingLabel.java | 21 + .../adempiere/process/RateInquiryProcess.java | 24 + .../process/RecreateStorageReservation.java | 4 + .../adempiere/process/ResetLockedAccount.java | 24 + .../process/SalesOrderRateInquiryProcess.java | 11 +- .../adempiere/process/ShipperCopyFrom.java | 36 ++ .../adempiere/process/ShipperCreateFrom.java | 33 ++ .../org/adempiere/process/UUIDGenerator.java | 12 +- .../process/VoidShipmentProcess.java | 2 +- .../src/org/adempiere/util/Callback.java | 6 +- .../org/adempiere/util/ContextRunnable.java | 4 +- .../util/DefaultReservationTracerFactory.java | 5 +- .../src/org/adempiere/util/GenerateModel.java | 2 + .../org/adempiere/util/GenerateModelJPA.java | 2 + .../src/org/adempiere/util/GridRowCtx.java | 20 +- .../src/org/adempiere/util/ICalloutUI.java | 11 + .../src/org/adempiere/util/IProcessUI.java | 13 +- .../adempiere/util/IReservationTracer.java | 4 +- .../util/IReservationTracerFactory.java | 5 +- .../org/adempiere/util/LogAuthFailure.java | 14 +- .../org/adempiere/util/MeasureInterface.java | 2 +- .../adempiere/util/ModelClassGenerator.java | 21 +- .../adempiere/util/ModelGeneratorDialog.java | 9 + .../util/ModelInterfaceGenerator.java | 42 +- .../src/org/adempiere/util/PaymentUtil.java | 36 +- .../src/org/adempiere/util/ProcessUtil.java | 27 +- .../adempiere/util/ReservationLogTracer.java | 3 +- .../src/org/adempiere/util/ServerContext.java | 2 +- .../util/ServerContextPropertiesWrapper.java | 5 +- .../adempiere/util/ServerContextProvider.java | 5 +- .../util/ServerContextURLHandler.java | 30 ++ .../src/org/adempiere/util/ShippingUtil.java | 51 ++- .../src/org/compiere/Adempiere.java | 85 +++- .../src/org/compiere/acct/Doc.java | 125 ++--- .../src/org/compiere/acct/DocLine.java | 52 ++- .../org/compiere/acct/DocLine_Allocation.java | 35 +- .../src/org/compiere/acct/DocLine_Bank.java | 14 +- .../src/org/compiere/acct/DocLine_Cash.java | 7 +- .../src/org/compiere/acct/DocLine_InOut.java | 1 + .../src/org/compiere/acct/DocManager.java | 27 +- .../src/org/compiere/acct/DocTax.java | 13 +- .../org/compiere/acct/Doc_AllocationHdr.java | 49 +- .../org/compiere/acct/Doc_AssetAddition.java | 45 +- .../org/compiere/acct/Doc_AssetDisposed.java | 33 +- .../src/org/compiere/acct/Doc_AssetReval.java | 50 +- .../org/compiere/acct/Doc_AssetTransfer.java | 18 +- .../org/compiere/acct/Doc_BankStatement.java | 20 +- .../src/org/compiere/acct/Doc_Cash.java | 12 +- .../compiere/acct/Doc_DepreciationEntry.java | 12 +- .../src/org/compiere/acct/Doc_GLJournal.java | 8 +- .../src/org/compiere/acct/Doc_InOut.java | 23 +- .../src/org/compiere/acct/Doc_Inventory.java | 9 +- .../src/org/compiere/acct/Doc_Invoice.java | 9 +- .../src/org/compiere/acct/Doc_MatchInv.java | 13 +- .../src/org/compiere/acct/Doc_MatchPO.java | 27 +- .../src/org/compiere/acct/Doc_Movement.java | 15 +- .../src/org/compiere/acct/Doc_Order.java | 23 +- .../src/org/compiere/acct/Doc_Payment.java | 9 +- .../src/org/compiere/acct/Doc_Production.java | 14 +- .../org/compiere/acct/Doc_ProjectIssue.java | 7 +- .../org/compiere/acct/Doc_Requisition.java | 15 +- .../src/org/compiere/acct/Fact.java | 35 +- .../src/org/compiere/acct/FactLine.java | 53 +-- .../src/org/compiere/acct/FactUtil.java | 2 +- .../src/org/compiere/acct/Matcher.java | 7 +- .../src/org/compiere/acct/ProductInfo.java | 2 +- .../org/compiere/db/AdempiereDatabase.java | 116 +++-- .../src/org/compiere/db/CConnection.java | 87 ++-- .../compiere/db/CallableStatementProxy.java | 9 + .../src/org/compiere/db/Database.java | 17 +- .../src/org/compiere/db/LDAP.java | 85 +--- .../compiere/db/PreparedStatementProxy.java | 22 +- .../src/org/compiere/db/ProxyFactory.java | 24 +- .../db/ReadReplicaPreparedStatementProxy.java | 5 +- .../org/compiere/db/SecurityPrincipal.java | 3 +- .../src/org/compiere/db/StatementProxy.java | 27 +- .../src/org/compiere/dbPort/Convert.java | 51 ++- .../org/compiere/dbPort/Convert_SQL92.java | 24 +- .../src/org/compiere/dbPort/Join.java | 18 +- .../impexp/BankStatementLoaderInterface.java | 78 ++-- .../impexp/BankStatementMatchInfo.java | 4 +- .../impexp/BankStatementMatcherInterface.java | 2 +- .../org/compiere/impexp/CopyImportFormat.java | 4 +- .../src/org/compiere/impexp/ImpFormat.java | 56 ++- .../src/org/compiere/impexp/ImpFormatRow.java | 10 +- .../src/org/compiere/impexp/MImpFormat.java | 13 +- .../org/compiere/impexp/MImpFormatRow.java | 13 +- .../src/org/compiere/impexp/OFX1ToXML.java | 11 +- .../impexp/OFXBankStatementHandler.java | 162 +++---- .../impexp/OFXFileBankStatementLoader.java | 16 +- .../src/org/compiere/install/Translation.java | 29 +- .../compiere/install/TranslationHandler.java | 14 +- .../org/compiere/model/AccessSqlParser.java | 7 +- .../compiere/model/AdempiereProcessor.java | 12 +- .../compiere/model/AdempiereProcessor2.java | 10 +- .../compiere/model/AdempiereProcessorLog.java | 6 +- .../src/org/compiere/model/ArchiveDB.java | 5 +- .../org/compiere/model/ArchiveFileSystem.java | 12 +- .../compiere/model/AttachmentDBSystem.java | 9 +- .../compiere/model/AttachmentFileSystem.java | 15 +- .../src/org/compiere/model/Callout.java | 15 +- .../src/org/compiere/model/CalloutEngine.java | 15 +- .../org/compiere/model/DataStatusEvent.java | 40 +- .../compiere/model/DataStatusListener.java | 2 +- .../src/org/compiere/model/DatabaseKey.java | 33 +- .../org/compiere/model/DocWorkflowMgr.java | 1 - .../org/compiere/model/FactsValidator.java | 28 +- .../src/org/compiere/model/GridField.java | 429 +++++++++++------- .../src/org/compiere/model/GridFieldVO.java | 47 +- .../src/org/compiere/model/GridTab.java | 409 ++++++++++------- .../src/org/compiere/model/GridTabVO.java | 63 +-- .../src/org/compiere/model/GridTable.java | 278 +++++++----- .../src/org/compiere/model/GridWindow.java | 61 +-- .../src/org/compiere/model/GridWindowVO.java | 29 +- .../src/org/compiere/model/IArchiveStore.java | 29 ++ .../model/IAttachmentLazyDataSource.java | 4 +- .../org/compiere/model/IAttachmentStore.java | 30 +- .../src/org/compiere/model/IImageStore.java | 29 ++ .../src/org/compiere/model/IMFAMechanism.java | 19 +- .../compiere/model/ImageDBStorageImpl.java | 3 +- .../compiere/model/ImageFileStorageImpl.java | 12 +- .../src/org/compiere/model/InfoColumnVO.java | 109 ++++- .../src/org/compiere/model/InfoRelatedVO.java | 43 +- .../src/org/compiere/model/Lookup.java | 94 ++-- .../compiere/model/LookupDisplayColumn.java | 5 +- .../src/org/compiere/model/MAccessLog.java | 12 +- .../src/org/compiere/model/MAccount.java | 65 +-- .../org/compiere/model/MAccountLookup.java | 23 +- .../org/compiere/model/MAcctProcessor.java | 15 +- .../org/compiere/model/MAcctProcessorLog.java | 12 +- .../src/org/compiere/model/MAcctSchema.java | 74 ++- .../compiere/model/MAcctSchemaDefault.java | 23 +- .../compiere/model/MAcctSchemaElement.java | 51 +-- .../src/org/compiere/model/MAcctSchemaGL.java | 29 +- .../src/org/compiere/model/MAchievement.java | 17 +- .../src/org/compiere/model/MActivity.java | 26 +- .../compiere/model/MAddressTransaction.java | 32 +- .../compiere/model/MAddressValidation.java | 56 ++- .../src/org/compiere/model/MAging.java | 16 +- .../src/org/compiere/model/MAlert.java | 17 +- .../org/compiere/model/MAlertProcessor.java | 26 +- .../compiere/model/MAlertProcessorLog.java | 12 +- .../org/compiere/model/MAlertRecipient.java | 17 +- .../src/org/compiere/model/MAlertRule.java | 18 +- .../org/compiere/model/MAllocationHdr.java | 101 +++-- .../org/compiere/model/MAllocationLine.java | 28 +- .../src/org/compiere/model/MArchive.java | 34 +- .../src/org/compiere/model/MAsset.java | 100 ++-- .../src/org/compiere/model/MAssetAcct.java | 55 ++- .../org/compiere/model/MAssetAddition.java | 154 +++++-- .../src/org/compiere/model/MAssetChange.java | 46 +- .../src/org/compiere/model/MAssetClass.java | 94 ++-- .../org/compiere/model/MAssetDelivery.java | 13 +- .../org/compiere/model/MAssetDisposed.java | 132 ++++-- .../src/org/compiere/model/MAssetGroup.java | 54 ++- .../org/compiere/model/MAssetGroupAcct.java | 57 ++- .../src/org/compiere/model/MAssetProduct.java | 42 +- .../src/org/compiere/model/MAssetReval.java | 79 +++- .../org/compiere/model/MAssetTransfer.java | 55 ++- .../src/org/compiere/model/MAssetType.java | 68 ++- .../src/org/compiere/model/MAssetUse.java | 112 +++-- .../org/compiere/model/MAssignmentSlot.java | 53 +-- .../src/org/compiere/model/MAttachment.java | 135 ++---- .../org/compiere/model/MAttachmentEntry.java | 37 +- .../org/compiere/model/MAttachmentNote.java | 12 +- .../src/org/compiere/model/MAttribute.java | 52 ++- .../compiere/model/MAttributeInstance.java | 24 +- .../src/org/compiere/model/MAttributeSet.java | 67 +-- .../compiere/model/MAttributeSetExclude.java | 18 +- .../compiere/model/MAttributeSetInstance.java | 65 ++- .../src/org/compiere/model/MAttributeUse.java | 19 +- .../org/compiere/model/MAttributeValue.java | 20 +- .../compiere/model/MAuthorizationAccount.java | 24 +- .../model/MAuthorizationCredential.java | 18 +- .../model/MAuthorizationProvider.java | 12 +- .../model/MAuthorizationScopeProv.java | 18 +- .../src/org/compiere/model/MBOM.java | 3 +- .../src/org/compiere/model/MBOMProduct.java | 3 +- .../org/compiere/model/MBPBankAccount.java | 35 +- .../src/org/compiere/model/MBPGroup.java | 28 +- .../src/org/compiere/model/MBPartner.java | 101 +++-- .../src/org/compiere/model/MBPartnerInfo.java | 21 +- .../org/compiere/model/MBPartnerLocation.java | 35 +- .../org/compiere/model/MBPartnerProduct.java | 30 +- .../src/org/compiere/model/MBank.java | 27 +- .../src/org/compiere/model/MBankAccount.java | 25 +- .../compiere/model/MBankAccountProcessor.java | 71 ++- .../org/compiere/model/MBankStatement.java | 68 ++- .../compiere/model/MBankStatementLine.java | 31 +- .../compiere/model/MBankStatementLoader.java | 38 +- .../compiere/model/MBankStatementMatcher.java | 20 +- .../src/org/compiere/model/MBankTransfer.java | 17 +- .../org/compiere/model/MBlackListCheque.java | 23 +- .../src/org/compiere/model/MCalendar.java | 31 +- .../src/org/compiere/model/MCampaign.java | 24 +- .../src/org/compiere/model/MCash.java | 70 ++- .../src/org/compiere/model/MCashBook.java | 21 +- .../src/org/compiere/model/MCashLine.java | 47 +- .../src/org/compiere/model/MCashPlan.java | 15 +- .../src/org/compiere/model/MCashPlanLine.java | 22 +- .../src/org/compiere/model/MChangeLog.java | 29 +- .../src/org/compiere/model/MChangeNotice.java | 12 +- .../org/compiere/model/MChangeRequest.java | 14 +- .../src/org/compiere/model/MCharge.java | 25 +- .../src/org/compiere/model/MChart.java | 54 ++- .../org/compiere/model/MChartDatasource.java | 57 ++- .../src/org/compiere/model/MChat.java | 23 +- .../src/org/compiere/model/MChatEntry.java | 14 +- .../src/org/compiere/model/MChatType.java | 18 +- .../src/org/compiere/model/MCity.java | 27 +- .../src/org/compiere/model/MClient.java | 60 ++- .../src/org/compiere/model/MClientInfo.java | 26 +- .../src/org/compiere/model/MClientShare.java | 37 +- .../src/org/compiere/model/MColor.java | 53 +-- .../src/org/compiere/model/MColorSchema.java | 32 +- .../src/org/compiere/model/MColumn.java | 118 +++-- .../src/org/compiere/model/MColumnAccess.java | 15 +- .../src/org/compiere/model/MCommission.java | 19 +- .../org/compiere/model/MCommissionAmt.java | 25 +- .../org/compiere/model/MCommissionDetail.java | 23 +- .../org/compiere/model/MCommissionLine.java | 18 +- .../org/compiere/model/MCommissionRun.java | 24 +- .../org/compiere/model/MContactInterest.java | 66 +-- .../org/compiere/model/MConversionRate.java | 32 +- .../compiere/model/MConversionRateUtil.java | 11 +- .../org/compiere/model/MConversionType.java | 26 +- .../src/org/compiere/model/MCost.java | 193 ++++---- .../src/org/compiere/model/MCostDetail.java | 97 ++-- .../src/org/compiere/model/MCostElement.java | 72 +-- .../src/org/compiere/model/MCostQueue.java | 35 +- .../src/org/compiere/model/MCostType.java | 15 +- .../src/org/compiere/model/MCountry.java | 50 +- .../src/org/compiere/model/MCountryGroup.java | 28 +- .../compiere/model/MCountryGroupCountry.java | 18 +- .../src/org/compiere/model/MCtxHelp.java | 12 +- .../src/org/compiere/model/MCtxHelpMsg.java | 23 +- .../compiere/model/MCtxHelpSuggestion.java | 39 +- .../src/org/compiere/model/MCurrency.java | 21 +- .../src/org/compiere/model/MCurrencyAcct.java | 17 +- .../org/compiere/model/MDashboardContent.java | 108 ++++- .../model/MDashboardContentAccess.java | 45 +- .../compiere/model/MDashboardPreference.java | 44 +- .../src/org/compiere/model/MDepositBatch.java | 61 ++- .../org/compiere/model/MDepositBatchLine.java | 29 +- .../src/org/compiere/model/MDepreciation.java | 104 +++-- .../compiere/model/MDepreciationBuild.java | 51 ++- .../model/MDepreciationConvention.java | 68 ++- .../compiere/model/MDepreciationEntry.java | 108 +++-- .../org/compiere/model/MDepreciationExp.java | 123 +++-- .../compiere/model/MDepreciationMethod.java | 80 +++- .../compiere/model/MDepreciationWorkfile.java | 149 ++++-- .../org/compiere/model/MDiscountSchema.java | 32 +- .../compiere/model/MDiscountSchemaBreak.java | 27 +- .../compiere/model/MDiscountSchemaLine.java | 22 +- .../src/org/compiere/model/MDistribution.java | 34 +- .../org/compiere/model/MDistributionLine.java | 34 +- .../org/compiere/model/MDistributionList.java | 24 +- .../compiere/model/MDistributionListLine.java | 28 +- .../org/compiere/model/MDistributionRun.java | 16 +- .../model/MDistributionRunDetail.java | 24 +- .../compiere/model/MDistributionRunLine.java | 57 ++- .../src/org/compiere/model/MDocBaseGroup.java | 30 +- .../org/compiere/model/MDocBaseGroupLine.java | 30 +- .../src/org/compiere/model/MDocType.java | 39 +- .../org/compiere/model/MDocTypeCounter.java | 60 ++- .../compiere/model/MDocumentActionAccess.java | 12 +- .../org/compiere/model/MDocumentStatus.java | 42 +- .../compiere/model/MDocumentStatusAccess.java | 22 +- .../src/org/compiere/model/MDunning.java | 19 +- .../src/org/compiere/model/MDunningLevel.java | 13 +- .../src/org/compiere/model/MDunningRun.java | 20 +- .../org/compiere/model/MDunningRunEntry.java | 18 +- .../org/compiere/model/MDunningRunLine.java | 26 +- .../src/org/compiere/model/MEXPFormat.java | 62 ++- .../org/compiere/model/MEXPFormatLine.java | 92 ++-- .../src/org/compiere/model/MEXPProcessor.java | 47 +- .../model/MEXPProcessorParameter.java | 24 +- .../org/compiere/model/MEXPProcessorType.java | 27 +- .../src/org/compiere/model/MElement.java | 14 +- .../src/org/compiere/model/MElementValue.java | 36 +- .../src/org/compiere/model/MEntityType.java | 22 +- .../src/org/compiere/model/MExpenseType.java | 24 +- .../src/org/compiere/model/MFactAcct.java | 23 +- .../compiere/model/MFactReconciliation.java | 25 +- .../src/org/compiere/model/MField.java | 21 +- .../org/compiere/model/MFieldSuggestion.java | 13 +- .../src/org/compiere/model/MForecast.java | 18 +- .../src/org/compiere/model/MForecastLine.java | 29 +- .../src/org/compiere/model/MForm.java | 18 +- .../src/org/compiere/model/MFormAccess.java | 13 +- .../src/org/compiere/model/MFreight.java | 28 +- .../org/compiere/model/MFreightCategory.java | 20 +- .../src/org/compiere/model/MGLCategory.java | 26 +- .../src/org/compiere/model/MGoal.java | 67 ++- .../org/compiere/model/MGoalRestriction.java | 17 +- .../src/org/compiere/model/MGroup.java | 23 +- .../src/org/compiere/model/MHierarchy.java | 22 +- .../src/org/compiere/model/MHouseKeeping.java | 25 +- .../src/org/compiere/model/MIFixedAsset.java | 72 ++- .../src/org/compiere/model/MIMPProcessor.java | 35 +- .../org/compiere/model/MIMPProcessorLog.java | 16 +- .../src/org/compiere/model/MImage.java | 43 +- .../org/compiere/model/MImportTemplate.java | 35 +- .../src/org/compiere/model/MInOut.java | 141 ++++-- .../src/org/compiere/model/MInOutConfirm.java | 66 ++- .../src/org/compiere/model/MInOutLine.java | 90 ++-- .../org/compiere/model/MInOutLineConfirm.java | 24 +- .../src/org/compiere/model/MInOutLineMA.java | 45 +- .../src/org/compiere/model/MIndexColumn.java | 19 +- .../src/org/compiere/model/MInfoColumn.java | 21 +- .../src/org/compiere/model/MInfoWindow.java | 64 ++- .../org/compiere/model/MInfoWindowAccess.java | 34 +- .../src/org/compiere/model/MInterestArea.java | 34 +- .../src/org/compiere/model/MInventory.java | 82 ++-- .../org/compiere/model/MInventoryLine.java | 52 ++- .../org/compiere/model/MInventoryLineMA.java | 47 +- .../src/org/compiere/model/MInvoice.java | 184 +++++--- .../src/org/compiere/model/MInvoiceBatch.java | 21 +- .../org/compiere/model/MInvoiceBatchLine.java | 17 +- .../src/org/compiere/model/MInvoiceLine.java | 107 ++--- .../compiere/model/MInvoicePaySchedule.java | 24 +- .../org/compiere/model/MInvoiceSchedule.java | 27 +- .../src/org/compiere/model/MInvoiceTax.java | 41 +- .../src/org/compiere/model/MIssue.java | 48 +- .../src/org/compiere/model/MIssueProject.java | 24 +- .../src/org/compiere/model/MIssueSystem.java | 7 +- .../src/org/compiere/model/MIssueUser.java | 23 +- .../src/org/compiere/model/MJournal.java | 91 ++-- .../src/org/compiere/model/MJournalBatch.java | 68 ++- .../org/compiere/model/MJournalGenerator.java | 14 +- .../compiere/model/MJournalGeneratorLine.java | 16 +- .../model/MJournalGeneratorSource.java | 16 +- .../src/org/compiere/model/MJournalLine.java | 40 +- .../src/org/compiere/model/MLabel.java | 27 +- .../org/compiere/model/MLabelAssignment.java | 12 +- .../org/compiere/model/MLabelCategory.java | 16 +- .../compiere/model/MLabelCategoryTable.java | 13 +- .../src/org/compiere/model/MLandedCost.java | 24 +- .../compiere/model/MLandedCostAllocation.java | 25 +- .../src/org/compiere/model/MLanguage.java | 39 +- .../src/org/compiere/model/MLdapAccess.java | 18 +- .../org/compiere/model/MLdapProcessor.java | 37 +- .../org/compiere/model/MLdapProcessorLog.java | 16 +- .../src/org/compiere/model/MLdapUser.java | 4 +- .../src/org/compiere/model/MLocation.java | 75 +-- .../org/compiere/model/MLocationLookup.java | 46 +- .../src/org/compiere/model/MLocator.java | 49 +- .../org/compiere/model/MLocatorLookup.java | 75 +-- .../src/org/compiere/model/MLocatorType.java | 21 +- .../src/org/compiere/model/MLookup.java | 111 +++-- .../src/org/compiere/model/MLookupCache.java | 3 +- .../org/compiere/model/MLookupFactory.java | 113 +++-- .../src/org/compiere/model/MLookupInfo.java | 14 +- .../src/org/compiere/model/MLot.java | 17 +- .../src/org/compiere/model/MLotCtl.java | 18 +- .../org/compiere/model/MLotCtlExclude.java | 20 +- .../src/org/compiere/model/MMFAMethod.java | 21 +- .../compiere/model/MMFARegisteredDevice.java | 25 +- .../org/compiere/model/MMFARegistration.java | 35 +- .../src/org/compiere/model/MMailText.java | 108 +++-- .../src/org/compiere/model/MMatchInv.java | 76 ++-- .../src/org/compiere/model/MMatchPO.java | 91 ++-- .../src/org/compiere/model/MMeasure.java | 39 +- .../src/org/compiere/model/MMeasureCalc.java | 38 +- .../src/org/compiere/model/MMenu.java | 43 +- .../src/org/compiere/model/MMessage.java | 28 +- .../model/MModelGeneratorTemplate.java | 15 +- .../src/org/compiere/model/MMovement.java | 67 ++- .../org/compiere/model/MMovementConfirm.java | 78 ++-- .../src/org/compiere/model/MMovementLine.java | 44 +- .../compiere/model/MMovementLineConfirm.java | 36 +- .../org/compiere/model/MMovementLineMA.java | 51 ++- .../src/org/compiere/model/MNote.java | 28 +- .../org/compiere/model/MOnlineTrxHistory.java | 27 +- .../src/org/compiere/model/MOpportunity.java | 33 +- .../src/org/compiere/model/MOrder.java | 180 ++++---- .../org/compiere/model/MOrderLandedCost.java | 29 +- .../model/MOrderLandedCostAllocation.java | 17 +- .../src/org/compiere/model/MOrderLine.java | 122 ++--- .../org/compiere/model/MOrderPaySchedule.java | 32 +- .../src/org/compiere/model/MOrderTax.java | 34 +- .../src/org/compiere/model/MOrg.java | 37 +- .../src/org/compiere/model/MOrgInfo.java | 23 +- .../org/compiere/model/MPAttributeLookup.java | 58 +-- .../src/org/compiere/model/MPInstance.java | 86 ++-- .../src/org/compiere/model/MPInstanceLog.java | 40 +- .../org/compiere/model/MPInstancePara.java | 24 +- .../src/org/compiere/model/MPOS.java | 35 +- .../src/org/compiere/model/MPOSKey.java | 19 +- .../src/org/compiere/model/MPOSKeyLayout.java | 22 +- .../src/org/compiere/model/MPOSPayment.java | 25 +- .../src/org/compiere/model/MPOSTerminal.java | 24 +- .../src/org/compiere/model/MPackage.java | 52 ++- .../src/org/compiere/model/MPackageMPS.java | 50 +- .../org/compiere/model/MPasswordHistory.java | 53 ++- .../src/org/compiere/model/MPasswordRule.java | 33 +- .../src/org/compiere/model/MPaySchedule.java | 19 +- .../src/org/compiere/model/MPaySelection.java | 25 +- .../compiere/model/MPaySelectionCheck.java | 88 ++-- .../org/compiere/model/MPaySelectionLine.java | 32 +- .../src/org/compiere/model/MPayment.java | 247 +++++----- .../org/compiere/model/MPaymentAllocate.java | 23 +- .../src/org/compiere/model/MPaymentBatch.java | 25 +- .../org/compiere/model/MPaymentLookup.java | 23 +- .../org/compiere/model/MPaymentProcessor.java | 19 +- .../src/org/compiere/model/MPaymentTerm.java | 28 +- .../compiere/model/MPaymentTransaction.java | 123 ++++- .../org/compiere/model/MPaymentValidate.java | 38 +- .../src/org/compiere/model/MPeriod.java | 102 +++-- .../org/compiere/model/MPeriodControl.java | 27 +- .../src/org/compiere/model/MPostIt.java | 31 +- .../src/org/compiere/model/MPreference.java | 17 +- .../src/org/compiere/model/MPriceList.java | 30 +- .../org/compiere/model/MPriceListVersion.java | 21 +- .../org/compiere/model/MPrivateAccess.java | 24 +- .../src/org/compiere/model/MProcess.java | 104 ++--- .../org/compiere/model/MProcessAccess.java | 18 +- .../org/compiere/model/MProcessDrillRule.java | 57 ++- .../compiere/model/MProcessDrillRulePara.java | 32 +- .../src/org/compiere/model/MProcessPara.java | 50 +- .../src/org/compiere/model/MProduct.java | 120 +++-- .../src/org/compiere/model/MProductBOM.java | 1 + .../org/compiere/model/MProductCategory.java | 41 +- .../compiere/model/MProductCategoryAcct.java | 25 +- .../org/compiere/model/MProductDownload.java | 31 +- .../src/org/compiere/model/MProductPO.java | 18 +- .../src/org/compiere/model/MProductPrice.java | 34 +- .../org/compiere/model/MProductPricing.java | 77 ++-- .../src/org/compiere/model/MProduction.java | 125 ++++- .../org/compiere/model/MProductionLine.java | 72 ++- .../org/compiere/model/MProductionLineMA.java | 57 ++- .../org/compiere/model/MProductionPlan.java | 57 ++- .../src/org/compiere/model/MProject.java | 74 +-- .../src/org/compiere/model/MProjectIssue.java | 35 +- .../src/org/compiere/model/MProjectLine.java | 39 +- .../src/org/compiere/model/MProjectPhase.java | 33 +- .../src/org/compiere/model/MProjectTask.java | 41 +- .../src/org/compiere/model/MProjectType.java | 49 +- .../org/compiere/model/MProjectTypePhase.java | 18 +- .../org/compiere/model/MProjectTypeTask.java | 26 +- .../src/org/compiere/model/MQualityTest.java | 51 ++- .../compiere/model/MQualityTestResult.java | 46 +- .../src/org/compiere/model/MQuery.java | 255 ++++++----- .../src/org/compiere/model/MRMA.java | 87 ++-- .../src/org/compiere/model/MRMALine.java | 74 +-- .../src/org/compiere/model/MRMATax.java | 31 +- .../src/org/compiere/model/MRecentItem.java | 45 +- .../src/org/compiere/model/MRecordAccess.java | 26 +- .../src/org/compiere/model/MRecurring.java | 44 +- .../src/org/compiere/model/MRecurringRun.java | 29 +- .../src/org/compiere/model/MRefList.java | 70 ++- .../src/org/compiere/model/MRefTable.java | 24 +- .../src/org/compiere/model/MReference.java | 22 +- .../src/org/compiere/model/MRegion.java | 257 ++--------- .../src/org/compiere/model/MRegistration.java | 2 + .../model/MRegistrationAttribute.java | 2 + .../compiere/model/MRegistrationValue.java | 2 + .../src/org/compiere/model/MReplenish.java | 19 +- .../src/org/compiere/model/MReplication.java | 21 +- .../org/compiere/model/MReplicationLog.java | 21 +- .../org/compiere/model/MReplicationRun.java | 21 +- .../compiere/model/MReplicationStrategy.java | 47 +- .../src/org/compiere/model/MReportCube.java | 37 +- .../src/org/compiere/model/MReportView.java | 31 +- .../src/org/compiere/model/MRequest.java | 129 +++--- .../org/compiere/model/MRequestAction.java | 26 +- .../org/compiere/model/MRequestCategory.java | 31 +- .../org/compiere/model/MRequestProcessor.java | 31 +- .../compiere/model/MRequestProcessorLog.java | 16 +- .../model/MRequestProcessorRoute.java | 13 +- .../src/org/compiere/model/MRequestType.java | 47 +- .../org/compiere/model/MRequestUpdate.java | 19 +- .../src/org/compiere/model/MRequisition.java | 54 ++- .../org/compiere/model/MRequisitionLine.java | 40 +- .../src/org/compiere/model/MResolution.java | 22 +- .../src/org/compiere/model/MResource.java | 26 +- .../compiere/model/MResourceAssignment.java | 20 +- .../src/org/compiere/model/MResourceType.java | 50 +- .../compiere/model/MResourceUnAvailable.java | 20 +- .../compiere/model/MRevenueRecogService.java | 14 +- .../compiere/model/MRevenueRecognition.java | 22 +- .../model/MRevenueRecognitionPlan.java | 14 +- .../model/MRevenueRecognitionRun.java | 16 +- .../src/org/compiere/model/MRfQ.java | 46 +- .../src/org/compiere/model/MRfQLine.java | 38 +- .../src/org/compiere/model/MRfQLineQty.java | 25 +- .../src/org/compiere/model/MRfQResponse.java | 50 +- .../org/compiere/model/MRfQResponseLine.java | 33 +- .../compiere/model/MRfQResponseLineQty.java | 29 +- .../src/org/compiere/model/MRfQTopic.java | 17 +- .../compiere/model/MRfQTopicSubscriber.java | 22 +- .../model/MRfQTopicSubscriberOnly.java | 16 +- .../src/org/compiere/model/MRole.java | 377 ++++++++------- .../src/org/compiere/model/MRoleIncluded.java | 48 +- .../src/org/compiere/model/MRoleMenu.java | 24 +- .../org/compiere/model/MRoleOrgAccess.java | 55 ++- .../src/org/compiere/model/MRule.java | 47 +- .../src/org/compiere/model/MSLACriteria.java | 2 + .../src/org/compiere/model/MSLAGoal.java | 2 + .../src/org/compiere/model/MSLAMeasure.java | 2 + .../src/org/compiere/model/MSMTP.java | 37 +- .../compiere/model/MSSOPrincipalConfig.java | 19 +- .../src/org/compiere/model/MSalesRegion.java | 25 +- .../src/org/compiere/model/MSchedule.java | 87 ++-- .../src/org/compiere/model/MScheduler.java | 60 +-- .../src/org/compiere/model/MSchedulerLog.java | 15 +- .../org/compiere/model/MSchedulerPara.java | 21 +- .../compiere/model/MSchedulerRecipient.java | 18 +- .../org/compiere/model/MSearchDefinition.java | 30 +- .../src/org/compiere/model/MSequence.java | 209 +++------ .../src/org/compiere/model/MSerNoCtl.java | 16 +- .../org/compiere/model/MSerNoCtlExclude.java | 20 +- .../src/org/compiere/model/MSession.java | 58 +-- .../src/org/compiere/model/MSetup.java | 78 +++- .../src/org/compiere/model/MShipper.java | 32 +- .../org/compiere/model/MShipperLabels.java | 60 ++- .../org/compiere/model/MShipperPackaging.java | 52 ++- .../compiere/model/MShipperPickupTypes.java | 54 ++- .../compiere/model/MShippingProcessor.java | 73 ++- .../compiere/model/MShippingTransaction.java | 135 +++++- .../model/MShippingTransactionLine.java | 52 ++- .../src/org/compiere/model/MStatus.java | 32 +- .../org/compiere/model/MStatusCategory.java | 34 +- .../src/org/compiere/model/MStatusLine.java | 29 +- .../org/compiere/model/MStatusLineUsedIn.java | 12 +- .../org/compiere/model/MStorageOnHand.java | 214 ++++----- .../org/compiere/model/MStorageProvider.java | 52 ++- .../compiere/model/MStorageReservation.java | 69 +-- .../model/MStorageReservationLog.java | 17 +- .../src/org/compiere/model/MStyle.java | 43 +- .../src/org/compiere/model/MStyleLine.java | 20 +- .../src/org/compiere/model/MSysConfig.java | 81 ++-- .../src/org/compiere/model/MSystem.java | 74 +-- .../src/org/compiere/model/MTab.java | 46 +- .../src/org/compiere/model/MTable.java | 156 ++++--- .../src/org/compiere/model/MTableAccess.java | 17 +- .../src/org/compiere/model/MTableIndex.java | 39 +- .../compiere/model/MTableScriptValidator.java | 26 +- .../src/org/compiere/model/MTask.java | 23 +- .../src/org/compiere/model/MTax.java | 61 ++- .../src/org/compiere/model/MTaxCategory.java | 17 +- .../org/compiere/model/MTaxDeclaration.java | 13 +- .../compiere/model/MTaxDeclarationAcct.java | 14 +- .../compiere/model/MTaxDeclarationLine.java | 13 +- .../src/org/compiere/model/MTaxPostal.java | 19 +- .../src/org/compiere/model/MTaxProvider.java | 30 +- .../src/org/compiere/model/MTest.java | 42 +- .../src/org/compiere/model/MTestUU.java | 8 +- .../src/org/compiere/model/MTimeExpense.java | 7 +- .../src/org/compiere/model/M_Element.java | 24 +- .../org/compiere/model/MatchPOAutoMatch.java | 9 +- .../src/org/compiere/model/Measure.java | 2 + .../compiere/model/ModelValidationEngine.java | 142 ++++-- .../org/compiere/model/ModelValidator.java | 36 +- .../src/org/compiere/model/PO.java | 27 +- .../compiere/process/DocActionEventData.java | 40 ++ .../org/compiere/process/DocumentEngine.java | 2 +- .../src/org/compiere/process/SvrProcess.java | 7 +- .../org/compiere/sla/DeliveryAccuracy.java | 2 + .../src/org/compiere/sla/SLACriteria.java | 2 + .../src/org/compiere/sla/SLAGoalProcess.java | 2 + .../org/compiere/sla/SLAMeasureProcess.java | 2 + .../src/org/compiere/util/Env.java | 4 - .../src/org/compiere/util/Ini.java | 1 + .../src/org/compiere/util/Task.java | 37 +- .../org/idempiere/fa/util/POCacheLocal.java | 74 ++- 743 files changed, 15800 insertions(+), 9809 deletions(-) diff --git a/org.adempiere.base.process/src/org/adempiere/process/UpdateRoleMenu.java b/org.adempiere.base.process/src/org/adempiere/process/UpdateRoleMenu.java index fb34afe72f..9778ef8e9d 100644 --- a/org.adempiere.base.process/src/org/adempiere/process/UpdateRoleMenu.java +++ b/org.adempiere.base.process/src/org/adempiere/process/UpdateRoleMenu.java @@ -11,6 +11,7 @@ import org.compiere.process.SvrProcess; import org.compiere.util.DB; @org.adempiere.base.annotation.Process +@Deprecated public class UpdateRoleMenu extends SvrProcess { private int p_role_id = 0; diff --git a/org.adempiere.base.process/src/org/compiere/process/DistributionCreate.java b/org.adempiere.base.process/src/org/compiere/process/DistributionCreate.java index 4e8566582b..517a4ed170 100644 --- a/org.adempiere.base.process/src/org/compiere/process/DistributionCreate.java +++ b/org.adempiere.base.process/src/org/compiere/process/DistributionCreate.java @@ -30,7 +30,8 @@ import org.compiere.model.MProduct; import org.compiere.util.Env; /** - * Create Distribution List Order + * Create Distribution List Order.
+ * Note: feature not fully implemented and have been marked as inactive in application dictionary. * * @author Jorg Janke * @version $Id: DistributionCreate.java,v 1.3 2006/07/30 00:51:01 jjanke Exp $ diff --git a/org.adempiere.base.process/src/org/compiere/process/IssueReport.java b/org.adempiere.base.process/src/org/compiere/process/IssueReport.java index 299044b39e..b464166e07 100644 --- a/org.adempiere.base.process/src/org/compiere/process/IssueReport.java +++ b/org.adempiere.base.process/src/org/compiere/process/IssueReport.java @@ -23,11 +23,13 @@ import org.compiere.model.MSystem; import org.compiere.util.AdempiereSystemError; /** - * Report System Issue + * Report System Issue. * * @author Jorg Janke * @version $Id: IssueReport.java,v 1.2 2006/07/30 00:54:44 jjanke Exp $ + * @deprecated not fully implemented */ +@Deprecated @org.adempiere.base.annotation.Process public class IssueReport extends SvrProcess { diff --git a/org.adempiere.base/src/com/akunagroup/uk/postcode/AddressInterface.java b/org.adempiere.base/src/com/akunagroup/uk/postcode/AddressInterface.java index ac9cbd4305..6c594abef0 100644 --- a/org.adempiere.base/src/com/akunagroup/uk/postcode/AddressInterface.java +++ b/org.adempiere.base/src/com/akunagroup/uk/postcode/AddressInterface.java @@ -30,7 +30,9 @@ package com.akunagroup.uk.postcode; * Interface for Address Lookup Web Service. * https://sourceforge.net/p/adempiere/feature-requests/137/ * The Address Structure + * @deprecated */ +@Deprecated(forRemoval = true, since = "11") public interface AddressInterface { public int size(); diff --git a/org.adempiere.base/src/com/akunagroup/uk/postcode/AddressLookup.java b/org.adempiere.base/src/com/akunagroup/uk/postcode/AddressLookup.java index 7e1fd351fd..2dcfc607b9 100644 --- a/org.adempiere.base/src/com/akunagroup/uk/postcode/AddressLookup.java +++ b/org.adempiere.base/src/com/akunagroup/uk/postcode/AddressLookup.java @@ -51,7 +51,9 @@ import org.w3c.dom.NodeList; * * @author Michael Judd * @version $Id$ + * @deprecated */ +@Deprecated(forRemoval = true, since = "11") public class AddressLookup implements AddressLookupInterface { /** The logger. */ private static final CLogger log = CLogger.getCLogger(AddressLookup.class); diff --git a/org.adempiere.base/src/com/akunagroup/uk/postcode/AddressLookupInterface.java b/org.adempiere.base/src/com/akunagroup/uk/postcode/AddressLookupInterface.java index d366a53004..b7c25ebc85 100644 --- a/org.adempiere.base/src/com/akunagroup/uk/postcode/AddressLookupInterface.java +++ b/org.adempiere.base/src/com/akunagroup/uk/postcode/AddressLookupInterface.java @@ -32,7 +32,9 @@ import java.util.HashMap; * Interface for Address Lookup Web Service. * https://sourceforge.net/p/adempiere/feature-requests/137/ * The Address lookup class interface + * @deprecated */ +@Deprecated(forRemoval = true, since = "11") public interface AddressLookupInterface { /* diff --git a/org.adempiere.base/src/com/akunagroup/uk/postcode/Postcode.java b/org.adempiere.base/src/com/akunagroup/uk/postcode/Postcode.java index 4d85ecbb09..a95f504a0e 100644 --- a/org.adempiere.base/src/com/akunagroup/uk/postcode/Postcode.java +++ b/org.adempiere.base/src/com/akunagroup/uk/postcode/Postcode.java @@ -26,6 +26,7 @@ package com.akunagroup.uk.postcode; +@Deprecated(forRemoval = true, since = "11") public class Postcode implements AddressInterface { diff --git a/org.adempiere.base/src/org/adempiere/apps/graph/ChartBuilder.java b/org.adempiere.base/src/org/adempiere/apps/graph/ChartBuilder.java index b7bbd9eac8..9299149dd8 100644 --- a/org.adempiere.base/src/org/adempiere/apps/graph/ChartBuilder.java +++ b/org.adempiere.base/src/org/adempiere/apps/graph/ChartBuilder.java @@ -58,6 +58,7 @@ import org.jfree.data.time.Year; import org.jfree.data.xy.IntervalXYDataset; /** + * Builder for JFree Chart * @author Paul Bowden, Adaxa Pty Ltd * @author hengsin * @@ -70,6 +71,9 @@ public class ChartBuilder { private HashMap queries; private Dataset dataset; + /** + * @param chart + */ public ChartBuilder(MChart chart) { this.chartModel = chart; } @@ -145,6 +149,9 @@ public class ChartBuilder { } } + /** + * Load data from chart data source + */ public void loadData() { queries = new HashMap(); for ( MChartDatasource ds : chartModel.getDatasources() ) @@ -153,6 +160,10 @@ public class ChartBuilder { } } + /** + * Load data from data source into {@link #dataset} + * @param ds + */ private void addData(MChartDatasource ds) { String value = ds.getValueColumn(); @@ -335,8 +346,13 @@ public class ChartBuilder { } - private Date increment(Date lastDate, String timeUnit, int qty) { - + /** + * @param lastDate input date + * @param timeUnit AD_Chart.TIMEUNIT_* + * @param qty qty to increment + * @return alter date + */ + private Date increment(Date lastDate, String timeUnit, int qty) { if ( lastDate == null ) return null; @@ -357,35 +373,56 @@ public class ChartBuilder { return cal.getTime(); } + /** + * Create and load data set from data source + * @return CategoryDataset + */ public CategoryDataset getCategoryDataset() { dataset = new DefaultCategoryDataset(); loadData(); return (CategoryDataset) dataset; } + /** + * Create and load data set from data source + * @return IntervalXYDataset + */ public IntervalXYDataset getXYDataset() { dataset = new TimeSeriesCollection(); loadData(); return (IntervalXYDataset) dataset; } + /** + * Create and load data set from data source + * @return PieDataset + */ public PieDataset getPieDataset() { dataset = new DefaultPieDataset(); loadData(); return (PieDataset) dataset; } + /** + * Get current data set + * @return dataset + */ public Dataset getDataset() { return dataset; } + /** + * @return named query + */ public HashMap getQueries() { return queries; } - public MQuery getQuery(String key) { - - + /** + * @param key + * @return MQuery + */ + public MQuery getQuery(String key) { if ( queries.containsKey(key) ) { return queries.get(key); @@ -394,6 +431,9 @@ public class ChartBuilder { return null; } + /** + * @return JFreeChart + */ private JFreeChart createXYBarChart() { JFreeChart chart = ChartFactory.createXYBarChart( chartModel.get_Translation(MChart.COLUMNNAME_Name), // chart title @@ -412,6 +452,9 @@ public class ChartBuilder { return chart; } + /** + * @return JFreeChart + */ private JFreeChart createTimeSeriesChart() { JFreeChart chart = ChartFactory.createTimeSeriesChart( chartModel.get_Translation(MChart.COLUMNNAME_Name), // chart title @@ -427,6 +470,9 @@ public class ChartBuilder { return chart; } + /** + * @return JFreeChart + */ private JFreeChart createWaterfallChart() { JFreeChart chart = ChartFactory.createWaterfallChart( chartModel.get_Translation(MChart.COLUMNNAME_Name), // chart title @@ -444,6 +490,9 @@ public class ChartBuilder { return chart; } + /** + * @return JFreeChart + */ private JFreeChart createRingChart() { final JFreeChart chart = ChartFactory.createRingChart(chartModel.get_Translation(MChart.COLUMNNAME_Name), getPieDataset(), chartModel.isDisplayLegend(), true, true); @@ -451,6 +500,9 @@ public class ChartBuilder { return chart; } + /** + * @return JFreeChart + */ private JFreeChart createPieChart() { final JFreeChart chart = ChartFactory.createPieChart(chartModel.get_Translation(MChart.COLUMNNAME_Name), getPieDataset(), false, true, true); @@ -458,6 +510,9 @@ public class ChartBuilder { return chart; } + /** + * @return JFreeChart + */ private JFreeChart create3DPieChart() { final JFreeChart chart = ChartFactory.createPieChart(chartModel.get_Translation(MChart.COLUMNNAME_Name), getPieDataset(), false, true, true); @@ -465,6 +520,9 @@ public class ChartBuilder { return chart; } + /** + * @return JFreeChart + */ private JFreeChart createBarChart() { JFreeChart chart = ChartFactory.createBarChart( chartModel.get_Translation(MChart.COLUMNNAME_Name), // chart title @@ -488,6 +546,9 @@ public class ChartBuilder { return chart; } + /** + * @return JFreeChart + */ private JFreeChart create3DBarChart() { JFreeChart chart = ChartFactory.createBarChart( chartModel.get_Translation(MChart.COLUMNNAME_Name), // chart title @@ -505,6 +566,9 @@ public class ChartBuilder { return chart; } + /** + * @return JFreeChart + */ private JFreeChart createStackedBarChart() { JFreeChart chart = ChartFactory.createStackedBarChart( chartModel.get_Translation(MChart.COLUMNNAME_Name), // chart title @@ -529,6 +593,9 @@ public class ChartBuilder { return chart; } + /** + * @return JFreeChart + */ private JFreeChart create3DStackedBarChart() { JFreeChart chart = ChartFactory.createStackedBarChart( chartModel.get_Translation(MChart.COLUMNNAME_Name), // chart title @@ -546,6 +613,9 @@ public class ChartBuilder { return chart; } + /** + * @return JFreeChart + */ private JFreeChart createAreaChart() { // create the chart... JFreeChart chart = ChartFactory.createAreaChart( @@ -564,6 +634,9 @@ public class ChartBuilder { return chart; } + /** + * @return JFreeChart + */ private JFreeChart createStackedAreaChart() { // create the chart... JFreeChart chart = ChartFactory.createStackedAreaChart( @@ -582,6 +655,9 @@ public class ChartBuilder { return chart; } + /** + * @return JFreeChart + */ private JFreeChart createLineChart() { // create the chart... JFreeChart chart = ChartFactory.createLineChart( @@ -601,6 +677,9 @@ public class ChartBuilder { return chart; } + /** + * @return JFreeChart + */ private JFreeChart create3DLineChart() { // create the chart... JFreeChart chart = ChartFactory.createLineChart( @@ -620,6 +699,9 @@ public class ChartBuilder { return chart; } + /** + * @param chart + */ private void setupCategoryChart(JFreeChart chart) { CategoryPlot plot = chart.getCategoryPlot(); CategoryAxis xAxis = (CategoryAxis)plot.getDomainAxis(); diff --git a/org.adempiere.base/src/org/adempiere/apps/graph/GraphBuilder.java b/org.adempiere.base/src/org/adempiere/apps/graph/GraphBuilder.java index 2f8263974b..b04ed41b08 100644 --- a/org.adempiere.base/src/org/adempiere/apps/graph/GraphBuilder.java +++ b/org.adempiere.base/src/org/adempiere/apps/graph/GraphBuilder.java @@ -33,8 +33,9 @@ import org.jfree.data.general.DefaultPieDataset; /** * * @author hengsin - * + * @deprecated */ +@Deprecated public class GraphBuilder { /** The Goal */ diff --git a/org.adempiere.base/src/org/adempiere/apps/graph/GraphColumn.java b/org.adempiere.base/src/org/adempiere/apps/graph/GraphColumn.java index 138f8fe1e3..2b2d694fb3 100644 --- a/org.adempiere.base/src/org/adempiere/apps/graph/GraphColumn.java +++ b/org.adempiere.base/src/org/adempiere/apps/graph/GraphColumn.java @@ -29,13 +29,11 @@ import org.compiere.util.CLogger; import org.compiere.util.DisplayType; /** - * + * Value object of chart column * @author hengsin - * */ public class GraphColumn { - /** * Base Constructor * @param label label @@ -81,6 +79,8 @@ public class GraphColumn /** * Request Type Constructor * @param rt Request Type + * @param data + * @param id */ public GraphColumn (MRequestType rt, BigDecimal data, int id) { @@ -92,6 +92,8 @@ public class GraphColumn /** * Project Type Constructor * @param pt Project Type + * @param data + * @param id */ public GraphColumn (MProjectType pt, BigDecimal data, int id) { @@ -163,33 +165,48 @@ public class GraphColumn return m_mc; } // getMeasureCalc + /** + * @return MRequestType + */ public MRequestType getRequestType() { return m_rt; } + /** + * @return MProjectType + */ public MProjectType getProjectType() { return m_pt; } + /** + * @return measure display type (MGoal.MEASUREDISPLAY_*) + */ public String getMeasureDisplay() { return m_measureDisplay; } // getMeasureDisplay + /** + * @return date + */ public Timestamp getDate() { return m_date; } // getDate + /** + * @return record id + */ public int getID() { return m_id; } /** - * @return Returns the label. + * @return column label. */ public String getLabel () { @@ -210,7 +227,7 @@ public class GraphColumn /** * @param date for label. - * @param MeasureDisplay measure display + * @param MeasureDisplay measure display type (MGoal.MEASUREDISPLAY_*) */ public void setLabel (Timestamp date, String MeasureDisplay) { @@ -243,7 +260,7 @@ public class GraphColumn } // setLabel /** - * @return Returns the targetValue. + * @return targetValue. */ public double getTargetValue () { @@ -259,7 +276,7 @@ public class GraphColumn } // setTargetValue /** - * @return Returns the data value. + * @return data value */ public double getValue () { @@ -279,7 +296,7 @@ public class GraphColumn } // setValue /** - * @return Returns the column width in pixels. + * @return column width in pixels. */ public double getColWidth () { @@ -295,7 +312,7 @@ public class GraphColumn } // getColWidth /** - * @return Returns the height in pixels. + * @return height in pixels. */ public double getColHeight() { @@ -310,6 +327,11 @@ public class GraphColumn m_height = height; } // setHeight + /** + * Get query for goal + * @param mGoal + * @return query + */ public MQuery getMQuery(MGoal mGoal) { MQuery query = null; diff --git a/org.adempiere.base/src/org/adempiere/base/AbstractModelFactory.java b/org.adempiere.base/src/org/adempiere/base/AbstractModelFactory.java index d9e496669a..5f40629057 100644 --- a/org.adempiere.base/src/org/adempiere/base/AbstractModelFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/AbstractModelFactory.java @@ -45,6 +45,13 @@ public abstract class AbstractModelFactory implements IModelFactory { return getPO(getClass(tableName), tableName, Record_ID, trxName); } + /** + * @param clazz + * @param tableName + * @param Record_ID + * @param trxName + * @return new PO instance + */ public static PO getPO(Class clazz, String tableName, int Record_ID, String trxName) { if (clazz == null) { @@ -130,6 +137,13 @@ public abstract class AbstractModelFactory implements IModelFactory { return getPO(getClass(tableName), tableName, Record_UU, trxName); } + /** + * @param clazz + * @param tableName + * @param Record_UU + * @param trxName + * @return new PO instance + */ public static PO getPO(Class clazz, String tableName, String Record_UU, String trxName) { if (clazz == null) { @@ -208,6 +222,13 @@ public abstract class AbstractModelFactory implements IModelFactory { return getPO(getClass(tableName), tableName, rs, trxName); } + /** + * @param clazz + * @param tableName + * @param rs + * @param trxName + * @return new PO instance + */ public static PO getPO(Class clazz, String tableName, ResultSet rs, String trxName) { if (clazz == null) { diff --git a/org.adempiere.base/src/org/adempiere/base/AnnotationBasedColumnCalloutFactory.java b/org.adempiere.base/src/org/adempiere/base/AnnotationBasedColumnCalloutFactory.java index 98fcbe021e..a608d59159 100644 --- a/org.adempiere.base/src/org/adempiere/base/AnnotationBasedColumnCalloutFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/AnnotationBasedColumnCalloutFactory.java @@ -98,6 +98,12 @@ public abstract class AnnotationBasedColumnCalloutFactory extends AnnotationBase return callouts.toArray(new IColumnCallout[0]); } + /** + * Create new callout instance using reflection and add it to the callouts list + * @param callouts + * @param classLoader + * @param calloutClassNames + */ private void newCalloutInstance(List callouts, ClassLoader classLoader, List calloutClassNames) { for(String calloutClass : calloutClassNames) { @@ -136,6 +142,11 @@ public abstract class AnnotationBasedColumnCalloutFactory extends AnnotationBase */ protected abstract String[] getPackages(); + /** + * Perform annotation scanning upon activation of component + * @param context + * @throws ClassNotFoundException + */ @Activate public void activate(ComponentContext context) throws ClassNotFoundException { long start = System.currentTimeMillis(); @@ -179,6 +190,11 @@ public abstract class AnnotationBasedColumnCalloutFactory extends AnnotationBase graph.scanAsync(getExecutorService(), getMaxThreads(), scanResultProcessor, getScanFailureHandler()); } + /** + * Process class annotation and register column callout. + * @param className + * @param annotationInfo + */ private void processAnnotation(String className, AnnotationInfo annotationInfo) { //not sure why but sometime ClassGraph return Object[] instead of the expected String[] Object[] tableNames = (Object[]) annotationInfo.getParameterValues().getValue("tableName"); @@ -232,6 +248,12 @@ public abstract class AnnotationBasedColumnCalloutFactory extends AnnotationBase } } + /** + * add callout for column names + * @param className + * @param columnNames + * @param columnNameMap + */ private void addCallout(String className, Object[] columnNames, Map> columnNameMap) { for (Object columnName : columnNames) { List callouts = columnNameMap.get(columnName); @@ -243,6 +265,11 @@ public abstract class AnnotationBasedColumnCalloutFactory extends AnnotationBase } } + /** + * add global callout (for all columns) + * @param className + * @param columnNameMap + */ private void addCallout(String className, Map> columnNameMap) { List callouts = columnNameMap.get("*"); if (callouts == null ) { diff --git a/org.adempiere.base/src/org/adempiere/base/AnnotationBasedEventManager.java b/org.adempiere.base/src/org/adempiere/base/AnnotationBasedEventManager.java index 67c9be31d2..0d29ab1ab1 100644 --- a/org.adempiere.base/src/org/adempiere/base/AnnotationBasedEventManager.java +++ b/org.adempiere.base/src/org/adempiere/base/AnnotationBasedEventManager.java @@ -215,6 +215,12 @@ public abstract class AnnotationBasedEventManager extends AnnotationBasedFactory scan(bundleContext, true, getPackages()); } + /** + * @param classLoader + * @param className + * @param filter + * @return new SimpleEventHandler instance + */ private EventHandler simpleEventDelegate(ClassLoader classLoader, String className, String filter) { try { @SuppressWarnings("unchecked") @@ -233,6 +239,13 @@ public abstract class AnnotationBasedEventManager extends AnnotationBasedFactory } } + /** + * @param classLoader + * @param className + * @param annotationInfo + * @param filter + * @return new ProcessEventHandler instance + */ private EventHandler processEventDelegate(ClassLoader classLoader, String className, AnnotationInfo annotationInfo, String filter) { try { String processUUID = (String) annotationInfo.getParameterValues().getValue("processUUID"); @@ -252,6 +265,13 @@ public abstract class AnnotationBasedEventManager extends AnnotationBasedFactory } } + /** + * @param classLoader + * @param className + * @param annotationInfo + * @param filter + * @return new ImportEventHandler instance + */ private EventHandler importEventDelegate(ClassLoader classLoader, String className, AnnotationInfo annotationInfo, String filter) { try { String importTableName = (String) annotationInfo.getParameterValues().getValue("importTableName"); @@ -271,6 +291,13 @@ public abstract class AnnotationBasedEventManager extends AnnotationBasedFactory } } + /** + * @param classLoader + * @param className + * @param annotationInfo + * @param filter + * @return new ModelEventHandler instance + */ private EventHandler modelEventDelegate(ClassLoader classLoader, String className, AnnotationInfo annotationInfo, String filter) { try { AnnotationClassRef classRef = (AnnotationClassRef) annotationInfo.getParameterValues().getValue("modelClass"); diff --git a/org.adempiere.base/src/org/adempiere/base/AnnotationBasedFactory.java b/org.adempiere.base/src/org/adempiere/base/AnnotationBasedFactory.java index 9083b0d445..970dbb2a4a 100644 --- a/org.adempiere.base/src/org/adempiere/base/AnnotationBasedFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/AnnotationBasedFactory.java @@ -21,6 +21,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.logging.Level; import org.compiere.Adempiere; import org.compiere.util.CLogger; @@ -66,14 +67,18 @@ public abstract class AnnotationBasedFactory { } catch (Exception e) { } } + /** + * Wait for completion of annotation scanning + */ protected void blockWhileScanning() { String className = this.getClass().getSimpleName(); if(!scanCompleted.get()) try { Instant start = Instant.now(); threadBlockerFuture.get(); - s_log.fine(() -> String.format("%s waited %d(ms) for class scanning to end" - , className, Duration.between(start, Instant.now()).toMillis())); + if (s_log.isLoggable(Level.FINE)) + s_log.fine(() -> String.format("%s waited %d(ms) for class scanning to end" + , className, Duration.between(start, Instant.now()).toMillis())); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); diff --git a/org.adempiere.base/src/org/adempiere/base/AnnotationBasedModelFactory.java b/org.adempiere.base/src/org/adempiere/base/AnnotationBasedModelFactory.java index 498614c35f..4ed50f8ab8 100644 --- a/org.adempiere.base/src/org/adempiere/base/AnnotationBasedModelFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/AnnotationBasedModelFactory.java @@ -32,7 +32,7 @@ import io.github.classgraph.ScanResult; /** * Translates table names into model classes having the {@link Model} annotation. Relies on - * {@link DefaultModelFactory} for everything else. + * {@link DefaultModelFactory} for everything else.
* This factory is designed to have a service rank higher than {@link DefaultModelFactory}, as class * discovery using SPI is preferred over reflection-based methods. * @author Saulo Gil @@ -77,6 +77,11 @@ public class AnnotationBasedModelFactory extends AnnotationBasedFactory implemen return patterns; } + /** + * Scan annotation upon activation of component + * @param context + * @throws ClassNotFoundException + */ @Activate public void activate(ComponentContext context) throws ClassNotFoundException { long start = System.currentTimeMillis(); @@ -125,6 +130,11 @@ public class AnnotationBasedModelFactory extends AnnotationBasedFactory implemen graph.scanAsync(getExecutorService(), getMaxThreads(), scanResultProcessor, getScanFailureHandler()); } + /** + * Process annotation scan result + * @param classLoader + * @param scanResult + */ private void processResults(ClassLoader classLoader, ScanResult scanResult ) { BiConsumer exceptionHandler = (className, exception) -> s_log.severe(String.format("exception while loading class %s - %s", className, exception.getMessage())); diff --git a/org.adempiere.base/src/org/adempiere/base/AnnotationBasedProcessFactory.java b/org.adempiere.base/src/org/adempiere/base/AnnotationBasedProcessFactory.java index fa18817f56..adf693ae82 100644 --- a/org.adempiere.base/src/org/adempiere/base/AnnotationBasedProcessFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/AnnotationBasedProcessFactory.java @@ -44,7 +44,7 @@ import io.github.classgraph.ClassGraph.ScanResultProcessor; import io.github.classgraph.ClassInfo; /** - * Scan, discover and register process classes. + * Scan, discover and register process classes.
* Process class will be registered using class name. You can use the optional * {@link Process} annotation to register a process class with an additional name (for e.g * to replace a core process class). @@ -72,6 +72,11 @@ public abstract class AnnotationBasedProcessFactory extends AnnotationBasedFacto */ protected abstract String[] getPackages(); + /** + * Scan annotation upon activation of component + * @param context + * @throws ClassNotFoundException + */ @Activate public void activate(ComponentContext context) throws ClassNotFoundException { long start = System.currentTimeMillis(); @@ -103,8 +108,9 @@ public abstract class AnnotationBasedProcessFactory extends AnnotationBasedFacto classCache.put(alternateName, className); } long end = System.currentTimeMillis(); - s_log.info(() -> this.getClass().getSimpleName() + " loaded " + classCache.size() + " classes in " - + ((end-start)/1000f) + "s"); + if (s_log.isLoggable(Level.INFO)) + s_log.info(() -> this.getClass().getSimpleName() + " loaded " + classCache.size() + " classes in " + + ((end-start)/1000f) + "s"); signalScanCompletion(true); }; diff --git a/org.adempiere.base/src/org/adempiere/base/ColumnCalloutManager.java b/org.adempiere.base/src/org/adempiere/base/ColumnCalloutManager.java index 854074710e..5965e577b8 100644 --- a/org.adempiere.base/src/org/adempiere/base/ColumnCalloutManager.java +++ b/org.adempiere.base/src/org/adempiere/base/ColumnCalloutManager.java @@ -59,7 +59,6 @@ public final class ColumnCalloutManager { } /** - * * @param tableName * @param columnName * @return list of {@link IColumnCallout} register for tableName.columnName @@ -137,7 +136,6 @@ public final class ColumnCalloutManager { // IDEMPIERE-2732 /** - * * @param className * @param methodName * @return {@link Callout} for className and methodName @@ -172,8 +170,7 @@ public final class ColumnCalloutManager { } /** - * - * @return {@link IMappedColumnCalloutFactory} + * @return {@link IMappedColumnCalloutFactory} instance */ public synchronized static IMappedColumnCalloutFactory getMappedColumnCalloutFactory() { IMappedColumnCalloutFactory factoryService = null; diff --git a/org.adempiere.base/src/org/adempiere/base/ComponentBlackListService.java b/org.adempiere.base/src/org/adempiere/base/ComponentBlackListService.java index f6f565c45f..9f627e647a 100644 --- a/org.adempiere.base/src/org/adempiere/base/ComponentBlackListService.java +++ b/org.adempiere.base/src/org/adempiere/base/ComponentBlackListService.java @@ -33,6 +33,8 @@ import org.osgi.service.component.runtime.ServiceComponentRuntime; import org.osgi.service.component.runtime.dto.ComponentDescriptionDTO; /** + * Service listener to block the loading of OSGi component.
+ * To block the loading of an OSGi component, append the OSGi component's component name to {IDEMPIERE_HOME}/components.blacklist file. * @author hengsin * */ diff --git a/org.adempiere.base/src/org/adempiere/base/DefaultAddressValidationFactory.java b/org.adempiere.base/src/org/adempiere/base/DefaultAddressValidationFactory.java index 5555259e39..547f590704 100644 --- a/org.adempiere.base/src/org/adempiere/base/DefaultAddressValidationFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/DefaultAddressValidationFactory.java @@ -20,7 +20,8 @@ import org.adempiere.model.IAddressValidation; import org.compiere.util.CLogger; /** - * Default address validation factory + * Default {@link IAddressValidationFactory} implementation for core.
+ * Load {@link IAddressValidation} instance from plugin.xml (org.adempiere.model.IAddressValidation extension point) or class path. * @author Elaine * */ diff --git a/org.adempiere.base/src/org/adempiere/base/DefaultCalloutFactory.java b/org.adempiere.base/src/org/adempiere/base/DefaultCalloutFactory.java index e0853b04c0..a2be08a332 100644 --- a/org.adempiere.base/src/org/adempiere/base/DefaultCalloutFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/DefaultCalloutFactory.java @@ -21,10 +21,9 @@ import org.compiere.model.Callout; import org.compiere.util.CLogger; /** + * Default {@link ICalloutFactory} implementation for core.
+ * Load {@link Callout} instance from plugin.xml (org.compiere.model.Callout extension point) or class path. * @author a42niem - * - * This is just a blueprint for creation of a CalloutFactory - * */ public class DefaultCalloutFactory implements ICalloutFactory { @@ -96,7 +95,8 @@ public class DefaultCalloutFactory implements ICalloutFactory { } } } - log.log(Level.FINE, "Required method " + methodName + " not found in class " + className); + if (log.isLoggable(Level.FINE)) + log.log(Level.FINE, "Required method " + methodName + " not found in class " + className); return null; } diff --git a/org.adempiere.base/src/org/adempiere/base/DefaultColumnCalloutFactory.java b/org.adempiere.base/src/org/adempiere/base/DefaultColumnCalloutFactory.java index 6bc7fe1969..b7f1858014 100644 --- a/org.adempiere.base/src/org/adempiere/base/DefaultColumnCalloutFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/DefaultColumnCalloutFactory.java @@ -18,8 +18,9 @@ import java.util.List; import org.adempiere.base.equinox.EquinoxExtensionLocator; /** + * Default {@link IColumnCalloutFactory} implementation for core.
+ * Load {@link IColumnCallout} instance from plugin.xml (org.adempiere.base.IColumnCallout extension point) * @author hengsin - * */ public class DefaultColumnCalloutFactory implements IColumnCalloutFactory { diff --git a/org.adempiere.base/src/org/adempiere/base/DefaultDocumentFactory.java b/org.adempiere.base/src/org/adempiere/base/DefaultDocumentFactory.java index 37e1e83ec1..bee2e8dcc9 100644 --- a/org.adempiere.base/src/org/adempiere/base/DefaultDocumentFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/DefaultDocumentFactory.java @@ -25,7 +25,8 @@ import org.compiere.util.CLogger; import org.compiere.util.Env; /** - * + * Default {@link IDocFactory} implementation from core.
+ * Load {@link Doc} instance from class path. * @author hengsin * */ diff --git a/org.adempiere.base/src/org/adempiere/base/DefaultLookupFactory.java b/org.adempiere.base/src/org/adempiere/base/DefaultLookupFactory.java index 31dd5ffce8..68537240a7 100644 --- a/org.adempiere.base/src/org/adempiere/base/DefaultLookupFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/DefaultLookupFactory.java @@ -26,9 +26,10 @@ import org.compiere.util.DisplayType; import static org.compiere.util.DisplayType.*; /** + * Default {@link ILookupFactory} implementation for core.
+ * Create new {@link Lookup} instance by predefined display type. * @author Jan Thielemann - jan.thielemann@evenos.de * @author hengsin - * */ public class DefaultLookupFactory implements ILookupFactory{ diff --git a/org.adempiere.base/src/org/adempiere/base/DefaultModelValidatorFactory.java b/org.adempiere.base/src/org/adempiere/base/DefaultModelValidatorFactory.java index fe7ecec0aa..784a5c9a34 100644 --- a/org.adempiere.base/src/org/adempiere/base/DefaultModelValidatorFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/DefaultModelValidatorFactory.java @@ -17,8 +17,9 @@ import org.adempiere.base.equinox.EquinoxExtensionLocator; import org.compiere.model.ModelValidator; /** + * Default {@link IModelValidatorFactory} implementation for core.
+ * Load {@link ModelValidator} instance from plugin.xml (org.adempiere.base.ModelValidator extension point) or class path. * @author hengsin - * */ public class DefaultModelValidatorFactory implements IModelValidatorFactory { diff --git a/org.adempiere.base/src/org/adempiere/base/DefaultPaymentExporterFactory.java b/org.adempiere.base/src/org/adempiere/base/DefaultPaymentExporterFactory.java index bdfc978423..2ab829b795 100644 --- a/org.adempiere.base/src/org/adempiere/base/DefaultPaymentExporterFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/DefaultPaymentExporterFactory.java @@ -20,8 +20,9 @@ import org.compiere.util.CLogger; import org.compiere.util.PaymentExport; /** + * Default {@link IPaymentExporterFactory} implementation for core.
+ * Load {@link PaymentExport} instance from plugin.xml (org.compiere.util.PaymentExport extension point) or class path. * @author mbozem - * */ public class DefaultPaymentExporterFactory implements IPaymentExporterFactory { diff --git a/org.adempiere.base/src/org/adempiere/base/DefaultPaymentProcessorFactory.java b/org.adempiere.base/src/org/adempiere/base/DefaultPaymentProcessorFactory.java index c948cbfd44..b79627757c 100644 --- a/org.adempiere.base/src/org/adempiere/base/DefaultPaymentProcessorFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/DefaultPaymentProcessorFactory.java @@ -20,8 +20,9 @@ import org.compiere.model.PaymentProcessor; import org.compiere.util.CLogger; /** + * Default {@link IPaymentProcessorFactory} implementation for core.
+ * Load {@link PaymentProcessor} instance from plugin.xml (org.compiere.model.PaymentProcessor extension point) or class path. * @author hengsin - * */ public class DefaultPaymentProcessorFactory implements IPaymentProcessorFactory { diff --git a/org.adempiere.base/src/org/adempiere/base/DefaultProcessFactory.java b/org.adempiere.base/src/org/adempiere/base/DefaultProcessFactory.java index 7d1f7b13a3..a1aa9396fe 100644 --- a/org.adempiere.base/src/org/adempiere/base/DefaultProcessFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/DefaultProcessFactory.java @@ -20,8 +20,9 @@ import org.compiere.process.ProcessCall; import org.compiere.util.CLogger; /** + * Default {@link IProcessFactory} implementation for core.
+ * Load {@link ProcessCall} instance from plugin.xml (org.adempiere.base.Process extension point) or class path. * @author hengsin - * */ public class DefaultProcessFactory implements IProcessFactory { diff --git a/org.adempiere.base/src/org/adempiere/base/DefaultProductPricingFactory.java b/org.adempiere.base/src/org/adempiere/base/DefaultProductPricingFactory.java index e8f87f618d..764a548ae1 100644 --- a/org.adempiere.base/src/org/adempiere/base/DefaultProductPricingFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/DefaultProductPricingFactory.java @@ -1,7 +1,35 @@ +/*********************************************************************** + * 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: * + * - Diego Ruiz * + **********************************************************************/ package org.adempiere.base; import org.compiere.model.MProductPricing; +/** + * Default {@link IProductPricingFactory} implementation for core.
+ * Always return new {@link MProductPricing} instance. + */ public class DefaultProductPricingFactory implements IProductPricingFactory { /** diff --git a/org.adempiere.base/src/org/adempiere/base/DefaultShipmentProcessorFactory.java b/org.adempiere.base/src/org/adempiere/base/DefaultShipmentProcessorFactory.java index 77667ed00b..4d10b9e7a5 100644 --- a/org.adempiere.base/src/org/adempiere/base/DefaultShipmentProcessorFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/DefaultShipmentProcessorFactory.java @@ -20,8 +20,9 @@ import org.adempiere.model.IShipmentProcessor; import org.compiere.util.CLogger; /** + * Default {@link IShipmentProcessorFactory} implementation for core.
+ * Load {@link IShipmentProcessor} instance from plugin.xml (org.adempiere.model.IShipmentProcessor extension point) or class path. * @author hengsin - * */ public class DefaultShipmentProcessorFactory implements IShipmentProcessorFactory { diff --git a/org.adempiere.base/src/org/adempiere/base/DefaultTaxLookup.java b/org.adempiere.base/src/org/adempiere/base/DefaultTaxLookup.java index 3f3c376244..997083ae95 100644 --- a/org.adempiere.base/src/org/adempiere/base/DefaultTaxLookup.java +++ b/org.adempiere.base/src/org/adempiere/base/DefaultTaxLookup.java @@ -31,8 +31,9 @@ import org.compiere.model.Tax; import org.osgi.service.component.annotations.Component; /** + * Default {@link ITaxLookup} implementation for core.
+ * Delegate to the static get methods in {@link Tax}. * @author hengsin - * */ @Component(immediate = true, service = {ITaxLookup.class}) public class DefaultTaxLookup implements ITaxLookup { diff --git a/org.adempiere.base/src/org/adempiere/base/DefaultTaxProviderFactory.java b/org.adempiere.base/src/org/adempiere/base/DefaultTaxProviderFactory.java index 3b5a1d14bf..bfb9b35621 100644 --- a/org.adempiere.base/src/org/adempiere/base/DefaultTaxProviderFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/DefaultTaxProviderFactory.java @@ -20,9 +20,9 @@ import org.adempiere.model.ITaxProvider; import org.compiere.util.CLogger; /** - * Default tax provider factory + * Default {@link ITaxProviderFactory} implementation for core.
+ * Load {@link ITaxProvider} instance from plugin.xml (org.adempiere.model.ITaxProvider extension point) or class path. * @author Elaine - * */ public class DefaultTaxProviderFactory implements ITaxProviderFactory { diff --git a/org.adempiere.base/src/org/adempiere/base/IBankStatementLoaderFactory.java b/org.adempiere.base/src/org/adempiere/base/IBankStatementLoaderFactory.java index 6b5839824b..64b38339c5 100644 --- a/org.adempiere.base/src/org/adempiere/base/IBankStatementLoaderFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/IBankStatementLoaderFactory.java @@ -34,7 +34,7 @@ public interface IBankStatementLoaderFactory { * want to use. * * @param className - * @return BankStatementLoader instance + * @return BankStatementLoaderInterface instance */ public BankStatementLoaderInterface newBankStatementLoaderInstance(String className); } diff --git a/org.adempiere.base/src/org/adempiere/base/IBankStatementMatcherFactory.java b/org.adempiere.base/src/org/adempiere/base/IBankStatementMatcherFactory.java index 0f1f10c374..d20d3bf411 100644 --- a/org.adempiere.base/src/org/adempiere/base/IBankStatementMatcherFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/IBankStatementMatcherFactory.java @@ -28,7 +28,7 @@ public interface IBankStatementMatcherFactory { * the fully qualified classname of the Loader class you want to use. * * @param className - * @return BankStatementMatcher instance + * @return BankStatementMatcherInterface instance */ public BankStatementMatcherInterface newBankStatementMatcherInstance(String className); } diff --git a/org.adempiere.base/src/org/adempiere/base/ICalloutFactory.java b/org.adempiere.base/src/org/adempiere/base/ICalloutFactory.java index 701f6c3dd0..1b487ac9be 100644 --- a/org.adempiere.base/src/org/adempiere/base/ICalloutFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/ICalloutFactory.java @@ -16,17 +16,17 @@ package org.adempiere.base; import org.compiere.model.Callout; /** - * + * Factory interface for {@link Callout}.
+ * For plugin that implement this as OSGi component, use property = {"service.ranking:Integer=1"} to set up a calling order + * that prioritizes your component over core component. * @author a42niem - * */ public interface ICalloutFactory { /** - * * @param className * @param methodName - * @return matching Callout + * @return matching Callout instance */ public Callout getCallout(String className, String methodName); diff --git a/org.adempiere.base/src/org/adempiere/base/IColumnCallout.java b/org.adempiere.base/src/org/adempiere/base/IColumnCallout.java index 49e3c00e80..0b091595c4 100755 --- a/org.adempiere.base/src/org/adempiere/base/IColumnCallout.java +++ b/org.adempiere.base/src/org/adempiere/base/IColumnCallout.java @@ -29,15 +29,15 @@ public interface IColumnCallout /** * Start Callout. *

- * Callout's are used for cross field validation and setting values in other fields - * when returning a non empty (error message) string, an exception is raised + * Callout's are used for cross field validation and setting values in other fields. + * When returning a non empty (error message) string, an exception is raised. *

* When invoked, the Tab model has the new value! * * @param ctx Context * @param WindowNo current Window No - * @param mTab Model Tab - * @param mField Model Field + * @param mTab Tab model + * @param mField Field model * @param value The new value * @param oldValue The old value * @return Error message or "" diff --git a/org.adempiere.base/src/org/adempiere/base/IColumnCalloutFactory.java b/org.adempiere.base/src/org/adempiere/base/IColumnCalloutFactory.java index b8f63459d6..8cb561d6d5 100644 --- a/org.adempiere.base/src/org/adempiere/base/IColumnCalloutFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/IColumnCalloutFactory.java @@ -14,14 +14,14 @@ package org.adempiere.base; /** - * + * Factory interface for {@link IColumnCallout}.
+ * For plugin that implement this as OSGi component, use property = {"service.ranking:Integer=1"} to set up a calling order + * that prioritizes your component over core component. * @author hengsin - * */ public interface IColumnCalloutFactory { /** - * * @param tableName * @param columnName * @return array of matching callouts diff --git a/org.adempiere.base/src/org/adempiere/base/IDictionaryService.java b/org.adempiere.base/src/org/adempiere/base/IDictionaryService.java index dded3eac76..40ba165697 100644 --- a/org.adempiere.base/src/org/adempiere/base/IDictionaryService.java +++ b/org.adempiere.base/src/org/adempiere/base/IDictionaryService.java @@ -21,15 +21,22 @@ import org.compiere.model.X_AD_Package_Imp_Proc; import org.osgi.framework.BundleContext; /** - * A dictionary service provides for easy handling of dynamic Adempiere - * dictionary. + * Interface for import of Application Dictionary data. * * @author Joerg Viola - * */ public interface IDictionaryService { + /** + * Import application dictionary package + * @param context + * @param packageFile Application Dictionary package + * @throws Exception + */ void merge(BundleContext context, File packageFile) throws Exception; + /** + * @return X_AD_Package_Imp_Proc + */ default public X_AD_Package_Imp_Proc getAD_Package_Imp_Proc() { return null; }; diff --git a/org.adempiere.base/src/org/adempiere/base/IDisplayTypeFactory.java b/org.adempiere.base/src/org/adempiere/base/IDisplayTypeFactory.java index 90dbbec955..2e7ee07db4 100644 --- a/org.adempiere.base/src/org/adempiere/base/IDisplayTypeFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/IDisplayTypeFactory.java @@ -18,40 +18,99 @@ import java.text.SimpleDateFormat; import org.compiere.util.Language; /** + * Interface for display type factory. * @author Jan Thielemann - jan.thielemann@evenos-consulting.de * @author evenos Consulting GmbH - www.evenos.org */ - public interface IDisplayTypeFactory { - + /** + * @param displayType + * @return true if displayType is of int ID type + */ public boolean isID(int displayType); + + /** + * @param displayType + * @return true if displayType is of UUID type + */ public default boolean isUUID(int displayType) { return false; - }; + } + + /** + * @param displayType + * @return true if displayType is of numeric type + */ public boolean isNumeric(int displayType); + + /** + * @param displayType + * @return default numeric precision for displayType + */ public Integer getDefaultPrecision(int displayType); + + /** + * @param displayType + * @return true if displayType is of text type + */ public boolean isText(int displayType); + + /** + * @param displayType + * @return true if displayType is of date type + */ public boolean isDate (int displayType); public default boolean isList (int displayType) { return false; } + + /** + * @param displayType + * @return true if displayType is of lookup type (usually a foreign key type) + */ public boolean isLookup(int displayType); + + /** + * @param displayType + * @return true if displayType is of LOB type + */ public boolean isLOB (int displayType); + + /** + * @param displayType + * @param language + * @param pattern + * @return DecimalFormat + */ public DecimalFormat getNumberFormat(int displayType, Language language, String pattern); + + /** + * @param displayType + * @param language + * @param pattern + * @return SimpleDateFormat + */ public SimpleDateFormat getDateFormat (int displayType, Language language, String pattern); + + /** + * @param displayType + * @param yesNoAsBoolean + * @return Java type for displayType + */ public Class getClass (int displayType, boolean yesNoAsBoolean); + + /** + * @param displayType + * @param columnName + * @param fieldLength + * @return SQL data type for displayType + */ public String getSQLDataType (int displayType, String columnName, int fieldLength); + + /** + * @param displayType + * @return description for displayType + */ public String getDescription (int displayType); } - - - - - - - - - - - diff --git a/org.adempiere.base/src/org/adempiere/base/IDocFactory.java b/org.adempiere.base/src/org/adempiere/base/IDocFactory.java index 37b0569ae3..b132c1385f 100644 --- a/org.adempiere.base/src/org/adempiere/base/IDocFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/IDocFactory.java @@ -25,9 +25,8 @@ import org.compiere.util.DB; import org.compiere.util.Env; /** - * + * Factory interface for {@link Doc}. * @author hengsin - * */ public interface IDocFactory { diff --git a/org.adempiere.base/src/org/adempiere/base/IGridTabImporter.java b/org.adempiere.base/src/org/adempiere/base/IGridTabImporter.java index 0849e01798..2827e513d7 100644 --- a/org.adempiere.base/src/org/adempiere/base/IGridTabImporter.java +++ b/org.adempiere.base/src/org/adempiere/base/IGridTabImporter.java @@ -23,14 +23,13 @@ import org.adempiere.util.IProcessUI; import org.compiere.model.GridTab; /** - * + * Interface to import data to {@link GridTab}. * @author Carlos Ruiz - * */ public interface IGridTabImporter { /** - * export gridTab data to file + * Import data from filestream to gridTab * @param gridTab * @param childs * @param filestream @@ -39,14 +38,14 @@ public interface IGridTabImporter { public File fileImport(GridTab gridTab, List childs, InputStream filestream, Charset charset, String importMode); /** - * export gridTab data to file + * Import data from filestream to gridTab * @param gridTab * @param childs * @param filestream * @param charset * @param importMode * @param processUI - * @return + * @return File for import log */ public File fileImport(GridTab gridTab, List childs, InputStream filestream, Charset charset, String importMode, IProcessUI processUI); diff --git a/org.adempiere.base/src/org/adempiere/base/IKeyStore.java b/org.adempiere.base/src/org/adempiere/base/IKeyStore.java index 5c14f484d2..5d11d54372 100644 --- a/org.adempiere.base/src/org/adempiere/base/IKeyStore.java +++ b/org.adempiere.base/src/org/adempiere/base/IKeyStore.java @@ -16,14 +16,12 @@ package org.adempiere.base; import javax.crypto.SecretKey; /** - * + * Interface for key store * @author deepak - * */ public interface IKeyStore { /** - * * @param AD_Client_ID * @return secret key */ diff --git a/org.adempiere.base/src/org/adempiere/base/ILookupFactory.java b/org.adempiere.base/src/org/adempiere/base/ILookupFactory.java index d7ab2f9fa0..94399c2708 100644 --- a/org.adempiere.base/src/org/adempiere/base/ILookupFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/ILookupFactory.java @@ -17,27 +17,27 @@ import org.compiere.model.InfoColumnVO; import org.compiere.model.Lookup; /** + * Factory interface for {@link Lookup}. + * For plugin that implement this as OSGi component, use property = {"service.ranking:Integer=1"} to set up a calling order + * that prioritizes your component over core component. * @author Jan Thielemann - jan.thielemann@evenos.de * @author evenos Consulting GmbH - www.evenos.org */ public interface ILookupFactory { /** - * * @param gridFieldVO * @return lookup instance */ public Lookup getLookup (GridFieldVO gridFieldVO); /** - * * @param gridFieldVO * @return true if the field's displaytype uses lookup */ public boolean isLookup(GridFieldVO gridFieldVO); /** - * * @param infoColumnVO * @return true if the field's displaytype uses lookup */ diff --git a/org.adempiere.base/src/org/adempiere/base/IMappedByNameFactory.java b/org.adempiere.base/src/org/adempiere/base/IMappedByNameFactory.java index 19150bdd9b..ebd347c976 100644 --- a/org.adempiere.base/src/org/adempiere/base/IMappedByNameFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/IMappedByNameFactory.java @@ -47,14 +47,12 @@ public interface IMappedByNameFactory { public void removeMapping(String name); /** - * * @param name * @return {@link Supplier} */ public Supplier getSupplier(String name); /** - * * @param name * @return new instance of T (if there are register supplier for name) */ diff --git a/org.adempiere.base/src/org/adempiere/base/IMappedColumnCalloutFactory.java b/org.adempiere.base/src/org/adempiere/base/IMappedColumnCalloutFactory.java index 0d73e29902..16ff32a3c9 100644 --- a/org.adempiere.base/src/org/adempiere/base/IMappedColumnCalloutFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/IMappedColumnCalloutFactory.java @@ -26,10 +26,11 @@ package org.adempiere.base; import java.util.function.Supplier; +import org.adempiere.base.annotation.Callout; import org.osgi.framework.BundleContext; /** - * + * Factory interface for mapping of tableName+columnName to {@link IColumnCallout} implementation. * @author hengsin * */ @@ -52,7 +53,7 @@ public interface IMappedColumnCalloutFactory { public void removeMapping(String tableName, String columnName, Supplier supplier); /** - * scan, discover and register classes with Callout annotation + * scan, discover and register classes with {@link Callout} annotation * @param context * @param packages */ diff --git a/org.adempiere.base/src/org/adempiere/base/IMappedDocumentFactory.java b/org.adempiere.base/src/org/adempiere/base/IMappedDocumentFactory.java index 27cb2cc2c2..1fb5ce0f8d 100644 --- a/org.adempiere.base/src/org/adempiere/base/IMappedDocumentFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/IMappedDocumentFactory.java @@ -31,7 +31,7 @@ import org.compiere.acct.Doc; import org.compiere.model.MAcctSchema; /** - * + * Factory interface for mapping between tableName+gaap to {@link Doc} implementation. * @author hengsin * */ @@ -46,7 +46,7 @@ public interface IMappedDocumentFactory { public void addMapping(String gaap, String tableName, Function supplier); /** - * + * Remove mapping * @param gaap * @param tableName */ diff --git a/org.adempiere.base/src/org/adempiere/base/IModelValidatorFactory.java b/org.adempiere.base/src/org/adempiere/base/IModelValidatorFactory.java index b887332e12..f9e5a04cf2 100644 --- a/org.adempiere.base/src/org/adempiere/base/IModelValidatorFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/IModelValidatorFactory.java @@ -16,7 +16,7 @@ package org.adempiere.base; import org.compiere.model.ModelValidator; /** - * + * Factory interface for {@link ModelValidator}. * @author hengsin * */ @@ -24,7 +24,7 @@ public interface IModelValidatorFactory { /** * @param className - * @return new modelvalidator intance + * @return new ModelValidator instance */ public ModelValidator newModelValidatorInstance(String className); } diff --git a/org.adempiere.base/src/org/adempiere/base/IPaymentExporterFactory.java b/org.adempiere.base/src/org/adempiere/base/IPaymentExporterFactory.java index 3397bf572a..8ad59c0732 100644 --- a/org.adempiere.base/src/org/adempiere/base/IPaymentExporterFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/IPaymentExporterFactory.java @@ -16,14 +16,14 @@ package org.adempiere.base; import org.compiere.util.PaymentExport; /** - * PaymentExporter factory interface. + * Factory interface for {@link PaymentExport}. * @author mbozem */ public interface IPaymentExporterFactory { /** * @param className - * @return payment exporter instance + * @return new PaymentExport instance */ public PaymentExport newPaymentExporterInstance(String className); } diff --git a/org.adempiere.base/src/org/adempiere/base/IPaymentProcessorFactory.java b/org.adempiere.base/src/org/adempiere/base/IPaymentProcessorFactory.java index 30cc7c9f42..ea321f0014 100644 --- a/org.adempiere.base/src/org/adempiere/base/IPaymentProcessorFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/IPaymentProcessorFactory.java @@ -16,15 +16,14 @@ package org.adempiere.base; import org.compiere.model.PaymentProcessor; /** - * + * Factory interface for {@link PaymentProcessor}. * @author hengsin - * */ public interface IPaymentProcessorFactory { /** * @param className - * @return payment processor instance + * @return new PaymentProcessor instance */ public PaymentProcessor newPaymentProcessorInstance(String className); } diff --git a/org.adempiere.base/src/org/adempiere/base/IProcessFactory.java b/org.adempiere.base/src/org/adempiere/base/IProcessFactory.java index 3f71656a96..e8fdd3ca4b 100644 --- a/org.adempiere.base/src/org/adempiere/base/IProcessFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/IProcessFactory.java @@ -16,16 +16,15 @@ package org.adempiere.base; import org.compiere.process.ProcessCall; /** - * + * Factory interface for {@link ProcessCall}. * @author hengsin - * */ public interface IProcessFactory { /** * Create new process instance * @param className - * @return new process instance + * @return new ProcessCall instance */ public ProcessCall newProcessInstance(String className); diff --git a/org.adempiere.base/src/org/adempiere/base/IProductPricing.java b/org.adempiere.base/src/org/adempiere/base/IProductPricing.java index fd3eecd6b3..cf8033342f 100644 --- a/org.adempiere.base/src/org/adempiere/base/IProductPricing.java +++ b/org.adempiere.base/src/org/adempiere/base/IProductPricing.java @@ -23,7 +23,7 @@ import org.compiere.model.I_M_RMALine; import org.compiere.model.I_M_RequisitionLine; /** - * Product Price Calculations + * Interface for Product Price Calculations */ public interface IProductPricing { diff --git a/org.adempiere.base/src/org/adempiere/base/IProductPricingFactory.java b/org.adempiere.base/src/org/adempiere/base/IProductPricingFactory.java index 846929a6c2..52540fb326 100644 --- a/org.adempiere.base/src/org/adempiere/base/IProductPricingFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/IProductPricingFactory.java @@ -13,8 +13,14 @@ *****************************************************************************/ package org.adempiere.base; +/** + * Factory interface for {@link AbstractProductPricing}. + */ public interface IProductPricingFactory { + /** + * @return new AbstractProductPricing instance + */ public AbstractProductPricing newProductPricingInstance(); } diff --git a/org.adempiere.base/src/org/adempiere/base/IReplenishFactory.java b/org.adempiere.base/src/org/adempiere/base/IReplenishFactory.java index 25ca46f313..f7ad3f8896 100644 --- a/org.adempiere.base/src/org/adempiere/base/IReplenishFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/IReplenishFactory.java @@ -11,9 +11,8 @@ import org.compiere.util.ReplenishInterface; public interface IReplenishFactory { /** - * * @param className - * @return Replenish instance + * @return new ReplenishInterface instance */ public ReplenishInterface newReplenishInstance(String className); } diff --git a/org.adempiere.base/src/org/adempiere/base/IResourceFinder.java b/org.adempiere.base/src/org/adempiere/base/IResourceFinder.java index a99ea7b76b..a3b499a0e9 100644 --- a/org.adempiere.base/src/org/adempiere/base/IResourceFinder.java +++ b/org.adempiere.base/src/org/adempiere/base/IResourceFinder.java @@ -18,8 +18,15 @@ package org.adempiere.base; import java.net.URL; +/** + * Service interface to find resource by name + */ public interface IResourceFinder { + /** + * @param name + * @return URL for resource found or null + */ URL getResource(String name); } diff --git a/org.adempiere.base/src/org/adempiere/base/IServiceHolder.java b/org.adempiere.base/src/org/adempiere/base/IServiceHolder.java index 3790199215..edd1fa7ce1 100644 --- a/org.adempiere.base/src/org/adempiere/base/IServiceHolder.java +++ b/org.adempiere.base/src/org/adempiere/base/IServiceHolder.java @@ -14,7 +14,7 @@ package org.adempiere.base; /** - * + * Holder interface for dynamic service * @author hengsin * * @param diff --git a/org.adempiere.base/src/org/adempiere/base/IServiceLocator.java b/org.adempiere.base/src/org/adempiere/base/IServiceLocator.java index 9ca8d48daa..a882c1f295 100644 --- a/org.adempiere.base/src/org/adempiere/base/IServiceLocator.java +++ b/org.adempiere.base/src/org/adempiere/base/IServiceLocator.java @@ -17,33 +17,30 @@ package org.adempiere.base; /** - * A service locator looks up services. - * This is the central authority for adempiere service definition, - * because each service defined has to be looked up via this interface. - * - * A service in adempiere is an implementation for the registered interface, expose through osgi service registry + * Interface for dynamic discovery of services.
+ * This is the primary entry point for iDempiere service discovery. * * @author viola * */ public interface IServiceLocator { /** - * + * Locate matching service by type (order by service.ranking priority) * @param type service interface * @return holder for dynamic service */ IServiceHolder locate(Class type); /** - * + * Locate matching service by type and query expression * @param type * @param query - * @return + * @return holder for service */ IServiceHolder locate(Class type, ServiceQuery query); /** - * + * Locate matching service by component name and query expression * @param type * @param componentName service component name * @param query @@ -52,14 +49,14 @@ public interface IServiceLocator { IServiceHolder locate(Class type, String componentName, ServiceQuery query); /** - * + * Find all matching services by type * @param type * @return holder for list of dynamic service */ IServicesHolder list(Class type); /** - * + * Find all matching services by type and query expression * @param type * @param query * @return holder for list of dynamic service @@ -67,7 +64,7 @@ public interface IServiceLocator { IServicesHolder list(Class type, ServiceQuery query); /** - * + * Find all matching services by component name and query expression * @param type * @param componentName osgi service component name * @param query diff --git a/org.adempiere.base/src/org/adempiere/base/IServiceReferenceHolder.java b/org.adempiere.base/src/org/adempiere/base/IServiceReferenceHolder.java index 46b8097a58..171d5f33d1 100644 --- a/org.adempiere.base/src/org/adempiere/base/IServiceReferenceHolder.java +++ b/org.adempiere.base/src/org/adempiere/base/IServiceReferenceHolder.java @@ -27,8 +27,8 @@ package org.adempiere.base; import org.osgi.framework.ServiceReference; /** - * Dynamic service reference holder for a service object. - * For cache usage, you should cache this instead of service object + * Service reference holder for a service object.
+ * For caching of service, you should cache this instead of the service object. * @author hengsin * * @param diff --git a/org.adempiere.base/src/org/adempiere/base/IServicesHolder.java b/org.adempiere.base/src/org/adempiere/base/IServicesHolder.java index 5f8bd566d5..1b3bee4c0a 100644 --- a/org.adempiere.base/src/org/adempiere/base/IServicesHolder.java +++ b/org.adempiere.base/src/org/adempiere/base/IServicesHolder.java @@ -16,7 +16,7 @@ package org.adempiere.base; import java.util.List; /** - * + * Holder interface for list of service * @author hengsin * * @param diff --git a/org.adempiere.base/src/org/adempiere/base/IShipmentProcessorFactory.java b/org.adempiere.base/src/org/adempiere/base/IShipmentProcessorFactory.java index f874d9c9d9..3c2b094664 100644 --- a/org.adempiere.base/src/org/adempiere/base/IShipmentProcessorFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/IShipmentProcessorFactory.java @@ -16,16 +16,15 @@ package org.adempiere.base; import org.adempiere.model.IShipmentProcessor; /** - * + * Factory interface for {@link IShipmentProcessor}. * @author hengsin - * */ public interface IShipmentProcessorFactory { /** * Create new shipment processor instance * @param className - * @return shipment processor instance + * @return new IShipmentProcessor instance */ public IShipmentProcessor newShipmentProcessorInstance(String className); } diff --git a/org.adempiere.base/src/org/adempiere/base/ITaxLookup.java b/org.adempiere.base/src/org/adempiere/base/ITaxLookup.java index 147adb623f..7c3fe161e2 100644 --- a/org.adempiere.base/src/org/adempiere/base/ITaxLookup.java +++ b/org.adempiere.base/src/org/adempiere/base/ITaxLookup.java @@ -28,9 +28,8 @@ import java.sql.Timestamp; import java.util.Properties; /** - * Interface to lookup C_Tax record id + * Interface to lookup C_Tax record id (C_Tax_ID) * @author hengsin - * */ public interface ITaxLookup { diff --git a/org.adempiere.base/src/org/adempiere/base/ITaxProviderFactory.java b/org.adempiere.base/src/org/adempiere/base/ITaxProviderFactory.java index d0356a4fd5..126efb6856 100644 --- a/org.adempiere.base/src/org/adempiere/base/ITaxProviderFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/ITaxProviderFactory.java @@ -18,14 +18,13 @@ import org.adempiere.model.ITaxProvider; /** * Tax provider factory interface * @author Elaine - * */ public interface ITaxProviderFactory { /** * Create new tax provider instance * @param className - * @return tax provider instance + * @return new ITaxProvider instance */ public ITaxProvider newTaxProviderInstance(String className); } diff --git a/org.adempiere.base/src/org/adempiere/base/MappedColumnCalloutFactory.java b/org.adempiere.base/src/org/adempiere/base/MappedColumnCalloutFactory.java index b39479a962..6ae84ba6dc 100644 --- a/org.adempiere.base/src/org/adempiere/base/MappedColumnCalloutFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/MappedColumnCalloutFactory.java @@ -45,9 +45,8 @@ import io.github.classgraph.ClassInfo; import io.github.classgraph.ScanResult; /** - * + * Default implementation of {@link IMappedColumnCalloutFactory} for core. * @author hengsin - * */ @Component(name = "org.adempiere.base.MappedColumnCalloutFactory", immediate = true, @@ -117,6 +116,9 @@ public class MappedColumnCalloutFactory implements IColumnCalloutFactory, IMappe } } + /** + * For plugin to lookup this service by component name and call this method to register annotated callout classes. + */ @Override public void scan(BundleContext context, String... packages) { ClassLoader classLoader = context.getBundle().adapt(BundleWiring.class).getClassLoader(); diff --git a/org.adempiere.base/src/org/adempiere/base/MappedDocumentFactory.java b/org.adempiere.base/src/org/adempiere/base/MappedDocumentFactory.java index 0b83da8a53..fb255b97aa 100644 --- a/org.adempiere.base/src/org/adempiere/base/MappedDocumentFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/MappedDocumentFactory.java @@ -35,17 +35,16 @@ import org.compiere.util.Env; import org.compiere.util.Util; import org.osgi.service.component.annotations.Component; -@Component(name = "org.adempiere.base.MappedDocumentFactory", - service = {IDocFactory.class, IMappedDocumentFactory.class}, - immediate = true, - property = {"service.ranking:Integer=1", "gaap=*"}) /** - * - * Document factory backed by map between tablename + gaap and lambda function object. + * Document factory backed by map between tablename + gaap and lambda function object.
* If you create a subclass of this and register it as osgi service, don't register for the IMappedDocumentFactory interface. * @author hengsin * */ +@Component(name = "org.adempiere.base.MappedDocumentFactory", + service = {IDocFactory.class, IMappedDocumentFactory.class}, + immediate = true, + property = {"service.ranking:Integer=1", "gaap=*"}) public class MappedDocumentFactory implements IDocFactory, IMappedDocumentFactory { private final ConcurrentHashMap> documentMap = new ConcurrentHashMap<>(); diff --git a/org.adempiere.base/src/org/adempiere/base/Model.java b/org.adempiere.base/src/org/adempiere/base/Model.java index 56059c903f..221f62ab71 100644 --- a/org.adempiere.base/src/org/adempiere/base/Model.java +++ b/org.adempiere.base/src/org/adempiere/base/Model.java @@ -28,7 +28,7 @@ public @interface Model { /** * Table name - * @return + * @return table name */ String table(); diff --git a/org.adempiere.base/src/org/adempiere/base/Service.java b/org.adempiere.base/src/org/adempiere/base/Service.java index 9a5af7d723..8267327a33 100644 --- a/org.adempiere.base/src/org/adempiere/base/Service.java +++ b/org.adempiere.base/src/org/adempiere/base/Service.java @@ -29,8 +29,7 @@ public class Service { private static IServiceLocator theLocator = new DynamicServiceLocator(); /** - * - * @return service locator instance + * @return IServiceLocator instance */ public static IServiceLocator locator() { return theLocator; diff --git a/org.adempiere.base/src/org/adempiere/base/annotation/Callout.java b/org.adempiere.base/src/org/adempiere/base/annotation/Callout.java index a3120dad41..66069d87a3 100644 --- a/org.adempiere.base/src/org/adempiere/base/annotation/Callout.java +++ b/org.adempiere.base/src/org/adempiere/base/annotation/Callout.java @@ -32,8 +32,9 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; /** - * Annotation for Column Callout. This should only be used with class that implements the IColumnCallout interface. - * You can repeat the annotation multiple time for different table and column name combination + * Annotation for Column Callout.
+ * This should only be used for class that implements the IColumnCallout interface. + * You can repeat the annotation multiple time for different table and column name combination.
* Note that you can't use * for both tableName and columnName attribute. * @author hengsin * diff --git a/org.adempiere.base/src/org/adempiere/base/annotation/EventTopicDelegate.java b/org.adempiere.base/src/org/adempiere/base/annotation/EventTopicDelegate.java index 667a0010be..09120ff67f 100644 --- a/org.adempiere.base/src/org/adempiere/base/annotation/EventTopicDelegate.java +++ b/org.adempiere.base/src/org/adempiere/base/annotation/EventTopicDelegate.java @@ -33,11 +33,9 @@ import java.lang.annotation.Target; import org.adempiere.base.event.annotations.EventDelegate; /** - * - * Annotation for OSGi Event Topic Delegate. + * Annotation for OSGi Event Topic Delegate.
* Works with {@link EventDelegate} and its sub classes * @author hengsin - * */ @Retention(RUNTIME) @Target(ElementType.TYPE) diff --git a/org.adempiere.base/src/org/adempiere/base/annotation/ImportEventTopic.java b/org.adempiere.base/src/org/adempiere/base/annotation/ImportEventTopic.java index 8df3d89ee1..4e8e409a2f 100644 --- a/org.adempiere.base/src/org/adempiere/base/annotation/ImportEventTopic.java +++ b/org.adempiere.base/src/org/adempiere/base/annotation/ImportEventTopic.java @@ -33,8 +33,8 @@ import java.lang.annotation.Target; import org.adempiere.base.event.annotations.imp.ImportEventDelegate; /** - * Define parameter for {@link ImportEventDelegate} - * Works with classes with {@link EventTopicDelegate} annotation + * Specify parameter for {@link ImportEventDelegate}.
+ * Works with classes with {@link EventTopicDelegate} annotation. * @author hengsin * */ diff --git a/org.adempiere.base/src/org/adempiere/base/annotation/ModelEventTopic.java b/org.adempiere.base/src/org/adempiere/base/annotation/ModelEventTopic.java index 2c0cdb4176..d23df8ed74 100644 --- a/org.adempiere.base/src/org/adempiere/base/annotation/ModelEventTopic.java +++ b/org.adempiere.base/src/org/adempiere/base/annotation/ModelEventTopic.java @@ -34,8 +34,8 @@ import org.adempiere.base.event.annotations.ModelEventDelegate; import org.compiere.model.PO; /** - * Specify parameter for {@link ModelEventDelegate} - * Works with classes with {@link EventTopicDelegate} annotation + * Specify parameter for {@link ModelEventDelegate}.
+ * Works with classes with {@link EventTopicDelegate} annotation. * @author hengsin * */ diff --git a/org.adempiere.base/src/org/adempiere/base/annotation/Parameter.java b/org.adempiere.base/src/org/adempiere/base/annotation/Parameter.java index 9412a0acf4..d5d0a8c46b 100644 --- a/org.adempiere.base/src/org/adempiere/base/annotation/Parameter.java +++ b/org.adempiere.base/src/org/adempiere/base/annotation/Parameter.java @@ -22,16 +22,16 @@ import org.compiere.model.X_AD_Process_Para; import org.compiere.process.SvrProcess; /** - * Tags a process class field as a process parameter in order to have its value set automatically. + * Tags a process class field as a process parameter in order to have its value set automatically.
* Class fields are matched against process parameters using the following heuristics:
* [1] If the parameter annotation has a name, then it must match exactly the process parameter * metadata definition. For example:
* @Parameter(name="C_BPartner_ID") int foo will fill foo with * the value of the parameter named C_BPartner_ID.
* [2] Class fields with the p_ prefix will be matched automatically. Example:
- * @Parameter Integer p_C_BPartner_ID will match a parameter named C_BPartner_ID. + * @Parameter Integer p_C_BPartner_ID will match a parameter named C_BPartner_ID.
* [3] Fields with their names matching metadata names after stripping the "_" character. Example: - * @Parameter Integer cBPartnerId will match a parameter named C_BPartner_ID. + * @Parameter Integer cBPartnerId will match a parameter named C_BPartner_ID.
* [4] Fields with their names matching exactly their metadata names. Example: * @Parameter Integer C_BPartner_ID will match a parameter named C_BPartner_ID. * @see SvrProcess diff --git a/org.adempiere.base/src/org/adempiere/base/annotation/Process.java b/org.adempiere.base/src/org/adempiere/base/annotation/Process.java index 7115156b91..adfde08c8d 100644 --- a/org.adempiere.base/src/org/adempiere/base/annotation/Process.java +++ b/org.adempiere.base/src/org/adempiere/base/annotation/Process.java @@ -1,3 +1,15 @@ +/****************************************************************************** + * Product: iDempiere ERP & CRM Smart Business Solution * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. 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., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + *****************************************************************************/ package org.adempiere.base.annotation; import static java.lang.annotation.ElementType.TYPE; diff --git a/org.adempiere.base/src/org/adempiere/base/annotation/ProcessEventTopic.java b/org.adempiere.base/src/org/adempiere/base/annotation/ProcessEventTopic.java index aeac806a63..1fd1c4250c 100644 --- a/org.adempiere.base/src/org/adempiere/base/annotation/ProcessEventTopic.java +++ b/org.adempiere.base/src/org/adempiere/base/annotation/ProcessEventTopic.java @@ -33,8 +33,8 @@ import java.lang.annotation.Target; import org.adempiere.base.event.annotations.process.ProcessEventDelegate; /** - * Define parameter for {@link ProcessEventDelegate} - * Works with classes with {@link EventTopicDelegate} annotation + * Specify parameter for {@link ProcessEventDelegate}.
+ * Works with classes with {@link EventTopicDelegate} annotation. * @author hengsin * */ @@ -43,7 +43,7 @@ import org.adempiere.base.event.annotations.process.ProcessEventDelegate; public @interface ProcessEventTopic { /** * AD_Process.AD_Process_UU (uuid) value for {@link ProcessEventDelegate} - * @return process uuid + * @return AD_Process_UU */ String processUUID(); } diff --git a/org.adempiere.base/src/org/adempiere/base/ds/DynamicServiceHolder.java b/org.adempiere.base/src/org/adempiere/base/ds/DynamicServiceHolder.java index de9dc2d537..debd99325b 100644 --- a/org.adempiere.base/src/org/adempiere/base/ds/DynamicServiceHolder.java +++ b/org.adempiere.base/src/org/adempiere/base/ds/DynamicServiceHolder.java @@ -25,8 +25,8 @@ import org.osgi.framework.ServiceReference; import org.osgi.util.tracker.ServiceTracker; /** + * Holder for OSGI service. Implemented using {@link ServiceTracker}. * @author hengsin - * */ public class DynamicServiceHolder implements IServiceHolder, IServicesHolder { diff --git a/org.adempiere.base/src/org/adempiere/base/ds/DynamicServiceLocator.java b/org.adempiere.base/src/org/adempiere/base/ds/DynamicServiceLocator.java index 3690d9527e..337ca84a4e 100644 --- a/org.adempiere.base/src/org/adempiere/base/ds/DynamicServiceLocator.java +++ b/org.adempiere.base/src/org/adempiere/base/ds/DynamicServiceLocator.java @@ -24,13 +24,13 @@ import org.osgi.service.component.ComponentConstants; import org.osgi.util.tracker.ServiceTracker; /** + * Service locator implementation for OSGi service. * @author hengsin - * */ public class DynamicServiceLocator implements IServiceLocator { /** - * + * default constructor */ public DynamicServiceLocator() { } @@ -109,6 +109,13 @@ public class DynamicServiceLocator implements IServiceLocator { return new DynamicServiceHolder(tracker); } + /** + * Create service query filter + * @param type + * @param serviceId + * @param query + * @return Filter + */ private Filter filter(Class type, String serviceId, ServiceQuery query) { StringBuilder builder = new StringBuilder("(&(objectclass="); builder.append(type.getName()).append(")"); diff --git a/org.adempiere.base/src/org/adempiere/base/ds/DynamicServiceReference.java b/org.adempiere.base/src/org/adempiere/base/ds/DynamicServiceReference.java index e73b58b5b2..7fc3097957 100644 --- a/org.adempiere.base/src/org/adempiere/base/ds/DynamicServiceReference.java +++ b/org.adempiere.base/src/org/adempiere/base/ds/DynamicServiceReference.java @@ -29,7 +29,7 @@ import org.osgi.framework.ServiceReference; import org.osgi.util.tracker.ServiceTracker; /** - * IServiceReferenceHolder implementation using ServiceTracker + * IServiceReferenceHolder for OSGi service, implemented using {@link ServiceTracker} * @author hengsin * * @param diff --git a/org.adempiere.base/src/org/adempiere/base/ds/ServiceRankingComparator.java b/org.adempiere.base/src/org/adempiere/base/ds/ServiceRankingComparator.java index 64990d8db8..41aaff8237 100644 --- a/org.adempiere.base/src/org/adempiere/base/ds/ServiceRankingComparator.java +++ b/org.adempiere.base/src/org/adempiere/base/ds/ServiceRankingComparator.java @@ -31,13 +31,13 @@ import org.osgi.framework.Constants; import org.osgi.framework.ServiceReference; /** - * Service Reference Comparator. + * Service Reference Comparator.
* This comparator follows OSGi Ranking policy. * @author hengsin */ public final class ServiceRankingComparator implements Comparator>, Serializable { /** - * + * generated serial id */ private static final long serialVersionUID = 3444598255961708618L; @@ -57,6 +57,7 @@ public final class ServiceRankingComparator implements Comparator serviceReference1, ServiceReference serviceReference2) { if (serviceReference1.equals(serviceReference2)) { return 0; } diff --git a/org.adempiere.base/src/org/adempiere/base/equinox/EquinoxExtensionHolder.java b/org.adempiere.base/src/org/adempiere/base/equinox/EquinoxExtensionHolder.java index 3a92956ed8..9e9c4f9d69 100644 --- a/org.adempiere.base/src/org/adempiere/base/equinox/EquinoxExtensionHolder.java +++ b/org.adempiere.base/src/org/adempiere/base/equinox/EquinoxExtensionHolder.java @@ -16,6 +16,7 @@ package org.adempiere.base.equinox; import java.util.List; /** + * Holder for list of Equinox extension. * @author hengsin * */ diff --git a/org.adempiere.base/src/org/adempiere/base/equinox/EquinoxExtensionLocator.java b/org.adempiere.base/src/org/adempiere/base/equinox/EquinoxExtensionLocator.java index 7abb64cb4f..a644e30ba6 100644 --- a/org.adempiere.base/src/org/adempiere/base/equinox/EquinoxExtensionLocator.java +++ b/org.adempiere.base/src/org/adempiere/base/equinox/EquinoxExtensionLocator.java @@ -20,8 +20,8 @@ import org.adempiere.base.ServiceQuery; /** - * This is the Equinox implementation of extension Locator. - * It delegates work to the ExtensionList that lookups up extensions. + * This is the Equinox implementation of extension Locator.
+ * It delegates work to the ExtensionList that lookups up extensions.
* Usually, the ids of extension points correspond to the interface names of the services. * * @author viola @@ -33,12 +33,14 @@ public class EquinoxExtensionLocator { private EquinoxExtensionLocator() {} + /** + * @return EquinoxExtensionLocator singleton instance + */ public static EquinoxExtensionLocator instance() { return INSTANCE; } /** - * * @param type * @return equinox extension holder */ @@ -47,7 +49,6 @@ public class EquinoxExtensionLocator { } /** - * * @param type * @param extensionPointId * @return equinox extension holder @@ -58,7 +59,6 @@ public class EquinoxExtensionLocator { } /** - * * @param type * @param query * @return equinox extension holder @@ -68,7 +68,6 @@ public class EquinoxExtensionLocator { } /** - * * @param type * @param extensionId * @param query @@ -80,7 +79,6 @@ public class EquinoxExtensionLocator { } /** - * * @param type * @param extensionPointId * @param extensionId @@ -94,7 +92,6 @@ public class EquinoxExtensionLocator { } /** - * * @param type * @return equinox extension holder */ @@ -103,7 +100,6 @@ public class EquinoxExtensionLocator { } /** - * * @param type * @param extensionPointId * @return equinox extension holder @@ -114,7 +110,6 @@ public class EquinoxExtensionLocator { } /** - * * @param type * @param query * @return equinox extension holder @@ -124,7 +119,6 @@ public class EquinoxExtensionLocator { } /** - * * @param type * @param extensionId * @param query @@ -136,7 +130,6 @@ public class EquinoxExtensionLocator { } /** - * * @param type * @param extensionPointId * @param extensionId diff --git a/org.adempiere.base/src/org/adempiere/base/equinox/ExtensionList.java b/org.adempiere.base/src/org/adempiere/base/equinox/ExtensionList.java index e7ee533faa..d8a51f6533 100644 --- a/org.adempiere.base/src/org/adempiere/base/equinox/ExtensionList.java +++ b/org.adempiere.base/src/org/adempiere/base/equinox/ExtensionList.java @@ -29,11 +29,11 @@ import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.Platform; /** - * This List looks up services as extensions in equinox. - * The extension point must be the class name of the service interface. + * This List looks up services as extensions in equinox.
+ * The extension point must be the class name of the service interface.
* The query attributes are checked against the attributes * of the extension configuration element. - * + *

* In order to minimize equinox lookups, a filtering iterator is used. * @author viola * @@ -41,15 +41,23 @@ import org.eclipse.core.runtime.Platform; */ public class ExtensionList implements Iterable{ + /** + * Iterator implementation for Equinox extension + * @param + */ public class ExtensionIterator implements Iterator { private int index = 0; + @Override public boolean hasNext() { iterateUntilAccepted(); return index implements Iterable{ } } + /** + * @param element + * @return true if current element match extension id or filter parameter + */ private boolean accept(IConfigurationElement element) { if (extensionId != null) { String id = element.getDeclaringExtension().getUniqueIdentifier(); @@ -74,6 +86,7 @@ public class ExtensionList implements Iterable{ } @SuppressWarnings("unchecked") + @Override public E next() { iterateUntilAccepted(); IConfigurationElement e = elements[index++]; @@ -95,6 +108,10 @@ public class ExtensionList implements Iterable{ } } + /** + * Not supported, will throw exception. + */ + @Override public void remove() { throw new UnsupportedOperationException(); } @@ -123,6 +140,12 @@ public class ExtensionList implements Iterable{ } } + /** + * @param type + * @param extensionPointId + * @param extensionId + * @param query + */ public ExtensionList(Class type, String extensionPointId, String extensionId, ServiceQuery query) { this(type, extensionPointId); this.extensionId = extensionId; @@ -133,6 +156,11 @@ public class ExtensionList implements Iterable{ } } + /** + * Sort by extension priority (if defined in extensions-priorty.properties). + * @param elementArray + * @return sorted elementArray + */ private IConfigurationElement[] sort(IConfigurationElement[] elementArray) { IConfigurationElement[] result = elementArray; TreeMap> elementMap = new TreeMap>(); @@ -169,14 +197,25 @@ public class ExtensionList implements Iterable{ return result; } + /** + * @return Iterator + */ public Iterator iterator() { return new ExtensionIterator(); } + /** + * add filter for discovery of extensions + * @param attribute + * @param value + */ public void addFilter(String attribute, String value) { filters.put(attribute, value); } + /** + * @return first matching extension + */ public T first() { Iterator i = iterator(); if (!i.hasNext()) @@ -184,6 +223,9 @@ public class ExtensionList implements Iterable{ return i.next(); } + /** + * @return list of matching extension + */ public List asList() { List result = new ArrayList(); for (T t : this) { diff --git a/org.adempiere.base/src/org/adempiere/base/equinox/ExtensionPriorityManager.java b/org.adempiere.base/src/org/adempiere/base/equinox/ExtensionPriorityManager.java index 7df6c951a8..423afdc4c7 100644 --- a/org.adempiere.base/src/org/adempiere/base/equinox/ExtensionPriorityManager.java +++ b/org.adempiere.base/src/org/adempiere/base/equinox/ExtensionPriorityManager.java @@ -25,7 +25,7 @@ import org.eclipse.core.runtime.Platform; import org.eclipse.osgi.service.datalocation.Location; /** - * + * Load extension priority from extensions-priorty.properties * @author hengsin * */ diff --git a/org.adempiere.base/src/org/adempiere/base/equinox/StackTraceCommand.java b/org.adempiere.base/src/org/adempiere/base/equinox/StackTraceCommand.java index 2d6be54feb..7951e4386d 100644 --- a/org.adempiere.base/src/org/adempiere/base/equinox/StackTraceCommand.java +++ b/org.adempiere.base/src/org/adempiere/base/equinox/StackTraceCommand.java @@ -19,16 +19,15 @@ import org.eclipse.osgi.framework.console.CommandProvider; import org.eclipse.osgi.framework.console.CommandInterpreter; /** + * OSGi console command for printing of stack trace. * @author hengsin - * */ public class StackTraceCommand implements CommandProvider { /** - * + * default constructor */ public StackTraceCommand() { - // TODO Auto-generated constructor stub } /* (non-Javadoc) diff --git a/org.adempiere.base/src/org/adempiere/base/event/AbstractEventHandler.java b/org.adempiere.base/src/org/adempiere/base/event/AbstractEventHandler.java index b37985ccec..f9128e8f66 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/AbstractEventHandler.java +++ b/org.adempiere.base/src/org/adempiere/base/event/AbstractEventHandler.java @@ -23,6 +23,7 @@ import org.osgi.service.event.Event; import org.osgi.service.event.EventHandler; /** + * Base class to help simplify implementation of OSGi {@link EventHandler}. * @author hengsin * */ @@ -79,13 +80,13 @@ public abstract class AbstractEventHandler implements EventHandler { } /** - * override this method to handle event + * Sub class should override this method to handle event. * @param event */ protected abstract void doHandleEvent(Event event); /** - * override this method to register event that the class want to listen to + * Sub class should override this method to register event that the class want to listen to */ protected abstract void initialize(); diff --git a/org.adempiere.base/src/org/adempiere/base/event/EventHelper.java b/org.adempiere.base/src/org/adempiere/base/event/EventHelper.java index de95c8a395..9fbf520809 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/EventHelper.java +++ b/org.adempiere.base/src/org/adempiere/base/event/EventHelper.java @@ -32,7 +32,7 @@ import org.compiere.util.CLogger; import org.osgi.service.event.Event; /** - * Helper methods for event handler + * Helper methods for {@link AbstractEventHandler}. * @author hengsin */ public final class EventHelper { @@ -66,7 +66,6 @@ public final class EventHelper { } /** - * * @param * @param event */ @@ -75,7 +74,6 @@ public final class EventHelper { } /** - * * @param * @param event * @param property diff --git a/org.adempiere.base/src/org/adempiere/base/event/EventManager.java b/org.adempiere.base/src/org/adempiere/base/event/EventManager.java index 331499e2f8..e6d9838162 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/EventManager.java +++ b/org.adempiere.base/src/org/adempiere/base/event/EventManager.java @@ -43,7 +43,7 @@ import org.osgi.service.event.EventConstants; import org.osgi.service.event.EventHandler; /** - * Simple wrapper for the osgi event admin service. + * Simple wrapper for the osgi event admin service.
* Usage: EventManager.getInstance().sendEvent/postEvent * @author hengsin * diff --git a/org.adempiere.base/src/org/adempiere/base/event/FactsEventData.java b/org.adempiere.base/src/org/adempiere/base/event/FactsEventData.java index 2bb920980d..bb6d225190 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/FactsEventData.java +++ b/org.adempiere.base/src/org/adempiere/base/event/FactsEventData.java @@ -15,14 +15,14 @@ package org.adempiere.base.event; import java.util.List; +import org.adempiere.base.event.annotations.doc.FactsValidateDelegate; import org.compiere.acct.Fact; import org.compiere.model.MAcctSchema; import org.compiere.model.PO; /** - * + * Event data for {@link FactsValidateDelegate}. * @author hengsin - * */ public class FactsEventData implements POEventData { private MAcctSchema acctSchema; diff --git a/org.adempiere.base/src/org/adempiere/base/event/IEventManager.java b/org.adempiere.base/src/org/adempiere/base/event/IEventManager.java index 1b5093f301..6208b7f4d9 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/IEventManager.java +++ b/org.adempiere.base/src/org/adempiere/base/event/IEventManager.java @@ -18,9 +18,8 @@ import org.osgi.service.event.Event; import org.osgi.service.event.EventHandler; /** - * + * Interface for global event manager * @author hengsin - * */ public interface IEventManager { diff --git a/org.adempiere.base/src/org/adempiere/base/event/IEventTopics.java b/org.adempiere.base/src/org/adempiere/base/event/IEventTopics.java index 1e8ae325fd..7d2d014a4e 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/IEventTopics.java +++ b/org.adempiere.base/src/org/adempiere/base/event/IEventTopics.java @@ -14,9 +14,8 @@ package org.adempiere.base.event; /** - * + * Event topic constants * @author hengsin - * */ public interface IEventTopics { @@ -91,7 +90,7 @@ public interface IEventTopics { public static final String PREF_AFTER_LOAD = "adempiere/pref/afterLoad"; - /** Called after next document actions are set */ + /** Called during discovery of available and valid document actions */ public static final String DOCACTION = "adempiere/docAction"; public static final String BROADCAST_MESSAGE = "idempiere/broadcastMsg"; diff --git a/org.adempiere.base/src/org/adempiere/base/event/ImportEventData.java b/org.adempiere.base/src/org/adempiere/base/event/ImportEventData.java index 5bd3818c2a..4a95e252ba 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/ImportEventData.java +++ b/org.adempiere.base/src/org/adempiere/base/event/ImportEventData.java @@ -13,13 +13,13 @@ *****************************************************************************/ package org.adempiere.base.event; +import org.adempiere.base.event.annotations.imp.ImportEventDelegate; import org.adempiere.process.ImportProcess; import org.compiere.model.PO; /** - * + * Event data for {@link ImportEventDelegate}. * @author hengsin - * */ public class ImportEventData { private ImportProcess importProcess; @@ -46,14 +46,14 @@ public class ImportEventData { } /** - * @return the source + * @return the source PO */ public PO getSource() { return source; } /** - * @return the target + * @return the target PO */ public PO getTarget() { return target; diff --git a/org.adempiere.base/src/org/adempiere/base/event/LoginEventData.java b/org.adempiere.base/src/org/adempiere/base/event/LoginEventData.java index 408e80eeed..9bb41e268a 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/LoginEventData.java +++ b/org.adempiere.base/src/org/adempiere/base/event/LoginEventData.java @@ -13,10 +13,11 @@ *****************************************************************************/ package org.adempiere.base.event; +import org.adempiere.base.event.annotations.AfterLoginEventDelegate; + /** - * + * Event data for {@link AfterLoginEventDelegate}. * @author hengsin - * */ public class LoginEventData { private int AD_Client_ID; diff --git a/org.adempiere.base/src/org/adempiere/base/event/ReportSendEMailEventData.java b/org.adempiere.base/src/org/adempiere/base/event/ReportSendEMailEventData.java index ffaf5f50b2..40e2790321 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/ReportSendEMailEventData.java +++ b/org.adempiere.base/src/org/adempiere/base/event/ReportSendEMailEventData.java @@ -33,6 +33,9 @@ package org.adempiere.base.event; import org.compiere.model.PrintInfo; +/** + * Event data for {@link IEventTopics#REPORT_SEND_EMAIL} event topic. + */ public class ReportSendEMailEventData { public static final String CONTEXT_EMAIL_TO = "_EMAIL_TO_"; @@ -49,10 +52,25 @@ public class ReportSendEMailEventData { private int m_recordId; private String m_recordUU; + /** + * @param windowNo + * @param tableId + * @param recordId + * @param printInfo + * @param subject + */ public ReportSendEMailEventData(int windowNo, int tableId, int recordId, PrintInfo printInfo, String subject) { this(windowNo, tableId, recordId, null, printInfo, subject); } + /** + * @param windowNo + * @param tableId + * @param recordId + * @param recordUU + * @param printInfo + * @param subject + */ public ReportSendEMailEventData(int windowNo, int tableId, int recordId, String recordUU, PrintInfo printInfo, String subject) { m_windowNo = windowNo; m_tableId = tableId; @@ -62,50 +80,86 @@ public class ReportSendEMailEventData { m_subject = subject; } + /** + * @return window number + */ public int getWindowNo() { return m_windowNo; } + /** + * @param windowNo + */ public void setWindowNo(int windowNo) { m_windowNo = windowNo; } + /** + * @return AD_Table_ID + */ public int getTableId() { return m_tableId; } + /** + * @param tableId AD_Table_ID + */ public void setTableId(int tableId) { m_tableId = tableId; } + /** + * @return record id + */ public int getRecordId() { return m_recordId; } + /** + * @param recordId + */ public void setRecordId(int recordId) { m_recordId = recordId; } + /** + * @return record uuid + */ public String getRecordUU() { return m_recordUU; } + /** + * @param recordUU record uuid + */ public void setRecordUU(String recordUU) { m_recordUU = recordUU; } + /** + * @return PrintInfo + */ public PrintInfo getFrom() { return m_printInfo; } + /** + * @param printInfo + */ public void setFrom(PrintInfo printInfo) { m_printInfo = printInfo; } + /** + * @return subject + */ public String getSubject() { return m_subject; } + /** + * @param subject + */ public void setSubject(String subject) { m_subject = subject; } diff --git a/org.adempiere.base/src/org/adempiere/base/event/RequestEventHandler.java b/org.adempiere.base/src/org/adempiere/base/event/RequestEventHandler.java index 6f5841175c..3d634494fa 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/RequestEventHandler.java +++ b/org.adempiere.base/src/org/adempiere/base/event/RequestEventHandler.java @@ -46,7 +46,7 @@ import org.osgi.service.cm.ManagedService; import org.osgi.service.event.Event; /** - * Request event handler + * Event handler for R_Request table and REQUEST_SEND_EMAIL event topic. * @author Nur Yasmin * */ @@ -100,6 +100,12 @@ public class RequestEventHandler extends AbstractEventHandler implements Managed registerTableEvent(IEventTopics.PO_AFTER_CHANGE, I_R_Request.Table_Name); } + /** + * Handle before update of R_Request record + * @param r + * @param newRecord + * @return error message or null + */ private String beforeSaveRequest(MRequest r, boolean newRecord) { // New @@ -212,6 +218,12 @@ public class RequestEventHandler extends AbstractEventHandler implements Managed return null; } + /** + * Handle after save of R_Request record + * @param r + * @param newRecord + * @return error message or null + */ private String afterSaveRequest(MRequest r, boolean newRecord) { // Initial Mail @@ -222,10 +234,10 @@ public class RequestEventHandler extends AbstractEventHandler implements Managed } /** - * Check for changes + * Process changes * @param ra request action * @param columnName column - * @return true if changes + * @return true if columnName has changes */ public boolean checkChange (MRequest r, MRequestAction ra, String columnName) { @@ -395,10 +407,10 @@ public class RequestEventHandler extends AbstractEventHandler implements Managed } } // sendNotice - /************************************************************************** - * Get MailID + /** + * Get mail trailer text * @param serverAddress server address - * @return Mail Trailer + * @return Mail trailer text */ private String getMailTrailer(MRequest r, String serverAddress) { diff --git a/org.adempiere.base/src/org/adempiere/base/event/RequestPropertyService.java b/org.adempiere.base/src/org/adempiere/base/event/RequestPropertyService.java index 77a83920d0..6a0cab5995 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/RequestPropertyService.java +++ b/org.adempiere.base/src/org/adempiere/base/event/RequestPropertyService.java @@ -32,9 +32,9 @@ import org.osgi.service.cm.Configuration; import org.osgi.service.cm.ConfigurationAdmin; /** - * Request property service + * Load request property from requesteventhandler.properties and update {@link Configuration} + * through {@link ConfigurationAdmin} service. * @author Elaine - * */ public class RequestPropertyService { @@ -42,17 +42,30 @@ public class RequestPropertyService { private static final CLogger logger = CLogger.getCLogger(RequestPropertyService.class); + /** + * Default constructor + */ public RequestPropertyService() { } + /** + * @param configurationAdmin + */ public void bindConfigurationAdmin(ConfigurationAdmin configurationAdmin) { readProperties(configurationAdmin); } + /** + * @param configurationAdmin + */ public void unbindConfigurationAdmin(ConfigurationAdmin configurationAdmin) { } + /** + * Load request property from requesteventhandler.properties + * @param service + */ private void readProperties(ConfigurationAdmin service) { File file = new File(Ini.getAdempiereHome(), REQUESTEVENTHANDLER_PROPERTIES); if (file.exists()) { diff --git a/org.adempiere.base/src/org/adempiere/base/event/RequestSendEMailEventData.java b/org.adempiere.base/src/org/adempiere/base/event/RequestSendEMailEventData.java index e3e8f0806a..0c889a8e8d 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/RequestSendEMailEventData.java +++ b/org.adempiere.base/src/org/adempiere/base/event/RequestSendEMailEventData.java @@ -20,9 +20,8 @@ import org.compiere.model.MClient; import org.compiere.model.MUser; /** - * + * Event data for {@link IEventTopics#REQUEST_SEND_EMAIL} event topic. * @author Elaine - * */ public class RequestSendEMailEventData { @@ -35,10 +34,29 @@ public class RequestSendEMailEventData private int requestID; private boolean isHtml; + /** + * @param client + * @param from + * @param to + * @param subject + * @param message + * @param attachment + * @param requestID + */ public RequestSendEMailEventData(MClient client, MUser from, MUser to, String subject, String message, File attachment, int requestID) { this(client, from, to, subject, message, attachment, requestID, false); } + /** + * @param client + * @param from + * @param to + * @param subject + * @param message + * @param attachment + * @param requestID + * @param isHtml + */ public RequestSendEMailEventData(MClient client, MUser from, MUser to, String subject, String message, File attachment, int requestID, boolean isHtml) { setClient(client); setFrom(from); @@ -50,66 +68,114 @@ public class RequestSendEMailEventData setHtml(isHtml); } + /** + * @return MClient + */ public MClient getClient() { return client; } + /** + * @param client + */ public void setClient(MClient client) { this.client = client; } + /** + * @return from user + */ public MUser getFrom() { return from; } + /** + * @param from from user + */ public void setFrom(MUser from) { this.from = from; } + /** + * @return to user + */ public MUser getTo() { return to; } + /** + * @param to to user + */ public void setTo(MUser to) { this.to = to; } + /** + * @return subject + */ public String getSubject() { return subject; } + /** + * @param subject + */ public void setSubject(String subject) { this.subject = subject; } + /** + * @return message + */ public String getMessage() { return message; } + /** + * @param message + */ public void setMessage(String message) { this.message = message; } + /** + * @return attachment file + */ public File getAttachment() { return attachment; } + /** + * @param attachment + */ public void setAttachment(File attachment) { this.attachment = attachment; } + /** + * @return R_Request_ID + */ public int getRequestID() { return requestID; } + /** + * @param requestID R_Request_ID + */ public void setRequestID(int requestID) { this.requestID = requestID; } + /** + * @return true if message is html text + */ public boolean isHtml() { return isHtml; } + /** + * @param isHtml + */ public void setHtml(boolean isHtml) { this.isHtml = isHtml; } diff --git a/org.adempiere.base/src/org/adempiere/base/event/annotations/AfterLoginEventDelegate.java b/org.adempiere.base/src/org/adempiere/base/event/annotations/AfterLoginEventDelegate.java index ad1ed275f4..72727a504d 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/annotations/AfterLoginEventDelegate.java +++ b/org.adempiere.base/src/org/adempiere/base/event/annotations/AfterLoginEventDelegate.java @@ -29,9 +29,10 @@ import org.adempiere.base.event.LoginEventData; import org.osgi.service.event.Event; /** - * + * Event delegate for login event.
+ * To handle login event, create a subclass of this and uses the {@link AfterLogin} annotation to + * annotate the method for the login event topic. * @author hengsin - * */ public abstract class AfterLoginEventDelegate extends EventDelegate { diff --git a/org.adempiere.base/src/org/adempiere/base/event/annotations/BaseEventHandler.java b/org.adempiere.base/src/org/adempiere/base/event/annotations/BaseEventHandler.java index 64e4762fba..ad43f56c4d 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/annotations/BaseEventHandler.java +++ b/org.adempiere.base/src/org/adempiere/base/event/annotations/BaseEventHandler.java @@ -29,26 +29,26 @@ import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; +import org.adempiere.base.annotation.EventTopicDelegate; import org.adempiere.base.event.EventHelper; import org.osgi.service.event.Event; import org.osgi.service.event.EventHandler; /** * - * Base class for event handler that works with annotation driven event delegate. + * Base class for event handler that works with annotation driven event delegate ({@link EventTopicDelegate}). * The implementation of event delegate doesn't have to be thread safe as a new instance of delegate is created for each event call. * @author hengsin * */ public abstract class BaseEventHandler implements EventHandler { - //event topic to method mapping + /** event topic:method */ protected final Map eventTopicMap = new HashMap(); private String filter; private Class delegateClass; /** - * * @param delegateClass */ public BaseEventHandler(Class delegateClass) { @@ -58,7 +58,7 @@ public abstract class BaseEventHandler implements EventHandler { } /** - * create event to topic to method mapping from annotations + * create event topic to method mapping from annotations * @param delegateClass */ protected void createTopicMap(Class delegateClass) { @@ -80,7 +80,6 @@ public abstract class BaseEventHandler implements EventHandler { } /** - * * @return arrays of event topic */ public String[] getTopics() { @@ -91,7 +90,6 @@ public abstract class BaseEventHandler implements EventHandler { } /** - * * @return event filter */ public String getFilter() { @@ -107,7 +105,6 @@ public abstract class BaseEventHandler implements EventHandler { } /** - * * @param propertyName * @param value */ @@ -153,7 +150,7 @@ public abstract class BaseEventHandler implements EventHandler { /** * create new instance of event delegate * @param event - * @return {@link EventDelegate} + * @return new {@link EventDelegate} instance */ protected abstract EventDelegate newEventDelegate(Event event); diff --git a/org.adempiere.base/src/org/adempiere/base/event/annotations/EventDelegate.java b/org.adempiere.base/src/org/adempiere/base/event/annotations/EventDelegate.java index 3151bbb21a..2abaccfcad 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/annotations/EventDelegate.java +++ b/org.adempiere.base/src/org/adempiere/base/event/annotations/EventDelegate.java @@ -28,8 +28,8 @@ import org.osgi.service.event.Event; /** * - * Annotation driven event delegate base class that works together with {@link BaseEventHandler}. - * Subclass implementation doesn't have to be thread safe as event delegate is create and throw away for each event call. + * Annotation driven event delegate base class that works together with {@link BaseEventHandler}.
+ * Subclass implementation doesn't have to be thread safe as event delegate is create and throw away for each event call.
* Subclass should use {@link EventTopic} or one of its derived annotation to define the event topic to handle * @author hengsin * @@ -39,7 +39,6 @@ public class EventDelegate { protected Event event; /** - * * @param event */ public EventDelegate(Event event) { @@ -47,7 +46,6 @@ public class EventDelegate { } /** - * * @return {@link Event} */ protected Event getEvent() { diff --git a/org.adempiere.base/src/org/adempiere/base/event/annotations/ModelEventDelegate.java b/org.adempiere.base/src/org/adempiere/base/event/annotations/ModelEventDelegate.java index 0104e796b6..a7c4608b4b 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/annotations/ModelEventDelegate.java +++ b/org.adempiere.base/src/org/adempiere/base/event/annotations/ModelEventDelegate.java @@ -28,8 +28,9 @@ import org.compiere.model.PO; import org.osgi.service.event.Event; /** - * - * event delegate for PO related event (po_before_change, doc_before_complete, etc) + * Event delegate for PO related event.
+ * To handle a model event, create a subclass of this and uses the model event annotation (BeforeChange, BeforeComplete, etc) + * to annotate the method for a specific model event topic. * @author hengsin * * @param @@ -39,7 +40,6 @@ public class ModelEventDelegate extends EventDelegate { private T model; /** - * * @param po * @param event */ @@ -49,8 +49,7 @@ public class ModelEventDelegate extends EventDelegate { } /** - * - * @return po model (mbpartner, morder, etc) + * @return PO model (MBPartner, MOrder, etc) */ protected T getModel() { return model; diff --git a/org.adempiere.base/src/org/adempiere/base/event/annotations/ModelEventHandler.java b/org.adempiere.base/src/org/adempiere/base/event/annotations/ModelEventHandler.java index 02855f3946..69331e78e5 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/annotations/ModelEventHandler.java +++ b/org.adempiere.base/src/org/adempiere/base/event/annotations/ModelEventHandler.java @@ -34,11 +34,10 @@ import org.compiere.model.PO; import org.osgi.service.event.Event; /** - * - * Event handler for PO related events (po_before_change, doc_before_complete, etc). - * Delegate to {@link ModelEventDelegate} instance created for each event call + * Event handler for PO related events.
+ * Developers usually don't have to use this class directly; instead, the recommended approach is + * to subclass {@link ModelEventDelegate} and use model event topic annotations. * @author hengsin - * */ public final class ModelEventHandler extends BaseEventHandler { @@ -48,6 +47,8 @@ public final class ModelEventHandler extends BaseEventHandler { /** * @param modelClassType + * @param delegateClass + * @param supplier */ public ModelEventHandler(Class modelClassType, Class> delegateClass, BiFunction> supplier) { @@ -57,6 +58,9 @@ public final class ModelEventHandler extends BaseEventHandler { findTableName(); } + /** + * Find table name property from annotation or static field (Table_Name). + */ private void findTableName() { try { Model model = modelClassType.getSuperclass().getAnnotation(Model.class); diff --git a/org.adempiere.base/src/org/adempiere/base/event/annotations/RequestSendEmailEventDelegate.java b/org.adempiere.base/src/org/adempiere/base/event/annotations/RequestSendEmailEventDelegate.java index 9a888dfeeb..d8cc9a202d 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/annotations/RequestSendEmailEventDelegate.java +++ b/org.adempiere.base/src/org/adempiere/base/event/annotations/RequestSendEmailEventDelegate.java @@ -29,7 +29,8 @@ import org.adempiere.base.event.RequestSendEMailEventData; import org.osgi.service.event.Event; /** - * + * Event delegate for {@link RequestSendEMail} event topic.
+ * To handle RequestSendEMail event, create a sub class of this and override the onRequestSendEmail method. * @author hengsin * */ diff --git a/org.adempiere.base/src/org/adempiere/base/event/annotations/SimpleEventHandler.java b/org.adempiere.base/src/org/adempiere/base/event/annotations/SimpleEventHandler.java index bfb40297f1..b4a70e65d0 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/annotations/SimpleEventHandler.java +++ b/org.adempiere.base/src/org/adempiere/base/event/annotations/SimpleEventHandler.java @@ -29,8 +29,7 @@ import java.util.function.Function; import org.osgi.service.event.Event; /** - * - * Event handler that delegate to {@link EventDelegate} instance (create for each event call) + * Event handler that delegate to {@link EventDelegate} instance (create for each event call). * @author hengsin * */ @@ -39,7 +38,6 @@ public final class SimpleEventHandler extends BaseEventHandler { private Function supplier; /** - * * @param delegateClass * @param supplier */ diff --git a/org.adempiere.base/src/org/adempiere/base/event/annotations/doc/FactsValidateDelegate.java b/org.adempiere.base/src/org/adempiere/base/event/annotations/doc/FactsValidateDelegate.java index 40f129f6f7..569dac6e61 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/annotations/doc/FactsValidateDelegate.java +++ b/org.adempiere.base/src/org/adempiere/base/event/annotations/doc/FactsValidateDelegate.java @@ -31,14 +31,14 @@ import org.compiere.model.PO; import org.osgi.service.event.Event; /** - * + * Event delegate for facts validate event.
+ * To handle facts validate event, create a subclass of this and uses the {@link FactsValidate} annotation + * to annotate the method for the FactsValidate event topic. * @author hengsin - * */ public abstract class FactsValidateDelegate extends ModelEventDelegate { /** - * * @param po * @param event */ @@ -47,7 +47,6 @@ public abstract class FactsValidateDelegate extends ModelEventDele } /** - * * @return {@link FactsEventData} */ protected FactsEventData getFactsEventData() { diff --git a/org.adempiere.base/src/org/adempiere/base/event/annotations/imp/ImportEventDelegate.java b/org.adempiere.base/src/org/adempiere/base/event/annotations/imp/ImportEventDelegate.java index ba432e090d..8aa26a9ba5 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/annotations/imp/ImportEventDelegate.java +++ b/org.adempiere.base/src/org/adempiere/base/event/annotations/imp/ImportEventDelegate.java @@ -30,9 +30,10 @@ import org.adempiere.base.event.annotations.EventDelegate; import org.osgi.service.event.Event; /** - * + * Event delegate for import event.
+ * To handle an import event, create a sub class of this and uses the import event annotation (AfterImport, BeforeImport, etc) + * to annotate method for a specific import event topic. * @author hengsin - * */ public class ImportEventDelegate extends EventDelegate { diff --git a/org.adempiere.base/src/org/adempiere/base/event/annotations/imp/ImportEventHandler.java b/org.adempiere.base/src/org/adempiere/base/event/annotations/imp/ImportEventHandler.java index 1ff6b8460c..70284b6217 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/annotations/imp/ImportEventHandler.java +++ b/org.adempiere.base/src/org/adempiere/base/event/annotations/imp/ImportEventHandler.java @@ -33,9 +33,10 @@ import org.compiere.util.Util; import org.osgi.service.event.Event; /** - * + * Event handler for import event.
+ * Developers usually don't have to use this class directly; instead, the recommended approach is + * to subclass {@link ImportEventDelegate} and use import event topic annotation. * @author hengsin - * */ public class ImportEventHandler extends BaseEventHandler { diff --git a/org.adempiere.base/src/org/adempiere/base/event/annotations/process/ProcessEventDelegate.java b/org.adempiere.base/src/org/adempiere/base/event/annotations/process/ProcessEventDelegate.java index 08cc8c7297..78a859c2dd 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/annotations/process/ProcessEventDelegate.java +++ b/org.adempiere.base/src/org/adempiere/base/event/annotations/process/ProcessEventDelegate.java @@ -30,7 +30,9 @@ import org.compiere.process.ProcessInfo; import org.osgi.service.event.Event; /** - * + * Event delegate for handling of process event.
+ * To handle a process related event topic, create a sub class of this and uses the process annotation + * (AfterProcess, BeforeProcess or PostProcess) to annotate the method for a specific process event topic. * @author hengsin * */ @@ -41,7 +43,6 @@ public class ProcessEventDelegate extends EventDelegate { } /** - * * @return {@link ProcessInfo} */ protected ProcessInfo getProcessInfo() { diff --git a/org.adempiere.base/src/org/adempiere/base/event/annotations/process/ProcessEventHandler.java b/org.adempiere.base/src/org/adempiere/base/event/annotations/process/ProcessEventHandler.java index 0b19e3bda4..1d86ee596d 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/annotations/process/ProcessEventHandler.java +++ b/org.adempiere.base/src/org/adempiere/base/event/annotations/process/ProcessEventHandler.java @@ -33,16 +33,16 @@ import org.compiere.util.Util; import org.osgi.service.event.Event; /** - * + * Event handle for process related event.
+ * Developers usually don't have to use this class directly; instead, the recommended approach is + * to subclass {@link ProcessEventDelegate} and use process event topic annotations. * @author hengsin - * */ public class ProcessEventHandler extends BaseEventHandler { private Function supplier; /** - * * @param delegateClass * @param processUUID filter by process uuid (null for all process) * @param supplier diff --git a/org.adempiere.base/src/org/adempiere/base/event/delegate/AutoProduceEventDelegate.java b/org.adempiere.base/src/org/adempiere/base/event/delegate/AutoProduceEventDelegate.java index 181f019919..1307db053c 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/delegate/AutoProduceEventDelegate.java +++ b/org.adempiere.base/src/org/adempiere/base/event/delegate/AutoProduceEventDelegate.java @@ -78,6 +78,11 @@ public class AutoProduceEventDelegate extends ModelEventDelegate { } } + /** + * Process shipment and create production document for auto produce products (if insufficient on hand). + * @param mInOut + * @return error message or null + */ private String processShipment(MInOut mInOut) { // Auto produce if on hand is not sufficient to fulfill order Map qtyUsedMap = new HashMap(); @@ -118,6 +123,17 @@ public class AutoProduceEventDelegate extends ModelEventDelegate { return null; } + /** + * Create and complete production document + * @param mInOut + * @param mInOutLine + * @param qtyEntered + * @param qtyOnHand + * @param endProductID + * @param productionCount + * @param qtyUsedMap + * @return error message or null + */ private String createProduction(MInOut mInOut, MInOutLine mInOutLine, BigDecimal qtyEntered, BigDecimal qtyOnHand, int endProductID, int[] productionCount, Map qtyUsedMap) { String description=Msg.getElement(Env.getCtx(), "M_InOut_ID", true) + " " + mInOut.getDocumentNo(); diff --git a/org.adempiere.base/src/org/adempiere/base/upload/IUploadHandler.java b/org.adempiere.base/src/org/adempiere/base/upload/IUploadHandler.java index 0079b9f3b8..c2c6d04f1f 100644 --- a/org.adempiere.base/src/org/adempiere/base/upload/IUploadHandler.java +++ b/org.adempiere.base/src/org/adempiere/base/upload/IUploadHandler.java @@ -28,22 +28,18 @@ package org.adempiere.base.upload; import org.compiere.model.MAuthorizationAccount; /** - * * handler interface for upload request * @author hengsin - * */ public interface IUploadHandler { /** - * * @return label for handler */ public String getLabel(); /** - * * @param media - * @param account userExternalAccount + * @param account external account to upload to (for e.g, Google drive account) * @return {@link UploadResponse} */ public UploadResponse uploadMedia(UploadMedia media, MAuthorizationAccount account); diff --git a/org.adempiere.base/src/org/adempiere/base/upload/IUploadService.java b/org.adempiere.base/src/org/adempiere/base/upload/IUploadService.java index 5a63ac0c61..4202ff6d4d 100644 --- a/org.adempiere.base/src/org/adempiere/base/upload/IUploadService.java +++ b/org.adempiere.base/src/org/adempiere/base/upload/IUploadService.java @@ -26,7 +26,6 @@ package org.adempiere.base.upload; /** - * * interface for upload service * @author hengsin * diff --git a/org.adempiere.base/src/org/adempiere/base/upload/UploadMedia.java b/org.adempiere.base/src/org/adempiere/base/upload/UploadMedia.java index 0e7eb16ba0..65adf331a7 100644 --- a/org.adempiere.base/src/org/adempiere/base/upload/UploadMedia.java +++ b/org.adempiere.base/src/org/adempiere/base/upload/UploadMedia.java @@ -28,7 +28,6 @@ package org.adempiere.base.upload; import java.io.InputStream; /** - * * representation of media * @author hengsin * @@ -41,7 +40,6 @@ public class UploadMedia { private long contentLength; /** - * * @param name * @param contentType * @param inputStream @@ -56,7 +54,6 @@ public class UploadMedia { } /** - * * @return content type of media */ public String getContentType() { @@ -64,7 +61,6 @@ public class UploadMedia { } /** - * * @return name/label of media */ public String getName() { @@ -72,7 +68,6 @@ public class UploadMedia { } /** - * * @return {@link InputStream} for media content */ public InputStream getInputStream() { @@ -80,7 +75,6 @@ public class UploadMedia { } /** - * * @return length of media content */ public long getContentLength() { diff --git a/org.adempiere.base/src/org/adempiere/base/upload/UploadResponse.java b/org.adempiere.base/src/org/adempiere/base/upload/UploadResponse.java index 131aa93f8f..6b54daf78b 100644 --- a/org.adempiere.base/src/org/adempiere/base/upload/UploadResponse.java +++ b/org.adempiere.base/src/org/adempiere/base/upload/UploadResponse.java @@ -26,7 +26,6 @@ package org.adempiere.base.upload; /** - * * Response from upload service * @author hengsin * @@ -37,7 +36,6 @@ public class UploadResponse { private String linkLabel; /** - * * @param link * @param linkLabel */ @@ -48,15 +46,13 @@ public class UploadResponse { } /** - * - * @return link url to the uploaded file + * @return link URL to the uploaded file */ public String getLink() { return link; } /** - * * @return label for the uploaded file */ public String getLinkLabel() { diff --git a/org.adempiere.base/src/org/adempiere/exceptions/AdempiereException.java b/org.adempiere.base/src/org/adempiere/exceptions/AdempiereException.java index 031c0112b4..a7bf65ad68 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/AdempiereException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/AdempiereException.java @@ -20,7 +20,7 @@ import org.compiere.util.Env; import org.compiere.util.Msg; /** - * Any exception that occurs inside the Adempiere core + * Runtime exception that occurs inside the Adempiere core * @author Teo Sarca, SC ARHIPAC SERVICE SRL */ public class AdempiereException extends RuntimeException { diff --git a/org.adempiere.base/src/org/adempiere/exceptions/BPartnerException.java b/org.adempiere.base/src/org/adempiere/exceptions/BPartnerException.java index c86fa48624..ecb97feadc 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/BPartnerException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/BPartnerException.java @@ -22,12 +22,16 @@ import org.compiere.model.I_C_BPartner; public abstract class BPartnerException extends AdempiereException { /** - * + * generated serial id */ private static final long serialVersionUID = -4311798678799373821L; private final int C_BPartner_ID; - BPartnerException(String ad_message, I_C_BPartner bp) + /** + * @param ad_message AD_Message.Value + * @param bp + */ + protected BPartnerException(String ad_message, I_C_BPartner bp) { super("@"+ad_message+"@ - "+(bp == null ? "?" : bp.getValue()+"_"+bp.getName())); if (bp != null) @@ -41,7 +45,7 @@ public abstract class BPartnerException extends AdempiereException } /** - * @return the c_BPartner_ID + * @return C_BPartner_ID */ public int getC_BPartner_ID() { diff --git a/org.adempiere.base/src/org/adempiere/exceptions/BPartnerNoAddressException.java b/org.adempiere.base/src/org/adempiere/exceptions/BPartnerNoAddressException.java index 183f6ff443..20d68b1a49 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/BPartnerNoAddressException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/BPartnerNoAddressException.java @@ -22,7 +22,7 @@ import org.compiere.model.I_C_BPartner; public class BPartnerNoAddressException extends BPartnerException { /** - * + * generated serial id */ private static final long serialVersionUID = -1892858395845764918L; public static final String AD_Message = "BPartnerNoAddress"; diff --git a/org.adempiere.base/src/org/adempiere/exceptions/BPartnerNoBillToAddressException.java b/org.adempiere.base/src/org/adempiere/exceptions/BPartnerNoBillToAddressException.java index 14bdeab0a5..6d6f0b7abe 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/BPartnerNoBillToAddressException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/BPartnerNoBillToAddressException.java @@ -22,7 +22,7 @@ import org.compiere.model.I_C_BPartner; public class BPartnerNoBillToAddressException extends BPartnerException { /** - * + * generated serial id */ private static final long serialVersionUID = -8423260338845096466L; public static final String AD_Message = "BPartnerNoBillToAddress"; diff --git a/org.adempiere.base/src/org/adempiere/exceptions/BPartnerNoShipToAddressException.java b/org.adempiere.base/src/org/adempiere/exceptions/BPartnerNoShipToAddressException.java index a5fe03bbd9..74c9ab7366 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/BPartnerNoShipToAddressException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/BPartnerNoShipToAddressException.java @@ -22,7 +22,7 @@ import org.compiere.model.I_C_BPartner; public class BPartnerNoShipToAddressException extends BPartnerException { /** - * + * generated serial id */ private static final long serialVersionUID = 4388496060894704270L; public static final String AD_Message = "BPartnerNoShipToAddress"; diff --git a/org.adempiere.base/src/org/adempiere/exceptions/DBException.java b/org.adempiere.base/src/org/adempiere/exceptions/DBException.java index 752b46f529..590b0e88d1 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/DBException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/DBException.java @@ -44,7 +44,7 @@ import org.compiere.util.Util; public class DBException extends AdempiereException { /** - * + * generated serial id */ private static final long serialVersionUID = -1961265420169932726L; @@ -56,7 +56,7 @@ public class DBException extends AdempiereException /** * Create a new DBException based on a SQLException - * @param e Specicy the Exception cause + * @param e Specify the Exception cause */ public DBException(Exception e) { @@ -139,7 +139,11 @@ public class DBException extends AdempiereException return (e != null ? e.getSQLState() : null); } - + /** + * @param e + * @param errorCode + * @return true if e is SQL exception and errorCode is the error code of SQL exception e. + */ private static final boolean isErrorCode(Exception e, int errorCode) { if (e == null) { return false; @@ -158,6 +162,11 @@ public class DBException extends AdempiereException return false; } + /** + * @param e + * @param SQLState + * @return true if e is SQL exception and SQLState is the SQL state of SQL exception e + */ private static final boolean isSQLState(Exception e, String SQLState) { if (e == null) { return false; @@ -178,6 +187,7 @@ public class DBException extends AdempiereException /** * Check if Unique Constraint Exception (aka ORA-00001) * @param e exception + * @return true if e is unique constraint exception */ public static boolean isUniqueContraintError(Exception e) { if (DB.isPostgreSQL()) @@ -189,6 +199,7 @@ public class DBException extends AdempiereException /** * Check if "child record found" exception (aka ORA-02292) * @param e exception + * @return true if e is child record found exception (typically for delete) */ public static boolean isChildRecordFoundError(Exception e) { if (DB.isPostgreSQL()) @@ -199,6 +210,7 @@ public class DBException extends AdempiereException /** * Check if "invalid identifier" exception (aka ORA-00904) * @param e exception + * @return true if e is invalid identifier exception */ public static boolean isInvalidIdentifierError(Exception e) { if (DB.isPostgreSQL()) @@ -207,8 +219,10 @@ public class DBException extends AdempiereException } /** - * Check if "invalid username/password" exception (aka ORA-01017) + * Check if "invalid username/password" exception (aka ORA-01017).
+ * Only implemented for Oracle. * @param e exception + * @return true if e is invalid user/password exception */ public static boolean isInvalidUserPassError(Exception e) { return isErrorCode(e, 1017); @@ -217,6 +231,7 @@ public class DBException extends AdempiereException /** * Check if "time out" exception (aka ORA-01013) * @param e + * @return true if e is time out exception */ public static boolean isTimeout(Exception e) { SQLException se = null; @@ -236,6 +251,7 @@ public class DBException extends AdempiereException /** * Check if value too large for column exception (aka ORA-12899) * @param e exception + * @return true if e is value too large for column exception */ public static boolean isValueTooLarge(Exception e) { if (DB.isPostgreSQL()) @@ -246,6 +262,7 @@ public class DBException extends AdempiereException /** * @param e + * @return default AD message for exception or null */ public static String getDefaultDBExceptionMessage(Exception e) { if (isUniqueContraintError(e)) { diff --git a/org.adempiere.base/src/org/adempiere/exceptions/DocTypeNotFoundException.java b/org.adempiere.base/src/org/adempiere/exceptions/DocTypeNotFoundException.java index 769635a687..1b5bac79ec 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/DocTypeNotFoundException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/DocTypeNotFoundException.java @@ -19,13 +19,13 @@ import org.compiere.util.Env; import org.compiere.util.Util; /** - * Throwed when desired document type was not found + * Throw when desired document type was not found * @author Teo Sarca, www.arhipac.ro */ public class DocTypeNotFoundException extends AdempiereException { /** - * + * generated serial id */ private static final long serialVersionUID = -4218893853798807816L; /** Doc Base Type */ @@ -41,6 +41,9 @@ public class DocTypeNotFoundException extends AdempiereException m_docBaseType = docBaseType; } + /** + * @return Document Base Type + */ public String getDocBaseType() { return m_docBaseType; @@ -58,7 +61,5 @@ public class DocTypeNotFoundException extends AdempiereException sb.append(" (").append(additionalInfo).append(")"); } return sb.toString(); - } - - + } } diff --git a/org.adempiere.base/src/org/adempiere/exceptions/FillMandatoryException.java b/org.adempiere.base/src/org/adempiere/exceptions/FillMandatoryException.java index b87ea6668f..5142d32643 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/FillMandatoryException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/FillMandatoryException.java @@ -14,21 +14,28 @@ package org.adempiere.exceptions; /** - * Throwed when there are some fields that are mandatory but unfilled. + * Throw when there are some fields that are mandatory but unfilled. * @author Teo Sarca, SC ARHIPAC SERVICE SRL */ public class FillMandatoryException extends AdempiereException { /** - * + * generated serial id */ private static final long serialVersionUID = 9074980284529933724L; + /** + * @param fields one or more field + */ public FillMandatoryException(String...fields) { super("@FillMandatory@ "+buildMessage(fields)); } + /** + * @param fields + * @return comma separated fields + */ private static final String buildMessage(String...fields) { StringBuilder sb = new StringBuilder(); diff --git a/org.adempiere.base/src/org/adempiere/exceptions/InvoiceFullyMatchedException.java b/org.adempiere.base/src/org/adempiere/exceptions/InvoiceFullyMatchedException.java index b696b68f8d..28740a0b5d 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/InvoiceFullyMatchedException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/InvoiceFullyMatchedException.java @@ -14,13 +14,13 @@ package org.adempiere.exceptions; /** - * Throwed when an invoice is fully matched so no more receipts can be generated. + * Throw when an invoice is fully matched so no more receipts can be generated. * @author Teo Sarca, www.arhipac.ro */ public class InvoiceFullyMatchedException extends AdempiereException { /** - * + * generated serial id */ private static final long serialVersionUID = -7474922528576404203L; diff --git a/org.adempiere.base/src/org/adempiere/exceptions/NegativeInventoryDisallowedException.java b/org.adempiere.base/src/org/adempiere/exceptions/NegativeInventoryDisallowedException.java index da49059d85..4874adde31 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/NegativeInventoryDisallowedException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/NegativeInventoryDisallowedException.java @@ -25,14 +25,14 @@ import org.compiere.util.Env; import org.compiere.util.Msg; /** - * + * Exception for negative on hand quantity * @author hengsin * */ public class NegativeInventoryDisallowedException extends AdempiereException { /** - * + * generated serial id */ private static final long serialVersionUID = 253224414462489886L; @@ -43,6 +43,15 @@ public class NegativeInventoryDisallowedException extends AdempiereException private BigDecimal QtyOnHand; private BigDecimal MovementQty; + /** + * @param ctx + * @param M_Warehouse_ID + * @param M_Product_ID + * @param M_AttributeSetInstance_ID + * @param M_Locator_ID + * @param QtyOnHand + * @param MovementQty + */ public NegativeInventoryDisallowedException(Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, int M_Locator_ID, BigDecimal QtyOnHand, BigDecimal MovementQty) { diff --git a/org.adempiere.base/src/org/adempiere/exceptions/NoUOMConversionException.java b/org.adempiere.base/src/org/adempiere/exceptions/NoUOMConversionException.java index c7d87e5586..dd49bd59e4 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/NoUOMConversionException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/NoUOMConversionException.java @@ -25,15 +25,26 @@ public class NoUOMConversionException extends AdempiereException { public static final String AD_Message = "NoUOMConversion"; /** - * + * generated serial id */ private static final long serialVersionUID = -4868882017576097089L; + /** + * @param M_Product_ID + * @param C_UOM_ID + * @param C_UOM_To_ID + */ public NoUOMConversionException(int M_Product_ID, int C_UOM_ID, int C_UOM_To_ID) { super(buildMessage(M_Product_ID, C_UOM_ID, C_UOM_To_ID)); } + /** + * @param M_Product_ID + * @param C_UOM_ID + * @param C_UOM_To_ID + * @return error message + */ private static String buildMessage(int M_Product_ID, int C_UOM_ID, int C_UOM_To_ID) { StringBuilder sb = new StringBuilder("@"+AD_Message+"@ - "); diff --git a/org.adempiere.base/src/org/adempiere/exceptions/NoVendorForProductException.java b/org.adempiere.base/src/org/adempiere/exceptions/NoVendorForProductException.java index 2df5f6f87f..ed65cb6757 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/NoVendorForProductException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/NoVendorForProductException.java @@ -14,14 +14,14 @@ package org.adempiere.exceptions; /** - * Throwed when there is no Vendor Info for given Product. + * Throw when there is no Vendor Info for a given Product. * @author Teo Sarca, www.arhipac.ro *

  • FR [ 2457781 ] Introduce NoVendorForProductException */ public class NoVendorForProductException extends AdempiereException { /** - * + * generated serial id */ private static final long serialVersionUID = 3412903630540562323L; diff --git a/org.adempiere.base/src/org/adempiere/exceptions/PORelationException.java b/org.adempiere.base/src/org/adempiere/exceptions/PORelationException.java index d07f98cab0..400a1b1dcd 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/PORelationException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/PORelationException.java @@ -54,10 +54,15 @@ public class PORelationException extends AdempiereException { public final Object[] msgParams; /** - * + * generated serial id */ private static final long serialVersionUID = -906400765022362887L; + /** + * @param msg + * @param adMsg + * @param msgParams + */ private PORelationException(final String msg, final String adMsg, final Object... msgParams) { @@ -67,6 +72,10 @@ public class PORelationException extends AdempiereException { this.msgParams = msgParams; } + /** + * Throw wrong number of key column count exception + * @param po + */ public static void throwWrongKeyColumnCount(final PO po) { if (logger.isLoggable(Level.FINE)) logger.fine("Invoked with po " + po); @@ -88,6 +97,13 @@ public class PORelationException extends AdempiereException { msgParams); } + /** + * throw missing AD_Window_ID exception + * @param po + * @param referenceName + * @param tableName + * @param isSOTrx + */ public static void throwMissingWindowId(final PO po, final String referenceName, final String tableName, final boolean isSOTrx) { diff --git a/org.adempiere.base/src/org/adempiere/exceptions/PeriodClosedException.java b/org.adempiere.base/src/org/adempiere/exceptions/PeriodClosedException.java index 2fb0a2b24e..6c0660dcb4 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/PeriodClosedException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/PeriodClosedException.java @@ -20,8 +20,8 @@ import org.compiere.model.X_C_DocType; import org.compiere.util.Env; /** - * Period Closed Exception. - * This exception is throwed by + * Period Closed Exception.
    + * This exception is throw by * {@link org.compiere.model.MPeriod#testPeriodOpen(java.util.Properties, Timestamp, int, int)} and * {@link org.compiere.model.MPeriod#testPeriodOpen(java.util.Properties, Timestamp, String, int)} methods. * @author Teo Sarca, SC ARHIPAC SERVICE SRL @@ -33,12 +33,13 @@ import org.compiere.util.Env; public class PeriodClosedException extends AdempiereException { /** - * + * generated serial id */ private static final long serialVersionUID = -2798371272365454799L; /** - * + * @param dateAcct + * @param docBaseType */ public PeriodClosedException(Timestamp dateAcct, String docBaseType) { diff --git a/org.adempiere.base/src/org/adempiere/exceptions/ProductNotOnPriceListException.java b/org.adempiere.base/src/org/adempiere/exceptions/ProductNotOnPriceListException.java index 3a522696ce..982a9b6ba1 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/ProductNotOnPriceListException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/ProductNotOnPriceListException.java @@ -30,17 +30,26 @@ import org.compiere.util.Env; public class ProductNotOnPriceListException extends AdempiereException { /** - * + * generated serial id */ private static final long serialVersionUID = -3505579126676698444L; public static final String AD_Message = "ProductNotOnPriceList"; + /** + * @param productPricing + * @param documentLineNo + */ public ProductNotOnPriceListException(IProductPricing productPricing, int documentLineNo) { super(buildMessage(productPricing, documentLineNo)); } + /** + * @param pp + * @param documentLineNo + * @return error message + */ private static final String buildMessage (IProductPricing pp, int documentLineNo) { StringBuilder sb = new StringBuilder(); diff --git a/org.adempiere.base/src/org/adempiere/exceptions/TaxCriteriaNotFoundException.java b/org.adempiere.base/src/org/adempiere/exceptions/TaxCriteriaNotFoundException.java index 0d1d5e8a68..aef41e77e6 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/TaxCriteriaNotFoundException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/TaxCriteriaNotFoundException.java @@ -22,17 +22,26 @@ package org.adempiere.exceptions; public class TaxCriteriaNotFoundException extends AdempiereException { /** - * + * generated serial id */ private static final long serialVersionUID = -8192276006656371964L; private static final String AD_Message = "TaxCriteriaNotFound"; + /** + * @param criteriaName + * @param criteria_ID + */ public TaxCriteriaNotFoundException(String criteriaName, int criteria_ID) { super(buildMessage(criteriaName, criteria_ID)); } + /** + * @param criteriaName + * @param criteria_ID + * @return error message + */ private static final String buildMessage (String criteriaName, int criteria_ID) { StringBuilder msg = new StringBuilder("@").append(AD_Message).append("@"); diff --git a/org.adempiere.base/src/org/adempiere/exceptions/TaxForChangeNotFoundException.java b/org.adempiere.base/src/org/adempiere/exceptions/TaxForChangeNotFoundException.java index b3138372a6..9a444685a3 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/TaxForChangeNotFoundException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/TaxForChangeNotFoundException.java @@ -16,19 +16,27 @@ package org.adempiere.exceptions; import org.compiere.util.Util; /** - * Throw when tax not found for given charge + * Throw when tax not found for a given charge * @author Teo Sarca, www.arhipac.ro *
  • FR [ 2758097 ] Implement TaxNotFoundException */ public class TaxForChangeNotFoundException extends AdempiereException { /** - * + * generated serial id */ private static final long serialVersionUID = 6553174922970467775L; private static final String AD_Message = "TaxForChargeNotFound"; // TODO : translate + /** + * @param C_Charge_ID + * @param AD_Org_ID + * @param M_Warehouse_ID + * @param billC_BPartner_Location_ID + * @param shipC_BPartner_Location_ID + * @param additionalMsg + */ public TaxForChangeNotFoundException(int C_Charge_ID, int AD_Org_ID, int M_Warehouse_ID, int billC_BPartner_Location_ID, int shipC_BPartner_Location_ID, String additionalMsg) { @@ -37,6 +45,15 @@ public class TaxForChangeNotFoundException extends AdempiereException additionalMsg)); } + /** + * @param C_Charge_ID + * @param AD_Org_ID + * @param M_Warehouse_ID + * @param billC_BPartner_Location_ID + * @param shipC_BPartner_Location_ID + * @param additionalMsg + * @return error message + */ private static final String buildMessage(int C_Charge_ID, int AD_Org_ID, int M_Warehouse_ID, int billC_BPartner_Location_ID, int shipC_BPartner_Location_ID, String additionalMsg) { diff --git a/org.adempiere.base/src/org/adempiere/exceptions/TaxNoExemptFoundException.java b/org.adempiere.base/src/org/adempiere/exceptions/TaxNoExemptFoundException.java index b60a207633..47c74cfb23 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/TaxNoExemptFoundException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/TaxNoExemptFoundException.java @@ -30,11 +30,18 @@ public class TaxNoExemptFoundException extends AdempiereException private static final String AD_Message = "TaxNoExemptFound"; + /** + * @param AD_Org_ID + */ public TaxNoExemptFoundException(int AD_Org_ID) { super(buildMessage(AD_Org_ID)); } + /** + * @param AD_Org_ID + * @return error message + */ private static final String buildMessage (int AD_Org_ID) { StringBuilder msg = new StringBuilder("@").append(AD_Message).append("@"); @@ -43,6 +50,10 @@ public class TaxNoExemptFoundException extends AdempiereException return msg.toString(); } + /** + * @param AD_Org_ID + * @return name for AD_Org_ID (* for 0 and ? for not found AD_Org_ID) + */ private static final String getOrgString(int AD_Org_ID) { if (AD_Org_ID <= 0) diff --git a/org.adempiere.base/src/org/adempiere/exceptions/TaxNotFoundException.java b/org.adempiere.base/src/org/adempiere/exceptions/TaxNotFoundException.java index 8e9f888c35..f0bdd4125d 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/TaxNotFoundException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/TaxNotFoundException.java @@ -29,13 +29,23 @@ import org.compiere.util.Env; public class TaxNotFoundException extends AdempiereException { /** - * + * generated serial id */ private static final long serialVersionUID = -5471615720092096644L; /** AD_Message code */ private static final String AD_Message = "TaxNotFound"; + /** + * @param C_TaxCategory_ID + * @param IsSOTrx + * @param shipDate + * @param shipFromC_Location_ID + * @param shipToC_Location_ID + * @param billDate + * @param billFromC_Location_ID + * @param billToC_Location_ID + */ public TaxNotFoundException(int C_TaxCategory_ID, boolean IsSOTrx, Timestamp shipDate, int shipFromC_Location_ID, int shipToC_Location_ID, Timestamp billDate, int billFromC_Location_ID, int billToC_Location_ID) @@ -45,6 +55,17 @@ public class TaxNotFoundException extends AdempiereException billDate, billFromC_Location_ID, billToC_Location_ID)); } + /** + * @param C_TaxCategory_ID + * @param IsSOTrx + * @param shipDate + * @param shipFromC_Location_ID + * @param shipToC_Location_ID + * @param billDate + * @param billFromC_Location_ID + * @param billToC_Location_ID + * @return error message + */ private static final String buildMessage (int C_TaxCategory_ID, boolean IsSOTrx, Timestamp shipDate, int shipFromC_Location_ID, int shipToC_Location_ID, Timestamp billDate, int billFromC_Location_ID, int billToC_Location_ID) diff --git a/org.adempiere.base/src/org/adempiere/exceptions/WarehouseInvalidForOrgException.java b/org.adempiere.base/src/org/adempiere/exceptions/WarehouseInvalidForOrgException.java index c1a44a1e68..fed9d5bb69 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/WarehouseInvalidForOrgException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/WarehouseInvalidForOrgException.java @@ -24,9 +24,8 @@ package org.adempiere.exceptions; */ public class WarehouseInvalidForOrgException extends AdempiereException { - /** - * + * generated serial id */ private static final long serialVersionUID = -8637554073291880392L; diff --git a/org.adempiere.base/src/org/adempiere/exceptions/WarehouseLocatorConflictException.java b/org.adempiere.base/src/org/adempiere/exceptions/WarehouseLocatorConflictException.java index 4d092a9c39..00bd009cbb 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/WarehouseLocatorConflictException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/WarehouseLocatorConflictException.java @@ -17,13 +17,13 @@ import org.compiere.model.I_M_Locator; import org.compiere.model.I_M_Warehouse; /** - * Throwed when a document warehouse does not match with document or document line locator. + * Throw when a document's warehouse does not match with document or document line locator. * @author Teo Sarca, www.arhipac.ro */ public class WarehouseLocatorConflictException extends AdempiereException { /** - * + * generated serial id */ private static final long serialVersionUID = 4812283712626432829L; diff --git a/org.adempiere.base/src/org/adempiere/impexp/AbstractExcelExporter.java b/org.adempiere.base/src/org/adempiere/impexp/AbstractExcelExporter.java index 0c553f0538..da71e6ce5c 100644 --- a/org.adempiere.base/src/org/adempiere/impexp/AbstractExcelExporter.java +++ b/org.adempiere.base/src/org/adempiere/impexp/AbstractExcelExporter.java @@ -147,6 +147,9 @@ public abstract class AbstractExcelExporter protected Boolean[] colSuppressRepeats; private int noOfParameter = 0; + /** + * Default constructor + */ public AbstractExcelExporter() { m_workbook = new HSSFWorkbook(); m_dataFormat = m_workbook.createDataFormat(); @@ -156,23 +159,39 @@ public abstract class AbstractExcelExporter return Env.getCtx(); } + /** + * @param colSplit column index to freeze + * @param rowSplit row index to freeze + */ protected void setFreezePane(int colSplit, int rowSplit) { m_colSplit = colSplit; m_rowSplit = rowSplit; } + /** + * Remove diacritics from str + * @param str + * @return fix string for Excel + */ private String fixString(String str) { // ms excel doesn't support UTF8 charset return Util.stripDiacritics(str); } + /** + * @return Language + */ protected Language getLanguage() { if (m_lang == null) m_lang = Env.getLanguage(getCtx()); return m_lang; } + /** + * @param isHeader + * @return HSSFFont + */ private HSSFFont getFont(boolean isHeader) { HSSFFont font = null; if (isHeader) { @@ -200,7 +219,7 @@ public abstract class AbstractExcelExporter * Get Excel number format string by given {@link NumberFormat} * @param df number format * @param isHighlightNegativeNumbers highlight negative numbers using RED color - * @return number excel format string + * @return excel format pattern */ private String getFormatString(NumberFormat df, boolean isHighlightNegativeNumbers) { StringBuilder format = new StringBuilder(); @@ -235,6 +254,11 @@ public abstract class AbstractExcelExporter } + /** + * @param row + * @param col + * @return HSSFCellStyle + */ private HSSFCellStyle getStyle(int row, int col) { int displayType = getDisplayType(row, col); String key = "cell-"+col+"-"+displayType; @@ -257,6 +281,11 @@ public abstract class AbstractExcelExporter return cs; } + /** + * @param row + * @param col + * @return Excel format pattern for cell + */ protected String getCellFormat(int row, int col) { boolean isHighlightNegativeNumbers = true; int displayType = getDisplayType(row, col); @@ -272,6 +301,10 @@ public abstract class AbstractExcelExporter return cellFormat; } + /** + * @param col + * @return HSSFCellStyle for column + */ private HSSFCellStyle getHeaderStyle(int col) { String key = "header-"+col; @@ -291,6 +324,11 @@ public abstract class AbstractExcelExporter return cs_header; } + /** + * auto size column + * @param sheet + * @param lastColumnIndex + */ private void fixColumnWidth(HSSFSheet sheet, int lastColumnIndex) { for (short colnum = 0; colnum < lastColumnIndex; colnum++) @@ -299,6 +337,12 @@ public abstract class AbstractExcelExporter } } + /** + * Update sheet setting prior to closing it + * @param prevSheet + * @param prevSheetName + * @param colCount + */ private void closeTableSheet(HSSFSheet prevSheet, String prevSheetName, int colCount) { if (prevSheet == null) @@ -317,6 +361,11 @@ public abstract class AbstractExcelExporter } } } + + /** + * Create new sheet + * @return HSSFSheet + */ private HSSFSheet createTableSheet() { HSSFSheet sheet= m_workbook.createSheet(); @@ -332,11 +381,18 @@ public abstract class AbstractExcelExporter return sheet; } + /** + * @param sheet + */ private void createTableHeader(HSSFSheet sheet) { createTableHeader(sheet, Math.max(noOfParameter, 0)); } - + + /** + * @param sheet + * @param headerRowNum + */ private void createTableHeader(HSSFSheet sheet, int headerRowNum) { int colnumMax = 0; @@ -362,21 +418,35 @@ public abstract class AbstractExcelExporter } // for all columns } + /** + * @return number of parameter + */ protected int getNoOfParameter() { return noOfParameter; } + /** + * @param noOfParameter + */ protected void setNoOfParameter(int noOfParameter) { this.noOfParameter = noOfParameter; } + /** + * Create parameter + * @param sheet + */ protected void createParameter(HSSFSheet sheet) { } + /** + * Create sheet header and footer + * @param sheet + */ protected void createHeaderFooter(HSSFSheet sheet) { // Sheet Header @@ -401,6 +471,10 @@ public abstract class AbstractExcelExporter } + /** + * Format sheet + * @param sheet + */ protected void formatPage(HSSFSheet sheet) { sheet.setFitToPage(true); @@ -412,11 +486,17 @@ public abstract class AbstractExcelExporter ps.setLandscape(false); } + /** + * @return true if export current record only + */ protected boolean isCurrentRowOnly() { return currentRowOnly; } + /** + * @param b + */ protected void setCurrentRowOnly(boolean b) { currentRowOnly = b; @@ -618,6 +698,12 @@ public abstract class AbstractExcelExporter Env.startBrowser(file.toURI().toString()); } + /** + * Export to work book + * @param workbook + * @param language + * @throws Exception + */ public void exportToWorkbook(HSSFWorkbook workbook, Language language) throws Exception { @@ -635,10 +721,9 @@ public abstract class AbstractExcelExporter } /** - * * @param row * @param col - * @return true if column is visible + * @return true if cell is visible */ protected boolean isVisible(int row, int col) { @@ -646,7 +731,6 @@ public abstract class AbstractExcelExporter } /** - * * @param col * @return true if column should be hidden when it is null */ @@ -655,7 +739,6 @@ public abstract class AbstractExcelExporter } /** - * * @param col * @return true if column is use to set new row position */ diff --git a/org.adempiere.base/src/org/adempiere/impexp/AbstractXLSXExporter.java b/org.adempiere.base/src/org/adempiere/impexp/AbstractXLSXExporter.java index b1fbece037..e1f8eed482 100644 --- a/org.adempiere.base/src/org/adempiere/impexp/AbstractXLSXExporter.java +++ b/org.adempiere.base/src/org/adempiere/impexp/AbstractXLSXExporter.java @@ -156,6 +156,9 @@ public abstract class AbstractXLSXExporter protected Boolean[] colSuppressRepeats; private int noOfParameter = 0; + /** + * Default constructor + */ public AbstractXLSXExporter() { m_workbook = new XSSFWorkbook(); @@ -167,18 +170,30 @@ public abstract class AbstractXLSXExporter return Env.getCtx(); } + /** + * @param colSplit column index to freeze + * @param rowSplit row index to freeze + */ protected void setFreezePane(int colSplit, int rowSplit) { m_colSplit = colSplit; m_rowSplit = rowSplit; } + /** + * Remove diacritics from str + * @param str + * @return fix string for Excel + */ private String fixString(String str) { // ms excel doesn't support UTF8 charset return Util.stripDiacritics(str); } + /** + * @return Language + */ protected Language getLanguage() { if (m_lang == null) @@ -186,6 +201,10 @@ public abstract class AbstractXLSXExporter return m_lang; } + /** + * @param isHeader + * @return XSSFFont + */ private XSSFFont getFont(boolean isHeader) { XSSFFont font = null; @@ -221,7 +240,7 @@ public abstract class AbstractXLSXExporter * @param df number format * @param isHighlightNegativeNumbers highlight negative numbers using RED * color - * @return number excel format string + * @return excel format pattern */ private String getFormatString(NumberFormat df, boolean isHighlightNegativeNumbers) { @@ -262,6 +281,11 @@ public abstract class AbstractXLSXExporter } + /** + * @param row + * @param col + * @return XSSFCellStyle + */ private XSSFCellStyle getStyle(int row, int col) { int displayType = getDisplayType(row, col); @@ -286,6 +310,11 @@ public abstract class AbstractXLSXExporter return cs; } + /** + * @param row + * @param col + * @return Excel format pattern for cell + */ protected String getCellFormat(int row, int col) { boolean isHighlightNegativeNumbers = true; int displayType = getDisplayType(row, col); @@ -301,6 +330,10 @@ public abstract class AbstractXLSXExporter return cellFormat; } + /** + * @param col + * @return XSSFCellStyle for column + */ private XSSFCellStyle getHeaderStyle(int col) { String key = "header-" + col; @@ -321,6 +354,11 @@ public abstract class AbstractXLSXExporter return cs_header; } + /** + * auto size column + * @param sheet + * @param lastColumnIndex + */ private void fixColumnWidth(XSSFSheet sheet, int colCount) { for (short colnum = 0; colnum < colCount; colnum++) @@ -329,6 +367,12 @@ public abstract class AbstractXLSXExporter } } + /** + * Update sheet setting prior to closing it + * @param prevSheet + * @param prevSheetName + * @param colCount + */ private void closeTableSheet(XSSFSheet prevSheet, String prevSheetName, int colCount) { if (prevSheet == null) @@ -351,6 +395,10 @@ public abstract class AbstractXLSXExporter } } + /** + * Create new sheet + * @return XSSFSheet + */ private XSSFSheet createTableSheet() { XSSFSheet sheet = m_workbook.createSheet(); @@ -366,11 +414,18 @@ public abstract class AbstractXLSXExporter return sheet; } + /** + * @param sheet + */ private void createTableHeader(XSSFSheet sheet) { createTableHeader(sheet, Math.max(noOfParameter, 0)); } + /** + * @param sheet + * @param headerRowNum + */ private void createTableHeader(XSSFSheet sheet, int headerRowNum) { int colnumMax = 0; @@ -419,6 +474,10 @@ public abstract class AbstractXLSXExporter footer.setRight(DisplayType.getDateFormat(DisplayType.DateTime, getLanguage()).format(now)); } + /** + * Format sheet + * @param sheet + */ protected void formatPage(XSSFSheet sheet) { sheet.setFitToPage(true); @@ -430,11 +489,17 @@ public abstract class AbstractXLSXExporter ps.setLandscape(false); } + /** + * @return true if export current record only + */ protected boolean isCurrentRowOnly() { return currentRowOnly; } + /** + * @param b + */ protected void setCurrentRowOnly(boolean b) { currentRowOnly = b; @@ -655,6 +720,12 @@ public abstract class AbstractXLSXExporter Env.startBrowser(file.toURI().toString()); } + /** + * Export to workbook + * @param workbook + * @param language + * @throws Exception + */ public void exportToWorkbook(XSSFWorkbook workbook, Language language) throws Exception { m_lang = language; @@ -670,26 +741,35 @@ public abstract class AbstractXLSXExporter return false; } + /** + * @return number of parameter + */ protected int getNoOfParameter() { return noOfParameter; } + /** + * @param noOfParameter + */ protected void setNoOfParameter(int noOfParameter) { this.noOfParameter = noOfParameter; } + /** + * Create parameter + * @param sheet + */ protected void createParameter(XSSFSheet sheet) { } /** - * * @param row * @param col - * @return true if column is visible + * @return true if cell is visible */ protected boolean isVisible(int row, int col) { @@ -697,7 +777,6 @@ public abstract class AbstractXLSXExporter } /** - * * @param col * @return true if column should be hidden when it is null */ @@ -706,7 +785,6 @@ public abstract class AbstractXLSXExporter } /** - * * @param col * @return true if column is use to set new row position */ diff --git a/org.adempiere.base/src/org/adempiere/impexp/ArrayExcelExporter.java b/org.adempiere.base/src/org/adempiere/impexp/ArrayExcelExporter.java index 0dfff3c175..5e1f155011 100644 --- a/org.adempiere.base/src/org/adempiere/impexp/ArrayExcelExporter.java +++ b/org.adempiere.base/src/org/adempiere/impexp/ArrayExcelExporter.java @@ -22,7 +22,7 @@ import org.compiere.util.Msg; import org.compiere.util.Util; /** - * Export excel from ArrayList of data + * Export to excel format (xlsx) from ArrayList of data * @author Teo Sarca, SC ARHIPAC SERVICE SRL * */ @@ -30,6 +30,10 @@ public class ArrayExcelExporter extends AbstractXLSXExporter { private Properties m_ctx = null; private ArrayList> m_data = null; + /** + * @param ctx + * @param data + */ public ArrayExcelExporter(Properties ctx, ArrayList> data) { super(); m_ctx = ctx; diff --git a/org.adempiere.base/src/org/adempiere/impexp/GridTabCSVExporter.java b/org.adempiere.base/src/org/adempiere/impexp/GridTabCSVExporter.java index db22edeeba..87a874a8aa 100644 --- a/org.adempiere.base/src/org/adempiere/impexp/GridTabCSVExporter.java +++ b/org.adempiere.base/src/org/adempiere/impexp/GridTabCSVExporter.java @@ -311,7 +311,10 @@ public class GridTabCSVExporter implements IGridTabExporter } } - //add constraints to not allow certain tabs + /** + * @param gridTab + * @return error message or null + */ private String isValidTabToExport(GridTab gridTab){ String result=null; @@ -323,6 +326,13 @@ public class GridTabCSVExporter implements IGridTabExporter return result; } + /** + * @param currentDetRow current detail row number + * @param tabMapDetails + * @param headArray column headers + * @param idxfld + * @return Detail Row(Map{Column Header, Value}) + */ private Map resolveMasterDetailRow(int currentDetRow,Map tabMapDetails,ListheadArray,int idxfld){ Map activeRow = new HashMap(); Object value = null; @@ -410,6 +420,14 @@ public class GridTabCSVExporter implements IGridTabExporter return whereClau; } + /** + * @param gridTab + * @param table + * @param column + * @param i row index + * @param headName + * @return column value + */ private Object resolveValue(GridTab gridTab, MTable table, MColumn column, int i, String headName) { Object value = null; if (headName.indexOf("[") >= 0 && headName.endsWith("]")) { @@ -437,6 +455,12 @@ public class GridTabCSVExporter implements IGridTabExporter return value; } + /** + * @param selectColumn + * @param tableName + * @param record_id + * @return value of selectColumn + */ private Object queryExecute(String selectColumn,String tableName,Object record_id){ StringBuilder select = new StringBuilder("SELECT ") @@ -447,6 +471,11 @@ public class GridTabCSVExporter implements IGridTabExporter return DB.getSQLValueStringEx(null, select.toString(),record_id); } + /** + * @param table + * @param column + * @return column header name + */ private String resolveColumnName(MTable table, MColumn column) { StringBuilder name = new StringBuilder(column.getColumnName()); if (DisplayType.isLookup(column.getAD_Reference_ID())) { @@ -473,6 +502,11 @@ public class GridTabCSVExporter implements IGridTabExporter return name.toString(); } + /** + * Resolve extra columns for displayType. Implemented for DisplayType.Location. + * @param displayType + * @return list of extra columns to export + */ private ArrayList resolveSpecialColumnName(int displayType){ ArrayList specialColumnNames = new ArrayList(); @@ -514,6 +548,11 @@ public class GridTabCSVExporter implements IGridTabExporter return "application/csv"; } + /** + * Get fields for export. + * @param gridTab + * @return fields for gridTab + */ private GridField[] getFields (GridTab gridTab) { GridTable tableModel = gridTab.getTableModel(); GridField[] tmpFields = tableModel.getFields(); diff --git a/org.adempiere.base/src/org/adempiere/impexp/GridTabCSVImporter.java b/org.adempiere.base/src/org/adempiere/impexp/GridTabCSVImporter.java index 9ac38aa740..767cfad433 100644 --- a/org.adempiere.base/src/org/adempiere/impexp/GridTabCSVImporter.java +++ b/org.adempiere.base/src/org/adempiere/impexp/GridTabCSVImporter.java @@ -129,6 +129,7 @@ public class GridTabCSVImporter implements IGridTabImporter /** Logger */ private static final CLogger log = CLogger.getCLogger(GridTabCSVImporter.class); + @Override public File fileImport(GridTab gridTab, List childs, InputStream filestream, Charset charset , String importMode) { return fileImport(gridTab, childs, filestream, charset, importMode, null); }//fileImport @@ -307,7 +308,7 @@ public class GridTabCSVImporter implements IGridTabImporter } /** - * Rollsback the trx and update the text in the file + * Rollback trx and update the text in log file */ private void rollbackTrx(){ trx.rollback(); @@ -319,7 +320,8 @@ public class GridTabCSVImporter implements IGridTabImporter } /** - * Commit the trx and writes in the file + * Commit trx and writes in log file + * @return error message or null */ private String commitTrx(){ try { @@ -336,7 +338,7 @@ public class GridTabCSVImporter implements IGridTabImporter /** * Map the header and returns the index where the detail starts * @param gridTab - * @return + * @return index where detail start */ private int mapCSVHeader(GridTab gridTab){ @@ -387,11 +389,12 @@ public class GridTabCSVImporter implements IGridTabImporter } return indxDetail; - }//mapFileHeader + }//mapCSVHeader /** * Map details fields in the csv file * @param indxDetail + * @param childs */ private void mapCSVDetail(int indxDetail, List childs){ @@ -458,10 +461,10 @@ public class GridTabCSVImporter implements IGridTabImporter tabMapIndexes.put(currentDetailTab,header.size()-1); } - }//mapFileDetail + }//mapCSVDetail /** - * Pre process te file lookign for errors + * Pre-process the input csv file and look for errors * @param processUI * @param gridTab * @param indxDetail @@ -605,16 +608,16 @@ public class GridTabCSVImporter implements IGridTabImporter } //createTrx /** - * Process the record for each row - * First insert the master tab - if no errors found proceeds with the details tabs when existing - * Stops at the first error found in the row + * Process the record for each row.
    + * First insert the master tab - if no errors found proceeds with the details tabs when existing.
    + * Stops at the first error found in the row. * @param importMode * @param gridTab * @param indxDetail * @param isDetail * @param idx * @param rowResult - * @return + * @return message or empty string */ private String processRecord(String importMode, GridTab gridTab, int indxDetail, boolean isDetail, int idx, StringBuilder rowResult, List childs){ @@ -788,6 +791,11 @@ public class GridTabCSVImporter implements IGridTabImporter throw new AdempiereException(msg); } + /** + * @param currentRecord + * @param total + * @return status text + */ private String refreshImportStatus(int currentRecord, int total){ int percent = currentRecord * 100; if (total > 0) @@ -804,6 +812,12 @@ public class GridTabCSVImporter implements IGridTabImporter } } + /** + * + * @param document + * @param AD_Process_ID + * @return message + */ private String processDocAction(PO document, int AD_Process_ID){ int AD_Workflow_ID = MProcess.get(Env.getCtx(),AD_Process_ID).getAD_Workflow_ID(); @@ -838,6 +852,13 @@ public class GridTabCSVImporter implements IGridTabImporter return isUpdateMode() || isMergeMode(); } + /** + * @param isKey + * @param isForeing + * @param isDetail + * @param headName + * @return column name + */ private String getColumnName(boolean isKey ,boolean isForeing ,boolean isDetail , String headName){ if(isKey){ @@ -864,6 +885,13 @@ public class GridTabCSVImporter implements IGridTabImporter return headName; } + /** + * Get extra fields for Location display type + * @param header + * @param tableName + * @param idx + * @return Extra fields for Location display type + */ private List getSpecialMColumn(List header, String tableName, int idx) { List lsField = new ArrayList(); @@ -889,6 +917,12 @@ public class GridTabCSVImporter implements IGridTabImporter return lsField; } + /** + * Get column value from map, order by header + * @param header + * @param map + * @return Value list for row + */ private List getOrderedRowFromMap (List header,Map map){ List tmpRow= new ArrayList(); for (int i = 0; i < header.size(); i++) @@ -903,6 +937,15 @@ public class GridTabCSVImporter implements IGridTabImporter return tmpRow; } + /** + * Pre-process tmpRow and looks for error + * @param gridTab + * @param header + * @param tmpRow + * @param startindx + * @param endindx + * @return error message or null + */ private StringBuilder preprocessRow (GridTab gridTab,List header,List tmpRow,int startindx,int endindx){ boolean isEmptyRow = true; @@ -991,6 +1034,15 @@ public class GridTabCSVImporter implements IGridTabImporter return null; } + /** + * Validate extra fields for DisplayType.Location. + * @param gridTab + * @param header + * @param tmpRow + * @param i + * @param sField + * @return error message or null + */ private StringBuilder validateSpecialFields(GridTab gridTab,List header,List tmpRow,int i,String sField){ GridField field = gridTab.getField(sField); @@ -1045,6 +1097,17 @@ public class GridTabCSVImporter implements IGridTabImporter return null; } + /** + * Process row for import + * @param gridTab + * @param header + * @param map + * @param startindx + * @param endindx + * @param masterRecord + * @param trx + * @return error message or null + */ private String proccessRow(GridTab gridTab,List header, Map map,int startindx,int endindx,PO masterRecord,Trx trx){ String logMsg = null; @@ -1331,6 +1394,10 @@ public class GridTabCSVImporter implements IGridTabImporter return logMsg; } + /** + * @param field + * @return CellProcessor + */ private CellProcessor getProccesorFromColumn(GridField field) { // TODO: List columns can use RequireSubStr constraint if (DisplayType.Date == field.getDisplayType()) { @@ -1354,6 +1421,16 @@ public class GridTabCSVImporter implements IGridTabImporter } } + /** + * @param gridTab + * @param map + * @param header + * @param startindx + * @param endindx + * @param masterRecord + * @param trx + * @return error message or null + */ private String areValidKeysAndColumns(GridTab gridTab, Map map,List header,int startindx,int endindx,PO masterRecord,Trx trx){ MQuery pquery = new MQuery(gridTab.getAD_Table_ID()); String logMsg= null; @@ -1473,6 +1550,13 @@ public class GridTabCSVImporter implements IGridTabImporter return logMsg; } + /** + * @param column + * @param foreignColumn + * @param value + * @param trx + * @return value from matching ad_ref_list record + */ private String resolveForeignList(MColumn column, String foreignColumn, Object value ,Trx trx) { String idS = null; String trxName = (trx!=null?trx.getTrxName():null); @@ -1482,6 +1566,14 @@ public class GridTabCSVImporter implements IGridTabImporter return idS; } + /** + * @param foreignTable + * @param foreignColumn + * @param value + * @param field + * @param trx + * @return -3 for not found, -2 for more than 1 match and > 0 for foreign id + */ private int resolveForeign(String foreignTable, String foreignColumn, Object value, GridField field, Trx trx) { boolean systemAccess = false; if (!"AD_Client".equals(foreignTable)) { @@ -1583,7 +1675,10 @@ public class GridTabCSVImporter implements IGridTabImporter return bChanged; } - //Copy from GridTable + /** + * @param value + * @return true if value is not null and not an empty string + */ private boolean isNotNullAndIsEmpty (Object value) { if (value != null && (value instanceof String) diff --git a/org.adempiere.base/src/org/adempiere/impexp/GridTabExcelExporter.java b/org.adempiere.base/src/org/adempiere/impexp/GridTabExcelExporter.java index 7ff72ac138..0c7d290242 100644 --- a/org.adempiere.base/src/org/adempiere/impexp/GridTabExcelExporter.java +++ b/org.adempiere.base/src/org/adempiere/impexp/GridTabExcelExporter.java @@ -29,7 +29,7 @@ import org.compiere.util.Env; import org.compiere.util.Msg; /** - * Excel Exporter Adapter for GridTab + * Excel (XLS) Exporter Adapter for GridTab * @author Teo Sarca, www.arhipac.ro *
  • FR [ 1943731 ] Window data export functionality */ @@ -37,6 +37,9 @@ public class GridTabExcelExporter extends AbstractExcelExporter implements IGrid { private GridTab m_tab = null; + /** + * Default constructor + */ public GridTabExcelExporter() { setFreezePane(0, 1); @@ -123,13 +126,19 @@ public class GridTabExcelExporter extends AbstractExcelExporter implements IGrid ; // nothing } + @Override protected int getCurrentRow() { return m_tab.getCurrentRow(); } + /** Column Name:MLookup */ private HashMap m_buttonLookups = new HashMap(); + /** + * @param mField + * @return lookup for field + */ private MLookup getButtonLookup(GridField mField) { MLookup lookup = m_buttonLookups.get(mField.getColumnName()); diff --git a/org.adempiere.base/src/org/adempiere/impexp/GridTabXLSXExporter.java b/org.adempiere.base/src/org/adempiere/impexp/GridTabXLSXExporter.java index f26149f3de..b39ccfa8eb 100644 --- a/org.adempiere.base/src/org/adempiere/impexp/GridTabXLSXExporter.java +++ b/org.adempiere.base/src/org/adempiere/impexp/GridTabXLSXExporter.java @@ -28,7 +28,7 @@ import org.compiere.util.Env; import org.compiere.util.Msg; /** - * Excel Exporter Adapter for GridTab + * Excel (XLSX) Exporter Adapter for GridTab * * @author Deepak Pansheriya */ @@ -36,6 +36,9 @@ public class GridTabXLSXExporter extends AbstractXLSXExporter implements IGridTa { private GridTab m_tab = null; + /** + * Default constructor + */ public GridTabXLSXExporter() { setFreezePane(0, 1); @@ -127,8 +130,13 @@ public class GridTabXLSXExporter extends AbstractXLSXExporter implements IGridTa return m_tab.getCurrentRow(); } + /** Column Name:MLookup */ private HashMap m_buttonLookups = new HashMap(); + /** + * @param mField + * @return lookup for field + */ private MLookup getButtonLookup(GridField mField) { MLookup lookup = m_buttonLookups.get(mField.getColumnName()); diff --git a/org.adempiere.base/src/org/adempiere/model/CalloutInfoWindow.java b/org.adempiere.base/src/org/adempiere/model/CalloutInfoWindow.java index b8eedc1069..567bba8f10 100644 --- a/org.adempiere.base/src/org/adempiere/model/CalloutInfoWindow.java +++ b/org.adempiere.base/src/org/adempiere/model/CalloutInfoWindow.java @@ -41,7 +41,7 @@ import org.compiere.util.Env; public class CalloutInfoWindow implements IColumnCallout { /** - * + * default constructor */ public CalloutInfoWindow() { } @@ -65,6 +65,12 @@ public class CalloutInfoWindow implements IColumnCallout { return ""; } + /** + * For AD_Reference_ID callout, set query operator and function of info column. + * @param mTab + * @param value AD_Reference_ID + * @return error message or null + */ private String reference(GridTab mTab, Object value) { if (value != null) { int id = ((Number)value).intValue(); @@ -76,6 +82,11 @@ public class CalloutInfoWindow implements IColumnCallout { return null; } + /** + * Set query operator and function + * @param AD_Reference_ID + * @param infoColumn + */ private void setQueryOption(int AD_Reference_ID, I_AD_InfoColumn infoColumn) { if (DisplayType.isText(AD_Reference_ID)) { infoColumn.setQueryOperator(X_AD_InfoColumn.QUERYOPERATOR_Like); @@ -88,6 +99,12 @@ public class CalloutInfoWindow implements IColumnCallout { } } + /** + * For AD_Table_ID callout, set from clause of info window. + * @param mTab GridTab for AD_InfoWindow + * @param value AD_Table_ID + * @return error message or null + */ private String table(GridTab mTab, Object value) { if (value != null) { int id = ((Number)value).intValue(); @@ -107,6 +124,12 @@ public class CalloutInfoWindow implements IColumnCallout { return null; } + /** + * For AD_Element_ID callout, copy element values to info column. + * @param mTab + * @param value + * @return error message or null + */ protected String element(GridTab mTab, Object value) { if (value != null) { int id = ((Number)value).intValue(); diff --git a/org.adempiere.base/src/org/adempiere/model/DocActionDelegate.java b/org.adempiere.base/src/org/adempiere/model/DocActionDelegate.java index 28742b0532..6b3a30e547 100644 --- a/org.adempiere.base/src/org/adempiere/model/DocActionDelegate.java +++ b/org.adempiere.base/src/org/adempiere/model/DocActionDelegate.java @@ -38,6 +38,7 @@ import org.adempiere.exceptions.AdempiereException; import org.adempiere.exceptions.PeriodClosedException; import org.compiere.model.MDocType; import org.compiere.model.MPeriod; +import org.compiere.model.MProjectIssue; import org.compiere.model.ModelValidationEngine; import org.compiere.model.ModelValidator; import org.compiere.model.PO; @@ -49,9 +50,9 @@ import org.compiere.util.TimeUtil; import org.compiere.util.Util; /** - * + * Helper class for implementation of {@link DocAction} interface. + * @see {@link MProjectIssue} for example usage. * @author hengsin - * */ public class DocActionDelegate implements DocAction { @@ -66,6 +67,9 @@ public class DocActionDelegate implements DocAction { /** Logger */ protected transient CLogger log = CLogger.getCLogger (getClass()); + /** + * @param po + */ public DocActionDelegate(T po) { this.po = po; } diff --git a/org.adempiere.base/src/org/adempiere/model/GenericPO.java b/org.adempiere.base/src/org/adempiere/model/GenericPO.java index bc368b3a8c..4d9f644c27 100644 --- a/org.adempiere.base/src/org/adempiere/model/GenericPO.java +++ b/org.adempiere.base/src/org/adempiere/model/GenericPO.java @@ -41,7 +41,7 @@ import org.compiere.process.DocAction; */ public class GenericPO extends PO implements DocAction { /** - * + * generated serial id */ private static final long serialVersionUID = 3180937588404433030L; @@ -135,8 +135,6 @@ public class GenericPO extends PO implements DocAction { return Integer.parseInt(p_info.getAccessLevel()); } - - /* METHODS TO USE GenericPO in Documents */ /** diff --git a/org.adempiere.base/src/org/adempiere/model/GenericZoomProvider.java b/org.adempiere.base/src/org/adempiere/model/GenericZoomProvider.java index 695e74b0dc..361784ef8f 100644 --- a/org.adempiere.base/src/org/adempiere/model/GenericZoomProvider.java +++ b/org.adempiere.base/src/org/adempiere/model/GenericZoomProvider.java @@ -46,7 +46,7 @@ import org.compiere.util.Util; /** * Generic provider of zoom targets. Contains pieces of {@link org.adempiere.webui.WZoomAcross} - * methods getZoomTargets and addTarget + * methods getZoomTargets and addTarget. * * @author Tobias Schoeneberg, www.metas.de - FR [ 2897194 ] Advanced Zoom and RelationTypes * @@ -57,6 +57,7 @@ public class GenericZoomProvider implements IZoomProvider { private Map queries; + @Override public List retrieveZoomInfos(PO po) { // User preference boolean detailedZoom = "Y".equals(Env.getContext(Env.getCtx(), "P|IsDetailedZoomAcross")); @@ -190,6 +191,14 @@ public class GenericZoomProvider implements IZoomProvider { } } + /** + * + * @param targetTableName + * @param targetColumnName + * @param AD_Tab_ID + * @param po + * @return MQuery + */ private MQuery evaluateQuery(String targetTableName, String targetColumnName, int AD_Tab_ID, final PO po) { Properties ctx = Env.getCtx(); int clientID = Env.getAD_Client_ID(ctx); @@ -283,6 +292,12 @@ public class GenericZoomProvider implements IZoomProvider { return query; } + /** + * @param object + * @param sql + * @param timeOut + * @return sql value from DB + */ private int getSQLValueTimeout(Object object, String sql, int timeOut) { int retValue = -1; PreparedStatement pstmt = null; diff --git a/org.adempiere.base/src/org/adempiere/model/GridTabWrapper.java b/org.adempiere.base/src/org/adempiere/model/GridTabWrapper.java index 557dfb956e..40f01efbd4 100644 --- a/org.adempiere.base/src/org/adempiere/model/GridTabWrapper.java +++ b/org.adempiere.base/src/org/adempiere/model/GridTabWrapper.java @@ -28,7 +28,7 @@ import org.compiere.util.CLogger; import org.compiere.util.Env; /** - * Wrap GridTab to ADempiere Bean Interface (i.e. generated interfaces). + * Wrap GridTab to ADempiere Model Interface (i.e. generated interfaces).
    * Usage example: *
      * I_A_Asset_Disposed bean = GridTabWrapper.create(mTab, I_A_Asset_Disposed.class); 
    @@ -42,6 +42,13 @@ public class GridTabWrapper implements InvocationHandler
     {
     	private static final CLogger log = CLogger.getCLogger(GridTabWrapper.class);
     	
    +	/**
    +	 * Create wrapper of type cl for gridTab.
    +	 * @param 
    +	 * @param gridTab
    +	 * @param cl
    +	 * @return wrapper instance for gridTab
    +	 */
     	@SuppressWarnings("unchecked")
     	public static  T create(GridTab gridTab, Class cl)
     	{
    @@ -52,6 +59,10 @@ public class GridTabWrapper implements InvocationHandler
     	
     	private final GridTab m_gridTab;
     	
    +	/**
    +	 * Private constructor.
    +	 * @param gridTab
    +	 */
     	private GridTabWrapper(GridTab gridTab)
     	{
     		this.m_gridTab = gridTab;
    @@ -121,6 +132,9 @@ public class GridTabWrapper implements InvocationHandler
     		}
     	}
     	
    +	/**
    +	 * @return GridTab
    +	 */
     	public GridTab getGridTab()
     	{
     		return this.m_gridTab;
    @@ -174,6 +188,10 @@ public class GridTabWrapper implements InvocationHandler
     		return po;
     	}
     	
    +	/**
    +	 * @param cl
    +	 * @return true if cl is iDempiere model interface
    +	 */
     	private boolean isModelInterface(Class cl)
     	{
     		try
    diff --git a/org.adempiere.base/src/org/adempiere/model/IAddressValidation.java b/org.adempiere.base/src/org/adempiere/model/IAddressValidation.java
    index 0af45c4122..a5d98d5ced 100644
    --- a/org.adempiere.base/src/org/adempiere/model/IAddressValidation.java
    +++ b/org.adempiere.base/src/org/adempiere/model/IAddressValidation.java
    @@ -23,5 +23,12 @@ import org.compiere.model.MAddressTransaction;
      *
      */
     public interface IAddressValidation {
    +	/**
    +	 * Perform online validation
    +	 * @param ctx
    +	 * @param addressTransaction
    +	 * @param trxName
    +	 * @return true if valid, false otherwise
    +	 */
     	public boolean onlineValidate(Properties ctx, MAddressTransaction addressTransaction, String trxName);
     }
    diff --git a/org.adempiere.base/src/org/adempiere/model/IInfoColumn.java b/org.adempiere.base/src/org/adempiere/model/IInfoColumn.java
    index 0b7ec86298..1b40e6d9a2 100644
    --- a/org.adempiere.base/src/org/adempiere/model/IInfoColumn.java
    +++ b/org.adempiere.base/src/org/adempiere/model/IInfoColumn.java
    @@ -17,10 +17,10 @@ package org.adempiere.model;
     import org.compiere.model.MInfoColumn;
     
     /**
    - * 
    + * Interface for class to provide access to contain or related {@link MInfoColumn}.
    + * @see MInfoProcess
    + * @see MInfoRelated
      * @author hieplq
    - * implement to provide InfoColumn
    - * example MInfoProcess, MInfoRelate
      *
      */
     public interface IInfoColumn {
    @@ -32,7 +32,7 @@ public interface IInfoColumn {
     	
     	/**
     	 * Object MInfoColumn
    -	 * @return
    +	 * @return MInfoColumn
     	 */
     	public MInfoColumn getAD_InfoColumn ();
     }
    diff --git a/org.adempiere.base/src/org/adempiere/model/IShipmentProcessor.java b/org.adempiere.base/src/org/adempiere/model/IShipmentProcessor.java
    index 55defe8f5b..bc060919ec 100644
    --- a/org.adempiere.base/src/org/adempiere/model/IShipmentProcessor.java
    +++ b/org.adempiere.base/src/org/adempiere/model/IShipmentProcessor.java
    @@ -19,15 +19,37 @@ import java.util.Properties;
     import org.compiere.model.MShippingTransaction;
     
     /**
    - * 
    + * Online shipment processor interface
      * @author Low Heng Sin
      *
      */
     public interface IShipmentProcessor 
     {	
    +	/**
    +	 * Perform online shipment
    +	 * @param ctx
    +	 * @param shippingTransaction
    +	 * @param trxName
    +	 * @return true if success, false otherwise
    +	 */
     	public boolean processShipment(Properties ctx, MShippingTransaction shippingTransaction, String trxName);
     	
    +	/**
    +	 * Perform shipment rate inquiry
    +	 * @param ctx
    +	 * @param shippingTransaction
    +	 * @param isPriviledgedRate
    +	 * @param trxName
    +	 * @return true if success, false otherwise
    +	 */
     	public boolean rateInquiry(Properties ctx, MShippingTransaction shippingTransaction, boolean isPriviledgedRate, String trxName);
     
    +	/**
    +	 * Void online shipment
    +	 * @param ctx
    +	 * @param shippingTransaction
    +	 * @param get_TrxName
    +	 * @return true if success, false otherwise
    +	 */
     	public boolean voidShipment(Properties ctx, MShippingTransaction shippingTransaction, String get_TrxName);
     }
    diff --git a/org.adempiere.base/src/org/adempiere/model/ITaxProvider.java b/org.adempiere.base/src/org/adempiere/model/ITaxProvider.java
    index 9ebfedae85..993f9a6cfe 100644
    --- a/org.adempiere.base/src/org/adempiere/model/ITaxProvider.java
    +++ b/org.adempiere.base/src/org/adempiere/model/ITaxProvider.java
    @@ -131,10 +131,10 @@ public interface ITaxProvider {
     	public boolean updateHeaderTax(MTaxProvider provider, MRMALine line);
     
     	/**
    -	 * 
    +	 * Validate connection to online tax calculation service.
     	 * @param provider
     	 * @param pi
    -	 * @return error message
    +	 * @return error message or null
     	 * @throws Exception
     	 */
     	public String validateConnection(MTaxProvider provider, ProcessInfo pi) throws Exception;
    diff --git a/org.adempiere.base/src/org/adempiere/model/IZoomProvider.java b/org.adempiere.base/src/org/adempiere/model/IZoomProvider.java
    index 2611e56c07..a859e4394b 100644
    --- a/org.adempiere.base/src/org/adempiere/model/IZoomProvider.java
    +++ b/org.adempiere.base/src/org/adempiere/model/IZoomProvider.java
    @@ -19,14 +19,14 @@ import org.compiere.model.MQuery;
     import org.compiere.model.PO;
     
     /**
    - * 
    + * Interface for zoom target provider.
      * @author Tobias Schoeneberg, www.metas.de - FR [ 2897194 ] Advanced Zoom and
      *         RelationTypes
      */
     public interface IZoomProvider {
     
     	/**
    -	 * 
    +	 * Discover zoom targets for po
     	 * @param po
     	 *            the po we need zoom targets for
     	 * @return a list of zoom targets. The {@link MQuery#getRecordCount()} of
    diff --git a/org.adempiere.base/src/org/adempiere/model/ImportValidator.java b/org.adempiere.base/src/org/adempiere/model/ImportValidator.java
    index f45be73e0b..53602c223b 100644
    --- a/org.adempiere.base/src/org/adempiere/model/ImportValidator.java
    +++ b/org.adempiere.base/src/org/adempiere/model/ImportValidator.java
    @@ -22,5 +22,13 @@ public interface ImportValidator
     	/** Event triggered after an import record is processed */
     	public static final int TIMING_AFTER_IMPORT = 40;
     	
    +	/**
    +	 * Handle import event
    +	 * @param process
    +	 * @param importModel
    +	 * @param targetModel
    +	 * @param timing {@link #TIMING_BEFORE_VALIDATE}, {@link #TIMING_AFTER_VALIDATE},
    +	 * {@link #TIMING_BEFORE_IMPORT} or {@link #TIMING_AFTER_IMPORT}.
    +	 */
     	public void validate(ImportProcess process, Object importModel, Object targetModel, int timing);
     }
    diff --git a/org.adempiere.base/src/org/adempiere/model/MBroadcastMessage.java b/org.adempiere.base/src/org/adempiere/model/MBroadcastMessage.java
    index 2779d12f4f..3070fe569b 100644
    --- a/org.adempiere.base/src/org/adempiere/model/MBroadcastMessage.java
    +++ b/org.adempiere.base/src/org/adempiere/model/MBroadcastMessage.java
    @@ -33,7 +33,7 @@ import org.idempiere.cache.ImmutablePOSupport;
     public class MBroadcastMessage extends X_AD_BroadcastMessage implements ImmutablePOSupport
     {
     	/**
    -	 * 
    +	 * generated serial id
     	 */
     	private static final long serialVersionUID = 3733943472482553977L;
     	public final static String CLIENTINFO_BROADCAST_COMPONENT_ID = "#clientInfo_BroadcastComponentId";
    @@ -49,11 +49,21 @@ public class MBroadcastMessage extends X_AD_BroadcastMessage implements Immutabl
             super(ctx, AD_BroadcastMessage_UU, trxName);
         }
     
    +    /**
    +     * @param ctx
    +     * @param AD_BroadcastMessage_ID
    +     * @param trxName
    +     */
         public MBroadcastMessage(Properties ctx, int AD_BroadcastMessage_ID, String trxName)
         {
     		super(ctx, AD_BroadcastMessage_ID, trxName);
     	}
         
    +    /**
    +     * @param ctx
    +     * @param rs
    +     * @param trxName
    +     */
         public MBroadcastMessage(Properties ctx, ResultSet rs, String trxName)
         {
         	super(ctx, rs, trxName);
    @@ -133,7 +143,7 @@ public class MBroadcastMessage extends X_AD_BroadcastMessage implements Immutabl
     	
     	/**
     	 * Is broadcast message applicable to current login user
    -	 * @return
    +	 * @return true if applicable, false otherwise
     	 */
         public boolean isValidUserforMessage()
         {
    @@ -168,11 +178,12 @@ public class MBroadcastMessage extends X_AD_BroadcastMessage implements Immutabl
         	return false;
         }
         
    -    /**************************************************************************
    +    /**
     	 * 	Before Save
     	 *	@param newRecord new
     	 *	@return save
     	 */
    +    @Override
     	protected boolean beforeSave (boolean newRecord)
     	{
     		if (BROADCASTTYPE_Immediate.equals(getBroadcastType())) {
    @@ -203,11 +214,12 @@ public class MBroadcastMessage extends X_AD_BroadcastMessage implements Immutabl
     		return translation;
     	}
     
    -	/** Returns a link to be used in broadcast messages to open a record
    +	/** 
    +	 * Returns a link to be used in broadcast messages to open a record
     	 * @param PO po
     	 * @param uuid of the window
     	 * @param text of the link
    -	 * @return the text to set in the broadcast message
    +	 * @return the URL link to set in the broadcast message
     	 * */
     	public String getUrlZoom(PO po, String windowUUID, String text) {
     		StringBuilder url = new StringBuilder("");
    diff --git a/org.adempiere.base/src/org/adempiere/model/MFreightShipmentProcessor.java b/org.adempiere.base/src/org/adempiere/model/MFreightShipmentProcessor.java
    index 7f47dd48b4..b7df462068 100644
    --- a/org.adempiere.base/src/org/adempiere/model/MFreightShipmentProcessor.java
    +++ b/org.adempiere.base/src/org/adempiere/model/MFreightShipmentProcessor.java
    @@ -104,6 +104,23 @@ public class MFreightShipmentProcessor implements IShipmentProcessor {
     		return true;
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param adMessage
    +	 * @param shipperId
    +	 * @param freightCategoryId
    +	 * @param dateOrder
    +	 * @param weight
    +	 * @param maxProductDimension
    +	 * @param countryFrom
    +	 * @param countryTo
    +	 * @param regionFrom
    +	 * @param regionTo
    +	 * @param freightId
    +	 * @param price
    +	 * @param trxName
    +	 * @return translated ad message
    +	 */
     	private String getMsg(Properties ctx, String adMessage, int shipperId, int freightCategoryId, Timestamp dateOrder,
     			BigDecimal weight, BigDecimal maxProductDimension, int countryFrom, int countryTo, int regionFrom,
     			int regionTo, int freightId, BigDecimal price, String trxName) {
    diff --git a/org.adempiere.base/src/org/adempiere/model/MInfoProcess.java b/org.adempiere.base/src/org/adempiere/model/MInfoProcess.java
    index 2f0a088d05..0b68fcbc41 100644
    --- a/org.adempiere.base/src/org/adempiere/model/MInfoProcess.java
    +++ b/org.adempiere.base/src/org/adempiere/model/MInfoProcess.java
    @@ -26,15 +26,15 @@ import org.compiere.util.Evaluator;
     import org.idempiere.cache.ImmutablePOSupport;
     
     /**
    - * Contain info of process in info window
    - * include process_id, image name, name
    + * Contain details of process in info window, 
    + * include ad_process_id, image name and name.
      * @author hieplq
      *
      */
     public class MInfoProcess extends X_AD_InfoProcess implements IInfoColumn, ImmutablePOSupport {
     	
     	/**
    -	 * 
    +	 * generated serial id
     	 */
     	private static final long serialVersionUID = 7833442401205258074L;
     
    @@ -80,8 +80,8 @@ public class MInfoProcess extends X_AD_InfoProcess implements IInfoColumn, Immut
     	
     	protected String m_viewIDName;
     	
    -	/**************************************************************************
    -	 *	Is the Column Visible ? Evaluater base in display logic expression and context of this po
    +	/**
    +	 *	Is the Column Visible ? Evaluated based on display logic expression and context of this PO.
     	 *  @return true, if visible
     	 */
     	public boolean isDisplayed (final int windowNo)
    @@ -89,10 +89,10 @@ public class MInfoProcess extends X_AD_InfoProcess implements IInfoColumn, Immut
     		return isDisplayed(this.getCtx(), windowNo);
     }
     	
    -	 /**************************************************************************
    -	 * Is the Column Visible ? Evaluater base in display logic expression and context
    +	 /**
    +	 * Is the Column Visible ? Evaluated based on display logic expression and context of this PO.
     	 * @param ctx
    -	 * @return
    +	 * @return true, if visible
     	 */
     	public boolean isDisplayed(final Properties ctx, final int windowNo) {		
     		if (getDisplayLogic() == null || getDisplayLogic().trim().length() == 0)
    diff --git a/org.adempiere.base/src/org/adempiere/model/MInfoRelated.java b/org.adempiere.base/src/org/adempiere/model/MInfoRelated.java
    index af16d83fef..361600a087 100644
    --- a/org.adempiere.base/src/org/adempiere/model/MInfoRelated.java
    +++ b/org.adempiere.base/src/org/adempiere/model/MInfoRelated.java
    @@ -25,7 +25,7 @@ import org.idempiere.cache.ImmutablePOSupport;
     
     public class MInfoRelated extends X_AD_InfoRelated implements IInfoColumn, ImmutablePOSupport {	
     	/**
    -	 * 
    +	 * generated serial id
     	 */
     	private static final long serialVersionUID = 4000783886138460291L;
     
    @@ -38,11 +38,21 @@ public class MInfoRelated extends X_AD_InfoRelated implements IInfoColumn, Immut
         public MInfoRelated(Properties ctx, String AD_InfoRelated_UU, String trxName) {
             super(ctx, AD_InfoRelated_UU, trxName);
         }
    -
    +
    +    /**
    +     * @param ctx
    +     * @param AD_InfoRelated_ID
    +     * @param trxName
    +     */
     	public MInfoRelated(Properties ctx, int AD_InfoRelated_ID, String trxName) {
     		super(ctx, AD_InfoRelated_ID, trxName);
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param rs
    +	 * @param trxName
    +	 */
     	public MInfoRelated(Properties ctx, ResultSet rs, String trxName) {
     		super(ctx, rs, trxName);
     	}
    @@ -56,6 +66,9 @@ public class MInfoRelated extends X_AD_InfoRelated implements IInfoColumn, Immut
     		copyPO(copy);
     	}
     	
    +	/**
    +	 * @return Link info column
    +	 */
     	public MInfoColumn getLinkInfoColumn() {
     		if (log.isLoggable(Level.INFO)) log.info("Link Column ID: -----  : " + getRelatedColumn_ID());
     
    @@ -66,6 +79,9 @@ public class MInfoRelated extends X_AD_InfoRelated implements IInfoColumn, Immut
     		return infoCol;
     	}
     
    +	/**
    +	 * @return Link column name
    +	 */
     	public String getLinkColumnName() {
     		MInfoColumn infoCol = getLinkInfoColumn();
     		if (infoCol != null)
    diff --git a/org.adempiere.base/src/org/adempiere/model/MPromotion.java b/org.adempiere.base/src/org/adempiere/model/MPromotion.java
    index 32506a8458..f3abaa5676 100644
    --- a/org.adempiere.base/src/org/adempiere/model/MPromotion.java
    +++ b/org.adempiere.base/src/org/adempiere/model/MPromotion.java
    @@ -37,14 +37,30 @@ public class MPromotion extends X_M_Promotion {
             super(ctx, M_Promotion_UU, trxName);
         }
     
    +    /**
    +     * @param ctx
    +     * @param M_Promotion_ID
    +     * @param trxName
    +     */
     	public MPromotion(Properties ctx, int M_Promotion_ID, String trxName) {
     		super(ctx, M_Promotion_ID, trxName);
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param rs
    +	 * @param trxName
    +	 */
     	public MPromotion(Properties ctx, ResultSet rs, String trxName) {
     		super(ctx, rs, trxName);
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param M_Promotion_ID
    +	 * @param trxName
    +	 * @param virtualColumns
    +	 */
     	public MPromotion(Properties ctx, int M_Promotion_ID, String trxName, String... virtualColumns) {
     		super(ctx, M_Promotion_ID, trxName, virtualColumns);
     	}
    diff --git a/org.adempiere.base/src/org/adempiere/model/MPromotionDistribution.java b/org.adempiere.base/src/org/adempiere/model/MPromotionDistribution.java
    index 5f78659d03..cec39196a1 100644
    --- a/org.adempiere.base/src/org/adempiere/model/MPromotionDistribution.java
    +++ b/org.adempiere.base/src/org/adempiere/model/MPromotionDistribution.java
    @@ -37,14 +37,30 @@ public class MPromotionDistribution extends X_M_PromotionDistribution {
             super(ctx, M_PromotionDistribution_UU, trxName);
         }
     
    +    /**
    +     * @param ctx
    +     * @param M_PromotionDistribution_ID
    +     * @param trxName
    +     */
     	public MPromotionDistribution(Properties ctx, int M_PromotionDistribution_ID, String trxName) {
     		super(ctx, M_PromotionDistribution_ID, trxName);
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param rs
    +	 * @param trxName
    +	 */
     	public MPromotionDistribution(Properties ctx, ResultSet rs, String trxName) {
     		super(ctx, rs, trxName);
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param M_PromotionDistribution_ID
    +	 * @param trxName
    +	 * @param virtualColumns
    +	 */
     	public MPromotionDistribution(Properties ctx, int M_PromotionDistribution_ID, String trxName,
     			String... virtualColumns) {
     		super(ctx, M_PromotionDistribution_ID, trxName, virtualColumns);
    diff --git a/org.adempiere.base/src/org/adempiere/model/MPromotionGroup.java b/org.adempiere.base/src/org/adempiere/model/MPromotionGroup.java
    index c5e5c961bd..ac61781d1a 100644
    --- a/org.adempiere.base/src/org/adempiere/model/MPromotionGroup.java
    +++ b/org.adempiere.base/src/org/adempiere/model/MPromotionGroup.java
    @@ -37,14 +37,30 @@ public class MPromotionGroup extends X_M_PromotionGroup {
             super(ctx, M_PromotionGroup_UU, trxName);
         }
     
    +    /**
    +     * @param ctx
    +     * @param M_PromotionGroup_ID
    +     * @param trxName
    +     */
     	public MPromotionGroup(Properties ctx, int M_PromotionGroup_ID, String trxName) {
     		super(ctx, M_PromotionGroup_ID, trxName);
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param rs
    +	 * @param trxName
    +	 */
     	public MPromotionGroup(Properties ctx, ResultSet rs, String trxName) {
     		super(ctx, rs, trxName);
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param M_PromotionGroup_ID
    +	 * @param trxName
    +	 * @param virtualColumns
    +	 */
     	public MPromotionGroup(Properties ctx, int M_PromotionGroup_ID, String trxName, String... virtualColumns) {
     		super(ctx, M_PromotionGroup_ID, trxName, virtualColumns);
     	}
    diff --git a/org.adempiere.base/src/org/adempiere/model/MPromotionGroupLine.java b/org.adempiere.base/src/org/adempiere/model/MPromotionGroupLine.java
    index 84766ad868..1784913fe6 100644
    --- a/org.adempiere.base/src/org/adempiere/model/MPromotionGroupLine.java
    +++ b/org.adempiere.base/src/org/adempiere/model/MPromotionGroupLine.java
    @@ -37,14 +37,30 @@ public class MPromotionGroupLine extends X_M_PromotionGroupLine {
             super(ctx, M_PromotionGroupLine_UU, trxName);
         }
     
    +    /**
    +     * @param ctx
    +     * @param M_PromotionGroupLine_ID
    +     * @param trxName
    +     */
     	public MPromotionGroupLine(Properties ctx, int M_PromotionGroupLine_ID, String trxName) {
     		super(ctx, M_PromotionGroupLine_ID, trxName);
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param rs
    +	 * @param trxName
    +	 */
     	public MPromotionGroupLine(Properties ctx, ResultSet rs, String trxName) {
     		super(ctx, rs, trxName);
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param M_PromotionGroupLine_ID
    +	 * @param trxName
    +	 * @param virtualColumns
    +	 */
     	public MPromotionGroupLine(Properties ctx, int M_PromotionGroupLine_ID, String trxName, String... virtualColumns) {
     		super(ctx, M_PromotionGroupLine_ID, trxName, virtualColumns);
     	}
    diff --git a/org.adempiere.base/src/org/adempiere/model/MPromotionLine.java b/org.adempiere.base/src/org/adempiere/model/MPromotionLine.java
    index 358f07c8af..607e9f13f4 100644
    --- a/org.adempiere.base/src/org/adempiere/model/MPromotionLine.java
    +++ b/org.adempiere.base/src/org/adempiere/model/MPromotionLine.java
    @@ -32,14 +32,30 @@ public class MPromotionLine extends X_M_PromotionLine {
             super(ctx, M_PromotionLine_UU, trxName);
         }
     
    +    /**
    +     * @param ctx
    +     * @param M_PromotionLine_ID
    +     * @param trxName
    +     */
     	public MPromotionLine(Properties ctx, int M_PromotionLine_ID, String trxName) {
     		super(ctx, M_PromotionLine_ID, trxName);
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param rs
    +	 * @param trxName
    +	 */
     	public MPromotionLine(Properties ctx, ResultSet rs, String trxName) {
     		super(ctx, rs, trxName);
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param M_PromotionLine_ID
    +	 * @param trxName
    +	 * @param virtualColumns
    +	 */
     	public MPromotionLine(Properties ctx, int M_PromotionLine_ID, String trxName, String... virtualColumns) {
     		super(ctx, M_PromotionLine_ID, trxName, virtualColumns);
     	}
    diff --git a/org.adempiere.base/src/org/adempiere/model/MPromotionPreCondition.java b/org.adempiere.base/src/org/adempiere/model/MPromotionPreCondition.java
    index a5d6f27452..b265eb7d82 100644
    --- a/org.adempiere.base/src/org/adempiere/model/MPromotionPreCondition.java
    +++ b/org.adempiere.base/src/org/adempiere/model/MPromotionPreCondition.java
    @@ -37,15 +37,31 @@ public class MPromotionPreCondition extends X_M_PromotionPreCondition {
             super(ctx, M_PromotionPreCondition_UU, trxName);
         }
     
    +    /**
    +     * @param ctx
    +     * @param M_PromotionPreCondition_ID
    +     * @param trxName
    +     */
     	public MPromotionPreCondition(Properties ctx,
     			int M_PromotionPreCondition_ID, String trxName) {
     		super(ctx, M_PromotionPreCondition_ID, trxName);
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param rs
    +	 * @param trxName
    +	 */
     	public MPromotionPreCondition(Properties ctx, ResultSet rs, String trxName) {
     		super(ctx, rs, trxName);
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param M_PromotionPreCondition_ID
    +	 * @param trxName
    +	 * @param virtualColumns
    +	 */
     	public MPromotionPreCondition(Properties ctx, int M_PromotionPreCondition_ID, String trxName,
     			String... virtualColumns) {
     		super(ctx, M_PromotionPreCondition_ID, trxName, virtualColumns);
    diff --git a/org.adempiere.base/src/org/adempiere/model/MPromotionReward.java b/org.adempiere.base/src/org/adempiere/model/MPromotionReward.java
    index e02893ca58..7779882145 100644
    --- a/org.adempiere.base/src/org/adempiere/model/MPromotionReward.java
    +++ b/org.adempiere.base/src/org/adempiere/model/MPromotionReward.java
    @@ -37,15 +37,31 @@ public class MPromotionReward extends X_M_PromotionReward {
             super(ctx, M_PromotionReward_UU, trxName);
         }
     
    +    /**
    +     * @param ctx
    +     * @param M_PromotionReward_ID
    +     * @param trxName
    +     */
     	public MPromotionReward(Properties ctx, int M_PromotionReward_ID,
     			String trxName) {
     		super(ctx, M_PromotionReward_ID, trxName);
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param rs
    +	 * @param trxName
    +	 */
     	public MPromotionReward(Properties ctx, ResultSet rs, String trxName) {
     		super(ctx, rs, trxName);
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param M_PromotionReward_ID
    +	 * @param trxName
    +	 * @param virtualColumns
    +	 */
     	public MPromotionReward(Properties ctx, int M_PromotionReward_ID, String trxName, String... virtualColumns) {
     		super(ctx, M_PromotionReward_ID, trxName, virtualColumns);
     	}
    diff --git a/org.adempiere.base/src/org/adempiere/model/MRelationType.java b/org.adempiere.base/src/org/adempiere/model/MRelationType.java
    index 8f4c9b1b1a..edae8bc227 100644
    --- a/org.adempiere.base/src/org/adempiere/model/MRelationType.java
    +++ b/org.adempiere.base/src/org/adempiere/model/MRelationType.java
    @@ -94,7 +94,7 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider {
     	final static String SQL_WINDOW_NAME_TRL = "SELECT Name FROM AD_Window_Trl WHERE AD_WINDOW_ID=? AND AD_LANGUAGE=?";
     
     	/**
    -	 * 
    +	 * generated serial id
     	 */
     	private static final long serialVersionUID = 5486148151201672913L;
     
    @@ -109,15 +109,31 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider {
         public MRelationType(Properties ctx, String AD_RelationType_UU, String trxName) {
             super(ctx, AD_RelationType_UU, trxName);
         }
    -
    +
    +    /**
    +     * @param ctx
    +     * @param AD_RelationType_ID
    +     * @param trxName
    +     */
     	public MRelationType(Properties ctx, int AD_RelationType_ID, String trxName) {
     		super(ctx, AD_RelationType_ID, trxName);
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param rs
    +	 * @param trxName
    +	 */
     	public MRelationType(Properties ctx, ResultSet rs, String trxName) {
     		super(ctx, rs, trxName);
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param AD_RelationType_ID
    +	 * @param trxName
    +	 * @param virtualColumns
    +	 */
     	public MRelationType(Properties ctx, int AD_RelationType_ID, String trxName, String... virtualColumns) {
     		super(ctx, AD_RelationType_ID, trxName, virtualColumns);
     	}
    @@ -128,7 +144,7 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider {
     	 * PO.
     	 * 
     	 * @param po
    -	 * @return
    +	 * @return matching relation types
     	 */
     	public static List retrieveTypes(final PO po,
     			final int windowId) {
    @@ -169,6 +185,11 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider {
     		}
     	}
     
    +	/**
    +	 * @param po
    +	 * @param windowID
    +	 * @return zoom info records from matching relation types
    +	 */
     	public static List retrieveZoomInfos(final PO po,
     			final int windowID) {
     
    @@ -185,6 +206,9 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider {
     		return result;
     	}
     
    +	/**
    +	 * @return display text from lookup of destination reference
    +	 */
     	private String getDestinationRoleDisplay() {
     
     		checkDestinationRefId();
    @@ -208,6 +232,10 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider {
     		return lookup.getDisplay(keyValue);
     	}
     
    +	/**
    +	 * @param windowId
    +	 * @return window name
    +	 */
     	private String retrieveWindowName(final int windowId) {
     
     		final boolean baseLanguage = Env.isBaseLanguage(Env.getCtx(),
    @@ -234,6 +262,13 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider {
     		}
     	}
     
    +	/**
    +	 * @param po
    +	 * @param windowId
    +	 * @param rs
    +	 * @return relation types
    +	 * @throws SQLException
    +	 */
     	private static List evalResultSet(final PO po,
     			final int windowId, final ResultSet rs) throws SQLException {
     
    @@ -291,10 +326,16 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider {
     		return result;
     	}
     
    -	static boolean whereClauseMatches(PO po, String where) {
    +	/**
    +	 * @param po
    +	 * @param where
    +	 * @return true if where is empty or match found in DB
    +	 */
    +	protected static boolean whereClauseMatches(PO po, String where) {
     
     		if (Util.isEmpty(where, true)) {
    -			logger.fine("whereClause is empty. Returning true");
    +			if (logger.isLoggable(Level.FINE))
    +				logger.fine("whereClause is empty. Returning true");
     			return true;
     		}
     
    @@ -312,10 +353,15 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider {
     		return match;
     	}
     
    +	/**
    +	 * @param po
    +	 * @param where
    +	 * @return parsed where clause
    +	 */
     	public static String parseWhereClause(final PO po, final String where) {
     
    -		logger
    -				.fine("building private ctx instance containing the PO's String and int values");
    +		if (logger.isLoggable(Level.FINE))
    +			logger.fine("building private ctx instance containing the PO's String and int values");
     
     		final Properties privateCtx = new Properties();
     		privateCtx.putAll(po.getCtx());
    @@ -347,6 +393,9 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider {
     		return parsedWhere;
     	}
     
    +	/**
    +	 * throw exception if destination reference is not valid
    +	 */
     	public void checkDestinationRefId() {
     
     		if (destinationRefId == 0) {
    @@ -358,7 +407,7 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider {
     	/**
     	 * 
     	 * @param po
    -	 * @return
    +	 * @return zoom info records from destination reference
     	 */
     	public List retrieveZoomInfos(final PO po) {
     
    @@ -386,6 +435,11 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider {
     				query, display));
     	}
     
    +	/**
    +	 * @param po
    +	 * @param refTable
    +	 * @return AD_Window_ID
    +	 */
     	public int retrieveWindowID(final PO po, final MRefTable refTable) {
     
     		MTable table = null;
    @@ -413,6 +467,12 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider {
     
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param referenceId
    +	 * @param trxName
    +	 * @return MRefTable
    +	 */
     	public static MRefTable retrieveRefTable(final Properties ctx,
     			final int referenceId, final String trxName) {
     
    @@ -425,6 +485,10 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider {
     		return refTable;
     	}
     
    +	/**
    +	 * Update record count and zoom value of query
    +	 * @param query
    +	 */
     	private static void evaluateQuery(final MQuery query) {
     
     		StringBuilder sqlCommon = new StringBuilder(" FROM ").append(query.getZoomTableName())
    @@ -445,27 +509,43 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider {
     		}
     	}
     
    +	/**
    +	 * @return table name of source reference
    +	 */
     	private String retrieveSourceTableName() {
     
     		return retrieveTableName(getAD_Reference_Source_ID());
     	}
     
    +	/**
    +	 * @return table name of target reference
    +	 */
     	private String retrieveTargetTableName() {
     
     		return retrieveTableName(getAD_Reference_Target_ID());
     	}
     
    +	/**
    +	 * @return table name of destination reference
    +	 */
     	public String retrieveDestinationTableName() {
     
     		return retrieveTableName(destinationRefId);
     	}
     
    +	/**
    +	 * @param refId
    +	 * @return table name
    +	 */
     	private String retrieveTableName(final int refId) {
     
     		return retrieveRefTable(getCtx(), refId, get_TrxName()).getAD_Table()
     				.getTableName();
     	}
     
    +	/**
    +	 * @return key column name of destination reference
    +	 */
     	public String retrieveDestinationKeyColName() {
     
     		final int keyColumnId = retrieveRefTable(getCtx(), destinationRefId,
    diff --git a/org.adempiere.base/src/org/adempiere/model/MShipperFacade.java b/org.adempiere.base/src/org/adempiere/model/MShipperFacade.java
    index 1f7dc694bd..7af0e73d36 100644
    --- a/org.adempiere.base/src/org/adempiere/model/MShipperFacade.java
    +++ b/org.adempiere.base/src/org/adempiere/model/MShipperFacade.java
    @@ -28,17 +28,26 @@ public class MShipperFacade
     	private MShipper m_shipper;
     	private MShippingProcessor m_processor;
     
    +	/**
    +	 * @param shipper
    +	 */
     	public MShipperFacade(MShipper shipper)
     	{
     		m_shipper = shipper;
     		m_processor = getShippingProcessor();
     	}
     	
    +	/**
    +	 * @return MShipper
    +	 */
     	public MShipper getMShipper()
     	{
     		return m_shipper;
     	}
     	
    +	/**
    +	 * @return MShippingProcessor
    +	 */
     	private MShippingProcessor getShippingProcessor() 
     	{
     		if (m_shipper.getM_ShippingProcessor_ID() > 0)
    @@ -46,66 +55,106 @@ public class MShipperFacade
     		return null;
     	}
     	
    +	/**
    +	 * @return shipping processor class
    +	 */
     	public String getShippingProcessorClass() 
     	{
     		return m_processor == null ? null : m_processor.getShippingProcessorClass();
     	}
     		
    +	/**
    +	 * @return connection key
    +	 */
     	public String getConnectionKey() 
     	{
     		return m_processor == null ? null : m_processor.getConnectionKey();
     	}
     	
    +	/**
    +	 * @return connection password
    +	 */
     	public String getConnectionPassword() 
     	{
     		return m_processor == null ? null : m_processor.getConnectionPassword();
     	}
     	
    +	/**
    +	 * @return connection user id
    +	 */
     	public String getUserID() 
     	{
     		return m_processor == null ? null : m_processor.getUserID();
     	}
     	
    +	/**
    +	 * @return connection host address
    +	 */
     	public String getHostAddress() 
     	{
     		return m_processor == null ? null : m_processor.getHostAddress();
     	}
     	
    +	/**
    +	 * @return optional connection proxy address
    +	 */
     	public String getProxyAddress() 
     	{
     		return m_processor == null ? null : m_processor.getProxyAddress();
     	}
     	
    +	/**
    +	 * @return connection port
    +	 */
     	public int getHostPort() 
     	{
     		return m_processor == null ? null : m_processor.getHostPort();
     	}
     	
    +	/**
    +	 * @return proxy user id
    +	 */
     	public String getProxyLogon()
     	{
     		return m_processor == null ? null : m_processor.getProxyLogon();
     	}
     	
    +	/**
    +	 * @return proxy password
    +	 */
     	public String getProxyPassword() 
     	{
     		return m_processor == null ? null : m_processor.getProxyPassword();
     	}	
     	
    +	/**
    +	 * @return proxy port
    +	 */
     	public int getProxyPort() 
     	{
     		return m_processor == null ? null : m_processor.getProxyPort();
     	}
     	
    +	/**
    +	 * @return shipping service path
    +	 */
     	public String getServicePath() 
     	{
     		return m_processor == null ? null : m_processor.getServicePath();
     	}	
     	
    +	/**
    +	 * @return shipping service code
    +	 */
     	public String getShippingServiceCode() 
     	{
     		return m_shipper.getShippingServiceCode();
     	}
     	
    +	/**
    +	 * @param AD_Org_ID 
    +	 * @return shipping service account
    +	 */
     	public String getShipperAccount(int AD_Org_ID) 
     	{
     		StringBuilder sql = new StringBuilder();
    @@ -121,6 +170,10 @@ public class MShipperFacade
     		return ac;
     	}
     	
    +	/**
    +	 * @param AD_Org_ID
    +	 * @return duties shipper account
    +	 */
     	public String getDutiesShipperAccount(int AD_Org_ID) 
     	{
     		StringBuilder sql = new StringBuilder();
    @@ -138,7 +191,6 @@ public class MShipperFacade
     	
     	/**
     	 * get Meter Number associated with Account Number, use by the Fedex interface
    -	/**
     	 * @param AD_Org_ID
     	 * @return Shipper Meter Number
     	 */
    @@ -152,16 +204,25 @@ public class MShipperFacade
     		return DB.getSQLValueString(null, sql.toString(), m_shipper.getC_BPartner_ID());
     	}
     	
    +	/**
    +	 * @return true if residential delivery service is supported
    +	 */
     	public boolean isResidential() 
     	{
     		return m_shipper.isResidential();
     	}
     	
    +	/**
    +	 * @return true if saturday delivery service is supported
    +	 */
     	public boolean isSaturdayDelivery()
     	{
     		return m_shipper.isSaturdayDelivery();
     	}
     	
    +	/**
    +	 * @return true if international delivery service is supported
    +	 */
     	public boolean isInternational()
     	{
     		return m_shipper.isInternational();
    diff --git a/org.adempiere.base/src/org/adempiere/model/MTabCustomization.java b/org.adempiere.base/src/org/adempiere/model/MTabCustomization.java
    index 4767880bd8..6c51c3bf97 100644
    --- a/org.adempiere.base/src/org/adempiere/model/MTabCustomization.java
    +++ b/org.adempiere.base/src/org/adempiere/model/MTabCustomization.java
    @@ -1,3 +1,27 @@
    +/***********************************************************************
    + * 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:                                                       *
    + * - hengsin                         								   *
    + **********************************************************************/
     package org.adempiere.model;
     
     import java.sql.ResultSet;
    @@ -9,34 +33,44 @@ import org.compiere.util.Util;
     
     public class MTabCustomization extends X_AD_Tab_Customization {
         /**
    -	 * 
    +	 * generated serial id
     	 */
     	private static final long serialVersionUID = 7401493734354775112L;
     
     	/**
    -    * UUID based Constructor
    -    * @param ctx  Context
    -    * @param AD_Tab_Customization_UU  UUID key
    -    * @param trxName Transaction
    -    */
    +     * UUID based Constructor
    +     * @param ctx  Context
    +     * @param AD_Tab_Customization_UU  UUID key
    +     * @param trxName Transaction
    +     */
         public MTabCustomization(Properties ctx, String AD_Tab_Customization_UU, String trxName) {
             super(ctx, AD_Tab_Customization_UU, trxName);
         }
    -
    +
    +    /**
    +     * @param ctx
    +     * @param AD_Tab_Customization_ID
    +     * @param trxName
    +     */
     	public MTabCustomization(Properties ctx, int AD_Tab_Customization_ID, String trxName) {
     		super(ctx, AD_Tab_Customization_ID, trxName);
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param rs
    +	 * @param trxName
    +	 */
     	public MTabCustomization(Properties ctx, ResultSet rs, String trxName) {
     		super(ctx, rs, trxName);
     	}
     	
     	/**
    -	 * 
     	 * @param ctx
     	 * @param AD_User_ID
     	 * @param AD_Tab_ID
     	 * @param trxName
    +	 * @return MTabCustomization
     	 */
     	public static MTabCustomization get(Properties ctx, int AD_User_ID, int AD_Tab_ID, String trxName) {
     		return get(ctx, AD_User_ID, AD_Tab_ID, trxName, false);
    @@ -48,7 +82,7 @@ public class MTabCustomization extends X_AD_Tab_Customization {
     	 * @param AD_Tab_ID
     	 * @param trxName
     	 * @param isQuickForm
    -	 * @return
    +	 * @return MTabCustomization
     	 */
     	public static MTabCustomization get(Properties ctx, int AD_User_ID, int AD_Tab_ID, String trxName, boolean isQuickForm) {
     		Query query = new Query(ctx, Table_Name, "AD_User_ID=? AND AD_Tab_ID=? AND IsQuickForm=?", trxName);
    diff --git a/org.adempiere.base/src/org/adempiere/model/MWizardProcess.java b/org.adempiere.base/src/org/adempiere/model/MWizardProcess.java
    index 5829c881cb..1c609fc598 100644
    --- a/org.adempiere.base/src/org/adempiere/model/MWizardProcess.java
    +++ b/org.adempiere.base/src/org/adempiere/model/MWizardProcess.java
    @@ -23,34 +23,44 @@ import org.compiere.model.X_AD_WizardProcess;
     
     public class MWizardProcess extends X_AD_WizardProcess {
     	/**
    -	 * 
    +	 * generated serial id
     	 */
     	private static final long serialVersionUID = -7713151820360928310L;
     
         /**
    -    * UUID based Constructor
    -    * @param ctx  Context
    -    * @param AD_WizardProcess_UU  UUID key
    -    * @param trxName Transaction
    -    */
    +     * UUID based Constructor
    +     * @param ctx  Context
    +     * @param AD_WizardProcess_UU  UUID key
    +     * @param trxName Transaction
    +     */
         public MWizardProcess(Properties ctx, String AD_WizardProcess_UU, String trxName) {
             super(ctx, AD_WizardProcess_UU, trxName);
         }
    -
    +
    +    /**
    +     * @param ctx
    +     * @param AD_WizardProcess_ID
    +     * @param trxName
    +     */
     	public MWizardProcess(Properties ctx, int AD_WizardProcess_ID, String trxName) {
     		super(ctx, AD_WizardProcess_ID, trxName);
     	}
     
    +	/**
    +	 * @param ctx
    +	 * @param rs
    +	 * @param trxName
    +	 */
     	public MWizardProcess(Properties ctx, ResultSet rs, String trxName) {
     		super(ctx, rs, trxName);
     	}
     	
     	/**
    -	 * Get the wizard notes for a node in the context client
    +	 * Get the wizard process for a workflow node in the context client
     	 * @param ctx
     	 * @param AD_WF_Node_ID
     	 * @param AD_Client_ID
    -	 * @return
    +	 * @return MWizardProcess
     	 */
     	public static MWizardProcess get(Properties ctx, int AD_WF_Node_ID, int AD_Client_ID) {
     		Query query = new Query(ctx, Table_Name, "AD_WF_Node_ID=? AND AD_Client_ID=?", null);
    diff --git a/org.adempiere.base/src/org/adempiere/model/MWlistboxCustomization.java b/org.adempiere.base/src/org/adempiere/model/MWlistboxCustomization.java
    index 7f82f1d24a..b910943ea4 100644
    --- a/org.adempiere.base/src/org/adempiere/model/MWlistboxCustomization.java
    +++ b/org.adempiere.base/src/org/adempiere/model/MWlistboxCustomization.java
    @@ -30,16 +30,16 @@ import org.compiere.util.Util;
     public class MWlistboxCustomization extends X_AD_Wlistbox_Customization {
     
     	/**
    -	 * 
    +	 * generated serial id
     	 */
     	private static final long serialVersionUID = -493650011622455985L;
     
         /**
    -    * UUID based Constructor
    -    * @param ctx  Context
    -    * @param AD_Wlistbox_Customization_UU  UUID key
    -    * @param trxName Transaction
    -    */
    +     * UUID based Constructor
    +     * @param ctx  Context
    +     * @param AD_Wlistbox_Customization_UU  UUID key
    +     * @param trxName Transaction
    +     */
         public MWlistboxCustomization(Properties ctx, String AD_Wlistbox_Customization_UU, String trxName) {
             super(ctx, AD_Wlistbox_Customization_UU, trxName);
         }
    @@ -78,7 +78,11 @@ public class MWlistboxCustomization extends X_AD_Wlistbox_Customization {
     		return query.setClient_ID().setOnlyActiveRecords(true).setParameters(new Object[] { AD_User_ID, AD_WListboxName}).first();
     	}
     
    -
    +	/**
    +	 * For each string element, remove the part starting from '='
    +	 * @param CustomizationNew
    +	 * @return modify list of string
    +	 */
     	private static List cleanCustomization (String[] CustomizationNew)
     	{
     		for (int i = 0; i < CustomizationNew.length; i++ )
    @@ -88,6 +92,11 @@ public class MWlistboxCustomization extends X_AD_Wlistbox_Customization {
     		return Arrays.asList(CustomizationNew); 
     	}	
     
    +	/**
    +	 * @param searchColumnName
    +	 * @param columnList
    +	 * @return matched index in columnList or -1 if no match found
    +	 */
     	private static int columnIndex(String 				searchColumnName, 
     								   List 	    columnList)
     	{
    @@ -98,11 +107,11 @@ public class MWlistboxCustomization extends X_AD_Wlistbox_Customization {
     				return i;
     			}
     		}
    -	return -1;
    +		return -1;
     	}
     
     	/**
    -	 * Save the columnWidth of the columns of the WListBox 
    +	 * Save columnWidth of WListBox columns to AD_Wlistbox_Customization  
     	 * @param ctx
     	 * @param AD_WListboxName
     	 * @param AD_User_ID
    diff --git a/org.adempiere.base/src/org/adempiere/model/POWrapper.java b/org.adempiere.base/src/org/adempiere/model/POWrapper.java
    index 9349522d98..70dcd495d3 100644
    --- a/org.adempiere.base/src/org/adempiere/model/POWrapper.java
    +++ b/org.adempiere.base/src/org/adempiere/model/POWrapper.java
    @@ -25,7 +25,7 @@ import org.compiere.model.PO;
     import org.compiere.util.CLogger;
     
     /**
    - * Wrap a PO object to a given bean interface.
    + * Wrap a PO object to a given interface.
      * Example
      * 
      * public interface I_C_Invoice_Customized
    @@ -46,6 +46,13 @@ import org.compiere.util.CLogger;
      */
     public class POWrapper implements InvocationHandler
     {
    +	/**
    +	 * Create wrapper of type cl for po
    +	 * @param 
    +	 * @param po
    +	 * @param cl interface class
    +	 * @return POWrapper instance
    +	 */
     	@SuppressWarnings("unchecked")
     	public static  T create(Object po, Class cl)
     	{
    @@ -60,6 +67,11 @@ public class POWrapper implements InvocationHandler
     		return (T)Proxy.newProxyInstance(cl.getClassLoader(), new Class[]{cl}, new POWrapper((PO)po));
     	}
     	
    +	/**
    +	 * @param 
    +	 * @param model
    +	 * @return the wrapped PO
    +	 */
     	@SuppressWarnings("unchecked")
     	public static  T getPO(Object model)
     	{
    @@ -70,12 +82,17 @@ public class POWrapper implements InvocationHandler
     	private static final CLogger log = CLogger.getCLogger(POWrapper.class);
     	private final PO po;
     	
    +	/**
    +	 * Private constructor. Use the static create method to create a new instance of POWrapper.
    +	 * @param po
    +	 */
     	private POWrapper(PO po)
     	{
     		super();
     		this.po = po;
     	}
     
    +	@Override
     	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
     	{
     		String methodName = method.getName();
    @@ -137,13 +154,16 @@ public class POWrapper implements InvocationHandler
     		}
     	}
     	
    +	/**
    +	 * @return wrapped PO instance
    +	 */
     	public PO getPO()
     	{
     		return po;
     	}
     	
     	/**
    -	 * Load object that is referenced by given property.
    +	 * Load object that is referenced by given property.
    * Example: getReferencedObject("M_Product", method) should load the M_Product record * with ID given by M_Product_ID property name; * @param propertyName @@ -180,6 +200,10 @@ public class POWrapper implements InvocationHandler return child; } + /** + * @param cl + * @return true if cl is a model interface (for e.g I_C_Order) type + */ private boolean isModelInterface(Class cl) { try diff --git a/org.adempiere.base/src/org/adempiere/model/ProductPriceValidator.java b/org.adempiere.base/src/org/adempiere/model/ProductPriceValidator.java index ea67e43daf..6f1920a112 100644 --- a/org.adempiere.base/src/org/adempiere/model/ProductPriceValidator.java +++ b/org.adempiere.base/src/org/adempiere/model/ProductPriceValidator.java @@ -30,7 +30,7 @@ import org.compiere.util.DB; import org.compiere.util.Env; /** - * Auto sync corresponding price list with the price list schema and base price list. + * Model validator to sync corresponding price list with the price list schema and base price list. * @author Elaine * */ @@ -39,20 +39,25 @@ public class ProductPriceValidator implements ModelValidator { private static final CLogger log = CLogger.getCLogger(ProductPriceValidator.class); private int m_AD_Client_ID; + @Override public int getAD_Client_ID() { return m_AD_Client_ID; } + @Override public void initialize(ModelValidationEngine engine, MClient client) { engine.addModelChange(MProductPrice.Table_Name, this); if (client != null) m_AD_Client_ID = client.getAD_Client_ID(); } + + @Override public String login(int AD_Org_ID, int AD_Role_ID, int AD_User_ID) { return null; } + @Override public String modelChange(PO po, int type) throws Exception { if (po instanceof MProductPrice) { if (type == TYPE_AFTER_CHANGE || type == TYPE_AFTER_NEW || type == TYPE_AFTER_DELETE) { @@ -134,6 +139,7 @@ public class ProductPriceValidator implements ModelValidator { return null; } + @Override public String docValidate(PO po, int timing) { return null; } diff --git a/org.adempiere.base/src/org/adempiere/model/PromotionRule.java b/org.adempiere.base/src/org/adempiere/model/PromotionRule.java index 6c059095f7..33c848e31f 100644 --- a/org.adempiere.base/src/org/adempiere/model/PromotionRule.java +++ b/org.adempiere.base/src/org/adempiere/model/PromotionRule.java @@ -42,12 +42,17 @@ import org.compiere.util.DB; import org.compiere.util.Env; /** - * + * Static helper methods for promotion rule (M_Promotion) * @author hengsin * */ public class PromotionRule { + /** + * Apply promotion rules to order + * @param order + * @throws Exception + */ public static void applyPromotions(MOrder order) throws Exception { //key = C_OrderLine, value = Qty to distribution Map orderLineQty = new LinkedHashMap(); @@ -288,6 +293,16 @@ public class PromotionRule { } } + /** + * Add discount line (order line with charge) + * @param order + * @param ol + * @param discount + * @param qty + * @param C_Charge_ID + * @param promotion + * @throws Exception + */ private static void addDiscountLine(MOrder order, MOrderLine ol, BigDecimal discount, BigDecimal qty, int C_Charge_ID, I_M_Promotion promotion) throws Exception { MOrderLine nol = new MOrderLine(order.getCtx(), 0, order.get_TrxName()); @@ -322,7 +337,7 @@ public class PromotionRule { } /** - * + * Find applicable promotion rules. * @param order * @return Map> * @throws Exception @@ -403,7 +418,7 @@ public class PromotionRule { } /** - * + * Calculate distribution quantity for order lines * @param distribution * @param prevSet * @param orderLineQty @@ -534,7 +549,6 @@ public class PromotionRule { } /** - * * @param promotion_ID * @param order * @return List @@ -600,15 +614,23 @@ public class PromotionRule { return applicable; } - static class DistributionSet { + protected static class DistributionSet { // Map orderLines = new LinkedHashMap(); BigDecimal setQty = BigDecimal.ZERO; } - static class OrderLineComparator implements Comparator { - Map index; - OrderLineComparator(Map olIndex) { + /** + * Price actual comparator for order line + */ + protected static class OrderLineComparator implements Comparator { + /** C_OrderLine_ID:MOrderLine */ + protected Map index; + + /** + * @param olIndex order lines + */ + protected OrderLineComparator(Map olIndex) { index = olIndex; } diff --git a/org.adempiere.base/src/org/adempiere/model/PromotionValidator.java b/org.adempiere.base/src/org/adempiere/model/PromotionValidator.java index abdc69ae9d..89e0fd9e0a 100644 --- a/org.adempiere.base/src/org/adempiere/model/PromotionValidator.java +++ b/org.adempiere.base/src/org/adempiere/model/PromotionValidator.java @@ -33,6 +33,7 @@ public class PromotionValidator implements ModelValidator { private int m_AD_Client_ID; + @Override public String docValidate(PO po, int timing) { if (po instanceof MOrder ) { if (timing == TIMING_AFTER_PREPARE) { @@ -57,6 +58,10 @@ public class PromotionValidator implements ModelValidator { return null; } + /** + * Increase M_PromotionPreCondition.PromotionCounter value + * @param order + */ private void increasePromotionCounter(MOrder order) { MOrderLine[] lines = order.getLines(false, null); String promotionCode = (String)order.get_Value("PromotionCode"); @@ -76,6 +81,10 @@ public class PromotionValidator implements ModelValidator { } } + /** + * Decrease M_PromotionPreCondition.PromotionCounter value + * @param order + */ private void decreasePromotionCounter(MOrder order) { MOrderLine[] lines = order.getLines(false, null); String promotionCode = (String)order.get_Value("PromotionCode"); @@ -95,6 +104,12 @@ public class PromotionValidator implements ModelValidator { } } + /** + * @param order + * @param promotionCode + * @param promotionID + * @return M_PromotionPreCondition_ID + */ private int findPromotionPreConditionId(MOrder order, String promotionCode, Integer promotionID) { String bpFilter = "M_PromotionPreCondition.C_BPartner_ID = ? OR M_PromotionPreCondition.C_BP_Group_ID = ? OR (M_PromotionPreCondition.C_BPartner_ID IS NULL AND M_PromotionPreCondition.C_BP_Group_ID IS NULL)"; @@ -135,10 +150,12 @@ public class PromotionValidator implements ModelValidator { return M_PromotionPreCondition_ID; } + @Override public int getAD_Client_ID() { return m_AD_Client_ID; } + @Override public void initialize(ModelValidationEngine engine, MClient client) { if (client != null) m_AD_Client_ID = client.getAD_Client_ID(); @@ -147,10 +164,12 @@ public class PromotionValidator implements ModelValidator { } + @Override public String login(int AD_Org_ID, int AD_Role_ID, int AD_User_ID) { return null; } + @Override public String modelChange(PO po, int type) throws Exception { if (po instanceof MOrderLine) { if (type == TYPE_AFTER_DELETE) { diff --git a/org.adempiere.base/src/org/adempiere/model/ShippingPackage.java b/org.adempiere.base/src/org/adempiere/model/ShippingPackage.java index 7d642151e1..8b56d141d4 100644 --- a/org.adempiere.base/src/org/adempiere/model/ShippingPackage.java +++ b/org.adempiere.base/src/org/adempiere/model/ShippingPackage.java @@ -28,42 +28,76 @@ public class ShippingPackage private BigDecimal width; private String description; + /** + * @return package weight + */ public BigDecimal getWeight() { return weight; } + /** + * Set package weight + * @param weight + */ public void setWeight(BigDecimal weight) { this.weight = weight; } + /** + * @return package height + */ public BigDecimal getHeight() { return height; } + /** + * Set package height + * @param height + */ public void setHeight(BigDecimal height) { this.height = height; } + /** + * @return package length + */ public BigDecimal getLength() { return length; } + /** + * Set package length + * @param length + */ public void setLength(BigDecimal length) { this.length = length; } + /** + * @return package width + */ public BigDecimal getWidth() { return width; } + /** + * Set package width + * @param width + */ public void setWidth(BigDecimal width) { this.width = width; } + /** + * @return description + */ public String getDescription() { return description; } + /** + * @param description + */ public void setDescription(String description) { this.description = description; } diff --git a/org.adempiere.base/src/org/adempiere/model/ZoomInfoFactory.java b/org.adempiere.base/src/org/adempiere/model/ZoomInfoFactory.java index 028ee145a3..0e5081132d 100644 --- a/org.adempiere.base/src/org/adempiere/model/ZoomInfoFactory.java +++ b/org.adempiere.base/src/org/adempiere/model/ZoomInfoFactory.java @@ -70,7 +70,7 @@ public class ZoomInfoFactory { /** * Adds {@link ZoomInfo} instances from {@link MRelationType}s and * {@link GenericZoomProvider}. - * + *

    * First it looks for matching {@link MRelationType} instances and adds * their {@link MRelationType#retrieveZoomInfos(PO)} results. Then it adds * the {@link GenericZoomProvider}'s results unless there is already one @@ -79,7 +79,7 @@ public class ZoomInfoFactory { * * @param po * @param windowID - * @return + * @return matching zoom info records */ public static List retrieveZoomInfos(final PO po, final int windowID) { diff --git a/org.adempiere.base/src/org/adempiere/pdf/Document.java b/org.adempiere.base/src/org/adempiere/pdf/Document.java index 2612bd7c25..33639da702 100644 --- a/org.adempiere.base/src/org/adempiere/pdf/Document.java +++ b/org.adempiere.base/src/org/adempiere/pdf/Document.java @@ -33,7 +33,7 @@ import com.lowagie.text.pdf.PdfTemplate; import com.lowagie.text.pdf.PdfWriter; /** - * Generate PDF document using iText + * Generate PDF document using iText (openpdf) * @author Low Heng Sin * */ @@ -43,6 +43,11 @@ public class Document { FontFactory.registerDirectories(); } + /** + * write pageable to output + * @param pageable + * @param output + */ private static void writePDF(Pageable pageable, OutputStream output) { try { @@ -92,6 +97,12 @@ public class Document { } } + /** + * Create pdf file from pageable + * @param filename + * @param pageable + * @return pdf file + */ public static File getPDFAsFile(String filename, Pageable pageable) { final File result = new File(filename); @@ -104,6 +115,11 @@ public class Document { return result; } + /** + * Create byte[] pdf content from pageable + * @param pageable + * @return pdf content + */ public static byte[] getPDFAsArray(Pageable pageable) { try { ByteArrayOutputStream output = new ByteArrayOutputStream(10240); @@ -116,10 +132,17 @@ public class Document { return null; } + /** + * @param layout + * @return nop, always return true + */ public static boolean isValid(Pageable layout) { return true; } + /** + * @return nop, always return true + */ public static boolean isLicensed() { return true; } diff --git a/org.adempiere.base/src/org/adempiere/print/export/PrintDataExcelExporter.java b/org.adempiere.base/src/org/adempiere/print/export/PrintDataExcelExporter.java index d5374db1d9..10c7845967 100644 --- a/org.adempiere.base/src/org/adempiere/print/export/PrintDataExcelExporter.java +++ b/org.adempiere.base/src/org/adempiere/print/export/PrintDataExcelExporter.java @@ -73,14 +73,31 @@ extends AbstractExcelExporter private int m_previousFormCol = -1; private String m_previousAreaType = null; + /** + * @param printData + * @param printFormat + */ public PrintDataExcelExporter(PrintData printData, MPrintFormat printFormat) { this(printData, printFormat, null, null); } + /** + * @param printData + * @param printFormat + * @param childPrintFormatDetails + * @param colSuppressRepeats + */ public PrintDataExcelExporter(PrintData printData, MPrintFormat printFormat, Map childPrintFormatDetails, Boolean[] colSuppressRepeats) { this(printData, printFormat, childPrintFormatDetails, colSuppressRepeats, null); } + /** + * @param printData + * @param printFormat + * @param childPrintFormatDetails + * @param colSuppressRepeats + * @param query + */ public PrintDataExcelExporter(PrintData printData, MPrintFormat printFormat, Map childPrintFormatDetails, Boolean[] colSuppressRepeats, MQuery query) { super(); this.m_printData = printData; @@ -95,6 +112,11 @@ extends AbstractExcelExporter return columns.size(); } + /** + * @param row + * @param col + * @return PrintDataElement for row and col or null + */ private PrintDataElement getPDE(int row, int col) { if (m_printData.getRowIndex() != row) m_printData.setRowIndex(row); @@ -123,6 +145,7 @@ extends AbstractExcelExporter } return null; } + @Override public int getDisplayType(int row, int col) { PrintDataElement pde = getPDE(row, col); @@ -236,6 +259,7 @@ extends AbstractExcelExporter m_printData.setRowIndex(row); } + @Override protected int getCurrentRow() { return m_printData.getRowIndex(); } diff --git a/org.adempiere.base/src/org/adempiere/print/export/PrintDataXLSXExporter.java b/org.adempiere.base/src/org/adempiere/print/export/PrintDataXLSXExporter.java index ef9f71d5de..1ed29b8b79 100644 --- a/org.adempiere.base/src/org/adempiere/print/export/PrintDataXLSXExporter.java +++ b/org.adempiere.base/src/org/adempiere/print/export/PrintDataXLSXExporter.java @@ -70,16 +70,32 @@ public class PrintDataXLSXExporter extends AbstractXLSXExporter private int m_previousFormCol = -1; private String m_previousAreaType = null; + /** + * @param printData + * @param printFormat + */ public PrintDataXLSXExporter(PrintData printData, MPrintFormat printFormat) { this(printData, printFormat, null); } + /** + * @param printData + * @param printFormat + * @param colSuppressRepeats + */ public PrintDataXLSXExporter(PrintData printData, MPrintFormat printFormat, Boolean[] colSuppressRepeats) { this(printData, printFormat, null, colSuppressRepeats, null); } + /** + * @param printData + * @param printFormat + * @param childPrintFormatDetails + * @param colSuppressRepeats + * @param query + */ public PrintDataXLSXExporter(PrintData printData, MPrintFormat printFormat, Map childPrintFormatDetails, Boolean[] colSuppressRepeats, MQuery query) { super(); @@ -96,6 +112,11 @@ public class PrintDataXLSXExporter extends AbstractXLSXExporter return columns.size(); } + /** + * @param row + * @param col + * @return PrintDataElement for row and col or null + */ private PrintDataElement getPDE(int row, int col) { if (m_printData.getRowIndex() != row) @@ -255,6 +276,7 @@ public class PrintDataXLSXExporter extends AbstractXLSXExporter m_printData.setRowIndex(row); } + @Override protected int getCurrentRow() { return m_printData.getRowIndex(); diff --git a/org.adempiere.base/src/org/adempiere/process/DepositBatchClose.java b/org.adempiere.base/src/org/adempiere/process/DepositBatchClose.java index d29389eea7..0e3634676e 100644 --- a/org.adempiere.base/src/org/adempiere/process/DepositBatchClose.java +++ b/org.adempiere.base/src/org/adempiere/process/DepositBatchClose.java @@ -36,7 +36,7 @@ import org.compiere.process.ProcessInfoParameter; import org.compiere.process.SvrProcess; /** - * Close Deposit Batch. + * Close Deposit Batch (set processed to Y) * * @author Alejandro Falcone * @version $Id: DepositBatchClose.java,v 1.2 2007/07/03 00:51:01 afalcone Exp $ @@ -50,6 +50,7 @@ public class DepositBatchClose extends SvrProcess /** * Prepare - e.g., get Parameters. */ + @Override protected void prepare() { ProcessInfoParameter[] para = getParameter(); @@ -68,6 +69,7 @@ public class DepositBatchClose extends SvrProcess * @return Message (translated text) * @throws Exception if not successful */ + @Override protected String doIt() throws Exception { MDepositBatch depositbatch = new MDepositBatch (getCtx(), m_C_DepositBatch_ID, get_TrxName()); diff --git a/org.adempiere.base/src/org/adempiere/process/Fill1099Extract.java b/org.adempiere.base/src/org/adempiere/process/Fill1099Extract.java index f6924663cd..5939ca0b5b 100644 --- a/org.adempiere.base/src/org/adempiere/process/Fill1099Extract.java +++ b/org.adempiere.base/src/org/adempiere/process/Fill1099Extract.java @@ -25,7 +25,7 @@ import org.compiere.process.SvrProcess; import org.compiere.util.*; /** - * Fill 1099 Extract + * Fill 1099 Extract (T_1099EXTRACT) with data from bpartner, bpartner location and invoices. * @author Carlos Ruiz * @version $Id: Fill1099Extract.java */ @@ -37,6 +37,7 @@ public class Fill1099Extract extends SvrProcess /** * Prepare - e.g., get Parameters. */ + @Override protected void prepare() { ProcessInfoParameter[] para = getParameter(); @@ -59,6 +60,7 @@ public class Fill1099Extract extends SvrProcess * @return Message * @throws Exception */ + @Override protected String doIt() throws Exception { if (log.isLoggable(Level.INFO)) log.info("CUT_DATE=" + p_Cut_Date); @@ -95,8 +97,8 @@ public class Fill1099Extract extends SvrProcess sql.append("get1099bucket (bp.c_bpartner_id, ?, 14), "); sql.append("get1099bucket (bp.c_bpartner_id, ?, 15), "); sql.append("get1099bucket (bp.c_bpartner_id, ?, 16) "); - sql.append("FROM c_bpartner bp, c_bpartner_location bpl "); //Yvonne: added C_BPARTNER_LOCATION bpl - sql.append("WHERE bp.c_bpartner_id = bpl.c_bpartner_id "); //Yvonne: added + sql.append("FROM c_bpartner bp, c_bpartner_location bpl "); + sql.append("WHERE bp.c_bpartner_id = bpl.c_bpartner_id "); sql.append("AND bp.isactive = 'Y' "); sql.append("AND bp.ad_client_id = ? "); sql.append("AND bp.isvendor = 'Y' "); diff --git a/org.adempiere.base/src/org/adempiere/process/IPrintShippingLabel.java b/org.adempiere.base/src/org/adempiere/process/IPrintShippingLabel.java index e1a6db2e94..11b2f1c291 100644 --- a/org.adempiere.base/src/org/adempiere/process/IPrintShippingLabel.java +++ b/org.adempiere.base/src/org/adempiere/process/IPrintShippingLabel.java @@ -1,12 +1,51 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.adempiere.process; import org.compiere.model.MAttachment; import org.compiere.model.MShipperLabels; +/** + * Interface for label printing service + */ public interface IPrintShippingLabel { + /** + * Print to label printer + * @param attachment + * @param labelType + * @return error message or null + * @throws Exception + */ public String printToLabelPrinter(MAttachment attachment, MShipperLabels labelType) throws Exception; + /** + * Print image type label + * @param attachment + * @param labelType + * @param title + * @return error message or null + * @throws Exception + */ public String printImageLabel(MAttachment attachment, MShipperLabels labelType, String title) throws Exception; } \ No newline at end of file diff --git a/org.adempiere.base/src/org/adempiere/process/ImportProcess.java b/org.adempiere.base/src/org/adempiere/process/ImportProcess.java index e3ab2dc841..7e17b1a2ef 100644 --- a/org.adempiere.base/src/org/adempiere/process/ImportProcess.java +++ b/org.adempiere.base/src/org/adempiere/process/ImportProcess.java @@ -1,6 +1,24 @@ -/** - * - */ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.adempiere.process; import java.util.Properties; diff --git a/org.adempiere.base/src/org/adempiere/process/PrintShippingLabel.java b/org.adempiere.base/src/org/adempiere/process/PrintShippingLabel.java index 0277b1be6d..d32a084a26 100644 --- a/org.adempiere.base/src/org/adempiere/process/PrintShippingLabel.java +++ b/org.adempiere.base/src/org/adempiere/process/PrintShippingLabel.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.adempiere.process; import org.adempiere.base.IServiceReferenceHolder; diff --git a/org.adempiere.base/src/org/adempiere/process/RateInquiryProcess.java b/org.adempiere.base/src/org/adempiere/process/RateInquiryProcess.java index d9dbe6b236..4b426bd947 100644 --- a/org.adempiere.base/src/org/adempiere/process/RateInquiryProcess.java +++ b/org.adempiere.base/src/org/adempiere/process/RateInquiryProcess.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.adempiere.process; import java.sql.Timestamp; @@ -9,6 +30,9 @@ import org.compiere.process.ProcessInfoLog; import org.compiere.process.ProcessInfoParameter; import org.compiere.process.SvrProcess; +/** + * Shipping rate inquiry for shipment package (M_Package) + */ @org.adempiere.base.annotation.Process public class RateInquiryProcess extends SvrProcess { diff --git a/org.adempiere.base/src/org/adempiere/process/RecreateStorageReservation.java b/org.adempiere.base/src/org/adempiere/process/RecreateStorageReservation.java index 407a28762c..149465a4ec 100644 --- a/org.adempiere.base/src/org/adempiere/process/RecreateStorageReservation.java +++ b/org.adempiere.base/src/org/adempiere/process/RecreateStorageReservation.java @@ -17,6 +17,10 @@ import org.compiere.process.SvrProcess; import org.compiere.util.DB; import org.compiere.util.Env; +/** + * Re-create storage reservation records (M_StorageReservation) if there are storage record with invalid reserverd/ordered qty.
    + * Precautions: current code validate reservation makes via C_OrderLine only. + */ @org.adempiere.base.annotation.Process public class RecreateStorageReservation extends SvrProcess { diff --git a/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java b/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java index 1d227c8d8f..b1fe547ac3 100644 --- a/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java +++ b/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.adempiere.process; import org.adempiere.exceptions.AdempiereException; @@ -10,6 +31,9 @@ import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.Msg; +/** + * Unlock locked user account + */ @org.adempiere.base.annotation.Process public class ResetLockedAccount extends SvrProcess { diff --git a/org.adempiere.base/src/org/adempiere/process/SalesOrderRateInquiryProcess.java b/org.adempiere.base/src/org/adempiere/process/SalesOrderRateInquiryProcess.java index 856c9232a9..84120ffb7f 100644 --- a/org.adempiere.base/src/org/adempiere/process/SalesOrderRateInquiryProcess.java +++ b/org.adempiere.base/src/org/adempiere/process/SalesOrderRateInquiryProcess.java @@ -45,7 +45,7 @@ import org.compiere.process.SvrProcess; import org.compiere.util.DisplayType; /** - * + * Shipping rate inquiry for sales order * @author Elaine * */ @@ -188,6 +188,15 @@ public class SalesOrderRateInquiryProcess extends SvrProcess return "@OK@"; } + /** + * Create MShippingTransaction record for order. + * @param ctx + * @param m_order + * @param action + * @param isPriviledgedRate + * @param trxName + * @return MShippingTransaction + */ public static MShippingTransaction createShippingTransaction(Properties ctx, MOrder m_order, String action, boolean isPriviledgedRate, String trxName) { MShipper shipper = new MShipper(ctx, m_order.getM_Shipper_ID(), trxName); diff --git a/org.adempiere.base/src/org/adempiere/process/ShipperCopyFrom.java b/org.adempiere.base/src/org/adempiere/process/ShipperCopyFrom.java index c0f5d310ff..6e993dd9a0 100644 --- a/org.adempiere.base/src/org/adempiere/process/ShipperCopyFrom.java +++ b/org.adempiere.base/src/org/adempiere/process/ShipperCopyFrom.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.adempiere.process; import java.math.BigDecimal; @@ -11,6 +32,9 @@ import org.compiere.model.X_M_ShipperPickupTypesCfg; import org.compiere.process.ProcessInfoParameter; import org.compiere.process.SvrProcess; +/** + * Process to copy shipping configuration records from another M_ShipperCfg record. + */ @org.adempiere.base.annotation.Process public class ShipperCopyFrom extends SvrProcess { @@ -49,6 +73,10 @@ public class ShipperCopyFrom extends SvrProcess return "OK"; } + /** + * Copy M_ShipperPackagingCfg records + * @param To_M_ShipperCfg_ID + */ private void createShipperPackaging(int To_M_ShipperCfg_ID) { StringBuilder whereClause = new StringBuilder(); @@ -75,6 +103,10 @@ public class ShipperCopyFrom extends SvrProcess } } + /** + * Copy M_ShipperLabelsCfg records + * @param To_M_ShipperCfg_ID + */ private void createShipperLabels(int To_M_ShipperCfg_ID) { StringBuilder whereClause = new StringBuilder(); @@ -103,6 +135,10 @@ public class ShipperCopyFrom extends SvrProcess } } + /** + * Copy M_ShipperPickupTypesCfg records + * @param To_M_ShipperCfg_ID + */ private void createShipperPickupTypes(int To_M_ShipperCfg_ID) { StringBuilder whereClause = new StringBuilder(); diff --git a/org.adempiere.base/src/org/adempiere/process/ShipperCreateFrom.java b/org.adempiere.base/src/org/adempiere/process/ShipperCreateFrom.java index c2f513a7cb..a4fbdf084b 100644 --- a/org.adempiere.base/src/org/adempiere/process/ShipperCreateFrom.java +++ b/org.adempiere.base/src/org/adempiere/process/ShipperCreateFrom.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.adempiere.process; import org.compiere.model.MShipper; @@ -9,6 +30,9 @@ import org.compiere.model.X_M_ShipperPackagingCfg; import org.compiere.model.X_M_ShipperPickupTypesCfg; import org.compiere.process.SvrProcess; +/** + * Create shipper child records from M_ShipperCfg child records. + */ @org.adempiere.base.annotation.Process public class ShipperCreateFrom extends SvrProcess { @@ -30,6 +54,9 @@ public class ShipperCreateFrom extends SvrProcess return "OK"; } + /** + * Create M_ShipperPackaging records from M_ShipperPackagingCfg records. + */ private void createShipperPackaging() { StringBuilder whereClause = new StringBuilder(); @@ -54,6 +81,9 @@ public class ShipperCreateFrom extends SvrProcess } } + /** + * Create M_ShipperLabels records from M_ShipperLabelsCfg records. + */ private void createShipperLabels() { StringBuilder whereClause = new StringBuilder(); @@ -78,6 +108,9 @@ public class ShipperCreateFrom extends SvrProcess } } + /** + * Create M_ShipperPickupTypes records from M_ShipperPickupTypesCfg records. + */ private void createShipperPickupTypes() { StringBuilder whereClause = new StringBuilder(); diff --git a/org.adempiere.base/src/org/adempiere/process/UUIDGenerator.java b/org.adempiere.base/src/org/adempiere/process/UUIDGenerator.java index 98e12f4c16..9f9139a756 100644 --- a/org.adempiere.base/src/org/adempiere/process/UUIDGenerator.java +++ b/org.adempiere.base/src/org/adempiere/process/UUIDGenerator.java @@ -43,7 +43,7 @@ import org.compiere.util.Util; import org.compiere.util.ValueNamePair; /** - * Add UUID column (tableName_UU) to table and update existing records with new UUID. + * Add UUID column (tableName_UU) to table and update existing records with new UUID.
    * Warning: this process is only safe to run if it have exclusive access to database. * @author hengsin * @@ -173,6 +173,12 @@ public class UUIDGenerator extends SvrProcess { return msgreturn.toString(); } + /** + * Fill column with new uuid value (if it is null) + * @param column + * @param trxName + * @return message + */ public static String updateUUID(MColumn column, String trxName) { MTable table = (MTable) column.getAD_Table(); if (table.getTableName().startsWith("T_")) { @@ -273,6 +279,10 @@ public class UUIDGenerator extends SvrProcess { return msg; } + /** + * sync column with DB + * @param column + */ private void syncColumn(MColumn column) { // Find Column in Database Connection conn = null; diff --git a/org.adempiere.base/src/org/adempiere/process/VoidShipmentProcess.java b/org.adempiere.base/src/org/adempiere/process/VoidShipmentProcess.java index 65ce4ef13b..9bcd5294ef 100644 --- a/org.adempiere.base/src/org/adempiere/process/VoidShipmentProcess.java +++ b/org.adempiere.base/src/org/adempiere/process/VoidShipmentProcess.java @@ -25,7 +25,7 @@ import org.compiere.process.ProcessInfoParameter; import org.compiere.process.SvrProcess; /** - * + * Void online shipment package * @author Low Heng Sin * */ diff --git a/org.adempiere.base/src/org/adempiere/util/Callback.java b/org.adempiere.base/src/org/adempiere/util/Callback.java index 85c035e7c6..73f8043b8a 100644 --- a/org.adempiere.base/src/org/adempiere/util/Callback.java +++ b/org.adempiere.base/src/org/adempiere/util/Callback.java @@ -14,12 +14,16 @@ package org.adempiere.util; /** - * + * Interface for callback. * @author hengsin * * @param */ public interface Callback { + /** + * Handle callback + * @param result + */ public void onCallback(T result); } diff --git a/org.adempiere.base/src/org/adempiere/util/ContextRunnable.java b/org.adempiere.base/src/org/adempiere/util/ContextRunnable.java index 86ccf8a720..69a64f75f5 100644 --- a/org.adempiere.base/src/org/adempiere/util/ContextRunnable.java +++ b/org.adempiere.base/src/org/adempiere/util/ContextRunnable.java @@ -48,14 +48,14 @@ public abstract class ContextRunnable implements Runnable { } /** - * setup thread context + * setup thread local context */ protected void setup() { ServerContext.setCurrentInstance(context); } /** - * clean up thread context + * clean up thread local context */ protected void cleanup() { ServerContext.dispose(); diff --git a/org.adempiere.base/src/org/adempiere/util/DefaultReservationTracerFactory.java b/org.adempiere.base/src/org/adempiere/util/DefaultReservationTracerFactory.java index 424c0fc4f4..fe6d8ae9c5 100644 --- a/org.adempiere.base/src/org/adempiere/util/DefaultReservationTracerFactory.java +++ b/org.adempiere.base/src/org/adempiere/util/DefaultReservationTracerFactory.java @@ -25,9 +25,8 @@ package org.adempiere.util; /** - * + * Default {@link IReservationTracerFactory} implementation for core. * @author hengsin - * */ public class DefaultReservationTracerFactory implements IReservationTracerFactory { @@ -37,7 +36,7 @@ public class DefaultReservationTracerFactory implements IReservationTracerFactor } /** - * + * Get the global singleton IReservationTracerFactory instance. * @return {@link IReservationTracerFactory} */ public static IReservationTracerFactory getInstance() { diff --git a/org.adempiere.base/src/org/adempiere/util/GenerateModel.java b/org.adempiere.base/src/org/adempiere/util/GenerateModel.java index e12cd82f6d..0abc740ba7 100644 --- a/org.adempiere.base/src/org/adempiere/util/GenerateModel.java +++ b/org.adempiere.base/src/org/adempiere/util/GenerateModel.java @@ -38,7 +38,9 @@ import org.compiere.util.DB; * @author Teo Sarca, teo.sarca@gmail.com *

  • BF [ 3020640 ] GenerateModel is failing when we provide a list of tables * https://sourceforge.net/p/adempiere/bugs/2447/ + * @deprecated */ +@Deprecated(forRemoval = true, since = "11") public class GenerateModel { diff --git a/org.adempiere.base/src/org/adempiere/util/GenerateModelJPA.java b/org.adempiere.base/src/org/adempiere/util/GenerateModelJPA.java index ec722ef42f..c244d151fa 100755 --- a/org.adempiere.base/src/org/adempiere/util/GenerateModelJPA.java +++ b/org.adempiere.base/src/org/adempiere/util/GenerateModelJPA.java @@ -36,7 +36,9 @@ import org.compiere.util.Env; * * @author Jorg Janke, Victor Perez (JPA variation) * @version $Id$ + * @deprecated */ +@Deprecated(forRemoval = true, since = "11") public class GenerateModelJPA { /** diff --git a/org.adempiere.base/src/org/adempiere/util/GridRowCtx.java b/org.adempiere.base/src/org/adempiere/util/GridRowCtx.java index 8c2ad82f39..aa8bd7036e 100644 --- a/org.adempiere.base/src/org/adempiere/util/GridRowCtx.java +++ b/org.adempiere.base/src/org/adempiere/util/GridRowCtx.java @@ -28,7 +28,7 @@ public class GridRowCtx extends Properties implements Evaluatee { /** - * + * generated serial id */ private static final long serialVersionUID = 8163657930039348267L; @@ -37,11 +37,20 @@ implements Evaluatee private final int windowNo; private final int row; + /** + * @param ctx + * @param tab + */ public GridRowCtx(Properties ctx, GridTab tab) { this(ctx, tab, -1); } + /** + * @param ctx + * @param tab + * @param row + */ public GridRowCtx(Properties ctx, GridTab tab, int row) { super(); @@ -51,6 +60,11 @@ implements Evaluatee this.row = row; } + /** + * Get column name from context property + * @param key context property + * @return column name + */ private String getColumnName(Object key) { if (! (key instanceof String) ) @@ -104,6 +118,9 @@ implements Evaluatee return value.toString(); } + /** + * @return current row + */ private int getRow() { return row >= 0 ? row : gridTab.getCurrentRow(); } @@ -259,6 +276,7 @@ implements Evaluatee return oval == null ? null : oval.toString(); } + @Override public String get_ValueAsString(String variableName) { return Env.getContext (this, windowNo, variableName, true); diff --git a/org.adempiere.base/src/org/adempiere/util/ICalloutUI.java b/org.adempiere.base/src/org/adempiere/util/ICalloutUI.java index 6d4c06d1bf..4d33784451 100644 --- a/org.adempiere.base/src/org/adempiere/util/ICalloutUI.java +++ b/org.adempiere.base/src/org/adempiere/util/ICalloutUI.java @@ -25,10 +25,21 @@ import org.compiere.model.MLookup; */ public interface ICalloutUI { + /** + * ask for input from user + * @param message + * @param lookup + * @param displayType + * @param callback + */ default public void askForInput(String message, MLookup lookup, int displayType, Callback callback){ throw new RuntimeException("Not Implemented"); } + /** + * Set desktop reference + * @param desktop + */ public void setDesktop(Object desktop); } diff --git a/org.adempiere.base/src/org/adempiere/util/IProcessUI.java b/org.adempiere.base/src/org/adempiere/util/IProcessUI.java index b013b0d251..d67bd5db68 100644 --- a/org.adempiere.base/src/org/adempiere/util/IProcessUI.java +++ b/org.adempiere.base/src/org/adempiere/util/IProcessUI.java @@ -20,7 +20,7 @@ import org.compiere.model.MLookup; import org.compiere.process.ProcessInfo; /** - * + * Interface to provide server process access to UI * @author hengsin * */ @@ -80,10 +80,15 @@ public interface IProcessUI { */ public void ask(String message, Callback callback); + /** + * ask for input from user + * @param message + * @param callback + */ public void askForInput(String message, Callback callback); /** - * Prompt for user secret input. + * Prompt for secret input (for e.g password) from user. * * @param title * @param callback @@ -92,7 +97,7 @@ public interface IProcessUI { /** * Prompt user for input with a configurable DisplayType (String, Number, TableDir or Search) - * + *

    * Usage is the same from ask and askForInput methods with some additional parameters * * muriloht - devCoffee #3390 @@ -122,7 +127,7 @@ public interface IProcessUI { default public void showReports(List pdfList) { throw new RuntimeException(); -} + } /** * show an info window from inside a process with user defined parameters diff --git a/org.adempiere.base/src/org/adempiere/util/IReservationTracer.java b/org.adempiere.base/src/org/adempiere/util/IReservationTracer.java index 8d11c0c137..59c3813b42 100644 --- a/org.adempiere.base/src/org/adempiere/util/IReservationTracer.java +++ b/org.adempiere.base/src/org/adempiere/util/IReservationTracer.java @@ -27,13 +27,13 @@ package org.adempiere.util; import java.math.BigDecimal; /** + * Interface to trace changes to quantity reserved/ordered * @author hengsin - * */ public interface IReservationTracer { /** - * + * trace quantity changes * @param originalQty * @param diffQty */ diff --git a/org.adempiere.base/src/org/adempiere/util/IReservationTracerFactory.java b/org.adempiere.base/src/org/adempiere/util/IReservationTracerFactory.java index 9c24907113..1a46bf0878 100644 --- a/org.adempiere.base/src/org/adempiere/util/IReservationTracerFactory.java +++ b/org.adempiere.base/src/org/adempiere/util/IReservationTracerFactory.java @@ -25,14 +25,13 @@ package org.adempiere.util; /** - * + * Factory interface for {@link IReservationTracer} * @author hengsin - * */ public interface IReservationTracerFactory { /** - * + * new {@link IReservationTracer} instance * @param C_DocType_ID * @param documentNo * @param lineNo diff --git a/org.adempiere.base/src/org/adempiere/util/LogAuthFailure.java b/org.adempiere.base/src/org/adempiere/util/LogAuthFailure.java index cd2ad81af8..89cd2f1cc6 100644 --- a/org.adempiere.base/src/org/adempiere/util/LogAuthFailure.java +++ b/org.adempiere.base/src/org/adempiere/util/LogAuthFailure.java @@ -30,7 +30,9 @@ import org.compiere.util.CLogger; import org.compiere.util.DisplayType; import org.compiere.util.Ini; - +/** + * Log authentication failure + */ public class LogAuthFailure { private static FileOutputStream file = null; @@ -39,6 +41,9 @@ public class LogAuthFailure { /** Logger */ private static final CLogger log = CLogger.getCLogger(LogAuthFailure.class); + /** + * Default constructor + */ public LogAuthFailure() { String path = Ini.getAdempiereHome() + File.separator + "log"; @@ -54,6 +59,13 @@ public class LogAuthFailure { } } + /** + * Log authentication failure message + * @param clientIP + * @param context + * @param username + * @param msg + */ public void log(String clientIP, String context, String username, String msg) { try { SimpleDateFormat format = DisplayType.getTimestampFormat_Default(); diff --git a/org.adempiere.base/src/org/adempiere/util/MeasureInterface.java b/org.adempiere.base/src/org/adempiere/util/MeasureInterface.java index 015b0db702..7667bbc405 100755 --- a/org.adempiere.base/src/org/adempiere/util/MeasureInterface.java +++ b/org.adempiere.base/src/org/adempiere/util/MeasureInterface.java @@ -17,7 +17,7 @@ package org.adempiere.util; import java.math.BigDecimal; /** - * Custom Measure Interface + * Custom performance measurement interface * * @author victor.perez@e-evolution.com, www.e-evolution.com */ diff --git a/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java b/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java index 5b8ddad4b2..ecc2925554 100644 --- a/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java +++ b/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java @@ -46,7 +46,6 @@ import org.compiere.util.Util; /** * Generate Model Classes extending PO. - * Base class for CMP interface - will be extended to create byte code directly * * @author Jorg Janke * @version $Id: GenerateModel.java,v 1.42 2005/05/08 15:16:56 jjanke Exp $ @@ -602,7 +601,13 @@ public class ModelClassGenerator } // createColumnMethods - // ****** Set Comment ****** + /** + * Generate javadoc comment for Set methods. + * @param columnName + * @param propertyName + * @param description + * @param result + */ public void generateJavaSetComment(String columnName, String propertyName, String description, StringBuilder result) { result.append(NL) @@ -617,7 +622,12 @@ public class ModelClassGenerator result.append(NL).append("\t*/").append(NL); } - // ****** Get Comment ****** + /** + * Generate javadoc comment for Get methods + * @param propertyName + * @param description + * @param result + */ public void generateJavaGetComment(String propertyName, String description, StringBuilder result) { result.append(NL) @@ -802,7 +812,7 @@ public class ModelClassGenerator } // createValueNamePair - /************************************************************************** + /** * Write to file * @param sb string buffer * @param fileName file name @@ -845,6 +855,7 @@ public class ModelClassGenerator /** Import classes */ private Collection s_importClasses = new TreeSet(); + /** * Add class name to class import list * @param className @@ -860,6 +871,7 @@ public class ModelClassGenerator } s_importClasses.add(className); } + /** * Add class to class import list * @param cl @@ -872,6 +884,7 @@ public class ModelClassGenerator return; addImportClass(cl.getCanonicalName()); } + /** * Generate java imports * @param sb diff --git a/org.adempiere.base/src/org/adempiere/util/ModelGeneratorDialog.java b/org.adempiere.base/src/org/adempiere/util/ModelGeneratorDialog.java index bb7844e0e4..7c79804258 100644 --- a/org.adempiere.base/src/org/adempiere/util/ModelGeneratorDialog.java +++ b/org.adempiere.base/src/org/adempiere/util/ModelGeneratorDialog.java @@ -56,6 +56,9 @@ public class ModelGeneratorDialog extends JFrame implements ActionListener { private JTextField fEntityType; private JTextField fColumnEntityType; + /** + * Default constructor + */ public ModelGeneratorDialog() { super(); setTitle("Model Class Generator"); @@ -114,6 +117,12 @@ public class ModelGeneratorDialog extends JFrame implements ActionListener { bCancel.addActionListener(this); } + /** + * Create GridBagConstraints + * @param x + * @param y + * @return GridBagConstraints + */ private GridBagConstraints makeGbc(int x, int y) { GridBagConstraints gbc = new GridBagConstraints(); gbc.gridwidth = 1; diff --git a/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java b/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java index 118c158910..ad98df03a8 100644 --- a/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java +++ b/org.adempiere.base/src/org/adempiere/util/ModelInterfaceGenerator.java @@ -55,6 +55,7 @@ import org.compiere.util.Env; import org.compiere.util.Util; /** + * Generate interface class for model * @author Trifon Trifonov * @version $Id$ * @@ -80,7 +81,6 @@ import org.compiere.util.Util; */ public class ModelInterfaceGenerator { - private String packageName = ""; public static final String NL = "\n"; @@ -108,7 +108,6 @@ public class ModelInterfaceGenerator private static final CLogger log = CLogger.getCLogger(ModelInterfaceGenerator.class); /** - * * @param AD_Table_ID * @param directory * @param packageName @@ -377,7 +376,13 @@ public class ModelInterfaceGenerator return sb.toString(); } - // ****** Set/Get Comment ****** + /** + * Generate javadoc comment for methods. + * @param startOfComment + * @param propertyName + * @param description + * @param result + */ public void generateJavaComment(String startOfComment, String propertyName, String description, StringBuilder result) { result.append("\n") .append("\t/** ").append(startOfComment).append(" ") @@ -389,7 +394,7 @@ public class ModelInterfaceGenerator result.append("\t */\n"); } - /* + /** * Write to file * * @param sb string buffer @@ -431,6 +436,7 @@ public class ModelInterfaceGenerator /** Import classes */ private Collection s_importClasses = new TreeSet(); + /** * Add class name to class import list * @param className @@ -450,6 +456,7 @@ public class ModelInterfaceGenerator } s_importClasses.add(className); } + /** * Add class to class import list * @param cl @@ -462,6 +469,7 @@ public class ModelInterfaceGenerator return; addImportClass(cl.getCanonicalName()); } + /** * Generate java imports * @param sb @@ -473,7 +481,6 @@ public class ModelInterfaceGenerator sb.append(NL); } - /** * Get class for given display type and reference * @param displayType @@ -483,7 +490,6 @@ public class ModelInterfaceGenerator public static Class getClass(String columnName, int displayType, int AD_Reference_ID) { // Handle Posted - // TODO: hardcoded if (columnName.equalsIgnoreCase("Posted") || columnName.equalsIgnoreCase("Processed") || columnName.equalsIgnoreCase("Processing")) @@ -491,7 +497,6 @@ public class ModelInterfaceGenerator return Boolean.class; } // Record_ID - // TODO: hardcoded else if (columnName.equalsIgnoreCase("Record_ID")) { return Integer.class; @@ -543,6 +548,11 @@ public class ModelInterfaceGenerator } } + /** + * @param cl + * @param displayType + * @return Java data type name (without the package part) + */ public static String getDataTypeName(Class cl, int displayType) { String dataType = cl.getName(); @@ -587,7 +597,6 @@ public class ModelInterfaceGenerator } /** - * * @param AD_Table_ID * @param toEntityType * @return true if a model getter method (method that is returning referenced PO) should be generated @@ -611,7 +620,7 @@ public class ModelInterfaceGenerator * Get EntityType Model Package. * author Victor Perez - [ 1785001 ] Using ModelPackage of EntityType to Generate Model Class * @param entityType - * @return + * @return Java package name or null */ public static String getModelPackage(String entityType) { @@ -624,6 +633,10 @@ public class ModelInterfaceGenerator return null; } + /** + * @param columnName + * @return Java field name + */ public static String getFieldName(String columnName) { String fieldName; @@ -634,6 +647,13 @@ public class ModelInterfaceGenerator return fieldName; } + /** + * @param AD_Table_ID + * @param columnName + * @param displayType + * @param AD_Reference_ID + * @return Java class name or null + */ public static String getReferenceClassName(int AD_Table_ID, String columnName, int displayType, int AD_Reference_ID) { String referenceClassName = null; @@ -666,10 +686,10 @@ public class ModelInterfaceGenerator else if (displayType == DisplayType.Table || (displayType == DisplayType.Search && AD_Reference_ID > 0)) { - // TODO: HARDCODED: do not generate model getter for Fact_Acct.Account_ID + // do not generate model getter for Fact_Acct.Account_ID if (AD_Table_ID == 270 && columnName.equals("Account_ID")) return null; - // TODO: HARDCODED: do not generate model getter for GL_DistributionLine.Account_ID + // do not generate model getter for GL_DistributionLine.Account_ID if (AD_Table_ID == 707 && columnName.equals("Account_ID")) return null; // diff --git a/org.adempiere.base/src/org/adempiere/util/PaymentUtil.java b/org.adempiere.base/src/org/adempiere/util/PaymentUtil.java index aeb711bfdf..f66e1de9fc 100644 --- a/org.adempiere.base/src/org/adempiere/util/PaymentUtil.java +++ b/org.adempiere.base/src/org/adempiere/util/PaymentUtil.java @@ -28,14 +28,20 @@ import org.compiere.util.DB; import org.compiere.util.Env; /** - * + * Helper methods for payment processor * @author Elaine - * */ public class PaymentUtil { private static final CLogger logger = CLogger.getCLogger(PaymentUtil.class); + /** + * Get business partner bank account by credit card number and payment processor id. + * @param bpartner + * @param creditCardNo + * @param C_PaymentProcessor_ID + * @return list of matching MBPBankAccount records + */ public static MBPBankAccount[] getBankAccounts(MBPartner bpartner, String creditCardNo, int C_PaymentProcessor_ID) { ArrayList list = new ArrayList(); String sql = "SELECT * FROM C_BP_BankAccount WHERE C_BPartner_ID=? AND CreditCardNumber=? AND C_PaymentProcessor_ID = ? AND IsActive='Y' ORDER BY Created"; @@ -61,6 +67,11 @@ public class PaymentUtil { return m_accounts; } + /** + * Replace the front part of credit card number with 0, keeping the last 4 digit. + * @param value credit card number + * @return partially mask credit card number + */ public static String encrpytCreditCard(String value) { if (value == null) return ""; @@ -82,6 +93,11 @@ public class PaymentUtil { return encryptedCC.toString(); } + /** + * Replace credit card cvv with 0 + * @param creditCardVV + * @return string fill with just 0 + */ public static String encrpytCvv(String creditCardVV) { if (creditCardVV == null) return ""; @@ -97,6 +113,10 @@ public class PaymentUtil { } } + /** + * @param str + * @return true if str is a number + */ public static boolean isNumeric(String str) { if (str != null && str.length() > 0) { NumberFormat formatter = NumberFormat.getInstance(); @@ -108,6 +128,11 @@ public class PaymentUtil { return true; } + /** + * Convert payment amount from dollar to cents (i.e x100) + * @param payAmt + * @return amount in cents (truncated to int) + */ public static int getPayAmtInCents(BigDecimal payAmt) { if (payAmt == null) @@ -117,6 +142,13 @@ public class PaymentUtil { return bd.intValue(); } + /** + * Build credit card expire string + * @param creditCardExpMM Expire month + * @param creditCardExpYY Expire year + * @param delimiter delimiter character between month and year + * @return credit card expire string (for e.g 10/26) + */ public static String getCreditCardExp(int creditCardExpMM, int creditCardExpYY, String delimiter) { String mm = String.valueOf(creditCardExpMM); diff --git a/org.adempiere.base/src/org/adempiere/util/ProcessUtil.java b/org.adempiere.base/src/org/adempiere/util/ProcessUtil.java index 34f1e48882..4fb36b6491 100644 --- a/org.adempiere.base/src/org/adempiere/util/ProcessUtil.java +++ b/org.adempiere.base/src/org/adempiere/util/ProcessUtil.java @@ -45,7 +45,7 @@ import org.compiere.wf.MWFProcess; import org.compiere.wf.MWorkflow; /** - * + * Helper methods for server process * @author Low Heng Sin * @author Teo Sarca, SC ARHIPAC SERVICE SRL *

  • BF [ 1757523 ] Server Processes are using Server's context @@ -62,6 +62,7 @@ public final class ProcessUtil { private ProcessUtil() {} /** + * Start database store procedure * @param processInfo * @param ProcedureName * @param trx @@ -72,6 +73,7 @@ public final class ProcessUtil { } /** + * Start database store procedure * @param processInfo * @param ProcedureName * @param trx @@ -123,7 +125,7 @@ public final class ProcessUtil { * @param ctx * @param pi * @param trx - * @return boolean + * @return true if process completed successfully */ public static boolean startJavaProcess(Properties ctx, ProcessInfo pi, Trx trx) { return startJavaProcess(ctx, pi, trx, true); @@ -134,7 +136,7 @@ public final class ProcessUtil { * @param pi * @param trx * @param managedTrx false if trx is managed by caller - * @return boolean + * @return true if process completed successfully */ public static boolean startJavaProcess(Properties ctx, ProcessInfo pi, Trx trx, boolean managedTrx) { return startJavaProcess(ctx, pi, trx, managedTrx, null); @@ -145,7 +147,7 @@ public final class ProcessUtil { * @param pi * @param trx * @param managedTrx false if trx is managed by caller - * @return boolean + * @return true if process completed successfully */ public static boolean startJavaProcess(Properties ctx, ProcessInfo pi, Trx trx, boolean managedTrx, IProcessUI processMonitor) { String className = pi.getClassName(); @@ -198,6 +200,13 @@ public final class ProcessUtil { return success; } + /** + * Start process written in script (javascript, groovy, etc) + * @param ctx + * @param pi + * @param trx + * @return true if process completed successfully + */ public static boolean startScriptProcess(Properties ctx, ProcessInfo pi, Trx trx) { String msg = null; boolean success = true; @@ -314,6 +323,13 @@ public final class ProcessUtil { return success; } + /** + * Start workflow + * @param ctx + * @param pi + * @param AD_Workflow_ID + * @return MWFProcess + */ public static MWFProcess startWorkFlow(Properties ctx, ProcessInfo pi, int AD_Workflow_ID) { MWorkflow wf = MWorkflow.get (ctx, AD_Workflow_ID); MWFProcess wfProcess = wf.start(pi, pi.getTransactionName()); @@ -326,11 +342,10 @@ public final class ProcessUtil { * @param ctx * @param pi * @param trx - * @return + * @return true if process completed successfully */ public static boolean startJavaProcessWithoutTrxClose(Properties ctx, ProcessInfo pi, Trx trx) { return startJavaProcess(ctx, pi, trx, false); } - } \ No newline at end of file diff --git a/org.adempiere.base/src/org/adempiere/util/ReservationLogTracer.java b/org.adempiere.base/src/org/adempiere/util/ReservationLogTracer.java index 34ea07523f..746a9a7785 100644 --- a/org.adempiere.base/src/org/adempiere/util/ReservationLogTracer.java +++ b/org.adempiere.base/src/org/adempiere/util/ReservationLogTracer.java @@ -31,8 +31,8 @@ import org.compiere.model.MWarehouse; import org.compiere.util.Env; /** + * Default {@link IReservationTracer} implementation for core * @author hengsin - * */ public class ReservationLogTracer implements IReservationTracer { @@ -48,7 +48,6 @@ public class ReservationLogTracer implements IReservationTracer { private String trxName; /** - * * @param C_DocType_ID * @param documentNo * @param lineNo diff --git a/org.adempiere.base/src/org/adempiere/util/ServerContext.java b/org.adempiere.base/src/org/adempiere/util/ServerContext.java index 69bea17b04..b0bcfe917b 100644 --- a/org.adempiere.base/src/org/adempiere/util/ServerContext.java +++ b/org.adempiere.base/src/org/adempiere/util/ServerContext.java @@ -21,7 +21,7 @@ import java.io.Serializable; import java.util.Properties; /** - * + * Inheritable thread local server context * @author Ashley G Ramdass * @date Feb 25, 2007 * @version $Revision: 0.10 $ diff --git a/org.adempiere.base/src/org/adempiere/util/ServerContextPropertiesWrapper.java b/org.adempiere.base/src/org/adempiere/util/ServerContextPropertiesWrapper.java index a929c49768..7a5c755d46 100644 --- a/org.adempiere.base/src/org/adempiere/util/ServerContextPropertiesWrapper.java +++ b/org.adempiere.base/src/org/adempiere/util/ServerContextPropertiesWrapper.java @@ -30,8 +30,9 @@ import java.util.Set; import org.adempiere.exceptions.AdempiereException; /** + * {@link Properties} wrapper for access to thread local server context.
    + * Delegate all method calls to {@link ServerContext#getCurrentInstance()}. * @author hengsin - * */ public class ServerContextPropertiesWrapper extends Properties { @@ -41,7 +42,7 @@ public class ServerContextPropertiesWrapper extends Properties { private static final long serialVersionUID = 4383867755398619422L; /** - * + * Default constructor */ public ServerContextPropertiesWrapper() { } diff --git a/org.adempiere.base/src/org/adempiere/util/ServerContextProvider.java b/org.adempiere.base/src/org/adempiere/util/ServerContextProvider.java index 7209db24f3..69db74c7fa 100644 --- a/org.adempiere.base/src/org/adempiere/util/ServerContextProvider.java +++ b/org.adempiere.base/src/org/adempiere/util/ServerContextProvider.java @@ -21,9 +21,8 @@ import java.util.Properties; import org.compiere.util.ContextProvider; /** - * + * Default {@link ContextProvider} for core. * @author Low Heng Sin - * */ public class ServerContextProvider implements ContextProvider { @@ -34,7 +33,7 @@ public class ServerContextProvider implements ContextProvider { private ServerContextProvider() {} /** - * Get server context proxy + * Get server context */ public Properties getContext() { return context; diff --git a/org.adempiere.base/src/org/adempiere/util/ServerContextURLHandler.java b/org.adempiere.base/src/org/adempiere/util/ServerContextURLHandler.java index cd898a045e..175591b05c 100644 --- a/org.adempiere.base/src/org/adempiere/util/ServerContextURLHandler.java +++ b/org.adempiere.base/src/org/adempiere/util/ServerContextURLHandler.java @@ -1,6 +1,36 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.adempiere.util; +/** + * Interface for URL handler + */ public interface ServerContextURLHandler { + public final static String SERVER_CONTEXT_URL_HANDLER = "SERVER_CONTEXT_URL_HANDLER"; + + /** + * Show URL in UI + * @param url + */ public void showURL(String url); } diff --git a/org.adempiere.base/src/org/adempiere/util/ShippingUtil.java b/org.adempiere.base/src/org/adempiere/util/ShippingUtil.java index 1f88875385..c9fc698050 100644 --- a/org.adempiere.base/src/org/adempiere/util/ShippingUtil.java +++ b/org.adempiere.base/src/org/adempiere/util/ShippingUtil.java @@ -1,15 +1,38 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.adempiere.util; import org.compiere.util.DB; - +/** + * Helper methods for shipping + */ public class ShippingUtil { /** - * - * @param shipper_id - * @param org_id - * @return ShipperAccount + * Get shipper account from C_BP_ShippingAcct + * @param shipper_id M_Shipper_ID + * @param org_id AD_Org_ID + * @return Shipper Account */ public static String getSenderShipperAccount(int shipper_id, int org_id) { @@ -24,9 +47,9 @@ public class ShippingUtil } /** - * - * @param shipper_id - * @param org_id + * Get duties shipper account from C_BP_ShippingAcct + * @param shipper_id M_Shipper_ID + * @param org_id AD_Org_ID * @return DutiesShipperAccount (if any) */ public static String getSenderDutiesShipperAccount(int shipper_id, int org_id) @@ -42,12 +65,12 @@ public class ShippingUtil } /** - * + * Find recipient C_BPartner_Location_ID from C_BP_ShippingAcct, M_InOut or C_Order (in the listed order). * @param shipper_id M_Shipper_ID - * @param c_bpartner_id - * @param ad_org_id - * @param inout_id - * @param order_id + * @param c_bpartner_id C_BPartner_ID + * @param ad_org_id AD_Org_ID + * @param inout_id M_InOut_ID + * @param order_id C_Order_ID * @return C_BPartner_Location_ID */ public static int findRecipientAccountLocationId(int shipper_id, int c_bpartner_id, int ad_org_id, int inout_id, int order_id) @@ -110,7 +133,7 @@ public class ShippingUtil } /** - * + * Get shipper account number (ShipperAccount) from C_BP_ShippingAcct * @param shipper_id * @param c_bpartner_id * @param c_bpartner_location_id diff --git a/org.adempiere.base/src/org/compiere/Adempiere.java b/org.adempiere.base/src/org/compiere/Adempiere.java index f206a86e2a..a31545362d 100644 --- a/org.adempiere.base/src/org/compiere/Adempiere.java +++ b/org.adempiere.base/src/org/compiere/Adempiere.java @@ -63,6 +63,7 @@ import org.osgi.framework.Bundle; public final class Adempiere { /** Timestamp */ + @Deprecated static public final String ID = "$Id: Adempiere.java,v 1.8 2006/08/11 02:58:14 jjanke Exp $"; /** Main Version String */ static public String MAIN_VERSION = "Release 11"; @@ -177,45 +178,65 @@ public final class Adempiere return "Unknown"; } // getVersion + /** + * @return true if application version should be shown to user + */ public static boolean isVersionShown(){ return MSysConfig.getBooleanValue(MSysConfig.APPLICATION_MAIN_VERSION_SHOWN, true); } + /** + * @return true if iDempiere AD version should be shown to user + */ public static boolean isDBVersionShown(){ boolean defaultVal = MSystem.get(Env.getCtx()).getSystemStatus().equalsIgnoreCase("P") ? false : true; return MSysConfig.getBooleanValue(MSysConfig.APPLICATION_DATABASE_VERSION_SHOWN, defaultVal); } + /** + * @return true if implementation vendor name should be shown to user + */ public static boolean isVendorShown(){ return MSysConfig.getBooleanValue(MSysConfig.APPLICATION_IMPLEMENTATION_VENDOR_SHOWN, true); } + /** + * @return true if JVM info should be shown to user + */ public static boolean isJVMShown(){ boolean defaultVal = MSystem.get(Env.getCtx()).getSystemStatus().equalsIgnoreCase("P") ? false : true; return MSysConfig.getBooleanValue(MSysConfig.APPLICATION_JVM_VERSION_SHOWN, defaultVal); } + /** + * @return true if OS information should be shown to user + */ public static boolean isOSShown(){ boolean defaultVal = MSystem.get(Env.getCtx()).getSystemStatus().equalsIgnoreCase("P") ? false : true; return MSysConfig.getBooleanValue(MSysConfig.APPLICATION_OS_INFO_SHOWN, defaultVal); } + /** + * @return true if application host should be shown to user + */ public static boolean isHostShown() { boolean defaultVal = MSystem.get(Env.getCtx()).getSystemStatus().equalsIgnoreCase("P") ? false : true; return MSysConfig.getBooleanValue(MSysConfig.APPLICATION_HOST_SHOWN, defaultVal); } + /** + * @return version of iDempiere AD + */ public static String getDatabaseVersion() { -// return DB.getSQLValueString(null, "select lastmigrationscriptapplied from ad_system"); return MSysConfig.getValue(MSysConfig.APPLICATION_DATABASE_VERSION, DB.getSQLValueString(null, "select lastmigrationscriptapplied from ad_system")); } /** - * Short Summary (Windows) - * @return summary + * Short Summary + * @return short summary (name + main_version + sub_title) */ public static String getSum() { @@ -225,9 +246,9 @@ public final class Adempiere } // getSum /** - * Summary (Windows). - * iDempiere(tm) Release 1.0c_2013-06-27 -Smart Suite ERP, CRM and SCM- Copyright (c) 1999-2021 iDempiere; Implementation: 2.5.1a 20040417-0243 - (C) 1999-2005 Jorg Janke, iDempiere Inc. USA - * @return Summary in Windows character set + * Summary + * @return Summary (name + main_version + date_version + sub_title+copyright + * + implementation_version + implementation_vendor) */ public static String getSummary() { @@ -242,7 +263,7 @@ public final class Adempiere } // getSummary /** - * Set Package Info + * Initialize implementation version and vendor text from Package Info. */ private static void setPackageInfo() { @@ -260,7 +281,7 @@ public final class Adempiere } // setPackageInfo /** - * Get Jar Implementation Version + * Get Implementation Version * @return Implementation-Version */ public static String getImplementationVersion() @@ -271,7 +292,7 @@ public final class Adempiere } // getImplementationVersion /** - * Get Jar Implementation Vendor + * Get Implementation Vendor * @return Implementation-Vendor */ public static String getImplementationVendor() @@ -336,8 +357,8 @@ public final class Adempiere } // getJavaInfo /** - * Get full URL - * @return URL + * Get URL of product + * @return URL or product */ public static String getURL() { @@ -345,7 +366,7 @@ public final class Adempiere } // getURL /** - * @return URL + * @return online help URL */ public static String getOnlineHelpURL() { @@ -354,7 +375,7 @@ public final class Adempiere /** * Get Sub Title - * @return Subtitle + * @return Product Subtitle */ public static String getSubtitle() { @@ -464,7 +485,7 @@ public final class Adempiere } // getImageIconLogo /** - * Get default (Home) directory + * Get instance home directory * @return Home directory */ public static String getAdempiereHome() @@ -494,19 +515,23 @@ public final class Adempiere s_supportEmail = email; } // setSupportEMail + /** + * @return true if started + */ public static synchronized boolean isStarted() { return (log != null); } - /************************************************************************* - * Startup Client/Server. + /** + * Startup Client/Server.
    + *
     	 *  - Print greeting,
     	 *  - Check Java version and
     	 *  - load ini parameters
    -	 *  If it is a client, load/set PLAF and exit if error.
    -	 *  If Client, you need to call startupEnvironment explicitly!
    -	 * 	For testing call method startupEnvironment
    +	 *  
    + * If it is a client, load/set PLAF and exit if error.
    + * If client, you need to call startupEnvironment explicitly! * @param isClient true for client * @return successful startup */ @@ -588,6 +613,10 @@ public final class Adempiere } } + /** + * Create thread pool + * @return ScheduledThreadPoolExecutor + */ private static ScheduledThreadPoolExecutor createThreadPool() { int max = Runtime.getRuntime().availableProcessors() * 20; int defaultMax = max; @@ -607,9 +636,8 @@ public final class Adempiere } /** - * Startup Adempiere Environment. - * Automatically called for Server connections - * For testing call this method. + * Startup Adempiere Environment.
    + * Automatically called for Server connections.
    * @param isClient true if client connection * @return successful startup */ @@ -685,17 +713,23 @@ public final class Adempiere return true; } // startupEnvironment + /** + * @param name + * @return URL for named resource + */ public static URL getResource(String name) { return Core.getResourceFinder().getResource(name); } + /** + * Stop instance + */ public static synchronized void stop() { threadPoolExecutor.shutdown(); log = null; } /** - * * @return {@link ScheduledThreadPoolExecutor} */ public static ScheduledThreadPoolExecutor getThreadPoolExecutor() { @@ -709,6 +743,7 @@ public final class Adempiere { m_listenerList.remove(ServerStateChangeListener.class, l); } + /** * @param l listener */ @@ -717,6 +752,10 @@ public final class Adempiere m_listenerList.add(ServerStateChangeListener.class, l); } + /** + * Fire event + * @param e + */ private static synchronized void fireServerStateChanged(ServerStateChangeEvent e) { ServerStateChangeListener[] listeners = m_listenerList.getListeners(ServerStateChangeListener.class); diff --git a/org.adempiere.base/src/org/compiere/acct/Doc.java b/org.adempiere.base/src/org/compiere/acct/Doc.java index aa9deefa5e..ef58c4a7f9 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc.java @@ -61,7 +61,7 @@ import org.compiere.util.Trx; import org.compiere.util.Util; /** - * Posting Document Root. + * Abstract base class for posting document. * *
      *  Table               Base Document Types (C_DocType.DocBaseType and AD_Reference_ID=183)
    @@ -212,7 +212,7 @@ public abstract class Doc
     	 *  @param AD_Table_ID Table ID of Documents
     	 *  @param Record_ID record ID to load
     	 *  @param trxName transaction name
    -	 *  @return Document or null
    +	 *  @return new Posting Document instance or null
     	 */
     	public static Doc get (MAcctSchema as, int AD_Table_ID, int Record_ID, String trxName)
     	{
    @@ -225,8 +225,8 @@ public abstract class Doc
     	 *  @param AD_Table_ID Table ID of Documents
     	 *  @param rs ResultSet
     	 *  @param trxName transaction name
    -	 *  @return Document
    -	 * @throws AdempiereUserError
    +	 *  @return new Posting Document instance or null
    +	 *  @throws AdempiereUserError
     	 */
     	public static Doc get (MAcctSchema as, int AD_Table_ID, ResultSet rs, String trxName)
     	{
    @@ -234,12 +234,12 @@ public abstract class Doc
     	}   //  get
     
     	/**
    -	 *  Post Document
    -	 * 	@param ass accounting schemata
    -	 * 	@param 	AD_Table_ID		Transaction table
    -	 *  @param  Record_ID       Record ID of this document
    -	 *  @param  force           force posting
    -	 *  @param trxName			transaction
    +	 *  Post document immediately
    +	 * 	@param ass accounting schema
    +	 * 	@param AD_Table_ID	Transaction table
    +	 *  @param Record_ID    Record ID of this document
    +	 *  @param force        force posting
    +	 *  @param trxName	    transaction
     	 *  @return null if the document was posted or error message
     	 */
     	public static String postImmediate (MAcctSchema[] ass,
    @@ -337,7 +337,7 @@ public abstract class Doc
     	private boolean m_manageLocalTrx;
     
     
    -	/**************************************************************************
    +	/**
     	 *  Constructor
     	 * 	@param as accounting schema
     	 * 	@param clazz Document Class
    @@ -455,7 +455,6 @@ public abstract class Doc
     	/** Error Message			*/
     	protected String			p_Error = null;
     
    -
     	/**
     	 * 	Get Context
     	 *	@return context
    @@ -505,7 +504,7 @@ public abstract class Doc
     	 *  Post Document.
     	 *  
     	 *  - try to lock document (Processed='Y' (AND Processing='N' AND Posted='N'))
    -	 * 		- if not ok - return false
    +	 *       - if not ok - return false
     	 *          - postlogic (for all Accounting Schema)
     	 *              - create Fact lines
     	 *          - postCommit
    @@ -514,7 +513,7 @@ public abstract class Doc
     	 *  
    * @param force if true ignore that locked * @param repost if true ignore that already posted - * @return null if posted error otherwise + * @return error message or null */ public final String post (boolean force, boolean repost) { @@ -704,8 +703,8 @@ public abstract class Doc } // post /** - * Delete Accounting - * @return number of records + * Delete fact records + * @return number of records deleted */ protected int deleteAcct() { @@ -720,7 +719,7 @@ public abstract class Doc } // deleteAcct /** - * Posting logic for Accounting Schema index + * Posting logic for Accounting Schema * @return posting status/error code */ private final String postLogic () @@ -796,7 +795,7 @@ public abstract class Doc } // postLogic /** - * Post Commit. + * Post Commit.
    * Save Facts & Document * @param status status * @return Posting Status @@ -866,7 +865,7 @@ public abstract class Doc } // postCommit /** - * Get Trx Name and create Transaction + * Get Trx Name * @return Trx Name */ public String getTrxName() @@ -889,7 +888,7 @@ public abstract class Doc } // unlock - /************************************************************************** + /** * Load Document Type and GL Info. * Set p_DocumentType and p_GL_Category_ID * @return document type (i.e. C_DocType.DocBaseType) @@ -1008,7 +1007,7 @@ public abstract class Doc } // setDocumentType - /************************************************************************** + /** * Is the Source Document Balanced * @return true if (source) balanced */ @@ -1090,7 +1089,7 @@ public abstract class Doc /** * Calculate Period from DateAcct. - * m_C_Period_ID is set to -1 of not open to 0 if not found + * m_C_Period_ID is set to -1 if not open, to 0 if not found */ public void setPeriod() { @@ -1120,7 +1119,7 @@ public abstract class Doc /** * Get C_Period_ID - * @return period + * @return C_Period_ID */ public int getC_Period_ID() { @@ -1289,9 +1288,8 @@ public abstract class Doc /** GL Accounts - Commitment Offset Sales */ public static final int ACCTTYPE_CommitmentOffsetSales = 112; - /** - * Get the Valid Combination id for Accounting Schema + * Get valid combination id by account type and accounting schema * @param AcctType see ACCTTYPE_* * @param as accounting schema * @return C_ValidCombination_ID @@ -1517,10 +1515,10 @@ public abstract class Doc } // getAccount_ID /** - * Get the account for Accounting Schema + * Get account record by accounting schema and account type * @param AcctType see ACCTTYPE_* * @param as accounting schema - * @return Account + * @return MAccount */ public final MAccount getAccount (int AcctType, MAcctSchema as) { @@ -1559,10 +1557,9 @@ public abstract class Doc return p_po.toString(); } // toString - /** * Get AD_Client_ID - * @return client + * @return AD_Client_ID */ public int getAD_Client_ID() { @@ -1571,7 +1568,7 @@ public abstract class Doc /** * Get AD_Org_ID - * @return org + * @return AD_Org_ID */ public int getAD_Org_ID() { @@ -1614,7 +1611,7 @@ public abstract class Doc /** * Get C_Currency_ID - * @return currency + * @return C_Currency_ID */ public int getC_Currency_ID() { @@ -1680,7 +1677,7 @@ public abstract class Doc /** * Get C_ConversionType_ID - * @return ConversionType + * @return C_ConversionType_ID */ public int getC_ConversionType_ID() { @@ -1694,6 +1691,9 @@ public abstract class Doc return 0; } // getC_ConversionType_ID + /** + * @return currency rate or null + */ public BigDecimal getCurrencyRate() { return null; @@ -1701,7 +1701,7 @@ public abstract class Doc /** * Get GL_Category_ID - * @return category + * @return GL_Category_ID */ public int getGL_Category_ID() { @@ -1717,7 +1717,7 @@ public abstract class Doc /** * Get getGL_Budget_ID - * @return budget + * @return GL_Budget_ID or 0 */ public int getGL_Budget_ID() { @@ -1733,7 +1733,7 @@ public abstract class Doc /** * Get Accounting Date - * @return currency + * @return DateAcct or null */ public Timestamp getDateAcct() { @@ -1760,7 +1760,7 @@ public abstract class Doc /** * Get Document Date - * @return currency + * @return document date */ public Timestamp getDateDoc() { @@ -1807,7 +1807,7 @@ public abstract class Doc /** * Is Sales Trx - * @return true if posted + * @return true if it is sales trx */ public boolean isSOTrx() { @@ -1827,7 +1827,7 @@ public abstract class Doc /** * Get C_DocType_ID - * @return DocType + * @return C_DocType_ID or 0 */ public int getC_DocType_ID() { @@ -1888,7 +1888,7 @@ public abstract class Doc /** * Get header level C_Charge_ID - * @return Charge + * @return C_Charge_ID or 0 */ public int getC_Charge_ID() { @@ -1904,7 +1904,7 @@ public abstract class Doc /** * Get SalesRep_ID - * @return SalesRep + * @return SalesRep_ID or 0 */ public int getSalesRep_ID() { @@ -1920,7 +1920,7 @@ public abstract class Doc /** * Get C_BankAccount_ID - * @return BankAccount + * @return C_BankAccount_ID or 0 */ public int getC_BankAccount_ID() { @@ -1950,7 +1950,7 @@ public abstract class Doc /** * Get C_CashBook_ID - * @return CashBook + * @return C_CashBook_ID or 0 */ public int getC_CashBook_ID() { @@ -1980,7 +1980,7 @@ public abstract class Doc /** * Get M_Warehouse_ID - * @return Warehouse + * @return M_Warehouse_ID or 0 */ public int getM_Warehouse_ID() { @@ -1997,7 +1997,7 @@ public abstract class Doc /** * Get C_BPartner_ID - * @return BPartner + * @return C_BPartner_ID or 0 */ public int getC_BPartner_ID() { @@ -2027,7 +2027,7 @@ public abstract class Doc /** * Get C_BPartner_Location_ID - * @return BPartner Location + * @return C_BPartner_Location_ID or 0 */ public int getC_BPartner_Location_ID() { @@ -2043,7 +2043,7 @@ public abstract class Doc /** * Get C_Project_ID - * @return Project + * @return C_Project_ID or 0 */ public int getC_Project_ID() { @@ -2059,7 +2059,7 @@ public abstract class Doc /** * Get C_ProjectPhase_ID - * @return Project Phase + * @return C_ProjectPhase_ID or 0 */ public int getC_ProjectPhase_ID() { @@ -2075,7 +2075,7 @@ public abstract class Doc /** * Get C_ProjectTask_ID - * @return Project Task + * @return C_ProjectTask_ID or 0 */ public int getC_ProjectTask_ID() { @@ -2091,7 +2091,7 @@ public abstract class Doc /** * Get C_SalesRegion_ID - * @return Sales Region + * @return C_SalesRegion_ID or 0 */ public int getC_SalesRegion_ID() { @@ -2107,7 +2107,7 @@ public abstract class Doc /** * Get C_SalesRegion_ID - * @return Sales Region + * @return C_SalesRegion_ID or 0 */ public int getBP_C_SalesRegion_ID() { @@ -2137,7 +2137,7 @@ public abstract class Doc /** * Get C_Activity_ID - * @return Activity + * @return C_Activity_ID or 0 */ public int getC_Activity_ID() { @@ -2153,7 +2153,7 @@ public abstract class Doc /** * Get C_Campaign_ID - * @return Campaign + * @return C_Campaign_ID or 0 */ public int getC_Campaign_ID() { @@ -2169,7 +2169,7 @@ public abstract class Doc /** * Get M_Product_ID - * @return Product + * @return M_Product_ID or 0 */ public int getM_Product_ID() { @@ -2185,7 +2185,7 @@ public abstract class Doc /** * Get AD_OrgTrx_ID - * @return Trx Org + * @return AD_OrgTrx_ID or 0 */ public int getAD_OrgTrx_ID() { @@ -2201,7 +2201,7 @@ public abstract class Doc /** * Get C_LocFrom_ID - * @return loc from + * @return from C_Location_ID or 0 */ public int getC_LocFrom_ID() { @@ -2219,7 +2219,7 @@ public abstract class Doc /** * Get C_LocTo_ID - * @return loc to + * @return to C_Location_ID or 0 */ public int getC_LocTo_ID() { @@ -2237,7 +2237,7 @@ public abstract class Doc /** * Get User1_ID - * @return Campaign + * @return User1_ID or 0 */ public int getUser1_ID() { @@ -2253,7 +2253,7 @@ public abstract class Doc /** * Get User2_ID - * @return Campaign + * @return User2_ID or 0 */ public int getUser2_ID() { @@ -2267,9 +2267,10 @@ public abstract class Doc return 0; } // getUser2_ID - /** - * Get User Defined value - * @return User defined + /** + * Get value by column name + * @param ColumnName + * @return column value or 0 (if column doesn't exists) */ public int getValue (String ColumnName) { @@ -2322,7 +2323,7 @@ public abstract class Doc } /** - * Return document whether need to defer posting or not + * @return true if posting of document should be deferred to next run of accounting posting */ public boolean isDeferPosting() { return false; diff --git a/org.adempiere.base/src/org/compiere/acct/DocLine.java b/org.adempiere.base/src/org/compiere/acct/DocLine.java index be895130c5..35e42cbcc3 100644 --- a/org.adempiere.base/src/org/compiere/acct/DocLine.java +++ b/org.adempiere.base/src/org/compiere/acct/DocLine.java @@ -119,7 +119,7 @@ public class DocLine /** * Get Currency - * @return c_Currency_ID + * @return C_Currency_ID */ public int getC_Currency_ID () { @@ -168,11 +168,17 @@ public class DocLine m_C_ConversionType_ID = C_ConversionType_ID; } // setC_ConversionType_ID + /** + * @return Currency rate + */ public BigDecimal getCurrencyRate() { return m_currencyRate; } + /** + * @param currencyRate + */ protected void setCurrencyRate(BigDecimal currencyRate) { m_currencyRate = currencyRate; @@ -325,9 +331,9 @@ public class DocLine log.fine(msg); } // setLineNetAmtDifference - /************************************************************************** + /** * Set Accounting Date - * @param dateAcct acct date + * @param dateAcct accounting date */ public void setDateAcct (Timestamp dateAcct) { @@ -405,7 +411,7 @@ public class DocLine } // getDateDoc - /************************************************************************** + /** * Set GL Journal Account * @param acct account */ @@ -506,7 +512,7 @@ public class DocLine m_C_Period_ID = C_Period_ID; } // setC_Period_ID - /************************************************************************** + /** * Get (Journal) AcctSchema * @return C_AcctSchema_ID */ @@ -517,7 +523,7 @@ public class DocLine /** * Get Line ID - * @return id + * @return id of line PO */ public int get_ID() { @@ -526,7 +532,7 @@ public class DocLine /** * Get AD_Org_ID - * @return org + * @return AD_Org_ID */ public int getAD_Org_ID() { @@ -535,7 +541,7 @@ public class DocLine /** * Get Order AD_Org_ID - * @return order org if defined + * @return order AD_Org_ID if defined */ public int getOrder_Org_ID() { @@ -568,7 +574,7 @@ public class DocLine /** * Is this an Item Product (vs. not a Service, a charge) - * @return true if product + * @return true if product is of type item */ public boolean isItem() { @@ -619,7 +625,7 @@ public class DocLine /** * Get Warehouse Locator To - * @return M_Locator_ID + * @return to M_Locator_ID */ public int getM_LocatorTo_ID() { @@ -685,7 +691,7 @@ public class DocLine /** * Get C_LocFrom_ID - * @return loc from + * @return C_Location_ID from */ public int getC_LocFrom_ID() { @@ -721,7 +727,7 @@ public class DocLine /** * Get C_LocTo_ID - * @return loc to + * @return C_Location_ID to */ public int getC_LocTo_ID() { @@ -818,7 +824,7 @@ public class DocLine /** * Quantity UOM - * @return Transaction or Storage M_UOM_ID + * @return Transaction or Storage C_UOM_ID */ public int getC_UOM_ID() { @@ -942,7 +948,7 @@ public class DocLine /** * Get C_BPartner_Location_ID - * @return BPartner Location + * @return C_BPartner_Location_ID */ public int getC_BPartner_Location_ID() { @@ -1080,8 +1086,8 @@ public class DocLine } // getC_Activity_ID /** - * Get User 1 - * @return user defined 1 + * Get user defined id 1 + * @return User1_ID */ public int getUser1_ID() { @@ -1096,8 +1102,8 @@ public class DocLine } // getUser1_ID /** - * Get User 2 - * @return user defined 2 + * Get user defined id 2 + * @return User2_ID */ public int getUser2_ID() { @@ -1111,10 +1117,10 @@ public class DocLine return 0; } // getUser2_ID - /** - * Get User Defined Column + /** + * Get column value * @param ColumnName column name - * @return user defined column value + * @return column value or 0 (if column doesn't exist) */ public int getValue(String ColumnName) { @@ -1130,6 +1136,7 @@ public class DocLine //AZ Goodwill private int m_ReversalLine_ID = 0; + /** * Set ReversalLine_ID * store original (voided/reversed) document line @@ -1151,6 +1158,9 @@ public class DocLine } // getReversalLine_ID //end AZ Goodwill + /** + * @return line PO + */ public PO getPO() { return p_po; diff --git a/org.adempiere.base/src/org/compiere/acct/DocLine_Allocation.java b/org.adempiere.base/src/org/compiere/acct/DocLine_Allocation.java index 0b9498600f..89982b6128 100644 --- a/org.adempiere.base/src/org/compiere/acct/DocLine_Allocation.java +++ b/org.adempiere.base/src/org/compiere/acct/DocLine_Allocation.java @@ -24,7 +24,7 @@ import org.compiere.model.MPayment; import org.compiere.util.DB; /** - * Allocation Line + * DocLine for {@link MAllocationLine} * * @author Jorg Janke * @version $Id: DocLine_Allocation.java,v 1.2 2006/07/30 00:53:33 jjanke Exp $ @@ -71,11 +71,10 @@ public class DocLine_Allocation extends DocLine private BigDecimal m_DiscountAmt; private BigDecimal m_WriteOffAmt; private BigDecimal m_OverUnderAmt; - - + /** * Get Invoice C_Currency_ID - * @return 0 if no invoice -1 if not found + * @return C_Currency_ID (0 if no invoice, -1 if not found) */ public int getInvoiceC_Currency_ID() { @@ -106,59 +105,65 @@ public class DocLine_Allocation extends DocLine .append("]"); return sb.toString (); } // toString - - + /** - * @return Returns the c_Order_ID. + * @return C_Order_ID. */ public int getC_Order_ID () { return m_C_Order_ID; } + /** - * @return Returns the discountAmt. + * @return discountAmt. */ public BigDecimal getDiscountAmt () { return m_DiscountAmt; } + /** - * @return Returns the overUnderAmt. + * @return overUnderAmt. */ public BigDecimal getOverUnderAmt () { return m_OverUnderAmt; } + /** - * @return Returns the writeOffAmt. + * @return writeOffAmt. */ public BigDecimal getWriteOffAmt () { return m_WriteOffAmt; } + /** - * @return Returns the c_CashLine_ID. + * @return C_CashLine_ID. */ public int getC_CashLine_ID () { return m_C_CashLine_ID; } + /** - * @return Returns the c_Invoice_ID. + * @return C_Invoice_ID. */ public int getC_Invoice_ID () { return m_C_Invoice_ID; } + /** - * @return Returns the c_Payment_ID. + * @return C_Payment_ID. */ public int getC_Payment_ID () { return m_C_Payment_ID; } - /** adaxa-pb - * @return Returns the C_Charge_ID. + + /** + * @return C_Charge_ID. */ public int getC_Charge_ID () { diff --git a/org.adempiere.base/src/org/compiere/acct/DocLine_Bank.java b/org.adempiere.base/src/org/compiere/acct/DocLine_Bank.java index 94b6a2ee7f..e860b71d0c 100644 --- a/org.adempiere.base/src/org/compiere/acct/DocLine_Bank.java +++ b/org.adempiere.base/src/org/compiere/acct/DocLine_Bank.java @@ -24,7 +24,7 @@ import org.compiere.util.DB; import org.compiere.util.Env; /** - * Bank Statement Line + * DocLine for {@link MBankStatementLine} * * @author Jorg Janke * @version $Id: DocLine_Bank.java,v 1.2 2006/07/30 00:53:33 jjanke Exp $ @@ -72,7 +72,7 @@ public class DocLine_Bank extends DocLine /** * Get AD_Org_ID * @param payment if true get Org from payment - * @return org + * @return AD_Org_ID */ public int getAD_Org_ID (boolean payment) { @@ -96,8 +96,8 @@ public class DocLine_Bank extends DocLine } // isReversal /** - * Get Interest - * @return InterestAmount + * Get Interest Amount + * @return Interest Amount */ public BigDecimal getInterestAmt() { @@ -105,8 +105,8 @@ public class DocLine_Bank extends DocLine } // getInterestAmt /** - * Get Statement - * @return Starement Amount + * Get Statement Amount + * @return Statement Amount */ public BigDecimal getStmtAmt() { @@ -114,7 +114,7 @@ public class DocLine_Bank extends DocLine } // getStrmtAmt /** - * Get Transaction + * Get Transaction Amount * @return transaction amount */ public BigDecimal getTrxAmt() diff --git a/org.adempiere.base/src/org/compiere/acct/DocLine_Cash.java b/org.adempiere.base/src/org/compiere/acct/DocLine_Cash.java index 9595953bb8..74b8d4533c 100644 --- a/org.adempiere.base/src/org/compiere/acct/DocLine_Cash.java +++ b/org.adempiere.base/src/org/compiere/acct/DocLine_Cash.java @@ -83,7 +83,6 @@ public class DocLine_Cash extends DocLine private BigDecimal m_DiscountAmt = Env.ZERO; private BigDecimal m_WriteOffAmt = Env.ZERO; - /** * Get Cash Type * @return cash type @@ -95,7 +94,7 @@ public class DocLine_Cash extends DocLine /** * Get Bank Account - * @return Bank Account + * @return C_BankAccount_ID */ public int getC_BankAccount_ID() { @@ -120,7 +119,7 @@ public class DocLine_Cash extends DocLine return m_Amount; } /** - * Get Discount + * Get Discount Amount * @return Discount Amount */ public BigDecimal getDiscountAmt() @@ -128,7 +127,7 @@ public class DocLine_Cash extends DocLine return m_DiscountAmt; } /** - * Get WriteOff + * Get Write Off Amount * @return Write-Off Amount */ public BigDecimal getWriteOffAmt() diff --git a/org.adempiere.base/src/org/compiere/acct/DocLine_InOut.java b/org.adempiere.base/src/org/compiere/acct/DocLine_InOut.java index 057bc5bdb1..6ee1db61b2 100644 --- a/org.adempiere.base/src/org/compiere/acct/DocLine_InOut.java +++ b/org.adempiere.base/src/org/compiere/acct/DocLine_InOut.java @@ -28,6 +28,7 @@ import org.compiere.model.MInOutLine; import org.compiere.model.PO; /** + * DocLine for {@link MInOutLine}. * @author etantg */ public class DocLine_InOut extends DocLine diff --git a/org.adempiere.base/src/org/compiere/acct/DocManager.java b/org.adempiere.base/src/org/compiere/acct/DocManager.java index 391fc6b032..3b93257fb4 100644 --- a/org.adempiere.base/src/org/compiere/acct/DocManager.java +++ b/org.adempiere.base/src/org/compiere/acct/DocManager.java @@ -22,6 +22,7 @@ import java.sql.SQLException; import java.sql.Savepoint; import java.util.ArrayList; import java.util.List; +import java.util.logging.Level; import org.adempiere.base.IDocFactory; import org.adempiere.base.IServiceReferenceHolder; @@ -43,7 +44,6 @@ import org.compiere.util.ValueNamePair; * This class contains methods to manage the posting of financial document. Most of the code is adapted from the legacy code in Doc.java * @author Jorg Janke * @author hengsin - * */ public class DocManager { @@ -57,19 +57,25 @@ public class DocManager { /** Table Names of documents */ private static String[] documentsTableName = null; - /* - * Array of tables with Post column + /** + * Array of table ids with Posted column */ public static int[] getDocumentsTableID() { fillDocumentsTableArrays(); return documentsTableID; } + /** + * Array of table names with Posted column + */ public static String[] getDocumentsTableName() { fillDocumentsTableArrays(); return documentsTableName; } + /** + * Load financial document tables (tables with Posted column) + */ private synchronized static void fillDocumentsTableArrays() { if (documentsTableID == null) { String sql = "SELECT t.AD_Table_ID, t.TableName " + @@ -202,8 +208,8 @@ public class DocManager { * @param AD_Table_ID Table ID of Documents * @param rs ResultSet * @param trxName transaction name - * @return Document - * @throws AdempiereUserError + * @return Document or null + * @throws AdempiereUserError */ public static Doc getDocument(MAcctSchema as, int AD_Table_ID, ResultSet rs, String trxName) { @@ -372,7 +378,8 @@ public class DocManager { } else trx.rollback(); - s_log.info("Error Posting " + doc + " to " + as + " Error: " + error); + if (s_log.isLoggable(Level.INFO)) + s_log.info("Error Posting " + doc + " to " + as + " Error: " + error); break; } } @@ -386,7 +393,8 @@ public class DocManager { else trx.rollback(); - s_log.info("Error Posting " + doc + " to " + as + " Error: NoDoc"); + if (s_log.isLoggable(Level.INFO)) + s_log.info("Error Posting " + doc + " to " + as + " Error: NoDoc"); return "NoDoc"; } } @@ -397,7 +405,6 @@ public class DocManager { if (!save(trxName, AD_Table_ID, Record_ID, status)) { ValueNamePair dbError = CLogger.retrieveError(); - // log.log(Level.SEVERE, "(doc not saved) ... rolling back"); if (localTrxName != null) { if (trx != null) trx.rollback(); @@ -450,8 +457,8 @@ public class DocManager { return error; } - /************************************************************************** - * Save to Disk - set posted flag + /** + * Save to DB - set posted flag * @param trxName transaction name * @return true if saved */ diff --git a/org.adempiere.base/src/org/compiere/acct/DocTax.java b/org.adempiere.base/src/org/compiere/acct/DocTax.java index 2d1fd47f5d..be75e4002e 100644 --- a/org.adempiere.base/src/org/compiere/acct/DocTax.java +++ b/org.adempiere.base/src/org/compiere/acct/DocTax.java @@ -37,7 +37,6 @@ import org.compiere.util.Env; public final class DocTax { /** - * Create Tax * @param C_Tax_ID tax * @param name name * @param rate rate @@ -149,7 +148,7 @@ public final class DocTax /** * Get Name of Tax - * @return name + * @return name of tax */ public String getName() { @@ -158,7 +157,7 @@ public final class DocTax /** * Get C_Tax_ID - * @return tax id + * @return C_Tax_ID */ public int getC_Tax_ID() { @@ -185,8 +184,8 @@ public final class DocTax } // addIncludedTax /** - * Get Included Tax - * @return tax amount + * Get Included Tax Amount + * @return included tax amount */ public BigDecimal getIncludedTax() { @@ -195,7 +194,7 @@ public final class DocTax /** * Get Included Tax Difference - * @return tax ampunt - included amount + * @return tax amount - included amount */ public BigDecimal getIncludedTaxDifference() { @@ -224,7 +223,7 @@ public final class DocTax /** * Is Sales Tax - * @return sales tax + * @return true if this is sales tax */ public boolean isSalesTax() { diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java b/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java index f99fee8462..e4a5ba0c70 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java @@ -52,10 +52,10 @@ import org.compiere.util.Env; *
    * @author Jorg Janke * @version $Id: Doc_Allocation.java,v 1.6 2006/07/30 00:53:33 jjanke Exp $ - * - * FR [ 1840016 ] Avoid usage of clearing accounts - subject to C_AcctSchema.IsPostIfClearingEqual - * Avoid posting if Receipt and both accounts Unallocated Cash and Receivable are equal - * Avoid posting if Payment and both accounts Payment Select and Liability are equal + *

    + * FR [ 1840016 ] Avoid usage of clearing accounts - subject to C_AcctSchema.IsPostIfClearingEqual
    + * Avoid posting if Receipt and both accounts Unallocated Cash and Receivable are equal
    + * Avoid posting if Payment and both accounts Payment Select and Liability are equal
    * * @author phib * BF [ 2019262 ] Allocation posting currency gain/loss omits line reference @@ -138,7 +138,7 @@ public class Doc_AllocationHdr extends Doc } // loadLines - /************************************************************************** + /** * Get Source Currency Balance - subtracts line and tax amounts from total - no rounding * @return positive amount, if total invoice is bigger than lines */ @@ -179,8 +179,8 @@ public class Doc_AllocationHdr extends Doc * - * ============================== * Realized Gain and Loss - * AR/AP DR CR - * Realized G/L DR CR + * AR/AP DR CR + * Realized G/L DR CR * * * @@ -538,8 +538,9 @@ public class Doc_AllocationHdr extends Doc return m_facts; } // createFact - /** Verify if the posting involves two or more organizations - @return true if there are more than one org involved on the posting + /** + * Verify if the posting involves two or more organizations + * @return true if there are more than one org involved on the posting */ private boolean isInterOrg(MAcctSchema as) { MAcctSchemaElement elementorg = as.getAcctSchemaElement(MAcctSchemaElement.ELEMENTTYPE_Organization); @@ -760,16 +761,17 @@ public class Doc_AllocationHdr extends Doc } // getCashAcct - /************************************************************************** - * Create Tax Correction. + /** + * Create Tax Correction.
    * Requirement: Adjust the tax amount, if you did not receive the full * amount of the invoice (payment discount, write-off). * Applies to many countries with VAT. + *

     	 * 	Example:
     	 * 		Invoice:	Net $100 + Tax1 $15 + Tax2 $5 = Total $120
     	 * 		Payment:	$115 (i.e. $5 underpayment)
     	 * 		Tax Adjustment = Tax1 = 0.63 (15/120*5) Tax2 = 0.21 (5/120/5)
    -	 *
    +	 *  
    * @param as accounting schema * @param fact fact * @param line Allocation line @@ -831,10 +833,10 @@ public class Doc_AllocationHdr extends Doc } // createTaxCorrection - /************************************************************************** - * Create Realized Gain & Loss. + /** + * Create Realized Gain & Loss.
    * Compares the Accounted Amount of the Invoice to the - * Accounted Amount of the Allocation + * Accounted Amount of the Allocation. * @param line Allocation line * @param as accounting schema * @param fact fact @@ -973,10 +975,10 @@ public class Doc_AllocationHdr extends Doc return null; } - /************************************************************************** - * Create Realized Gain & Loss. + /** + * Create Realized Gain & Loss.
    * Compares the Accounted Amount of the Payment to the - * Accounted Amount of the Allocation + * Accounted Amount of the Allocation. * @param line Allocation line * @param as accounting schema * @param fact fact @@ -1052,7 +1054,8 @@ public class Doc_AllocationHdr extends Doc if (acctDifference == null || acctDifference.signum() == 0) { - log.fine("No Difference"); + if (log.isLoggable(Level.FINE)) + log.fine("No Difference"); return null; } @@ -1078,7 +1081,7 @@ public class Doc_AllocationHdr extends Doc return null; } - /************************************************************************** + /** * Create Rounding Correction. * Compares the Accounted Amount of the AR/AP Invoice to the * Accounted Amount of the AR/AP Allocation @@ -1464,7 +1467,7 @@ public class Doc_AllocationHdr extends Doc return null; } // createInvoiceRounding - /************************************************************************** + /** * Create Rounding Correction. * Compares the Accounted Amount of the Payment to the * Accounted Amount of the Allocation @@ -1801,7 +1804,7 @@ public class Doc_AllocationHdr extends Doc * Balance Accounting * @param as accounting schema * @param fact - * @return + * @return fact line */ private FactLine balanceAccounting(MAcctSchema as, Fact fact) { @@ -1831,7 +1834,7 @@ public class Doc_AllocationHdr extends Doc /** * Has Debit Receivables/Payables Trade Amount * @param invoice - * @return + * @return true */ private boolean hasDebitTradeAmt(MInvoice invoice) { diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_AssetAddition.java b/org.adempiere.base/src/org/compiere/acct/Doc_AssetAddition.java index bda4016d4a..c482145fe2 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_AssetAddition.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_AssetAddition.java @@ -20,34 +20,42 @@ import org.compiere.util.Env; /** + * Posting for {@link MAssetAddition} document. DOCBASETYPE_GLDocument. * @author Teo_Sarca, SC ARHIPAC SERVICE SRL */ public class Doc_AssetAddition extends Doc { + /** + * @param as + * @param rs + * @param trxName + */ public Doc_AssetAddition (MAcctSchema as, ResultSet rs, String trxName) { super(as, MAssetAddition.class, rs, MDocType.DOCBASETYPE_GLDocument, trxName); } - + @Override protected String loadDocumentDetails() { return null; } - + @Override public BigDecimal getBalance() { return Env.ZERO; } /** - * Produce inregistrarea: + * Produce posting: *
     	 *	20.., 21..[A_Asset_Acct]			=	23..[P_Asset_Acct/Project Acct]
     	 * 
    + * @param as + * @return facts */ - + @Override public ArrayList createFacts(MAcctSchema as) { MAssetAddition assetAdd = getAssetAddition(); @@ -83,11 +91,18 @@ public class Doc_AssetAddition extends Doc return facts; } + /** + * @return MAssetAddition + */ private MAssetAddition getAssetAddition() { return (MAssetAddition)getPO(); } + /** + * @param as + * @return account for credit side (project, charge or expense) + */ private MAccount getP_Asset_Acct(MAcctSchema as) { MAssetAddition assetAdd = getAssetAddition(); @@ -118,13 +133,22 @@ public class Doc_AssetAddition extends Doc return pAssetAcct; } + /** + * @param M_Product_ID + * @param as + * @return expense account + */ public MAccount getP_Expense_Acct(int M_Product_ID, MAcctSchema as) { ProductCost pc = new ProductCost(getCtx(), M_Product_ID, 0, null); return pc.getAccount(ProductCost.ACCTTYPE_P_Expense, as); } - + /** + * @param prj + * @param as + * @return project wip or asset account + */ private MAccount getProjectAcct(I_C_Project prj, MAcctSchema as) { // TODO: keep in sync with org.compiere.acct.Doc_ProjectIssue.createFacts(MAcctSchema) logic @@ -142,6 +166,10 @@ public class Doc_AssetAddition extends Doc return MAccount.get(getCtx(), acct_id); } + /** + * @param as + * @return asset account + */ private MAccount getA_Asset_Acct(MAcctSchema as) { MAssetAddition assetAdd = getAssetAddition(); @@ -151,6 +179,9 @@ public class Doc_AssetAddition extends Doc return MAccount.get(getCtx(), acct_id); } + /** + * @return C_BPartner_ID from invoice or 0 + */ public int getInvoicePartner_ID() { MAssetAddition assetAdd = getAssetAddition(); @@ -164,6 +195,10 @@ public class Doc_AssetAddition extends Doc return 0; } } + + /** + * @return C_Project_ID from invoice line or 0 + */ public int getInvoiceProject_ID() { MAssetAddition assetAdd = getAssetAddition(); diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_AssetDisposed.java b/org.adempiere.base/src/org/compiere/acct/Doc_AssetDisposed.java index c71b5b37ed..2f7a5dfbba 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_AssetDisposed.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_AssetDisposed.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.acct; import java.math.BigDecimal; @@ -14,6 +35,7 @@ import org.compiere.util.Env; /** + * Posting for {@link MAssetDisposed} document. DOCBASETYPE_GLDocument. * @author Teo_Sarca, SC ARHIPAC SERVICE SRL */ public class Doc_AssetDisposed extends Doc @@ -28,19 +50,19 @@ public class Doc_AssetDisposed extends Doc super(as, MAssetDisposed.class, rs, MDocType.DOCBASETYPE_GLDocument, trxName); } - + @Override protected String loadDocumentDetails() { return null; } - + @Override public BigDecimal getBalance() { return Env.ZERO; } - + @Override public ArrayList createFacts(MAcctSchema as) { MAssetDisposed assetDisp = (MAssetDisposed)getPO(); @@ -63,6 +85,11 @@ public class Doc_AssetDisposed extends Doc return facts; } + /** + * @param accountName + * @param as + * @return MAccount + */ private MAccount getAccount(String accountName, MAcctSchema as) { MAssetDisposed assetDisp = (MAssetDisposed)getPO(); diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_AssetReval.java b/org.adempiere.base/src/org/compiere/acct/Doc_AssetReval.java index 15ce596517..1222bae133 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_AssetReval.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_AssetReval.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.acct; import java.math.BigDecimal; @@ -13,20 +34,25 @@ import org.compiere.util.Env; /** + * Posting for {@link MAssetReval} document. DOCBASETYPE_GLJournal. * @author Anca Bradau www.arhipac.ro - * */ public class Doc_AssetReval extends Doc { - private static final String POSTINGTYPE_Actual = "A"; + + /** + * @param as + * @param rs + * @param trxName + */ public Doc_AssetReval (MAcctSchema as, ResultSet rs, String trxName) { super(as, MAssetReval.class, rs, MDocType.DOCBASETYPE_GLJournal, trxName); } - + @Override public ArrayList createFacts(MAcctSchema as) { MAssetAcct assetAcct = getAssetAcct(as); @@ -51,26 +77,38 @@ public class Doc_AssetReval extends Doc return facts; } - + @Override public BigDecimal getBalance() { return Env.ZERO; } - + @Override protected String loadDocumentDetails() { return null; } + + /** + * @return POSTINGTYPE_Actual + */ public String getPostingType() { return POSTINGTYPE_Actual; } + /** + * @param as + * @return MAssetAcct + */ private MAssetAcct getAssetAcct(MAcctSchema as) { return MAssetAcct.forA_Asset_ID(getCtx(),as.get_ID(), getA_Asset_ID(), getPostingType() , getDateAcct(), null); } + + /** + * @return MAssetReval + */ private MAssetReval getAssetReval() { return (MAssetReval)getPO(); @@ -78,7 +116,7 @@ public class Doc_AssetReval extends Doc /** * Get A_Asset_ID - * @return Asset + * @return A_Asset_ID */ public int getA_Asset_ID() { diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_AssetTransfer.java b/org.adempiere.base/src/org/compiere/acct/Doc_AssetTransfer.java index c4ae2d246a..39c42f518a 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_AssetTransfer.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_AssetTransfer.java @@ -13,8 +13,8 @@ import org.compiere.util.Env; /** + * Posting for {@link MAssetTransfer} document. DOCBASETYPE_GLJournal. * @author Anca Bradau www.arhipac.ro - * */ public class Doc_AssetTransfer extends Doc { @@ -24,23 +24,24 @@ public class Doc_AssetTransfer extends Doc super(as, MAssetTransfer.class, rs, MDocType.DOCBASETYPE_GLJournal, trxName); } - + @Override protected String loadDocumentDetails() { return null; } - + @Override public BigDecimal getBalance() { return Env.ZERO; } + /** - * Produce inregistrarea: + * Produce posting: *
     	 *	20.., 21..[A_Asset_New_Acct]			=	23..[A_Asset_Acct]		
     	 * 
    */ - + @Override public ArrayList createFacts(MAcctSchema as) { MAssetTransfer assetTr = getAssetTransfer(); @@ -71,10 +72,17 @@ public class Doc_AssetTransfer extends Doc return facts; } + /** + * @return MAssetTransfer + */ private MAssetTransfer getAssetTransfer() { return (MAssetTransfer)getPO(); } + + /** + * @return MDepreciationWorkfile + */ private MDepreciationWorkfile getAssetWorkfile() { MAssetTransfer assetTr = getAssetTransfer(); diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_BankStatement.java b/org.adempiere.base/src/org/compiere/acct/Doc_BankStatement.java index c1c07a2968..b1da2bf7ea 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_BankStatement.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_BankStatement.java @@ -29,16 +29,16 @@ import org.compiere.model.MBankStatementLine; import org.compiere.util.Env; /** - * Post Invoice Documents. + * Post {@link MBankStatement} Documents. *
      *  Table:              C_BankStatement (392)
      *  Document Types:     CMB
      *  
    * @author Jorg Janke * @version $Id: Doc_Bank.java,v 1.3 2006/07/30 00:53:33 jjanke Exp $ - * - * FR [ 1840016 ] Avoid usage of clearing accounts - subject to C_AcctSchema.IsPostIfClearingEqual - * Avoid posting if both accounts BankAsset and BankInTransit are equal + *

    + * FR [ 1840016 ] Avoid usage of clearing accounts - subject to C_AcctSchema.IsPostIfClearingEqual.
    + * Avoid posting if both accounts BankAsset and BankInTransit are equal. * @author victor.perez@e-evolution.com, e-Evolution http://www.e-evolution.com *

  • FR [ 2520591 ] Support multiples calendar for Org * @see https://sourceforge.net/p/adempiere/feature-requests/631/ @@ -64,6 +64,7 @@ public class Doc_BankStatement extends Doc * Load Specific Document Details * @return error message or null */ + @Override protected String loadDocumentDetails () { MBankStatement bs = (MBankStatement)getPO(); @@ -85,13 +86,15 @@ public class Doc_BankStatement extends Doc } // loadDocumentDetails /** - * Load Invoice Line. + * Load bank statement lines. * @param bs bank statement + *
     	 *  4 amounts
     	 *  AMTTYPE_Payment
     	 *  AMTTYPE_Statement2
     	 *  AMTTYPE_Charge
     	 *  AMTTYPE_Interest
    +	 *  
    * @return DocLine Array */ protected DocLine[] loadLines(MBankStatement bs) @@ -114,11 +117,11 @@ public class Doc_BankStatement extends Doc return dls; } // loadLines - - /************************************************************************** + /** * Get Source Currency Balance - subtracts line amounts from total - no rounding * @return positive amount, if total invoice is bigger than lines */ + @Override public BigDecimal getBalance() { BigDecimal retValue = Env.ZERO; @@ -144,13 +147,14 @@ public class Doc_BankStatement extends Doc * CMB. *
     	 *      BankAsset       DR      CR  (Statement)
    -	 *      BankInTransit   DR      CR              (Payment)
    +	 *      BankInTransit   DR      CR  (Payment)
     	 *      Charge          DR          (Charge)
     	 *      Interest        DR      CR  (Interest)
     	 *  
    * @param as accounting schema * @return Fact */ + @Override public ArrayList createFacts (MAcctSchema as) { // create Fact Header diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Cash.java b/org.adempiere.base/src/org/compiere/acct/Doc_Cash.java index 26a70f5387..0e1227314b 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Cash.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Cash.java @@ -28,7 +28,7 @@ import org.compiere.model.MCashLine; import org.compiere.util.Env; /** - * Post Invoice Documents. + * Post {@link MCash} Documents. DOCTYPE_CashJournal. *
      *  Table:              C_Cash (407)
      *  Document Types:     CMC
    @@ -53,6 +53,7 @@ public class Doc_Cash extends Doc
     	 *  Load Specific Document Details
     	 *  @return error message or null
     	 */
    +	@Override
     	protected String loadDocumentDetails ()
     	{
     		MCash cash = (MCash)getPO();
    @@ -72,7 +73,6 @@ public class Doc_Cash extends Doc
     		return null;
     	}   //  loadDocumentDetails
     
    -
     	/**
     	 *	Load Cash Line
     	 *	@param cash journal
    @@ -97,11 +97,11 @@ public class Doc_Cash extends Doc
     		return dls;
     	}	//	loadLines
     
    -
    -	/**************************************************************************
    +	/**
     	 *  Get Source Currency Balance - subtracts line amounts from total - no rounding
     	 *  @return positive amount, if total invoice is bigger than lines
     	 */
    +	@Override
     	public BigDecimal getBalance()
     	{
     		BigDecimal retValue = Env.ZERO;
    @@ -118,7 +118,6 @@ public class Doc_Cash extends Doc
     		sb.append("]");
     		//
     		if (log.isLoggable(Level.FINE)) log.fine(toString() + " Balance=" + retValue + sb.toString());
    -	//	return retValue;
     		return Env.ZERO;    //  Lines are balanced
     	}   //  getBalance
     
    @@ -146,8 +145,9 @@ public class Doc_Cash extends Doc
     	 *          CashAsset               CR
     	 *  
    * @param as account schema - * @return Fact + * @return Facts */ + @Override public ArrayList createFacts (MAcctSchema as) { // Need to have CashBook diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_DepreciationEntry.java b/org.adempiere.base/src/org/compiere/acct/Doc_DepreciationEntry.java index 0df6fe473c..2c12f9b333 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_DepreciationEntry.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_DepreciationEntry.java @@ -13,9 +13,9 @@ import org.compiere.util.Env; /** + * Posting for {@link MDepreciationEntry} document. * @author Teo Sarca, SC ARHIPAC SERVICE SRL * @version $Id$ - * */ public class Doc_DepreciationEntry extends Doc { @@ -34,7 +34,7 @@ public class Doc_DepreciationEntry extends Doc private String m_PostingType = null; private int m_C_AcctSchema_ID = 0; - + @Override protected String loadDocumentDetails () { MDepreciationEntry entry = (MDepreciationEntry)getPO(); @@ -44,6 +44,10 @@ public class Doc_DepreciationEntry extends Doc return null; } + /** + * @param depexp + * @return new DocLine instance + */ private DocLine createLine(MDepreciationExp depexp) { if (!depexp.isProcessed()) @@ -52,14 +56,14 @@ public class Doc_DepreciationEntry extends Doc return docLine; } - + @Override public BigDecimal getBalance() { BigDecimal retValue = Env.ZERO; return retValue; } // getBalance - + @Override public ArrayList createFacts (MAcctSchema as) { ArrayList facts = new ArrayList(); diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_GLJournal.java b/org.adempiere.base/src/org/compiere/acct/Doc_GLJournal.java index 1933dfa8f0..5e23a3bd06 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_GLJournal.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_GLJournal.java @@ -57,6 +57,7 @@ public class Doc_GLJournal extends Doc * Load Specific Document Details * @return error message or null */ + @Override protected String loadDocumentDetails () { MJournal journal = (MJournal)getPO(); @@ -71,7 +72,7 @@ public class Doc_GLJournal extends Doc /** - * Load Invoice Line + * Load GL journal lines * @param journal journal * @return DocLine Array */ @@ -105,11 +106,11 @@ public class Doc_GLJournal extends Doc return dls; } // loadLines - - /************************************************************************** + /** * Get Source Currency Balance - subtracts line and tax amounts from total - no rounding * @return positive amount, if total invoice is bigger than lines */ + @Override public BigDecimal getBalance() { BigDecimal retValue = Env.ZERO; @@ -136,6 +137,7 @@ public class Doc_GLJournal extends Doc * @param as acct schema * @return Fact */ + @Override public ArrayList createFacts (MAcctSchema as) { ArrayList facts = new ArrayList(); diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java b/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java index 6137957f25..f934e9c83e 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java @@ -80,6 +80,7 @@ public class Doc_InOut extends Doc * Load Document Details * @return error message or null */ + @Override protected String loadDocumentDetails() { setC_Currency_ID(NO_CURRENCY); @@ -156,6 +157,7 @@ public class Doc_InOut extends Doc * Get Balance * @return Zero (always balanced) */ + @Override public BigDecimal getBalance() { BigDecimal retValue = Env.ZERO; @@ -179,6 +181,7 @@ public class Doc_InOut extends Doc * @param as accounting schema * @return Fact */ + @Override public ArrayList createFacts (MAcctSchema as) { // @@ -664,7 +667,6 @@ public class Doc_InOut extends Doc // Low - check if c_orderline_id is valid if (orderLine != null) { - // Elaine 2008/06/26 C_Currency_ID = orderLine.getC_Currency_ID(); // costs = orderLine.getPriceCost(); @@ -877,7 +879,6 @@ public class Doc_InOut extends Doc { for (int i = 0; i < p_lines.length; i++) { - // Elaine 2008/06/26 int C_Currency_ID = as.getC_Currency_ID(); // DocLine_InOut line = (DocLine_InOut) p_lines[i]; @@ -1075,6 +1076,13 @@ public class Doc_InOut extends Doc return facts; } // createFact + /** + * @param as + * @param M_Product_ID + * @param ma + * @param reversalLine_ID + * @return MCostDetail.Amt + */ private BigDecimal findReversalCostDetailAmt(MAcctSchema as, int M_Product_ID, MInOutLineMA ma, int reversalLine_ID) { StringBuilder select = new StringBuilder("SELECT ").append(MCostDetail.COLUMNNAME_Amt) .append(" FROM ").append(MCostDetail.Table_Name).append(" WHERE ") @@ -1086,10 +1094,21 @@ public class Doc_InOut extends Doc return amt; } + /** + * @param line + * @return true if line is for reversal + */ private boolean isReversal(DocLine line) { return m_Reversal_ID !=0 && line.getReversalLine_ID() != 0; } + /** + * Create cost detail record from purchase return + * @param as + * @param line + * @param costs + * @return error message or empty string + */ private String createVendorRMACostDetail(MAcctSchema as, DocLine line, BigDecimal costs) { BigDecimal tQty = line.getQty(); diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Inventory.java b/org.adempiere.base/src/org/compiere/acct/Doc_Inventory.java index e42925a4bb..3ef03378dd 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Inventory.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Inventory.java @@ -74,6 +74,7 @@ public class Doc_Inventory extends Doc * Load Document Details * @return error message or null */ + @Override protected String loadDocumentDetails() { MInventory inventory = (MInventory)getPO(); @@ -101,7 +102,7 @@ public class Doc_Inventory extends Doc } // loadDocumentDetails /** - * Load Invoice Line + * Load inventory lines * @param inventory inventory * @return DocLine Array */ @@ -160,6 +161,7 @@ public class Doc_Inventory extends Doc * Get Balance * @return Zero (always balanced) */ + @Override public BigDecimal getBalance() { BigDecimal retValue = Env.ZERO; @@ -177,6 +179,7 @@ public class Doc_Inventory extends Doc * @param as account schema * @return Fact */ + @Override public ArrayList createFacts (MAcctSchema as) { // create Fact Header @@ -439,6 +442,10 @@ public class Doc_Inventory extends Doc return facts; } // createFact + /** + * @param line + * @return true if line is for reversal + */ private boolean isReversal(DocLine line) { return m_Reversal_ID !=0 && line.getReversalLine_ID() != 0; } diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Invoice.java b/org.adempiere.base/src/org/compiere/acct/Doc_Invoice.java index d4c4b74ce2..1948462568 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Invoice.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Invoice.java @@ -88,6 +88,7 @@ public class Doc_Invoice extends Doc * Load Specific Document Details * @return error message or null */ + @Override protected String loadDocumentDetails () { MInvoice invoice = (MInvoice)getPO(); @@ -342,10 +343,11 @@ public class Doc_Invoice extends Doc } // getPrecision - /************************************************************************** + /** * Get Source Currency Balance - subtracts line and tax amounts from total - no rounding * @return positive amount, if total invoice is bigger than lines */ + @Override public BigDecimal getBalance() { BigDecimal retValue = Env.ZERO; @@ -405,6 +407,7 @@ public class Doc_Invoice extends Doc * @param as accounting schema * @return Fact */ + @Override public ArrayList createFacts (MAcctSchema as) { // @@ -806,7 +809,7 @@ public class Doc_Invoice extends Doc } // createFact /** - * Create Fact Cash Based (i.e. only revenue/expense) + * Create Fact for Cash Based accounting (i.e. only revenue/expense) * @param as accounting schema * @param fact fact to add lines to * @param multiplier source amount multiplier @@ -915,7 +918,7 @@ public class Doc_Invoice extends Doc * @param as accounting schema * @param fact fact * @param line document line - * @param dr DR entry (normal api) + * @param dr true for DR side, false otherwise * @return true if landed costs were created */ protected boolean landedCost (MAcctSchema as, Fact fact, DocLine line, boolean dr) diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_MatchInv.java b/org.adempiere.base/src/org/compiere/acct/Doc_MatchInv.java index 0d314848de..4628d49620 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_MatchInv.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_MatchInv.java @@ -96,6 +96,7 @@ public class Doc_MatchInv extends Doc * Load Specific Document Details * @return error message or null */ + @Override protected String loadDocumentDetails () { setC_Currency_ID (Doc.NO_CURRENCY); @@ -120,10 +121,11 @@ public class Doc_MatchInv extends Doc } // loadDocumentDetails - /************************************************************************** + /** * Get Source Currency Balance - subtracts line and tax amounts from total - no rounding * @return Zero (always balanced) */ + @Override public BigDecimal getBalance() { return Env.ZERO; @@ -145,6 +147,7 @@ public class Doc_MatchInv extends Doc * @param as accounting schema * @return Fact */ + @Override public ArrayList createFacts (MAcctSchema as) { ArrayList facts = new ArrayList(); @@ -484,8 +487,9 @@ public class Doc_MatchInv extends Doc } } - /** Verify if the posting involves two or more organizations - @return true if there are more than one org involved on the posting + /** + * Verify if the posting involves two or more organizations + * @return true if there are more than one org involved on the posting */ private boolean isInterOrg(MAcctSchema as) { MAcctSchemaElement elementorg = as.getAcctSchemaElement(MAcctSchemaElement.ELEMENTTYPE_Organization); @@ -1238,6 +1242,7 @@ public class Doc_MatchInv extends Doc } /** + * Update fact line with invoice line details (qty and accounting dimension) * @param factLine */ protected void updateFactLine(FactLine factLine) { @@ -1344,7 +1349,7 @@ public class Doc_MatchInv extends Doc } // createInvoiceGainLoss /** - * Create Gain/Loss and Rounding Correction for reverse invoice + * Create Gain/Loss and Rounding Correction for reversal invoice * @param as accounting schema * @param fact * @param acct diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java b/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java index d48a823cf7..3dfd117d78 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java @@ -215,10 +215,11 @@ public class Doc_MatchPO extends Doc } // loadDocumentDetails - /************************************************************************** + /** * Get Source Currency Balance - subtracts line and tax amounts from total - no rounding * @return Zero - always balanced */ + @Override public BigDecimal getBalance() { return Env.ZERO; @@ -235,6 +236,7 @@ public class Doc_MatchPO extends Doc * @param as accounting schema * @return Fact */ + @Override public ArrayList createFacts (MAcctSchema as) { ArrayList facts = new ArrayList(); @@ -537,8 +539,9 @@ public class Doc_MatchPO extends Doc } } // createFact - /** Verify if the posting involves two or more organizations - @return true if there are more than one org involved on the posting + /** + * Verify if the posting involves two or more organizations + * @return true if there are more than one org involved on the posting */ private boolean isInterOrg(MAcctSchema as) { MAcctSchemaElement elementorg = as.getAcctSchemaElement(MAcctSchemaElement.ELEMENTTYPE_Organization); @@ -556,7 +559,13 @@ public class Doc_MatchPO extends Doc return false; } - // Elaine 2008/6/20 + /** + * Create cost detail for MatchPO + * @param as + * @param poCost + * @param landedCostMap + * @return error message or empty string + */ private String createMatchPOCostDetail(MAcctSchema as, BigDecimal poCost, Map landedCostMap) { if (m_ioLine != null && m_ioLine.getM_InOutLine_ID() > 0 && @@ -648,7 +657,14 @@ public class Doc_MatchPO extends Doc return ""; } - + /** + * Create cost detail for landed cost adjustment + * @param as + * @param landedCostMap + * @param mMatchPO + * @param tQty + * @return error message or empty string + */ private String createLandedCostAdjustments(MAcctSchema as, Map landedCostMap, MMatchPO mMatchPO, BigDecimal tQty) { @@ -675,6 +691,5 @@ public class Doc_MatchPO extends Doc public boolean isDeferPosting() { return m_deferPosting; } - } // Doc_MatchPO diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Movement.java b/org.adempiere.base/src/org/compiere/acct/Doc_Movement.java index 22e1f11daf..349126c38e 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Movement.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Movement.java @@ -31,7 +31,7 @@ import org.compiere.model.ProductCost; import org.compiere.util.Env; /** - * Post Invoice Documents. + * Post {@link MMovement} Documents. DOCTYPE_MatMovement. *
      *  Table:              M_Movement (323)
      *  Document Types:     MMM
    @@ -62,6 +62,7 @@ public class Doc_Movement extends Doc
     	 *  Load Document Details
     	 *  @return error message or null
     	 */
    +	@Override
     	protected String loadDocumentDetails()
     	{
     		setC_Currency_ID(NO_CURRENCY);
    @@ -77,7 +78,7 @@ public class Doc_Movement extends Doc
     	}   //  loadDocumentDetails
     
     	/**
    -	 *	Load Invoice Line
    +	 *	Load inventory movement lines
     	 *	@param move move
     	 *  @return document lines (DocLine_Material)
     	 */
    @@ -105,6 +106,7 @@ public class Doc_Movement extends Doc
     	 *  Get Balance
     	 *  @return balance (ZERO) - always balanced
     	 */
    +	@Override
     	public BigDecimal getBalance()
     	{
     		BigDecimal retValue = Env.ZERO;
    @@ -121,7 +123,8 @@ public class Doc_Movement extends Doc
     	 *  
    * @param as account schema * @return Fact - */ + */ + @Override public ArrayList createFacts (MAcctSchema as) { // create Fact Header @@ -260,7 +263,11 @@ public class Doc_Movement extends Doc facts.add(fact); return facts; } // createFact - + + /** + * @param line + * @return true if line is for reversal + */ private boolean isReversal(DocLine line) { return m_Reversal_ID !=0 && line.getReversalLine_ID() != 0; } diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Order.java b/org.adempiere.base/src/org/compiere/acct/Doc_Order.java index 68116cf8f8..3a3940d18c 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Order.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Order.java @@ -69,6 +69,7 @@ public class Doc_Order extends Doc * Load Specific Document Details * @return error message or null */ + @Override protected String loadDocumentDetails () { MOrder order = (MOrder)getPO(); @@ -87,7 +88,7 @@ public class Doc_Order extends Doc /** - * Load Invoice Line + * Load order lines * @param order order * @return DocLine Array */ @@ -145,7 +146,6 @@ public class Doc_Order extends Doc return dl; } // loadLines - /** * Load Requisitions * @return requisition lines of Order @@ -213,7 +213,6 @@ public class Doc_Order extends Doc return dls; } // loadRequisitions - /** * Get Currency Precision * @return precision @@ -226,7 +225,7 @@ public class Doc_Order extends Doc } // getPrecision /** - * Load Invoice Taxes + * Load Order Taxes * @return DocTax Array */ private DocTax[] loadTaxes() @@ -272,11 +271,11 @@ public class Doc_Order extends Doc return tl; } // loadTaxes - - /************************************************************************** + /** * Get Source Currency Balance - subtracts line and tax amounts from total - no rounding * @return positive amount, if total invoice is bigger than lines */ + @Override public BigDecimal getBalance() { BigDecimal retValue = Env.ZERO; @@ -318,8 +317,7 @@ public class Doc_Order extends Doc return retValue; } // getBalance - - /************************************************************************* + /** * Create Facts (the accounting logic) for * SOO, POO. *
    @@ -334,6 +332,7 @@ public class Doc_Order extends Doc
     	 *  @param as accounting schema
     	 *  @return Fact
     	 */
    +	@Override
     	public ArrayList createFacts (MAcctSchema as)
     	{
     		ArrayList facts = new ArrayList();
    @@ -342,8 +341,6 @@ public class Doc_Order extends Doc
     		{
     			updateProductPO(as);
     
    -			//BigDecimal grossAmt = getAmount(Doc.AMTTYPE_Gross);
    -
     			//  Commitment
     			@SuppressWarnings("unused")
     			FactLine fl = null;
    @@ -450,7 +447,6 @@ public class Doc_Order extends Doc
     		return facts;
     	}   //  createFact
     
    -
     	/**
     	 * 	Update ProductPO PriceLastPO
     	 *	@param as accounting schema
    @@ -487,7 +483,6 @@ public class Doc_Order extends Doc
     		if (log.isLoggable(Level.FINE)) log.fine("Updated=" + no);
     	}	//	updateProductPO
     
    -
     	/**
     	 * 	Get Commitments
     	 * 	@param doc document
    @@ -582,8 +577,8 @@ public class Doc_Order extends Doc
     	}	//	getCommitments
     
     	/**
    -	 * 	Get Commitment Release.
    -	 * 	Called from MatchInv for accrual and Allocation for Cash Based
    +	 * 	Get Commitment Release.
    + * Called from MatchInv for accrual and Allocation for cash based accounting * @param as accounting schema * @param doc doc * @param Qty qty invoiced/matched diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Payment.java b/org.adempiere.base/src/org/compiere/acct/Doc_Payment.java index 032ab9bc80..26edd5a89d 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Payment.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Payment.java @@ -31,7 +31,7 @@ import org.compiere.model.MSysConfig; import org.compiere.util.Env; /** - * Post Invoice Documents. + * Post {@link MPayment} Documents. *
      *  Table:              C_Payment (335)
      *  Document Types      ARP, APP
    @@ -63,6 +63,7 @@ public class Doc_Payment extends Doc
     	 *  Load Specific Document Details
     	 *  @return error message or null
     	 */
    +	@Override
     	protected String loadDocumentDetails ()
     	{
     		MPayment pay = (MPayment)getPO();
    @@ -75,11 +76,11 @@ public class Doc_Payment extends Doc
     		return null;
     	}   //  loadDocumentDetails
     
    -
    -	/**************************************************************************
    +	/**
     	 *  Get Source Currency Balance - always zero
     	 *  @return Zero (always balanced)
     	 */
    +	@Override
     	public BigDecimal getBalance()
     	{
     		BigDecimal retValue = Env.ZERO;
    @@ -104,6 +105,7 @@ public class Doc_Payment extends Doc
     	 *  @param as accounting schema
     	 *  @return Fact
     	 */
    +	@Override
     	public ArrayList createFacts (MAcctSchema as)
     	{
     		//  create Fact Header
    @@ -185,7 +187,6 @@ public class Doc_Payment extends Doc
     		return ba.getAD_Org_ID();
     	}	//	getBank_Org_ID
     
    -
     	@Override
     	public BigDecimal getCurrencyRate() {
     		if (getC_Currency_ID() == getAcctSchema().getC_Currency_ID())
    diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Production.java b/org.adempiere.base/src/org/compiere/acct/Doc_Production.java
    index 1eaf6b5d50..0fcfa43b86 100644
    --- a/org.adempiere.base/src/org/compiere/acct/Doc_Production.java
    +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Production.java
    @@ -28,6 +28,7 @@ import java.util.logging.Level;
     import org.compiere.model.MAcctSchema;
     import org.compiere.model.MCostDetail;
     import org.compiere.model.MProduct;
    +import org.compiere.model.MProduction;
     import org.compiere.model.MProductionLineMA;
     import org.compiere.model.ProductCost;
     import org.compiere.model.X_M_Production;
    @@ -36,7 +37,7 @@ import org.compiere.util.DB;
     import org.compiere.util.Env;
     
     /**
    - *  Post Invoice Documents.
    + *  Post {@link MProduction} Documents.
      *  
      *  Table:              M_Production (325)
      *  Document Types:     MMP
    @@ -61,6 +62,7 @@ public class Doc_Production extends Doc
     	 *  Load Document Details
     	 *  @return error message or null
     	 */
    +	@Override
     	protected String loadDocumentDetails()
     	{
     		setC_Currency_ID (NO_CURRENCY);
    @@ -81,7 +83,7 @@ public class Doc_Production extends Doc
     	 * @param line
     	 * @param isUsePlan
     	 * @param addMoreQty when you want get value, just pass null
    -	 * @return
    +	 * @return qty produce for line (include addMoreQty if addMoreQty is not null)
     	 */
     	private BigDecimal manipulateQtyProduced (Map mQtyProduced, X_M_ProductionLine line, Boolean isUsePlan, BigDecimal addMoreQty){
     		BigDecimal qtyProduced = null;
    @@ -102,7 +104,7 @@ public class Doc_Production extends Doc
     		return qtyProduced;
     	}
     	/**
    -	 *	Load Invoice Line
    +	 *	Load production lines
     	 *	@param prod production
     	 *  @return DoaLine Array
     	 */
    @@ -112,7 +114,7 @@ public class Doc_Production extends Doc
     		mQtyProduced = new HashMap<>(); 
     		String sqlPL = null;
     		if (prod.isUseProductionPlan()){
    -//			Production
    +			//	Production Plan
     			//	-- ProductionLine	- the real level
     			sqlPL = "SELECT * FROM "
     							+ " M_ProductionLine pro_line INNER JOIN M_ProductionPlan plan ON pro_line.M_ProductionPlan_id = plan.M_ProductionPlan_id "
    @@ -120,7 +122,7 @@ public class Doc_Production extends Doc
     							+ " WHERE pro.M_Production_ID=? "
     							+ " ORDER BY plan.M_ProductionPlan_id, pro_line.Line";
     		}else{
    -//			Production
    +			//	Production
     			//	-- ProductionLine	- the real level
     			sqlPL = "SELECT * FROM M_ProductionLine pl "
     					+ "WHERE pl.M_Production_ID=? "
    @@ -178,6 +180,7 @@ public class Doc_Production extends Doc
     	 *  Get Balance
     	 *  @return Zero (always balanced)
     	 */
    +	@Override
     	public BigDecimal getBalance()
     	{
     		BigDecimal retValue = Env.ZERO;
    @@ -194,6 +197,7 @@ public class Doc_Production extends Doc
     	 *  @param as account schema
     	 *  @return Fact
     	 */
    +	@Override
     	public ArrayList createFacts (MAcctSchema as)
     	{
     		//  create Fact Header
    diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_ProjectIssue.java b/org.adempiere.base/src/org/compiere/acct/Doc_ProjectIssue.java
    index 740ec46697..c6a48a4599 100644
    --- a/org.adempiere.base/src/org/compiere/acct/Doc_ProjectIssue.java
    +++ b/org.adempiere.base/src/org/compiere/acct/Doc_ProjectIssue.java
    @@ -32,7 +32,7 @@ import org.compiere.util.DB;
     import org.compiere.util.Env;
     
     /**
    - *	Project Issue.
    + *	Posting for {@link MProjectIssue} document. DOCTYPE_ProjectIssue.
    * Note: * Will load the default GL Category. * Set up a document type to set the GL Category. @@ -62,6 +62,7 @@ public class Doc_ProjectIssue extends Doc * Load Document Details * @return error message or null */ + @Override protected String loadDocumentDetails() { setC_Currency_ID(NO_CURRENCY); @@ -84,6 +85,7 @@ public class Doc_ProjectIssue extends Doc * Get DocumentNo * @return document no */ + @Override public String getDocumentNo () { MProject p = m_issue.getParent(); @@ -99,6 +101,7 @@ public class Doc_ProjectIssue extends Doc * Get Balance * @return Zero (always balanced) */ + @Override public BigDecimal getBalance() { BigDecimal retValue = Env.ZERO; @@ -117,6 +120,7 @@ public class Doc_ProjectIssue extends Doc * @param as accounting schema * @return Fact */ + @Override public ArrayList createFacts (MAcctSchema as) { // create Fact Header @@ -230,7 +234,6 @@ public class Doc_ProjectIssue extends Doc * @param as Account Schema * @return Unit Labor Cost */ - private BigDecimal getLaborCost(MAcctSchema as) { // Todor Lulov 30.01.2008 diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Requisition.java b/org.adempiere.base/src/org/compiere/acct/Doc_Requisition.java index 35df8f4e4d..af5a524fa8 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Requisition.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Requisition.java @@ -29,7 +29,7 @@ import org.compiere.model.ProductCost; import org.compiere.util.Env; /** - * Post Order Documents. + * Post {@link MRequisition} Documents. * *
      *   Table:              M_Requisition
    @@ -56,6 +56,7 @@ public class Doc_Requisition extends Doc
     	 *	Load Specific Document Details
     	 *  @return error message or null
     	 */
    +	@Override
     	protected String loadDocumentDetails ()
     	{
     		setC_Currency_ID(NO_CURRENCY);
    @@ -95,19 +96,18 @@ public class Doc_Requisition extends Doc
     		return dls;
     	}	// loadLines
     
    -	/***************************************************************************
    -	 * Get Source Currency Balance - subtracts line and tax amounts from total -
    -	 * no rounding
    -	 *
    -	 * @return positive amount, if total invoice is bigger than lines
    +	/**
    +	 * Get Balance
    +	 * @return balance (ZERO) - always balanced
     	 */
    +	@Override
     	public BigDecimal getBalance ()
     	{
     		BigDecimal retValue = Env.ZERO;
     		return retValue;
     	}	// getBalance
     
    -	/***************************************************************************
    +	/**
     	 * Create Facts (the accounting logic) for POR.
     	 * 
     	 * Reservation
    @@ -117,6 +117,7 @@ public class Doc_Requisition extends Doc
     	 * @param as accounting schema
     	 * @return Fact
     	 */
    +	@Override
     	public ArrayList createFacts (MAcctSchema as)
     	{
     		ArrayList facts = new ArrayList();
    diff --git a/org.adempiere.base/src/org/compiere/acct/Fact.java b/org.adempiere.base/src/org/compiere/acct/Fact.java
    index a4db8d52c8..ff42ef6787 100644
    --- a/org.adempiere.base/src/org/compiere/acct/Fact.java
    +++ b/org.adempiere.base/src/org/compiere/acct/Fact.java
    @@ -60,7 +60,6 @@ public final class Fact
     		if (log.isLoggable(Level.CONFIG)) log.config(toString());
     	}	//	Fact
     
    -
     	/**	Log					*/
     	private static final CLogger	log = CLogger.getCLogger(Fact.class);
     
    @@ -83,14 +82,12 @@ public final class Fact
     	/** Encumbrance Posting */
     	public static final String	POST_Reservation = MFactAcct.POSTINGTYPE_Reservation;
     
    -
     	/** Is Converted        */
     	private boolean		    m_converted = false;
     
     	/** Lines               */
     	private ArrayList	m_lines = new ArrayList();
     
    -
     	/**
     	 *  Dispose
     	 */
    @@ -114,8 +111,6 @@ public final class Fact
     	public FactLine createLine (DocLine docLine, MAccount account,
     		int C_Currency_ID, BigDecimal debitAmt, BigDecimal creditAmt)
     	{
    -	//	log.fine("createLine - " + account	+ " - Dr=" + debitAmt + ", Cr=" + creditAmt);
    -
     		//  Data Check
     		if (account == null)
     		{
    @@ -293,10 +288,10 @@ public final class Fact
     	}	//	getSourceBalance
     
     	/**
    -	 *	Create Source Line for Suspense Balancing.
    +	 *	Create Source Line for Suspense Balancing.
    * Only if Suspense Balancing is enabled and not a multi-currency document - * (double check as otherwise the rule should not have fired) - * If not balanced create balancing entry in currency of the document + * (double check as, otherwise the rule should not have fired).
    + * If not balanced, create balancing entry in currency of the document. * @return FactLine */ public FactLine balanceSource() @@ -329,9 +324,8 @@ public final class Fact m_lines.add(line); return line; } // balancingSource - - /************************************************************************** + /** * Are all segments balanced * @return true if segments are balanced */ @@ -354,9 +348,9 @@ public final class Fact /** * Is Source Segment balanced. - * @param segmentType - see AcctSchemaElement.SEGMENT_* - * Implemented only for Org - * Other sensible candidates are Project, User1/2 + * @param segmentType - see AcctSchemaElement.SEGMENT_*.
    + * Implemented only for Org. + * Other sensible candidates are Project, User1/2. * @return true if segments are balanced */ public boolean isSegmentBalanced (String segmentType) @@ -501,9 +495,8 @@ public final class Fact map.clear(); } } // balanceSegment - - /************************************************************************** + /** * Are the lines Accounting Balanced * @return true if accounting lines are balanced */ @@ -534,18 +527,19 @@ public final class Fact FactLine line = (FactLine)m_lines.get(i); result = result.add(line.getAcctBalance()); } - // log.fine(result.toString()); return result; } // getAcctBalance /** * Balance Accounting Currency. + *
     	 *  If the accounting currency is not balanced,
     	 *      if Currency balancing is enabled
     	 *          create a new line using the currency balancing account with zero source balance
     	 *      or
     	 *          adjust the line with the largest balance sheet account
     	 *          or if no balance sheet account exist, the line with the largest amount
    +	 *  
    * @return FactLine */ public FactLine balanceAccounting() @@ -831,7 +825,7 @@ public final class Fact return true; } // distribute - /************************************************************************** + /** * String representation * @return String */ @@ -857,7 +851,7 @@ public final class Fact } // getLines /** - * Save Fact + * Save Fact Lines * @param trxName transaction * @return true if all lines were saved */ @@ -875,8 +869,8 @@ public final class Fact } // commit /** - * Get Transaction - * @return trx + * Get Transaction Name + * @return trx nam */ public String get_TrxName() { @@ -902,7 +896,6 @@ public final class Fact public static class Balance { /** - * New Balance * @param dr DR * @param cr CR */ diff --git a/org.adempiere.base/src/org/compiere/acct/FactLine.java b/org.adempiere.base/src/org/compiere/acct/FactLine.java index 1c1a0198df..4507e49fa1 100644 --- a/org.adempiere.base/src/org/compiere/acct/FactLine.java +++ b/org.adempiere.base/src/org/compiere/acct/FactLine.java @@ -61,7 +61,7 @@ import org.compiere.util.Env; public final class FactLine extends X_Fact_Acct { /** - * + * generated serial id */ private static final long serialVersionUID = -601720541421664784L; @@ -133,9 +133,9 @@ public final class FactLine extends X_Fact_Acct } // reverse /** - * Create Accrual (flip CR/DR) of the line + * Create reverse accrual (flip CR/DR) of the line * @param description new description - * @return accrual line + * @return reverse accrual line */ public FactLine accrue (String description) { @@ -215,7 +215,7 @@ public final class FactLine extends X_Fact_Acct * @param C_Currency_ID currency * @param AmtSourceDr source amount dr * @param AmtSourceCr source amount cr - * @return true, if any if the amount is not zero + * @return true, if any of the amount is not zero */ public boolean setAmtSource (int C_Currency_ID, BigDecimal AmtSourceDr, BigDecimal AmtSourceCr) { @@ -295,7 +295,7 @@ public final class FactLine extends X_Fact_Acct } // setAmtAcct /** - * Set Accounted Amounts rounded by currency + * Set Accounted Amounts rounded by standard precision of currency * @param C_Currency_ID currency * @param AmtAcctDr acct amount dr * @param AmtAcctCr acct amount cr @@ -486,8 +486,8 @@ public final class FactLine extends X_Fact_Acct } // addDescription /** - * Set Warehouse Locator. - * - will overwrite Organization - + * Set Warehouse Locator.
    + * - will reset Organization to 0 - * @param M_Locator_ID locator */ public void setM_Locator_ID (int M_Locator_ID) @@ -500,7 +500,7 @@ public final class FactLine extends X_Fact_Acct /************************************************************************** * Set Location * @param C_Location_ID location - * @param isFrom from + * @param isFrom true - from, false - to. */ public void setLocation (int C_Location_ID, boolean isFrom) { @@ -511,9 +511,9 @@ public final class FactLine extends X_Fact_Acct } // setLocator /** - * Set Location from Locator + * Set Location from Locator (M_Warehouse) * @param M_Locator_ID locator - * @param isFrom from + * @param isFrom true - from, false - to. */ public void setLocationFromLocator (int M_Locator_ID, boolean isFrom) { @@ -546,7 +546,7 @@ public final class FactLine extends X_Fact_Acct } // setLocationFromLocator /** - * Set Location from Busoness Partner Location + * Set Location from Business Partner Location * @param C_BPartner_Location_ID bp location * @param isFrom from */ @@ -580,9 +580,9 @@ public final class FactLine extends X_Fact_Acct } // setLocationFromBPartner /** - * Set Location from Organization + * Set Location from Organization (AD_OrgInfo) * @param AD_Org_ID org - * @param isFrom from + * @param isFrom true - from, false - to. */ public void setLocationFromOrg (int AD_Org_ID, boolean isFrom) { @@ -614,7 +614,7 @@ public final class FactLine extends X_Fact_Acct } // setLocationFromOrg - /************************************************************************** + /** * Returns Source Balance of line * @return source balance */ @@ -660,7 +660,7 @@ public final class FactLine extends X_Fact_Acct } // isBalanceSheet /** - * Currect Accounting Amount. + * Adjust Accounting Amount. *
     	 *  Example:    1       -1      1       -1
     	 *  Old         100/0   100/0   0/100   0/100
    @@ -795,7 +795,7 @@ public final class FactLine extends X_Fact_Acct
     
     	
     	/**
    -	 *  Get AD_Org_ID (balancing segment).
    +	 *  Get AD_Org_ID (balancing segment). 
    * (if not set directly - from document line, document, account, locator) *

    * Note that Locator needs to be set before - otherwise @@ -873,10 +873,9 @@ public final class FactLine extends X_Fact_Acct return super.getAD_Org_ID(); } // setAD_Org_ID - /** * Get/derive Sales Region - * @return Sales Region + * @return C_SalesRegion_ID */ public int getC_SalesRegion_ID () { @@ -891,11 +890,10 @@ public final class FactLine extends X_Fact_Acct setC_SalesRegion_ID (m_doc.getC_SalesRegion_ID()); if (super.getC_SalesRegion_ID() == 0 && m_doc.getBP_C_SalesRegion_ID() > 0) setC_SalesRegion_ID (m_doc.getBP_C_SalesRegion_ID()); - // derive SalesRegion if AcctSegment + // derive SalesRegion from AcctSegment if (super.getC_SalesRegion_ID() == 0 && m_doc.getC_BPartner_Location_ID() != 0 && m_doc.getBP_C_SalesRegion_ID() == -1) // never tried - // && m_acctSchema.isAcctSchemaElement(MAcctSchemaElement.ELEMENTTYPE_SalesRegion)) { String sql = "SELECT COALESCE(C_SalesRegion_ID,0) FROM C_BPartner_Location WHERE C_BPartner_Location_ID=?"; setC_SalesRegion_ID (DB.getSQLValue(null, @@ -983,9 +981,8 @@ public final class FactLine extends X_Fact_Acct } return true; } // beforeSave - - - /************************************************************************** + + /** * Revenue Recognition. * Called from FactLine.save *

    @@ -1110,7 +1107,7 @@ public final class FactLine extends X_Fact_Acct return new_Account_ID; } // createRevenueRecognition - /************************************************************************** + /** * Update Line with reversed Original Amount in Accounting Currency. * Also copies original dimensions like Project, etc. * Called from Doc_MatchInv @@ -1126,7 +1123,7 @@ public final class FactLine extends X_Fact_Acct return updateReverseLine(AD_Table_ID, Record_ID, Line_ID, multiplier, null); } - /************************************************************************** + /** * Update Line with reversed Original Amount in Accounting Currency. * Also copies original dimensions like Project, etc. * Called from Doc_MatchInv @@ -1136,9 +1133,9 @@ public final class FactLine extends X_Fact_Acct * @param multiplier targetQty/documentQty * @param otherLine reversal line created before this. if not null, this reversal should reverse the opposite sign. * @return true if success - * - * NOTE: otherLine is required in cases where the original DR/CR postings are done in the same account - * in this case looking just for the first posting is wrong and results in a non-balanced reversal posting + *

    + * NOTE: otherLine is required in cases where the original DR/CR postings are done in the same account. + * In this case looking just for the first posting is wrong and results in a non-balanced reversal posting */ public boolean updateReverseLine (int AD_Table_ID, int Record_ID, int Line_ID, BigDecimal multiplier, FactLine otherLine) diff --git a/org.adempiere.base/src/org/compiere/acct/FactUtil.java b/org.adempiere.base/src/org/compiere/acct/FactUtil.java index e16b960715..2dcccdeb4e 100644 --- a/org.adempiere.base/src/org/compiere/acct/FactUtil.java +++ b/org.adempiere.base/src/org/compiere/acct/FactUtil.java @@ -8,8 +8,8 @@ import java.math.BigDecimal; import org.compiere.model.MAccount; /** + * Helper methods for Fact and FactLine * @author ancu - * */ public final class FactUtil { diff --git a/org.adempiere.base/src/org/compiere/acct/Matcher.java b/org.adempiere.base/src/org/compiere/acct/Matcher.java index 7ef2d72906..d5c98c1561 100644 --- a/org.adempiere.base/src/org/compiere/acct/Matcher.java +++ b/org.adempiere.base/src/org/compiere/acct/Matcher.java @@ -28,8 +28,7 @@ import org.compiere.util.DB; import org.compiere.util.Env; /** - * Automatic Matching. - * Inv + * Automatic Invoice-Receipt Matching. * * @author Jorg Janke * @version $Id: Matcher.java,v 1.2 2006/07/30 00:53:33 jjanke Exp $ @@ -57,7 +56,7 @@ public class Matcher /** * Matching *

    -	 *  Derive Invoice-Receipt Match from PO-Invoice and PO-Receipt
    +	 *  Derive Invoice-Receipt Matching from PO-Invoice and PO-Receipt
     	 * 	Purchase Order (20)
     	 *  - Invoice1 (10)
     	 *  - Invoice2 (10)
    @@ -70,7 +69,7 @@ public class Matcher
     	 *
     	 *  (b) Creates Indirects
     	 * 		- Invoice1 - Receipt2 (5)
    -	 *  (Not imlemented)
    +	 *  (Not implemented)
     	 *
     	 *
     	 *  
    diff --git a/org.adempiere.base/src/org/compiere/acct/ProductInfo.java b/org.adempiere.base/src/org/compiere/acct/ProductInfo.java index c68c594405..65ed7e7493 100644 --- a/org.adempiere.base/src/org/compiere/acct/ProductInfo.java +++ b/org.adempiere.base/src/org/compiere/acct/ProductInfo.java @@ -124,7 +124,7 @@ public class ProductInfo /** * Is Product/Item - * @return true if product + * @return true if product is of item type */ public boolean isProduct() { diff --git a/org.adempiere.base/src/org/compiere/db/AdempiereDatabase.java b/org.adempiere.base/src/org/compiere/db/AdempiereDatabase.java index 928811ed9a..72ac17e569 100644 --- a/org.adempiere.base/src/org/compiere/db/AdempiereDatabase.java +++ b/org.adempiere.base/src/org/compiere/db/AdempiereDatabase.java @@ -30,10 +30,8 @@ import org.compiere.model.MColumn; import org.compiere.model.MTable; import org.compiere.model.PO; -//import org.compiere.util.CPreparedStatement; - /** - * Interface for Adempiere Databases + * Interface for database adapter * * @author Jorg Janke * @version $Id: AdempiereDatabase.java,v 1.5 2006/09/22 23:35:19 jjanke Exp $ @@ -89,10 +87,10 @@ public interface AdempiereDatabase String userName); /** - * Get Database Connection String + * Get Database Connection URL * @param connectionURL Connection URL * @param userName user name - * @return connection String + * @return connection URL */ public String getConnectionURL (String connectionURL, String userName); @@ -119,44 +117,37 @@ public interface AdempiereDatabase * @return info */ public String toString(); - - /************************************************************************** - * Convert an individual Oracle Style statements to target database statement syntax + /** + * Convert an individual Oracle syntax statements to target database statement syntax * * @param oraStatement oracle statement * @return converted Statement */ public String convertStatement (String oraStatement); - - /** * Check if DBMS support the sql statement - * @sql SQL statement + * @param sql SQL statement * @return true: yes */ public boolean isSupported(String sql); - - - /** * Get constraint type associated with the index - * @conn connection - * @tableName table name - * @IXName Index name + * @param conn connection + * @param tableName table name + * @param IXName Index name * @return String[0] = 0: do not know, 1: Primary Key 2: Foreign Key * String[1] - String[n] = Constraint Name */ public String getConstraintType(Connection conn, String tableName, String IXName); - /** * Check and generate an alternative SQL - * @reExNo number of re-execution - * @msg previous execution error message - * @sql previous executed SQL + * @param reExNo number of re-execution + * @param msg previous execution error message + * @param sql previous executed SQL * @return String, the alternative SQL, null if no alternative */ public String getAlternativeSQL(int reExNo, String msg, String sql); @@ -174,13 +165,12 @@ public interface AdempiereDatabase */ public String getSystemDatabase(String databaseName); - /** - * Create SQL TO Date String from Timestamp + * Create SQL TO Date statement for Timestamp * * @param time Date to be converted - * @param dayOnly true if time set to 00:00:00 - * @return date function + * @param dayOnly true if time should be set to 00:00:00 + * @return to date function */ public String TO_DATE (Timestamp time, boolean dayOnly); @@ -210,25 +200,29 @@ public interface AdempiereDatabase /** - * Return next sequence this Sequence - * @param Name Sequence - * @param trxName Transaction + * Get next sequence number in this Sequence + * @param Name Sequence name + * @param trxName Transaction name */ public int getNextID(String Name, String trxName); /** - * Return next sequence this Sequence - * @param Name Sequence + * Get next sequence number in this Sequence + * @param Name Sequence name */ public int getNextID(String Name); - /* + /** * Create Native Sequence - * @param Sequence Name + * @param name Sequence Name + * @param increment + * @param minvalue + * @param maxvalue + * @param start + * @param trxName */ public boolean createSequence(String name , int increment , int minvalue , int maxvalue ,int start, String trxName); - - + /** Create User commands */ public static final int CMD_CREATE_USER = 0; /** Create Database/Schema Commands */ @@ -238,22 +232,21 @@ public interface AdempiereDatabase /** * Get SQL Commands. - * + *
     	 * 	The following variables are resolved:
     	 * 	@SystemPassword@, @AdempiereUser@, @AdempierePassword@
     	 * 	@SystemPassword@, @DatabaseName@, @DatabaseDevice@
    -	 *  
    -	 *	@param cmdType CMD_*
    +	 *  
    + * @param cmdType {@link #CMD_CREATE_USER}, {@link #CMD_CREATE_DATABASE} or {@link #CMD_DROP_DATABASE} * @return array of commands to be executed */ public String[] getCommands (int cmdType); - /** * Get Cached Connection on Server * @param connection info * @param autoCommit true if autocommit connection - * @param transactionIsolation Connection transaction level + * @param transactionIsolation transaction isolation level * @return connection or null * @throws Exception */ @@ -282,7 +275,7 @@ public interface AdempiereDatabase /** * Create DataSource * @param connection connection - * @return data dource + * @return data source */ public DataSource getDataSource(CConnection connection); @@ -297,6 +290,10 @@ public interface AdempiereDatabase */ public void close(); + /** + * Get {@link Convert} implementation for this DB adapter + * @return Convert instance + */ public Convert getConvert(); /** @@ -304,14 +301,9 @@ public interface AdempiereDatabase */ public boolean isQueryTimeoutSupported(); - /** - * Default sql use to test whether a connection is still valid - */ - //public final static String DEFAULT_CONN_TEST_SQL = "SELECT Version FROM AD_System"; - /** * Is the database have sql extension that return a subset of the query result - * @return boolean + * @return true if DB support paging SQL */ public boolean isPagingSupported(); @@ -320,7 +312,7 @@ public interface AdempiereDatabase * @param sql * @param start * @param end - * @return + * @return SQL with added paging clause */ public String addPagingSQL(String sql, int start, int end); @@ -332,6 +324,10 @@ public interface AdempiereDatabase */ public boolean forUpdate(PO po, int timeout); + /** + * @param e + * @return unique constraint name + */ public String getNameOfUniqueConstraintError(Exception e); /** @@ -364,7 +360,7 @@ public interface AdempiereDatabase /** * @param columnName * @param csv comma separated value - * @return subset sql clause + * @return intersect sql clause */ public String intersectClauseForCSV(String columnName, String csv); @@ -372,7 +368,7 @@ public interface AdempiereDatabase * @param columnName * @param csv comma separated value * @param isNotClause - * @return subset sql clause + * @return intersect sql clause */ public String intersectClauseForCSV(String columnName, String csv, boolean isNotClause); @@ -386,7 +382,6 @@ public interface AdempiereDatabase } /** - * * @return true if using native dialect, false if using oracle dialect */ public default boolean isNativeMode() { @@ -399,13 +394,11 @@ public interface AdempiereDatabase public String getNumericDataType(); /** - * - * @return fixed lenght character data type name + * @return fixed length character data type name */ public String getCharacterDataType(); /** - * * @return variable length character data type name */ public String getVarcharDataType(); @@ -418,30 +411,27 @@ public interface AdempiereDatabase }; /** - * * @return binary large object data type name */ public String getBlobDataType(); /** - * * @return character large object data type name */ public String getClobDataType(); /** - * * @return time stamp data type name */ public String getTimestampDataType(); /** - * * @return timestamp with time zone type name */ public String getTimestampWithTimezoneDataType(); + /** - * Get SQL Create + * Get create table SQL statement * @param table * @return create table DDL */ @@ -479,31 +469,27 @@ public interface AdempiereDatabase } // getSQLCreate /** - * * @param column - * @return ddl sql for column + * @return DDL SQL statement for column */ public String getSQLDDL(MColumn column); /** - * * @param table * @param column - * @return add column sql + * @return add column SQL statement */ public String getSQLAdd(MTable table, MColumn column); /** - * * @param table * @param column * @param setNullOption - * @return alter column sql + * @return alter column SQL statement */ public String getSQLModify (MTable table, MColumn column, boolean setNullOption); /** - * * @param ex * @return true if ex is caused by query timeout */ diff --git a/org.adempiere.base/src/org/compiere/db/CConnection.java b/org.adempiere.base/src/org/compiere/db/CConnection.java index da9b34ea36..d7122952c8 100644 --- a/org.adempiere.base/src/org/compiere/db/CConnection.java +++ b/org.adempiere.base/src/org/compiere/db/CConnection.java @@ -31,7 +31,7 @@ import org.compiere.util.CLogger; import org.compiere.util.Ini; /** - * Adempiere Connection Descriptor + * Adempiere DB Connection Descriptor * * @author Jorg Janke * @author Marek Mosiewicz<marek.mosiewicz@jotel.com.pl> - support for RMI over HTTP @@ -40,7 +40,7 @@ import org.compiere.util.Ini; public class CConnection implements Serializable, Cloneable { /** - * + * generated serial id */ private static final long serialVersionUID = -1823868178123935209L; @@ -125,10 +125,7 @@ public class CConnection implements Serializable, Cloneable return cc; } // get - - - /************************************************************************** - * Adempiere Connection + /** * @param host optional application/db host */ public CConnection (String host) @@ -192,7 +189,7 @@ public class CConnection implements Serializable, Cloneable private int m_webPort; private int m_sslPort; - /************************************************************************* + /** * Get Name * @return connection name */ @@ -218,8 +215,7 @@ public class CConnection implements Serializable, Cloneable m_name = toString (); } // setName - - /************* + /** * Get Application Host * @return apps host */ @@ -515,8 +511,8 @@ public class CConnection implements Serializable, Cloneable } /** - * Method getFwHost - * @return String + * Get fire wall host + * @return fire wall host */ public String getFwHost () { @@ -524,7 +520,7 @@ public class CConnection implements Serializable, Cloneable } /** - * Method setFwHost + * Set fire wall host * @param fw_host String */ public void setFwHost (String fw_host) @@ -640,14 +636,12 @@ public class CConnection implements Serializable, Cloneable setViaFirewall (false); } - // begin vpj-cd e-evolution 09 ene 2006 // PostgreSQL if (isPostgreSQL ()) { if (getDbPort () != Database.DB_POSTGRESQL_DEFAULT_PORT) setDbPort (Database.DB_POSTGRESQL_DEFAULT_PORT); } - //end vpj-cd e-evolution 09 ene 2006 } // setType /** @@ -659,7 +653,6 @@ public class CConnection implements Serializable, Cloneable return m_db.supportsBLOB (); } // supportsBLOB - /** * Is Oracle DB * @return true if Oracle @@ -687,25 +680,23 @@ public class CConnection implements Serializable, Cloneable return m_okDB; } // isDatabaseOK - /************************************************************************** - * Create DB Connection + /** + * Create DB data source * @return data source != null */ public boolean setDataSource() { - // System.out.println ("CConnection.setDataSource - " + m_ds + " - Client=" + Ini.isClient()); if (m_ds == null && Ini.isClient()) { AdempiereDatabase getDB = getDatabase(); if (getDB != null) // no db selected m_ds = getDB.getDataSource(this); - // System.out.println ("CConnection.setDataSource - " + m_ds); } return m_ds != null; } // setDataSource /** - * Set Data Source + * Set DB Data Source * @param ds data source * @return data source != null */ @@ -718,7 +709,7 @@ public class CConnection implements Serializable, Cloneable } // setDataSource /** - * Get Server Connection + * Get DB data source * @return DataSource */ public DataSource getDataSource () @@ -727,7 +718,7 @@ public class CConnection implements Serializable, Cloneable } // getDataSource /** - * Has Server Connection + * Has DB data source * @return true if DataSource exists */ public boolean isDataSource () @@ -735,15 +726,16 @@ public class CConnection implements Serializable, Cloneable return m_ds != null; } // isDataSource - - /************************************************************************** + /** * Test Database Connection. + *
     	 *  -- Example --
     	 *  Database: PostgreSQL - 7.1.3
     	 *  Driver:   PostgreSQL Native Driver - PostgreSQL 7.2 JDBC2
     	 *  -- Example --
     	 *  Database: Oracle - Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production With the Partitioning option JServer Release 8.1.7.0.0 - Production
     	 *  Driver:   Oracle JDBC driver - 9.0.1.1.0
    +	 *  
    * @param retest * @return Exception or null */ @@ -775,6 +767,11 @@ public class CConnection implements Serializable, Cloneable return m_dbException; // from opening } // testDatabase + /** + * Read DB info from connection + * @param conn + * @throws SQLException + */ public void readInfo(Connection conn) throws SQLException { DatabaseMetaData dbmd = conn.getMetaData (); m_info[0] = "Database=" + dbmd.getDatabaseProductName () @@ -788,7 +785,7 @@ public class CConnection implements Serializable, Cloneable if (log.isLoggable(Level.CONFIG)) log.config(m_info[0] + " - " + m_info[1]); } - /************************************************************************* + /** * Short String representation * @return appsHost{dbHost-dbName-uid} */ @@ -870,7 +867,6 @@ public class CConnection implements Serializable, Cloneable return sb.toString(); } // toStringDetail - /** * String representation. * Used also for Instantiation @@ -913,6 +909,11 @@ public class CConnection implements Serializable, Cloneable return sb.toString (); } // toStringLong + /** + * Use html like escape sequence to escape = and , + * @param value + * @return escape value + */ private String escape(String value) { if (value == null) return null; @@ -924,7 +925,7 @@ public class CConnection implements Serializable, Cloneable } /** - * Set Attributes from String (pares toStringLong()) + * Set Attributes from String (parse {@link #toStringLong()}) * @param attributes attributes */ private void setAttributes (String attributes) @@ -1002,6 +1003,11 @@ public class CConnection implements Serializable, Cloneable } } // setAttributes + /** + * @param value + * @return un-escape value + * @see CConnection#escape(String) + */ private String unescape(String value) { value = value.replace("&eq;", "="); value = value.replace(",", ","); @@ -1013,6 +1019,7 @@ public class CConnection implements Serializable, Cloneable * @param o object * @return true if o equals this */ + @Override public boolean equals (Object o) { if (o instanceof CConnection) @@ -1031,7 +1038,7 @@ public class CConnection implements Serializable, Cloneable } // equals /** - * Get Info. + * Get Info.
    * - Database, Driver, Status Info * @return info */ @@ -1046,19 +1053,19 @@ public class CConnection implements Serializable, Cloneable return sb.toString (); } // getInfo - - /************************************************************************* + /** * Hashcode * @return hashcode of name */ + @Override public int hashCode () { return m_name.hashCode (); } // hashCode /** - * Get Database - * @return database + * Get Database Adapter + * @return database adapter instance */ public AdempiereDatabase getDatabase () { @@ -1097,8 +1104,8 @@ public class CConnection implements Serializable, Cloneable } // getDatabase /** - * Get Connection String - * @return connection string + * Get Connection URL + * @return connection URL */ public String getConnectionURL () { @@ -1110,10 +1117,10 @@ public class CConnection implements Serializable, Cloneable } // getConnectionURL /** - * Create Connection - no not close. - * Sets m_dbException + * Get Connection. + * Sets {@link #m_dbException}. * @param autoCommit true if autocommit connection - * @param transactionIsolation Connection transaction level + * @param transactionIsolation transaction isolation level * @return Connection */ public Connection getConnection (boolean autoCommit, int transactionIsolation) @@ -1199,7 +1206,9 @@ public class CConnection implements Serializable, Cloneable * Get Application Server Initial Context * @param useCache if true, use existing cache * @return Initial Context or null + * @deprecated */ + @Deprecated(forRemoval = true, since = "11") public InitialContext getInitialContext (boolean useCache) { return null; @@ -1207,7 +1216,7 @@ public class CConnection implements Serializable, Cloneable /** * Convert Statement - * @param origStatement original statement (Oracle notation) + * @param origStatement original statement (Oracle syntax) * @return converted Statement * @throws Exception */ @@ -1242,7 +1251,7 @@ public class CConnection implements Serializable, Cloneable /** * Get Transaction Isolation Info * @param transactionIsolation trx iso - * @return clear test + * @return transaction isolation level */ public static String getTransactionIsolationInfo(int transactionIsolation) { diff --git a/org.adempiere.base/src/org/compiere/db/CallableStatementProxy.java b/org.adempiere.base/src/org/compiere/db/CallableStatementProxy.java index 91e8e21bad..e647dec423 100644 --- a/org.adempiere.base/src/org/compiere/db/CallableStatementProxy.java +++ b/org.adempiere.base/src/org/compiere/db/CallableStatementProxy.java @@ -26,10 +26,19 @@ import org.idempiere.db.util.AutoCommitConnectionBroker; */ public class CallableStatementProxy extends PreparedStatementProxy { + /** + * @param vo + */ public CallableStatementProxy(CStatementVO vo) { super(vo); } + /** + * @param resultSetType + * @param resultSetConcurrency + * @param sql0 + * @param trxName + */ public CallableStatementProxy(int resultSetType, int resultSetConcurrency, String sql0, String trxName) { super(resultSetType, resultSetConcurrency, sql0, trxName); diff --git a/org.adempiere.base/src/org/compiere/db/Database.java b/org.adempiere.base/src/org/compiere/db/Database.java index 51834057a1..84e1af0809 100644 --- a/org.adempiere.base/src/org/compiere/db/Database.java +++ b/org.adempiere.base/src/org/compiere/db/Database.java @@ -56,8 +56,9 @@ public class Database private static final CCache> s_databaseReferenceCache = new CCache<>(null, "IDatabase", 2, false); /** - * Get Database by database Id. - * @return database + * Get database adapter by database type. + * @param type + * @return database adapter */ public static AdempiereDatabase getDatabase (String type) { @@ -79,6 +80,9 @@ public class Database return db; } + /** + * @return array of supported database name + */ public static String[] getDatabaseNames() { List names = new ArrayList(); @@ -90,10 +94,9 @@ public class Database } /** - * Get Database Driver by url string. - * Access to database specific functionality. + * Get Database adapter by URL string. * @param url JDBC connection url - * @return iDempiere Database Driver + * @return iDempiere Database Adapter */ public static AdempiereDatabase getDatabaseFromURL(String url) { @@ -112,9 +115,9 @@ public class Database } /** - * Apply common validations for database object names + * Apply common validations for database identifier. * @param identifier String - * @return String error-code - null if not error + * @return error-code or null (if no error) */ public static String isValidIdentifier(String identifier) { diff --git a/org.adempiere.base/src/org/compiere/db/LDAP.java b/org.adempiere.base/src/org/compiere/db/LDAP.java index a3a7f32569..26a9d557b2 100644 --- a/org.adempiere.base/src/org/compiere/db/LDAP.java +++ b/org.adempiere.base/src/org/compiere/db/LDAP.java @@ -66,7 +66,6 @@ public class LDAP { // Create the initial context InitialLdapContext ctx = new InitialLdapContext(env, null); - // DirContext ctx = new InitialDirContext(env); // Test - Get the attributes ctx.getAttributes(""); @@ -91,70 +90,7 @@ public class LDAP /** Logger */ private static final CLogger log = CLogger.getCLogger (LDAP.class); - - - /** - * Test NT - * @throws LoginException - * - private static void testNT () throws LoginException - { - try - { - System.out.println ("NT system ----------------------------"); - NTSystem ntsystem = new NTSystem (); - System.out.println (ntsystem); - System.out.println (ntsystem.getDomain ()); - System.out.println (ntsystem.getDomainSID ()); - System.out.println (ntsystem.getName ()); - System.out.println (ntsystem.getUserSID ()); - System.out.println ("NT login ----------------------------"); - NTLoginModule ntlogin = new NTLoginModule (); - System.out.println (ntlogin); - Map map = new HashMap(); - map.put ("debug", "true"); - ntlogin.initialize (null, null, null, map); - System.out.println (ntlogin.login ()); - } - catch (LoginException le) - { - System.err.println ("Authentication attempt failed" + le); - } - } // testNT - - - /** - * testKerberos - * @throws LoginException - * - private static void testKerberos () - throws LoginException - { - System.out.println ("Krb login ----------------------------"); - Map map = new HashMap(); - // map.put("debug", "true"); - // map.put("debugNative", "true"); - Krb5LoginModule klogin = new Krb5LoginModule (); - System.out.println (klogin); - map.put ("principal", "username@compiere.org"); - map.put ("credential", "pass"); - klogin.initialize (null, null, null, map); - System.out.println (klogin.login ()); - /*********************************************************************** - * ** No krb5.ini file found in entire system Debug is true storeKey - * false useTicketCache false useKeyTab false doNotPrompt false - * ticketCache is null KeyTab is null refreshKrb5Config is false - * principal is jjanke tryFirstPass is false useFirstPass is false - * storePass is false clearPass is false [Krb5LoginModule] - * authentication failed Could not load configuration file - * c:\winnt\krb5.ini (The system cannot find the file specified) - * javax.security.auth.login.LoginException: Could not load - * configuration file c:\winnt\krb5.ini (The system cannot find the file - * specified) - * - } // testKerbos - /**/ - + /** * Print Attributes to System.out * @param attrs @@ -187,23 +123,6 @@ public class LDAP e.printStackTrace (); } } - } // dump - - /** - * Test - * @param args ignored - */ - public static void main (String[] args) - { - try - { - validate("ldap://dc.compiere.org", "compiere.org", "jjanke", "ikeepforgetting"); - } - catch (Exception e) - { - e.printStackTrace(); - } - } // main - + } // dump } // LDAP diff --git a/org.adempiere.base/src/org/compiere/db/PreparedStatementProxy.java b/org.adempiere.base/src/org/compiere/db/PreparedStatementProxy.java index 95b5a480f1..dcfedcad66 100644 --- a/org.adempiere.base/src/org/compiere/db/PreparedStatementProxy.java +++ b/org.adempiere.base/src/org/compiere/db/PreparedStatementProxy.java @@ -32,6 +32,12 @@ import org.idempiere.db.util.AutoCommitConnectionBroker; */ public class PreparedStatementProxy extends StatementProxy { + /** + * @param resultSetType + * @param resultSetConcurrency + * @param sql0 + * @param trxName + */ public PreparedStatementProxy(int resultSetType, int resultSetConcurrency, String sql0, String trxName) { if (sql0 == null || sql0.length() == 0) @@ -45,6 +51,12 @@ public class PreparedStatementProxy extends StatementProxy { init(); } // PreparedStatementProxy + /** + * @param resultSetType + * @param resultSetConcurrency + * @param sql0 + * @param connection + */ public PreparedStatementProxy(int resultSetType, int resultSetConcurrency, String sql0, Connection connection) { if (sql0 == null || sql0.length() == 0) @@ -56,13 +68,16 @@ public class PreparedStatementProxy extends StatementProxy { init(connection); } // PreparedStatementProxy + /** + * @param vo + */ public PreparedStatementProxy(CStatementVO vo) { super(vo); } // PreparedStatementProxy /** - * Initialise the prepared statement wrapper object + * Initialize the prepared statement wrapper object */ protected void init() { try { @@ -86,7 +101,7 @@ public class PreparedStatementProxy extends StatementProxy { } /** - * Initialise the prepared statement wrapper object + * Initialize the prepared statement wrapper object */ protected void init(Connection connection) { try { @@ -101,7 +116,8 @@ public class PreparedStatementProxy extends StatementProxy { @Override protected RowSet getRowSet() { - log.finest("local_getRowSet"); + if (log.isLoggable(Level.FINE)) + log.finest("local_getRowSet"); RowSet rowSet = null; ResultSet rs = null; diff --git a/org.adempiere.base/src/org/compiere/db/ProxyFactory.java b/org.adempiere.base/src/org/compiere/db/ProxyFactory.java index 8b2f8b3a2b..5cb9d81754 100644 --- a/org.adempiere.base/src/org/compiere/db/ProxyFactory.java +++ b/org.adempiere.base/src/org/compiere/db/ProxyFactory.java @@ -21,7 +21,6 @@ import org.compiere.util.CStatement; import org.compiere.util.CStatementVO; /** - * * Factory class to instantiate dynamic proxy for CStatement, CPreparedStatement and CCallableStatement * @author Low Heng Sin * @@ -29,11 +28,10 @@ import org.compiere.util.CStatementVO; public class ProxyFactory { /** - * * @param resultSetType * @param resultSetConcurrency * @param trxName - * @return CStatement proxy + * @return new CStatement proxy instance */ public static CStatement newCStatement(int resultSetType, int resultSetConcurrency, String trxName) { @@ -43,12 +41,11 @@ public class ProxyFactory { } /** - * * @param resultSetType * @param resultSetConcurrency * @param sql * @param trxName - * @return CPreparedStatement proxy + * @return new CPreparedStatement proxy instance */ public static CPreparedStatement newCPreparedStatement(int resultSetType, int resultSetConcurrency, String sql, String trxName) { @@ -58,12 +55,11 @@ public class ProxyFactory { } /** - * * @param resultSetType * @param resultSetConcurrency * @param sql * @param trxName - * @return CPreparedStatement proxy + * @return new CPreparedStatement proxy instance */ public static CPreparedStatement newCPreparedStatement(int resultSetType, int resultSetConcurrency, String sql, Connection connection) { @@ -73,12 +69,11 @@ public class ProxyFactory { } /** - * * @param resultSetType * @param resultSetConcurrency * @param sql * @param trxName - * @return CCallableStatement proxy + * @return new CCallableStatement proxy instance */ public static CCallableStatement newCCallableStatement(int resultSetType, int resultSetConcurrency, String sql, String trxName) { @@ -88,9 +83,8 @@ public class ProxyFactory { } /** - * * @param info - * @return CStatement proxy + * @return new CStatement proxy instance */ public static CStatement newCStatement(CStatementVO info) { return (CStatement)Proxy.newProxyInstance(CStatement.class.getClassLoader(), @@ -99,9 +93,8 @@ public class ProxyFactory { } /** - * * @param info - * @return CPreparedStatement proxy + * @return new CPreparedStatement proxy instance */ public static CPreparedStatement newCPreparedStatement(CStatementVO info) { return (CPreparedStatement)Proxy.newProxyInstance(CPreparedStatement.class.getClassLoader(), @@ -110,9 +103,8 @@ public class ProxyFactory { } /** - * * @param info - * @return CCallableStatement proxy + * @return new CCallableStatement proxy instance */ public static CCallableStatement newCCallableStatement(CStatementVO info) { return (CCallableStatement)Proxy.newProxyInstance(CCallableStatement.class.getClassLoader(), @@ -125,7 +117,7 @@ public class ProxyFactory { * @param resultSetType * @param resultSetConcurrency * @param sql - * @return {@link CPreparedStatement} + * @return new {@link CPreparedStatement} proxy instance */ public static CPreparedStatement newReadReplicaPreparedStatement(int resultSetType, int resultSetConcurrency, String sql) { ReadReplicaPreparedStatementProxy handler = new ReadReplicaPreparedStatementProxy(resultSetType, resultSetConcurrency, sql); diff --git a/org.adempiere.base/src/org/compiere/db/ReadReplicaPreparedStatementProxy.java b/org.adempiere.base/src/org/compiere/db/ReadReplicaPreparedStatementProxy.java index f89459e484..823c25ae94 100644 --- a/org.adempiere.base/src/org/compiere/db/ReadReplicaPreparedStatementProxy.java +++ b/org.adempiere.base/src/org/compiere/db/ReadReplicaPreparedStatementProxy.java @@ -56,7 +56,6 @@ public class ReadReplicaPreparedStatementProxy implements InvocationHandler { protected CStatementVO p_vo = null; /** - * * @param resultSetType * @param resultSetConcurrency * @param sql @@ -85,6 +84,10 @@ public class ReadReplicaPreparedStatementProxy implements InvocationHandler { } } + /** + * Execute the wrapped prepare statement and return row set + * @return row set + */ private RowSet getRowSet() { if (log.isLoggable(Level.FINEST)) diff --git a/org.adempiere.base/src/org/compiere/db/SecurityPrincipal.java b/org.adempiere.base/src/org/compiere/db/SecurityPrincipal.java index 19abd0b6bc..517639872c 100644 --- a/org.adempiere.base/src/org/compiere/db/SecurityPrincipal.java +++ b/org.adempiere.base/src/org/compiere/db/SecurityPrincipal.java @@ -17,8 +17,9 @@ import java.io.Serializable; /** * Use by CConnection to store authentication info for application server. * @author Low Heng Sin - * + * @deprecated */ +@Deprecated(forRemoval = true, since = "11") public class SecurityPrincipal implements Serializable { /** * generated serial version id diff --git a/org.adempiere.base/src/org/compiere/db/StatementProxy.java b/org.adempiere.base/src/org/compiere/db/StatementProxy.java index 97e4b3b308..ff59984f32 100644 --- a/org.adempiere.base/src/org/compiere/db/StatementProxy.java +++ b/org.adempiere.base/src/org/compiere/db/StatementProxy.java @@ -34,7 +34,6 @@ import org.compiere.util.Trx; import org.idempiere.db.util.AutoCommitConnectionBroker; /** - * * Dynamic proxy for the CStatement interface * @author Low Heng Sin */ @@ -50,7 +49,12 @@ public class StatementProxy implements InvocationHandler { protected transient Statement p_stmt = null; /** Value Object */ protected CStatementVO p_vo = null; - + + /** + * @param resultSetType + * @param resultSetConcurrency + * @param trxName + */ public StatementProxy(int resultSetType, int resultSetConcurrency, String trxName) { p_vo = new CStatementVO (resultSetType, resultSetConcurrency); p_vo.setTrxName(trxName); @@ -58,6 +62,9 @@ public class StatementProxy implements InvocationHandler { init(); } + /** + * @param vo + */ public StatementProxy(CStatementVO vo) { p_vo = vo; init(); @@ -66,6 +73,7 @@ public class StatementProxy implements InvocationHandler { //for subclass protected StatementProxy() {} + @Override public Object invoke(Object obj, Method method, Object[] args) throws Throwable { String name = method.getName(); @@ -172,8 +180,8 @@ public class StatementProxy implements InvocationHandler { } /** - * Close - * @throws SQLException + * Close + * @throws SQLException * @see java.sql.Statement#close() */ private void close () throws SQLException @@ -194,14 +202,15 @@ public class StatementProxy implements InvocationHandler { } // close /** - * Execute Query - * @return ResultSet or RowSet + * Execute the wrapped statement and return row set + * @return RowSet * @throws SQLException * @see java.sql.PreparedStatement#executeQuery() */ protected RowSet getRowSet() { - log.finest("getRowSet"); + if (log.isLoggable(Level.FINEST)) + log.finest("getRowSet"); RowSet rowSet = null; ResultSet rs = null; try @@ -222,10 +231,10 @@ public class StatementProxy implements InvocationHandler { rowSet = null; } return rowSet; - } // local_getRowSet + } // getRowSet /** - * Commit (if local) + * Commit (if local trx) * @throws SQLException */ private void commit() throws SQLException diff --git a/org.adempiere.base/src/org/compiere/dbPort/Convert.java b/org.adempiere.base/src/org/compiere/dbPort/Convert.java index 5d67befa76..0d8c5896ef 100644 --- a/org.adempiere.base/src/org/compiere/dbPort/Convert.java +++ b/org.adempiere.base/src/org/compiere/dbPort/Convert.java @@ -50,7 +50,7 @@ import org.compiere.util.Ini; import org.compiere.util.Util; /** - * Convert SQL to Target DB + * Convert SQL from Oracle syntax to Target DB syntax * * @author Jorg Janke, Victor Perez * @version $Id: Convert.java,v 1.3 2006/07/30 00:55:04 jjanke Exp $ @@ -97,10 +97,10 @@ public abstract class Convert m_verbose = verbose; } // setVerbose - /************************************************************************** - * Execute SQL Statement (stops at first error). - * If an error occured hadError() returns true. - * You can get details via getConversionError() or getException() + /** + * Execute SQL Statements (stops at first error).
    + * If an error occur, hadError() returns true.
    + * You can get error details via getConversionError() or getException(). * @param sqlStatements * @param conn connection * @return true if success @@ -194,9 +194,9 @@ public abstract class Convert } // getException /** - * Returns true if a conversion or execution error had occured. - * Get more details via getConversionError() or getException() - * @return true if error had occured + * Returns true if a conversion or execution error had occurred. + * Get more details via getConversionError() or getException(). + * @return true if error had occurred */ public boolean hasError() { @@ -204,10 +204,10 @@ public abstract class Convert } // hasError /** - * Convert SQL Statement (stops at first error). - * Statements are delimited by / - * If an error occured hadError() returns true. - * You can get details via getConversionError() + * Convert SQL Statements (stops at first error).
    + * Statements are delimited by /.
    + * If an error occurred, hadError() returns true. + * You can get details via getConversionError(). * @param sqlStatements * @return converted statement as a string */ @@ -226,9 +226,9 @@ public abstract class Convert } // convertAll /** - * Convert SQL Statement (stops at first error). - * If an error occured hadError() returns true. - * You can get details via getConversionError() + * Convert SQL Statements (stops at first error).
    + * If an error occurred, hadError() returns true. + * You can get details via getConversionError(). * @param sqlStatements * @return Array of converted Statements */ @@ -247,15 +247,14 @@ public abstract class Convert /** * Return last conversion error or null. - * @return lst conversion error + * @return last conversion error */ public String getConversionError() { return m_conversionError; } // getConversionError - - /************************************************************************** + /** * Conversion routine (stops at first error). *
     	 *  - convertStatement
    @@ -278,7 +277,7 @@ public abstract class Convert
     	}   //  convertIt
     
     	/**
    -	 * Clean up Statement. Remove trailing spaces, carrige return and tab 
    +	 * Clean up Statement. Remove trailing spaces, carriage return and tab 
     	 * 
     	 * @param statement
     	 * @return sql statement
    @@ -292,11 +291,10 @@ public abstract class Convert
     
     		clean = clean.trim();
     		return clean;
    -	} // removeComments
    +	} // cleanUpStatement
     	
     	/**
    -	 * Utility method to replace quoted string with a predefined marker
    -
    +	 * Utility method to replace quoted string with a predefined marker.
     	 * @param inputValue
     	 * @param retVars
     	 * @param nonce
    @@ -331,6 +329,7 @@ public abstract class Convert
     	 * Utility method to recover quoted string store in retVars
     	 * @param retValue
     	 * @param retVars
    +	 * @param nonce
     	 * @return string
     	 */
     	protected String recoverQuotedStrings(String retValue, VectorretVars, String nonce) {
    @@ -354,7 +353,7 @@ public abstract class Convert
     	}
     	
     	/**
    -	 * Convert simple SQL Statement. Based on ConvertMap
    +	 * Convert simple SQL Statement. Based on ConvertMap.
     	 * 
     	 * @param sqlStatement
     	 * @return converted Statement
    @@ -364,7 +363,8 @@ public abstract class Convert
     		if (sqlStatement.toUpperCase().indexOf("EXCEPTION WHEN") != -1) {
     			String error = "Exception clause needs to be converted: "
     					+ sqlStatement;
    -			log.info(error);
    +			if (log.isLoggable(Level.INFO))
    +				log.info(error);
     			m_conversionError = error;
     			return sqlStatement;
     		}
    @@ -404,7 +404,7 @@ public abstract class Convert
     	/**
     	 * do convert map base conversion
     	 * @param sqlStatement
    -	 * @return string
    +	 * @return converted sql statement
     	 */
     	protected String convertWithConvertMap(String sqlStatement) {
     		try 
    @@ -551,6 +551,7 @@ public abstract class Convert
     		return logMigrationScript;
     	}
     
    +	/** List of tables to skip log migration script */
     	private static String [] dontLogTables = new String[] {
     			"AD_ACCESSLOG",
     			"AD_ALERTPROCESSORLOG",
    diff --git a/org.adempiere.base/src/org/compiere/dbPort/Convert_SQL92.java b/org.adempiere.base/src/org/compiere/dbPort/Convert_SQL92.java
    index 0531480529..834c6f9796 100644
    --- a/org.adempiere.base/src/org/compiere/dbPort/Convert_SQL92.java
    +++ b/org.adempiere.base/src/org/compiere/dbPort/Convert_SQL92.java
    @@ -32,8 +32,8 @@ public abstract class Convert_SQL92 extends Convert {
     	private static final CLogger	log	= CLogger.getCLogger (Convert_SQL92.class);
     	
     	/**************************************************************************
    -	 *  Convert Outer Join.
    -	 *  Converting joins can ve very complex when multiple tables/keys are involved.
    +	 *  Convert Outer Join.
    + * Converting joins can be very complex when multiple tables/keys are involved. * The main scenarios supported are two tables with multiple key columns * and multiple tables with single key columns. *
    {@code
    @@ -57,10 +57,7 @@ public abstract class Convert_SQL92 extends Convert {
     		//
     		int fromIndex = Util.findIndexOf (sqlStatement.toUpperCase(), " FROM ");
     		int whereIndex = Util.findIndexOf(sqlStatement.toUpperCase(), " WHERE ");
    -		//begin vpj-cd e-evolution 03/14/2005 PostgreSQL
    -		//int endWhereIndex = Util.findIndexOf(sqlStatement.toUpperCase(), " GRPUP BY ");
     		int endWhereIndex = Util.findIndexOf(sqlStatement.toUpperCase(), " GROUP BY ");
    -        //end vpj-cd e-evolution 03/14/2005	PostgreSQL
     		if (endWhereIndex == -1)
     			endWhereIndex = Util.findIndexOf(sqlStatement.toUpperCase(), " ORDER BY ");
     		if (endWhereIndex == -1)
    @@ -69,7 +66,6 @@ public abstract class Convert_SQL92 extends Convert {
     		if (trace)
     		{
     			if (log.isLoggable(Level.INFO)) log.info("OuterJoin<== " + sqlStatement);
    -		//	log.info("From=" + fromIndex + ", Where=" + whereIndex + ", End=" + endWhereIndex + ", Length=" + sqlStatement.length());
     		}
     		//
     		String selectPart = sqlStatement.substring(0, fromIndex);
    @@ -109,7 +105,6 @@ public abstract class Convert_SQL92 extends Convert {
     				end = newWherePart.indexOf(" OR ", pos);
     			if (end == -1)
     				end = newWherePart.length();
    -		//	log.info("<= " + newWherePart + " - Start=" + start + "+" + startOffset + ", End=" + end);
     
     			//  extract condition
     			String condition = newWherePart.substring(start+startOffset, end);
    @@ -118,7 +113,6 @@ public abstract class Convert_SQL92 extends Convert {
     				if (log.isLoggable(Level.INFO)) log.info("->" + condition);
     			//  new WHERE clause
     			newWherePart = newWherePart.substring(0, start) + newWherePart.substring(end);
    -		//	log.info("=> " + newWherePart);
     			//
     			pos = newWherePart.indexOf("(+)");
     		}
    @@ -321,7 +315,7 @@ public abstract class Convert_SQL92 extends Convert {
     		return retValue.toString();
     	}   //  convertOuterJoin
     	
    -	/**************************************************************************
    +	/**
     	 *  Converts Decode.
     	 *  
    {@code
     	 *      DECODE (a, 1, 'one', 2, 'two', 'none')
    @@ -332,7 +326,6 @@ public abstract class Convert_SQL92 extends Convert {
     	 */
     	protected String convertDecode(String sqlStatement, int fromIndex)
     	{
    -	//	log.info("DECODE<== " + sqlStatement);
     		String statement = sqlStatement;
     		StringBuilder sb = new StringBuilder("CASE");
     
    @@ -362,7 +355,6 @@ public abstract class Convert_SQL92 extends Convert {
     		//  find the expression "a" - find first , ignoring ()
     		index = Util.findIndexOf (statement, ',');
     		String expression = statement.substring(0, index).trim();
    -	//	log.info("Expression=" + expression);
     
     		//  Pairs "1, 'one',"
     		statement = statement.substring(index+1);
    @@ -372,7 +364,6 @@ public abstract class Convert_SQL92 extends Convert {
     			String first = statement.substring(0, index);
     			char cc = statement.charAt(index);
     			statement = statement.substring(index+1);
    -		//	log.info("First=" + first + ", Char=" + cc);
     			//
     			boolean error = false;
     			if (cc == ',')
    @@ -385,7 +376,6 @@ public abstract class Convert_SQL92 extends Convert {
     					String second = statement.substring(0, index);
     					sb.append(" WHEN ").append(expression).append("=").append(first.trim())
     						.append(" THEN ").append(second.trim());
    -		//			log.info(">>" + sb.toString());
     					statement = statement.substring(index+1);
     					index = Util.findIndexOf (statement, ',',')');
     				}
    @@ -393,7 +383,6 @@ public abstract class Convert_SQL92 extends Convert {
     			else if (cc == ')')
     			{
     				sb.append(" ELSE ").append(first.trim()).append(" END");
    -		//		log.info(">>" + sb.toString());
     				index = -1;
     			}
     			else
    @@ -410,11 +399,10 @@ public abstract class Convert_SQL92 extends Convert {
     		}
     		sb.append(statement);
     		sb.insert(0, firstPart);
    -	//	log.info("DECODE==> " + sb.toString());
     		return sb.toString();
     	}	//  convertDecode
     	
    -	/***************************************************************************
    +	/**
     	 * Converts Delete.
     	 * 
     	 * 
    @@ -437,9 +425,9 @@ public abstract class Convert_SQL92 extends Convert {
     	} // convertDelete
     	
     	/**
    -	 * Is character a valid sql operator
    +	 * Is character a valid SQL operator
     	 * @param c
    -	 * @return boolean
    +	 * @return true if c is SQL operator
     	 */
     	protected boolean isOperator(char c)
     	{
    diff --git a/org.adempiere.base/src/org/compiere/dbPort/Join.java b/org.adempiere.base/src/org/compiere/dbPort/Join.java
    index 84f338cce7..16508589f8 100644
    --- a/org.adempiere.base/src/org/compiere/dbPort/Join.java
    +++ b/org.adempiere.base/src/org/compiere/dbPort/Join.java
    @@ -19,7 +19,7 @@ package org.compiere.dbPort;
     import org.compiere.util.Util;
     
     /**
    - *  Join Clause.
    + *  Model for Join Clause.
      *  
      *  f.AD_Column_ID = c.AD_Column_ID(+)
      *  
    @@ -48,9 +48,11 @@ public class Join private String m_condition; /** - * Evaluate the clause. + * Parse join clause. + *
     	 *  e.g.    tb.AD_User_ID(+)=?
     	 *          f.AD_Column_ID = c.AD_Column_ID(+)
    +	 *  
    * @param joinClause */ private void evaluate (String joinClause) @@ -81,7 +83,7 @@ public class Join } // evaluate /** - * Get origial Join Clause. + * Get original Join Clause.
    * e.g. f.AD_Column_ID = c.AD_Column_ID(+) * @return Join cluase */ @@ -109,7 +111,7 @@ public class Join } // getJoinAlias /** - * Is Left Aouter Join + * Is Left Outer Join * @return true if left outer join */ public boolean isLeft() @@ -118,7 +120,7 @@ public class Join } // isLeft /** - * Get Join condition. + * Get Join condition.
    * e.g. f.AD_Column_ID = c.AD_Column_ID * @return join condition */ @@ -153,8 +155,8 @@ public class Join } // getMainTable /** - * Set Main Table Name. - * If table name equals alias, the alias is set to "" + * Set Join Table Name.
    + * If join table name equals join alias, the join alias is set to "" * @param joinTable */ public void setJoinTable(String joinTable) @@ -178,7 +180,7 @@ public class Join /*************************************************************************/ /** - * This Join is a condition of the first Join. + * This Join is a condition of the first Join.
    * e.g. tb.AD_User_ID(+)=? or tb.AD_User_ID(+)='123' * @param first * @return true if condition diff --git a/org.adempiere.base/src/org/compiere/impexp/BankStatementLoaderInterface.java b/org.adempiere.base/src/org/compiere/impexp/BankStatementLoaderInterface.java index 49af8d09f1..e57858428c 100644 --- a/org.adempiere.base/src/org/compiere/impexp/BankStatementLoaderInterface.java +++ b/org.adempiere.base/src/org/compiere/impexp/BankStatementLoaderInterface.java @@ -21,10 +21,9 @@ import java.sql.Timestamp; import org.compiere.model.MBankStatementLoader; - /** - * Interface to be implemented by bank statement loader classes - * + * Interface to be implemented by bank statement loader classes. + *
      *  Bank statement loader classes that extend this interface can be loaded
      *  by the MBankStatementLoader controller class. 
      *  The usage patter looks like this:
    @@ -42,7 +41,7 @@ import org.compiere.model.MBankStatementLoader;
      *
      *  -The MBankStatementLoader controller object can now obtain the data for the current bank
      *  statement line by using the corresponding get methods of the loader class.
    - *
    + *  
    * @author Maarten Klinker, Eldir Tomassen * @version $Id: BankStatementLoaderInterface.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $ */ @@ -58,21 +57,19 @@ public interface BankStatementLoaderInterface /** * Verify whether the data to be imported is valid - * @return Data is valid - * If the actual loaders does not do any validity checks - * it will just return true. + * @return true if Data is valid */ public boolean isValid(); /** * Start importing statement lines - * @return Statement lines imported successfully + * @return true if statement lines imported successfully */ public boolean loadLines(); /** * Return the most recent error - * @return Error message + * @return Error message. * This error message will be handled as a ADempiere message, * (e.g. it can be translated) */ @@ -80,7 +77,7 @@ public interface BankStatementLoaderInterface /** * Return the most recent error description - * @return Error description + * @return Error description. * This is an additional error description, it can be used to provided * descriptive information, such as a file name or SQL error, that can not * be translated by the ADempiere message system. @@ -89,9 +86,10 @@ public interface BankStatementLoaderInterface /** * The last time this loader acquired bank statement data. - * For OFX this is the value. This is generally only available\ + *

    + * For OFX this is the <DTEND> value. This is generally only available * after loadLines() has been called. If a specific loader class - * does not provided this information it is allowed to return null + * does not provide this information it is allowed to return null. * @return Date last run */ public Timestamp getDateLastRun(); @@ -115,7 +113,7 @@ public interface BankStatementLoaderInterface public String getIBAN() ; /** - * Additional reference information + * Additional reference information.
    * Statement level reference information. If a specific loader class * does not provided this, it is allowed to return null. * @return Statement Reference @@ -123,7 +121,7 @@ public interface BankStatementLoaderInterface public String getStatementReference(); /** - * Statement Date + * Statement Date.
    * Date of the bank statement. If a specific loader does not provide this, * it is allowed to return null. * @return Statement Date @@ -132,7 +130,8 @@ public interface BankStatementLoaderInterface /** * Transaction ID assigned by the bank. - * For OFX this is the + *

    + * For OFX this is the <FITID>. * If a specific loader does not provide this, it is allowed to return * null. * @return Transaction ID @@ -140,28 +139,31 @@ public interface BankStatementLoaderInterface public String getTrxID(); /** - * Additional reference information + * Additional reference information. * Statement line level reference information. - * For OFX this is the field. + *

    + * For OFX this is the <REFNUM> field. * If a specific loader does not provided this, it is allowed to return null. * @return Reference */ public String getReference(); /** - * Check number + * Check number. * Check number, in case the transaction was initiated by a check. - * For OFX this is the field, for MS-Money (OFC) this is the - * field. + *

    + * For OFX this is the <CHECKNUM> field, for MS-Money (OFC) this is the + * <CHKNUM> field. * If a specific loader does not provide this, it is allowed to return null. * @return Transaction reference */ public String getCheckNo(); /** - * Payee name - * Name information, for OFX this is the or - * field + * Payee name. + *

    + * Name information, for OFX this is the <NAME> or + * <PAYEE><NAME> field. * If a specific loader class does not provide this, it is allowed * to return null. * @return Payee name @@ -169,8 +171,9 @@ public interface BankStatementLoaderInterface public String getPayeeName(); /** - * Payee account - * Account information of "the other party" + * Payee account. + *

    + * Account information of "the other party". * If a specific loader class does not provide this, it is allowed * to return null. * @return Payee bank account number @@ -178,14 +181,15 @@ public interface BankStatementLoaderInterface public String getPayeeAccountNo(); /** - * Statement line date + * Statement line date. * This has to be provided by all loader classes. * @return Statement line date */ public Timestamp getStatementLineDate(); /** - * Effective date + * Effective date. + *

    * Date at the funds became available. * If a specific loader does not provide this, it is allowed to return null. * @return Effective date @@ -193,8 +197,8 @@ public interface BankStatementLoaderInterface public Timestamp getValutaDate(); /** - * Transaction type - * @return Transaction type + * Transaction type. + * @return Transaction type.
    * This returns the transaction type as used by the bank * Whether a transaction is credit or debit depends on the amount (i.e. negative), * this field is for reference only. @@ -211,7 +215,7 @@ public interface BankStatementLoaderInterface /** * Currency - * @return Currency + * @return Currency.
    * Return the currency, if included in the statement data. * It is returned as it appears in the import data, it should * not be processed by the loader in any way. @@ -222,7 +226,7 @@ public interface BankStatementLoaderInterface /** * Statement line amount - * @return Statement Line Amount + * @return Statement Line Amount. * This has to be provided by all loader classes. */ public BigDecimal getStmtAmt(); @@ -241,17 +245,17 @@ public interface BankStatementLoaderInterface /** * Transaction memo - * @return Memo + * @return Memo.
    * Additional descriptive information. - * For OFX this is the filed, for SWIFT MT940 + * For OFX this is the <MEMO> filed, for SWIFT MT940 * this is the "86" line. * If a specific loader does not provide this, it is allowed to return null. */ public String getMemo(); /** - * Charge name - * @return Charge name + * Charge name. + * @return Charge name.
    * Name of the charge, in case this transaction is a bank charge. * If a specific loader class does not provide this, it is allowed * to return null. @@ -260,8 +264,8 @@ public interface BankStatementLoaderInterface /** * Charge amount - * @return Charge amount - * Name of the charge, in case this transaction is a bank charge. + * @return Charge amount.
    + * Charge amount, in case this transaction is a bank charge. * If a specific loader class does not provide this, it is allowed * to return null. */ diff --git a/org.adempiere.base/src/org/compiere/impexp/BankStatementMatchInfo.java b/org.adempiere.base/src/org/compiere/impexp/BankStatementMatchInfo.java index 41ac1fc59f..92ee7e60e6 100644 --- a/org.adempiere.base/src/org/compiere/impexp/BankStatementMatchInfo.java +++ b/org.adempiere.base/src/org/compiere/impexp/BankStatementMatchInfo.java @@ -18,7 +18,7 @@ package org.compiere.impexp; /** * Bank Statement Match Information. - * Returned by Bank Statement Matcher + * Returned by Bank Statement Matcher. * * @author Jorg Janke * @version $Id: BankStatementMatchInfo.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $ @@ -38,7 +38,6 @@ public class BankStatementMatchInfo private int m_C_Payment_ID = 0; private int m_C_Invoice_ID = 0; - /** * Do we have a match? * @return true if something could be matched @@ -48,7 +47,6 @@ public class BankStatementMatchInfo return m_C_BPartner_ID > 0 || m_C_Payment_ID > 0 || m_C_Invoice_ID > 0; } // isValid - /** * Get matched BPartner * @return BPartner diff --git a/org.adempiere.base/src/org/compiere/impexp/BankStatementMatcherInterface.java b/org.adempiere.base/src/org/compiere/impexp/BankStatementMatcherInterface.java index 10a9ba099d..41050175c5 100644 --- a/org.adempiere.base/src/org/compiere/impexp/BankStatementMatcherInterface.java +++ b/org.adempiere.base/src/org/compiere/impexp/BankStatementMatcherInterface.java @@ -20,7 +20,7 @@ import org.compiere.model.MBankStatementLine; import org.compiere.model.X_I_BankStatement; /** - * Bank Statement Matcher Algorithm Interface + * Bank Statement Matcher Interface * * @author Jorg Janke * @version $Id: BankStatementMatcherInterface.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $ diff --git a/org.adempiere.base/src/org/compiere/impexp/CopyImportFormat.java b/org.adempiere.base/src/org/compiere/impexp/CopyImportFormat.java index 74c6eb6b8b..b4c7fd7038 100644 --- a/org.adempiere.base/src/org/compiere/impexp/CopyImportFormat.java +++ b/org.adempiere.base/src/org/compiere/impexp/CopyImportFormat.java @@ -23,7 +23,6 @@ import org.compiere.model.MProcessPara; import org.compiere.process.ProcessInfoParameter; import org.compiere.process.SvrProcess; - /** * Copy Import Format (lines) * @@ -39,6 +38,7 @@ public class CopyImportFormat extends SvrProcess /** * Prepare - e.g., get Parameters. */ + @Override protected void prepare() { ProcessInfoParameter[] para = getParameter(); @@ -54,13 +54,13 @@ public class CopyImportFormat extends SvrProcess } to_AD_ImpFormat_ID = getRecord_ID(); } // prepare - /** * Process Copy * @return info * @throws Exception */ + @Override protected String doIt () throws Exception { if (log.isLoggable(Level.INFO)) log.info("doIt = From=" + from_AD_ImpFormat_ID + " To=" + to_AD_ImpFormat_ID); diff --git a/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java b/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java index ae46a71b8c..b9edaf7d11 100644 --- a/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java +++ b/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java @@ -35,7 +35,7 @@ import org.compiere.util.DB; import org.compiere.util.Env; /** - * Import Format a Row + * Import Format * * @author Jorg Janke * @author Trifon Trifonov, Catura AG (www.catura.de) @@ -101,6 +101,10 @@ public final class ImpFormat return m_name; } // getName + /** + * Set separator character for column + * @param newChar + */ public void setSeparatorChar(String newChar) { if (newChar == null || newChar.length() == 0) { throw new IllegalArgumentException("Separator Character must be 1 char"); @@ -108,11 +112,16 @@ public final class ImpFormat separatorChar = newChar; } } + + /** + * @return separator character for column + */ public String getSeparatorChar() { return separatorChar; } + /** - * Import Table + * Set Import Table * @param AD_Table_ID table */ public void setTable (int AD_Table_ID) @@ -164,8 +173,7 @@ public final class ImpFormat } else if (m_AD_Table_ID == I_I_BPartner.Table_ID) // I_BPartner { - // gody: 20070113 to allow multiple contacts per BP - // m_tableUnique1 = "Value"; // the key + ; } else if (m_AD_Table_ID == I_I_ElementValue.Table_ID) // I_ElementValue { @@ -232,7 +240,7 @@ public final class ImpFormat return m_BPartner; } // getVPartner - /************************************************************************* + /** * Add Format Row * @param row row */ @@ -242,9 +250,9 @@ public final class ImpFormat } // addRow /** - * Get Row + * Get Format Row * @param index index - * @return Import Format Row + * @return Import Format Row or null (if index is not valid) */ public ImpFormatRow getRow (int index) { @@ -254,16 +262,16 @@ public final class ImpFormat } // getRow /** - * Get Row Count - * @return row count + * Get Format Row Count + * @return format row count */ public int getRowCount() { return m_rows.size(); } // getRowCount - /************************************************************************* - * Factory load + /** + * Load import format * @param Id id * @return Import Format */ @@ -303,9 +311,9 @@ public final class ImpFormat } // getFormat /** - * Load Format Rows with ID + * Load Format Rows via import format id * @param format format - * @param ID id + * @param ID import format id */ private static void loadRows (ImpFormat format, int ID) { @@ -346,8 +354,8 @@ public final class ImpFormat } } // loadLines - /************************************************************************* - * Parse Line returns ArrayList of values + /** + * Parse line and returns list of values * * @param line line * @param withLabel true if with label @@ -445,15 +453,15 @@ public final class ImpFormat } // parseLine /** - * Parse flexible line format. - * A bit inefficient as it always starts from the start + * Parse flexible line format.
    + * A bit inefficient as it always starts from the start. * * @param line the line to be parsed * @param formatType Comma or Tab * @param fieldNo number of field to be returned * @return field in lime or "" - @throws IllegalArgumentException if format unknowns - * */ + * @throws IllegalArgumentException if format unknowns + */ private String parseFlexFormat (String line, String formatType, int fieldNo) { final char QUOTE = '"'; @@ -527,7 +535,7 @@ public final class ImpFormat return ""; } // parseFlexFormat - /************************************************************************* + /** * Insert/Update Database. * @param ctx context * @param line line @@ -538,7 +546,8 @@ public final class ImpFormat { if (line == null || line.trim().length() == 0) { - log.finest("No Line"); + if (log.isLoggable(Level.FINEST)) + log.finest("No Line"); return false; } String[] nodes = parseLine (line, true, false, true); // with label, no trace, ignore empty @@ -547,7 +556,6 @@ public final class ImpFormat if (log.isLoggable(Level.FINEST)) log.finest("Nothing parsed from: " + line); return false; } - // log.config( "ImpFormat.updateDB - listSize=" + nodes.length); // Standard Fields int AD_Client_ID = Env.getAD_Client_ID(ctx); @@ -556,7 +564,6 @@ public final class ImpFormat AD_Org_ID = 0; int UpdatedBy = Env.getAD_User_ID(ctx); - // Check if the record is already there ------------------------------ StringBuilder sql = new StringBuilder ("SELECT COUNT(*), MAX(") .append(m_tablePK).append(") FROM ").append(m_tableName) @@ -649,7 +656,8 @@ public final class ImpFormat if (log.isLoggable(Level.FINER)) log.finer("New ID=" + ID + " " + find); } else { - log.warning("Not Inserted, Old ID=" + ID + " " + find); + if (log.isLoggable(Level.WARNING)) + log.warning("Not Inserted, Old ID=" + ID + " " + find); return false; } diff --git a/org.adempiere.base/src/org/compiere/impexp/ImpFormatRow.java b/org.adempiere.base/src/org/compiere/impexp/ImpFormatRow.java index 397996e365..cabb6b22a9 100644 --- a/org.adempiere.base/src/org/compiere/impexp/ImpFormatRow.java +++ b/org.adempiere.base/src/org/compiere/impexp/ImpFormatRow.java @@ -212,7 +212,6 @@ public final class ImpFormatRow throw new IllegalArgumentException("DataType must be S/D/N/C"); } // setDataType - /** * Data Type * @return data type @@ -377,7 +376,7 @@ public final class ImpFormatRow /** * Set maximum length for Strings (truncated). - * Ignored, if 0 + * Ignored, if 0. * @param maxLength max length */ public void setMaxLength (int maxLength) @@ -386,7 +385,7 @@ public final class ImpFormatRow } // setMaxLength - /************************************************************************* + /** * Parse value. * Field content in [] are treated as comments * @param info data item @@ -428,7 +427,6 @@ public final class ImpFormatRow retValue = ""; return (retValue.trim().length() > 0 ? importprefix : "") + retValue.trim(); } // parse - /** * Return date as YYYY-MM-DD HH24:MI:SS (JDBC Timestamp format w/o milliseconds) @@ -469,9 +467,11 @@ public final class ImpFormatRow } // parseNumber /** - * Return String. + *

    +	 *  Return String.
     	 *  - clean ' and backslash
     	 *  - check max length
    +	 *  
    * @param info data * @return info with in SQL format */ diff --git a/org.adempiere.base/src/org/compiere/impexp/MImpFormat.java b/org.adempiere.base/src/org/compiere/impexp/MImpFormat.java index f7a29f23bd..ab300be87a 100644 --- a/org.adempiere.base/src/org/compiere/impexp/MImpFormat.java +++ b/org.adempiere.base/src/org/compiere/impexp/MImpFormat.java @@ -25,7 +25,6 @@ import java.util.logging.Level; import org.compiere.model.X_AD_ImpFormat; import org.compiere.util.DB; - /** * Import Format Model * @@ -36,16 +35,16 @@ public class MImpFormat extends X_AD_ImpFormat { /** - * + * generated serial id */ private static final long serialVersionUID = -3768339618622673968L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_ImpFormat_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_ImpFormat_UU UUID key + * @param trxName Transaction + */ public MImpFormat(Properties ctx, String AD_ImpFormat_UU, String trxName) { super(ctx, AD_ImpFormat_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/impexp/MImpFormatRow.java b/org.adempiere.base/src/org/compiere/impexp/MImpFormatRow.java index 6ba82bff8c..4664cc27d5 100644 --- a/org.adempiere.base/src/org/compiere/impexp/MImpFormatRow.java +++ b/org.adempiere.base/src/org/compiere/impexp/MImpFormatRow.java @@ -22,7 +22,6 @@ import java.util.Properties; import org.compiere.model.X_AD_ImpFormat_Row; import org.compiere.util.Util; - /** * Import Format Row Model * @@ -33,16 +32,16 @@ public class MImpFormatRow extends X_AD_ImpFormat_Row { /** - * + * generated serial id */ private static final long serialVersionUID = 6251836513717968622L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_ImpFormat_Row_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_ImpFormat_Row_UU UUID key + * @param trxName Transaction + */ public MImpFormatRow(Properties ctx, String AD_ImpFormat_Row_UU, String trxName) { super(ctx, AD_ImpFormat_Row_UU, trxName); if (Util.isEmpty(AD_ImpFormat_Row_UU)) diff --git a/org.adempiere.base/src/org/compiere/impexp/OFX1ToXML.java b/org.adempiere.base/src/org/compiere/impexp/OFX1ToXML.java index 9aef1157b1..55a9209d02 100644 --- a/org.adempiere.base/src/org/compiere/impexp/OFX1ToXML.java +++ b/org.adempiere.base/src/org/compiere/impexp/OFX1ToXML.java @@ -28,10 +28,10 @@ import java.util.logging.Level; import org.compiere.util.CLogger; /** - * Covert OFX 1XX (SQGML) into valid XML - * + * Covert OFX 1XX (SQGML) into valid XML. + *

    * SGML BASED OFX 1 compliant data is read from the BufferedReader - * passed to init. This class extends InputSream, allowing the + * passed to init. This class extends InputStream, allowing the * XML compliant output data to be read from it. * * @author Maarten Klinker @@ -106,6 +106,7 @@ public final class OFX1ToXML extends InputStream implements Runnable * Method run * @see java.lang.Runnable#run() */ + @Override public void run() { boolean addCloseTag; @@ -183,6 +184,7 @@ public final class OFX1ToXML extends InputStream implements Runnable * @return int * @throws IOException */ + @Override public int read() throws IOException { return m_reader.read(); @@ -201,9 +203,6 @@ public final class OFX1ToXML extends InputStream implements Runnable return m_reader.read(cbuf, off, len); } // read - - - /** * Encodes strings for XML * @param text text diff --git a/org.adempiere.base/src/org/compiere/impexp/OFXBankStatementHandler.java b/org.adempiere.base/src/org/compiere/impexp/OFXBankStatementHandler.java index 513f2ba67f..1c964595a6 100644 --- a/org.adempiere.base/src/org/compiere/impexp/OFXBankStatementHandler.java +++ b/org.adempiere.base/src/org/compiere/impexp/OFXBankStatementHandler.java @@ -42,13 +42,13 @@ import org.xml.sax.helpers.DefaultHandler; /** - * Parser for OFX bank statements - * + * Parser for OFX bank statements. + *

    * This class is a parser for OFX bankstatements. OFX versions from 102 to 202 - * and MS-Money OFC message sets are supported. + * and MS-Money OFC message sets are supported.
    * Only fully XML compliant OFX data is supported. Files that are not XML * compliant, e.g. OFX versions older then 200, will be preprocessed by - * the OFX1ToXML class before parsing. + * the OFX1ToXML class before parsing.
    * This class should be extended by a class that obtains the data to be parsed * for example from a file, or using HTTP. * @@ -78,10 +78,8 @@ public abstract class OFXBankStatementHandler extends DefaultHandler protected Timestamp m_dateLastRun = null; protected Timestamp m_statementDate = null; - StringBuffer m_valueBuffer = new StringBuffer(); + protected StringBuffer m_valueBuffer = new StringBuffer(); - - /** XML OFX Tag */ public static final String XML_OFX_TAG = "OFX"; @@ -105,8 +103,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler /** Status aggregate */ public static final String XML_STATUS_TAG = "STATUS"; - - + /** Statement-response aggregate */ public static final String XML_STMTRS_TAG = "STMTRS"; /** XML CURDEF Tag */ @@ -173,8 +170,8 @@ public abstract class OFXBankStatementHandler extends DefaultHandler /** * Initialize the loader - * * @param controller Reference to the BankStatementLoaderController - @return Initialized succesfully + * @param controller Reference to the BankStatementLoaderController + * @return Initialized successfully */ protected boolean init(MBankStatementLoader controller) { @@ -267,8 +264,9 @@ public abstract class OFXBankStatementHandler extends DefaultHandler return result; } // attachInput - /** Verify the validity of the OFX data - * @return true if input is valid OFX data + /** + * Verify the validity of the OFX data + * @return true if input is valid OFX data */ public boolean isValid() { @@ -292,8 +290,9 @@ public abstract class OFXBankStatementHandler extends DefaultHandler return result; } //isValid - /** Check wether the import was succesfull - * @return true if all statement lines have been imported succesfully + /** + * Check wether the import was succesfull + * @return true if all statement lines have been imported succesfully */ public boolean importSuccessfull() { @@ -305,9 +304,9 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } // importSuccessfull /** - * Read statementlines from InputStream. - * @return load success + * Read statementlines from InputStream.
    * This method will be invoked from ImportController. + * @return load success */ public boolean loadLines() { @@ -334,6 +333,9 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } // loadLines + /** + * Close {@link #m_reader} + */ private void closeBufferedReader() { if (m_reader != null) try { @@ -344,8 +346,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getDateLastRun - * @return Timestamp + * @return last run date */ public Timestamp getDateLastRun() { @@ -353,8 +354,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getRoutingNo - * @return String + * @return routing number */ public String getRoutingNo() { @@ -362,8 +362,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getBankAccountNo - * @return String + * @return line bank account number */ public String getBankAccountNo() { @@ -371,16 +370,14 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getIBAN - * @return String + * @return IBAN */ public String getIBAN() { return null; } /** - * Method getStatementReference - * @return String + * @return line statement reference */ public String getStatementReference() { @@ -388,8 +385,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getStatementDate - * @return Timestamp + * @return statement date */ public Timestamp getStatementDate() { @@ -397,8 +393,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getReference - * @return String + * @return line reference */ public String getReference() { @@ -406,8 +401,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getStatementLineDate - * @return Timestamp + * @return line statement date */ public Timestamp getStatementLineDate() { @@ -415,8 +409,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getValutaDate - * @return Timestamp + * @return line valuta date */ public Timestamp getValutaDate() { @@ -424,8 +417,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getTrxType - * @return String + * @return line trx type */ public String getTrxType() { @@ -433,8 +425,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getIsReversal - * @return boolean + * @return true if line is reversal */ public boolean getIsReversal() { @@ -442,8 +433,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getCurrency - * @return String + * @return line currency */ public String getCurrency() { @@ -451,8 +441,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getStmtAmt - * @return BigDecimal + * @return line statement amount */ public BigDecimal getStmtAmt() { @@ -460,8 +449,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getTrxAmt - * @return Transaction Amount + * @return Line Transaction Amount */ public BigDecimal getTrxAmt() { @@ -472,7 +460,6 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getInterestAmount * @return Interest Amount */ public BigDecimal getInterestAmt() @@ -482,8 +469,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler /** - * Method getMemo - * @return String + * @return line memo */ public String getMemo() { @@ -491,8 +477,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getChargeName - * @return String + * @return line charge name */ public String getChargeName() { @@ -500,8 +485,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getChargeAmt - * @return BigDecimal + * @return line charge amount */ public BigDecimal getChargeAmt() { @@ -509,8 +493,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getTrxID - * @return String + * @return line transaction id */ public String getTrxID() { @@ -518,8 +501,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getPayeeAccountNo - * @return String + * @return line payee account number */ public String getPayeeAccountNo() { @@ -527,8 +509,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getPayeeName - * @return String + * @return line payee name */ public String getPayeeName() { @@ -536,8 +517,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getCheckNo - * @return String + * @return line check number */ public String getCheckNo() { @@ -555,6 +535,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler * @throws org.xml.sax.SAXException * @see org.xml.sax.ContentHandler#startElement(String, String, String, Attributes) */ + @Override public void startElement (String uri, String localName, String qName, Attributes attributes) throws org.xml.sax.SAXException { @@ -584,7 +565,8 @@ public abstract class OFXBankStatementHandler extends DefaultHandler * @param length int * @throws SAXException * @see org.xml.sax.ContentHandler#characters(char[], int, int) - **/ + */ + @Override public void characters (char ch[], int start, int length) throws SAXException { @@ -595,7 +577,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler /** * Check for valid XML structure. (all tags are properly ended). - * The statements are passed to ImportController when the statement end () + * The statements are passed to ImportController when the statement end (</STMTTRN>) * is detected. * @param uri String * @param localName String @@ -603,6 +585,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler * @throws SAXException * @see org.xml.sax.ContentHandler#endElement(String, String, String) */ + @Override public void endElement (String uri, String localName, String qName) throws SAXException { @@ -766,33 +749,16 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } } } // endElement - - - /* - * Copyright 2008 Web Cohesion - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * + + /** * source: https://github.com/stoicflame/ofx4j/blob/a604e4f6ffefea61403434cf853bbd1b20740386/src/main/java/com/webcohesion/ofx4j/io/DefaultStringConversion.java - * + *

    + * Parse the timezone offset of the form [HOURS_OFF_GMT:TZ_ID] + * + * @param tzoffset The offset pattern. + * @return The timezone. */ - /** - * Parse the timezone offset of the form [HOURS_OFF_GMT:TZ_ID] - * - * @param tzoffset The offset pattern. - * @return The timezone. - */ - protected TimeZone parseTimeZone(String tzoffset) { + protected TimeZone parseTimeZone(String tzoffset) { StringTokenizer tokenizer = new StringTokenizer(tzoffset, "[]:"); TimeZone tz = GMT_TIME_ZONE; if (tokenizer.hasMoreTokens()) { @@ -807,12 +773,12 @@ public abstract class OFXBankStatementHandler extends DefaultHandler public static final int DATE_FORMAT_LENGTH = "yyyyMMddHHmmss.SSS".length(); public static final int TIME_FORMAT_LENGTH = "HHmmss.SSS".length(); - /** - * Parses a date according to OFX. - * - * @param value The value of the date. - * @return The date value. - */ + /** + * Parses a date according to OFX. + * + * @param value The value of the date. + * @return The date value. + */ protected Date parseDate(String value) { char[] parseableDate = new char[DATE_FORMAT_LENGTH]; Arrays.fill(parseableDate, '0'); @@ -850,7 +816,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method parseOfxDate + * Parse OFX date * @param value String * @return Timestamp * @throws ParseException @@ -868,8 +834,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } //parseOfxDate /** - * Method getLastErrorMessage - * @return String + * @return last error message */ public String getLastErrorMessage() { @@ -877,8 +842,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler } /** - * Method getLastErrorDescription - * @return String + * @return last error description */ public String getLastErrorDescription() { @@ -889,7 +853,7 @@ public abstract class OFXBankStatementHandler extends DefaultHandler * @author ET * @version $Id: OFXBankStatementHandler.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $ */ - static class StatementLine + protected static class StatementLine { protected String routingNo = null; protected String bankAccountNo = null; diff --git a/org.adempiere.base/src/org/compiere/impexp/OFXFileBankStatementLoader.java b/org.adempiere.base/src/org/compiere/impexp/OFXFileBankStatementLoader.java index bb9980911e..dc86eeb1f4 100644 --- a/org.adempiere.base/src/org/compiere/impexp/OFXFileBankStatementLoader.java +++ b/org.adempiere.base/src/org/compiere/impexp/OFXFileBankStatementLoader.java @@ -27,7 +27,6 @@ import org.xml.sax.SAXException; * @author Eldir Tomassen * @version $Id: */ - public final class OFXFileBankStatementLoader extends OFXBankStatementHandler implements BankStatementLoaderInterface { @@ -37,8 +36,7 @@ public final class OFXFileBankStatementLoader extends OFXBankStatementHandler im * @return boolean * @see org.compiere.impexp.BankStatementLoaderInterface#init(MBankStatementLoader) */ - //m_stream is not closed because the BufferedReader in the parent class is closed and according to the Java docs: - //Calling close() on the BufferedReader closes the underlying stream by default implementation + @Override public boolean init(MBankStatementLoader controller) { boolean result = false; @@ -63,12 +61,10 @@ public final class OFXFileBankStatementLoader extends OFXBankStatementHandler im { return result; } - //if (m_stream == null) - //{ - //return result; - //} + //m_stream is not closed because the BufferedReader in the parent class is closed and according to the Java docs: + //Calling close() on the BufferedReader closes the underlying stream by default implementation result = attachInput(m_stream); - } + } catch(Exception e) { m_errorMessage = new StringBuffer("ErrorReadingData"); @@ -78,15 +74,14 @@ public final class OFXFileBankStatementLoader extends OFXBankStatementHandler im return result; } // init - /** - * Method characters * @param ch char[] * @param start int * @param length int * @throws SAXException * @see org.xml.sax.ContentHandler#characters(char[], int, int) */ + @Override public void characters (char ch[], int start, int length) throws SAXException { @@ -97,5 +92,4 @@ public final class OFXFileBankStatementLoader extends OFXBankStatementHandler im super.characters(ch, start, length); } // characterS - } // OFXFileBankStatementLoader diff --git a/org.adempiere.base/src/org/compiere/install/Translation.java b/org.adempiere.base/src/org/compiere/install/Translation.java index 643970918e..a66ec4bce7 100644 --- a/org.adempiere.base/src/org/compiere/install/Translation.java +++ b/org.adempiere.base/src/org/compiere/install/Translation.java @@ -59,7 +59,6 @@ import org.eclipse.equinox.app.IApplicationContext; import org.w3c.dom.Document; import org.w3c.dom.Element; - /** * Translation Table Import + Export * @@ -148,7 +147,8 @@ public class Translation implements IApplication public String importTrl (String directory, int AD_Client_ID, String AD_Language, String Trl_Table, String trxName) { String fileName = directory + File.separator + Trl_Table + "_" + AD_Language + ".xml"; - log.info(fileName); + if (log.isLoggable(Level.INFO)) + log.info(fileName); File in = new File (fileName); if (!in.exists()) { @@ -161,7 +161,6 @@ public class Translation implements IApplication { TranslationHandler handler = new TranslationHandler(AD_Client_ID, trxName); SAXParserFactory factory = SAXParserFactory.newInstance(); - // factory.setValidating(true); SAXParser parser = factory.newSAXParser(); parser.parse(in, handler); if (log.isLoggable(Level.INFO)) log.info("Updated=" + handler.getUpdateCount()); @@ -179,20 +178,21 @@ public class Translation implements IApplication return e.toString(); } } // importTrl - - /************************************************************************** - * Import Translation + /** + * Export Translation * @param directory file directory * @param AD_Client_ID only certain client if id >= 0 * @param AD_Language language * @param Trl_Table translation table _Trl + * @param onlyCentralized * @return status message */ public String exportTrl (String directory, int AD_Client_ID, String AD_Language, String Trl_Table, boolean onlyCentralized) { String fileName = directory + File.separator + Trl_Table + "_" + AD_Language + ".xml"; - log.info(fileName); + if (log.isLoggable(Level.INFO)) + log.info(fileName); File out = new File(fileName); boolean isBaseLanguage = Language.isBaseLanguage(AD_Language); @@ -217,7 +217,6 @@ public class Translation implements IApplication try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - // System.out.println(factory.getClass().getName()); DocumentBuilder builder = factory.newDocumentBuilder(); // // @@ -340,10 +339,9 @@ public class Translation implements IApplication return ""; } // exportTrl - /** - * Get Columns for Table + * Get Columns for translation Table (*_trl) * @param Base_Table table * @return array of translated columns */ @@ -391,7 +389,6 @@ public class Translation implements IApplication while (rs.next()) { String s = rs.getString(1); - // System.out.println(s); list.add(s); } } @@ -413,9 +410,11 @@ public class Translation implements IApplication } // getTrlColumns /** + *

     	 * Validate Language.
     	 *  - Check if AD_Language record exists
     	 *  - Check Trl table records
    +	 *  
    * @param p_AD_Language language * @return "" if validated - or error message */ @@ -423,10 +422,12 @@ public class Translation implements IApplication return validateLanguage(p_AD_Language, null); } - /************************************************************************** - * Validate Language. + /** + *
    +	 *  Validate Language.
     	 *  - Check if AD_Language record exists
     	 *  - Check Trl table records
    +	 *  
    * @param AD_Language language * @param trxName transaction * @return "" if validated - or error message @@ -522,7 +523,7 @@ public class Translation implements IApplication } } // process - /************************************************************************** + /** * OSGi Batch Interface * * @author tbayen - IDEMPIERE-1554 diff --git a/org.adempiere.base/src/org/compiere/install/TranslationHandler.java b/org.adempiere.base/src/org/compiere/install/TranslationHandler.java index fcfc9733e1..e53e9dd847 100644 --- a/org.adempiere.base/src/org/compiere/install/TranslationHandler.java +++ b/org.adempiere.base/src/org/compiere/install/TranslationHandler.java @@ -84,9 +84,8 @@ public class TranslationHandler extends DefaultHandler private int m_updateCount = 0; private static final CLogger log = CLogger.getCLogger(TranslationHandler.class); - - /************************************************************************** + /** * Receive notification of the start of an element. * * @param uri namespace @@ -95,10 +94,10 @@ public class TranslationHandler extends DefaultHandler * @param attributes attributes * @throws org.xml.sax.SAXException */ + @Override public void startElement (String uri, String localName, String qName, Attributes attributes) throws org.xml.sax.SAXException { - // log.fine( "TranslationHandler.startElement", qName); // + " - " + uri + " - " + localName); if (qName.equals(Translation.XML_TAG) || qName.equals(Translation.XML_TAG2) || qName.equals(Translation.XML_TAG3)) { m_AD_Language = attributes.getValue(Translation.XML_ATTRIBUTE_LANGUAGE); @@ -115,13 +114,11 @@ public class TranslationHandler extends DefaultHandler m_curID = attributes.getValue(Translation.XML_ROW_ATTRIBUTE_ID); m_curUUID = attributes.getValue(Translation.XML_ROW_ATTRIBUTE_UUID); m_trl = attributes.getValue(Translation.XML_ROW_ATTRIBUTE_TRANSLATED); - // log.finest( "ID=" + m_curID); m_sql = new StringBuffer(); } else if (qName.equals(Translation.XML_VALUE_TAG)) { m_curColumnName = attributes.getValue(Translation.XML_VALUE_ATTRIBUTE_COLUMN); - // log.finest( "ColumnName=" + m_curColName); } else log.severe ("UNKNOWN TAG: " + qName); @@ -136,11 +133,11 @@ public class TranslationHandler extends DefaultHandler * @param length length * @throws SAXException */ + @Override public void characters (char ch[], int start, int length) throws SAXException { m_curValue.append(ch, start, length); - // Log.trace(Log.l6_Database+1, "TranslationHandler.characters", m_curValue.toString()); } // characters /** @@ -150,13 +147,13 @@ public class TranslationHandler extends DefaultHandler * @param qName qualified name * @throws SAXException */ + @Override public void endElement (String uri, String localName, String qName) throws SAXException { - // Log.trace(Log.l6_Database+1, "TranslationHandler.endElement", qName); if (qName.equals(Translation.XML_TAG) || qName.equals(Translation.XML_TAG2) || qName.equals(Translation.XML_TAG3)) { - + ; } else if (qName.equals(Translation.XML_ROW_TAG)) { // Set section if (m_sql.length() > 0) @@ -207,7 +204,6 @@ public class TranslationHandler extends DefaultHandler } } // endElement - /** * Get Number of updates * @return update count diff --git a/org.adempiere.base/src/org/compiere/model/AccessSqlParser.java b/org.adempiere.base/src/org/compiere/model/AccessSqlParser.java index ad080c1985..f0c0827b1b 100644 --- a/org.adempiere.base/src/org/compiere/model/AccessSqlParser.java +++ b/org.adempiere.base/src/org/compiere/model/AccessSqlParser.java @@ -99,7 +99,7 @@ public class AccessSqlParser /** * Parse Original SQL. * Called from setSql or Constructor. - * @return true if pased + * @return true if parsed successfully */ public boolean parse() { @@ -119,7 +119,7 @@ public class AccessSqlParser } // parse /** - * Parses m_sqlOriginal and creates Array of m_sql statements + * Parses {@link #m_sqlOriginal} and creates Array of {@link #m_sql} statements */ private void getSelectStatements() { @@ -272,7 +272,6 @@ public class AccessSqlParser return retValue; } // getTableInfo - /** * String Representation * @return info @@ -419,7 +418,7 @@ public class AccessSqlParser } // TableInfo /** - * Short Constuctor - no syn + * Short Constuctor - no synonym * @param tableName table */ public TableInfo (String tableName) diff --git a/org.adempiere.base/src/org/compiere/model/AdempiereProcessor.java b/org.adempiere.base/src/org/compiere/model/AdempiereProcessor.java index 1583e8fa20..95c51c92ae 100644 --- a/org.adempiere.base/src/org/compiere/model/AdempiereProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/AdempiereProcessor.java @@ -22,7 +22,7 @@ import java.util.Properties; import org.adempiere.exceptions.AdempiereException; /** - * Processor Interface + * Background Processor Interface * * @author Jorg Janke * @version $Id: AdempiereProcessor.java,v 1.2 2006/07/30 00:51:03 jjanke Exp $ @@ -85,26 +85,26 @@ public interface AdempiereProcessor public String getServerID(); /** - * Get the date Next run + * Get next run date * @param requery requery database * @return date next run */ public Timestamp getDateNextRun (boolean requery); /** - * Set Date Next Run + * Set Next Run Date * @param dateNextWork next work */ public void setDateNextRun(Timestamp dateNextWork); /** - * Get the date Last run + * Get Last run date * @return date lext run */ public Timestamp getDateLastRun (); /** - * Set Date Last Run + * Set Last Run Date * @param dateLastRun last run */ public void setDateLastRun(Timestamp dateLastRun); @@ -116,7 +116,7 @@ public interface AdempiereProcessor public boolean save(); /** - * Save throwing exception + * Save throwing exception * @throws AdempiereException * @see #save() */ diff --git a/org.adempiere.base/src/org/compiere/model/AdempiereProcessor2.java b/org.adempiere.base/src/org/compiere/model/AdempiereProcessor2.java index 64e6508f58..6694e2a89d 100644 --- a/org.adempiere.base/src/org/compiere/model/AdempiereProcessor2.java +++ b/org.adempiere.base/src/org/compiere/model/AdempiereProcessor2.java @@ -14,18 +14,20 @@ package org.compiere.model; /** - * + * Additional Background Processor Interface * @author hengsin * */ public interface AdempiereProcessor2 { /** - * @return true if previous DateNextRun should be use as base to calculate the new + * @return True if previous DateNextRun should be use as base to calculate the new * DateNextRun value. False to follow the legacy behaviour where current - * server time is use as the base to the new DateNextRun value. + * server time is use as the base to calculate the new DateNextRun value. */ public boolean isIgnoreProcessingTime(); - // IDEMPIERE-391 + /** + * @return AD_Schedule_ID + */ public int getAD_Schedule_ID(); } diff --git a/org.adempiere.base/src/org/compiere/model/AdempiereProcessorLog.java b/org.adempiere.base/src/org/compiere/model/AdempiereProcessorLog.java index 54de5a1407..6b1ee10a9f 100644 --- a/org.adempiere.base/src/org/compiere/model/AdempiereProcessorLog.java +++ b/org.adempiere.base/src/org/compiere/model/AdempiereProcessorLog.java @@ -19,7 +19,7 @@ package org.compiere.model; import java.sql.Timestamp; /** - * Processor Log Interface + * Background Processor Log Interface * * @author Jorg Janke * @version $Id: AdempiereProcessorLog.java,v 1.3 2006/07/30 00:51:04 jjanke Exp $ @@ -33,7 +33,7 @@ public interface AdempiereProcessorLog public Timestamp getCreated(); /** - * Get Summary. Textual summary of this request + * Get Summary. Textual summary of execution * @return Summary */ public String getSummary (); @@ -45,7 +45,7 @@ public interface AdempiereProcessorLog public String getDescription (); /** - * Get Error. An Error occured in the execution + * Get Error. An error occurred in execution * @return true if error */ public boolean isError (); diff --git a/org.adempiere.base/src/org/compiere/model/ArchiveDB.java b/org.adempiere.base/src/org/compiere/model/ArchiveDB.java index 29dcb97c4d..535bf5b19a 100644 --- a/org.adempiere.base/src/org/compiere/model/ArchiveDB.java +++ b/org.adempiere.base/src/org/compiere/model/ArchiveDB.java @@ -24,8 +24,8 @@ import java.util.zip.ZipOutputStream; import org.compiere.util.CLogger; /** + * DB backed implementation of {@link IArchiveStore} * @author juliana - * */ public class ArchiveDB implements IArchiveStore { @@ -108,8 +108,7 @@ public class ArchiveDB implements IArchiveStore { } @Override - public boolean deleteArchive(MArchive archive, MStorageProvider prov) { - + public boolean deleteArchive(MArchive archive, MStorageProvider prov) { return true; } diff --git a/org.adempiere.base/src/org/compiere/model/ArchiveFileSystem.java b/org.adempiere.base/src/org/compiere/model/ArchiveFileSystem.java index 94ed800075..2b5880bc66 100644 --- a/org.adempiere.base/src/org/compiere/model/ArchiveFileSystem.java +++ b/org.adempiere.base/src/org/compiere/model/ArchiveFileSystem.java @@ -44,8 +44,8 @@ import org.xml.sax.SAXException; import org.w3c.dom.Element; /** + * File system backed implementation of {@link IArchiveStore} * @author juliana - * */ public class ArchiveFileSystem implements IArchiveStore { @@ -160,6 +160,12 @@ public class ArchiveFileSystem implements IArchiveStore { } } + /** + * Write archive data to file + * @param archive + * @param prov + * @param inflatedData archive data + */ private void write(MArchive archive, MStorageProvider prov, byte[] inflatedData) { BufferedOutputStream out = null; @@ -221,6 +227,10 @@ public class ArchiveFileSystem implements IArchiveStore { } } + /** + * @param prov + * @return root path + */ private String getArchivePathRoot(MStorageProvider prov) { String archivePathRoot = prov.getFolder(); if (archivePathRoot == null) diff --git a/org.adempiere.base/src/org/compiere/model/AttachmentDBSystem.java b/org.adempiere.base/src/org/compiere/model/AttachmentDBSystem.java index 10ad54eab2..c5004ce627 100644 --- a/org.adempiere.base/src/org/compiere/model/AttachmentDBSystem.java +++ b/org.adempiere.base/src/org/compiere/model/AttachmentDBSystem.java @@ -25,9 +25,11 @@ import java.util.zip.ZipOutputStream; import org.compiere.util.CLogger; +/** + * DB backed implementation of {@link IAttachmentStore} + */ public class AttachmentDBSystem implements IAttachmentStore -{ - +{ /** Indicator for zip data */ public static final String ZIP = "zip"; private static final CLogger log = CLogger.getCLogger(AttachmentDBSystem.class); @@ -35,7 +37,7 @@ public class AttachmentDBSystem implements IAttachmentStore @Override public boolean loadLOBData(MAttachment attach, MStorageProvider prov) { -// Reset + // Reset attach.m_items = new ArrayList(); // byte[] data = attach.getBinaryData(); @@ -117,7 +119,6 @@ public class AttachmentDBSystem implements IAttachmentStore + entry.getCompressedSize() + " (" + entry.getSize() + ") " + (entry.getCompressedSize()*100/entry.getSize())+ "%"); } - // zip.finish(); zip.close(); byte[] zipData = out.toByteArray(); if (log.isLoggable(Level.FINE)) log.fine("Length=" + zipData.length); diff --git a/org.adempiere.base/src/org/compiere/model/AttachmentFileSystem.java b/org.adempiere.base/src/org/compiere/model/AttachmentFileSystem.java index 4fafbbc016..fbb36495fa 100644 --- a/org.adempiere.base/src/org/compiere/model/AttachmentFileSystem.java +++ b/org.adempiere.base/src/org/compiere/model/AttachmentFileSystem.java @@ -44,18 +44,13 @@ import org.w3c.dom.NodeList; import org.xml.sax.SAXException; /** + * File system backed implementation of {@link IAttachmentStore} * @author juliana - * */ public class AttachmentFileSystem implements IAttachmentStore { - // TODO: Implement FileSystemFallbackDB - private final CLogger log = CLogger.getCLogger(getClass()); - /** - * - */ @Override public boolean save(MAttachment attach,MStorageProvider prov) { String attachmentPathRoot = getAttachmentPathRoot(prov); @@ -243,7 +238,7 @@ public class AttachmentFileSystem implements IAttachmentStore { /** * Get the entries from the XML * @param data - * @return + * @return xml node list */ private NodeList getEntriesFromXML(byte[] data) { NodeList entries = null; @@ -276,7 +271,7 @@ public class AttachmentFileSystem implements IAttachmentStore { /** * Returns a path snippet, containing client, org, table and record id. - * @return String + * @return path snippet */ private String getAttachmentPathSnippet(MAttachment attach){ @@ -326,6 +321,10 @@ public class AttachmentFileSystem implements IAttachmentStore { return true; } + /** + * @param prov + * @return root path + */ private String getAttachmentPathRoot(MStorageProvider prov) { String attachmentPathRoot = prov.getFolder(); if (attachmentPathRoot == null) diff --git a/org.adempiere.base/src/org/compiere/model/Callout.java b/org.adempiere.base/src/org/compiere/model/Callout.java index 59501e7024..280325d37a 100644 --- a/org.adempiere.base/src/org/compiere/model/Callout.java +++ b/org.adempiere.base/src/org/compiere/model/Callout.java @@ -18,9 +18,14 @@ package org.compiere.model; import java.util.Properties; +import org.adempiere.base.IColumnCallout; + /** - * Callout Interface for Callout. - * Used in MTab and ImpFormatRow + * Callout Interface for column/field. + * Used in MTab and ImpFormatRow. + * @see CalloutEngine + * @see IColumnCallout + * @see org.adempiere.base.annotation.Callout * * @author Jorg Janke * @version $Id: Callout.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $ @@ -30,8 +35,8 @@ public interface Callout /** * Start Callout. *

    - * Callout's are used for cross field validation and setting values in other fields - * when returning a non empty (error message) string, an exception is raised + * Callout's are used for field validation, cross field validation and setting values in other fields. + * When returning a non empty (error message) string, an exception is raised. *

    * When invoked, the Tab model has the new value! * @@ -49,7 +54,7 @@ public interface Callout /** * Conversion Rules. - * Convert a String + * Use by ImpFormatRow to convert an input value. * * @param method in notation User_Function * @param value the value diff --git a/org.adempiere.base/src/org/compiere/model/CalloutEngine.java b/org.adempiere.base/src/org/compiere/model/CalloutEngine.java index 34458b4c3e..83e97a56d8 100644 --- a/org.adempiere.base/src/org/compiere/model/CalloutEngine.java +++ b/org.adempiere.base/src/org/compiere/model/CalloutEngine.java @@ -27,7 +27,7 @@ import org.compiere.util.CLogger; import org.compiere.util.Env; /** - * Callout Engine. + * Callout Engine. Default implementation of {@link Callout} interface using Java reflection. * * @author Jorg Janke * @version $Id: CalloutEngine.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $ @@ -58,8 +58,8 @@ public class CalloutEngine implements Callout /** * Start Callout. *

    - * Callout's are used for cross field validation and setting values in other fields - * when returning a non empty (error message) string, an exception is raised + * Callout's are used for field validation, cross field validation and setting values in other fields. + * When returning a non empty (error message) string, an exception is raised. *

    * When invoked, the Tab model has the new value! * @@ -72,6 +72,7 @@ public class CalloutEngine implements Callout * @param oldValue The old value * @return Error message or "" */ + @Override public String start (Properties ctx, String methodName, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) { @@ -132,7 +133,7 @@ public class CalloutEngine implements Callout /** * Conversion Rules. - * Convert a String + * Use by ImpFormatRow to convert an input value. * * @param methodAndArgs method name and additional arguments (in brackets, separated by commas) * @param value the value @@ -196,13 +197,9 @@ public class CalloutEngine implements Callout return null; } // getMethod - /*************************************************************************/ - - //private static boolean s_calloutActive = false; - /** * Is the current callout being called in the middle of - * another callout doing her works. + * another callout doing her works.
    * Callout can use GridTab.getActiveCalloutInstance() method * to find out callout for which field is running. * @return true if active diff --git a/org.adempiere.base/src/org/compiere/model/DataStatusEvent.java b/org.adempiere.base/src/org/compiere/model/DataStatusEvent.java index 9dffec2a3e..5fbbb1e161 100644 --- a/org.adempiere.base/src/org/compiere/model/DataStatusEvent.java +++ b/org.adempiere.base/src/org/compiere/model/DataStatusEvent.java @@ -34,7 +34,7 @@ public final class DataStatusEvent extends EventObject implements Serializable { /** - * + * generated serial id */ private static final long serialVersionUID = -1988674163839245029L; @@ -75,7 +75,7 @@ public final class DataStatusEvent extends EventObject implements Serializable private String m_columnName = null; // IDEMPIERE-1287:indicate case user just start edit field, want update status of toolbar button (like save button) - // but don't want change anything (ever value of edit field) + // but don't want change anything (even value of edit field) private boolean isInitEdit = false; /** Created */ @@ -94,7 +94,7 @@ public final class DataStatusEvent extends EventObject implements Serializable public Object Record_ID = null; /** - * Set Loaded Info + * Set Loading Info * @param loadedRows loaded rows */ public void setLoading (int loadedRows) @@ -132,7 +132,7 @@ public final class DataStatusEvent extends EventObject implements Serializable /** * Get current row (zero based) - * @return current roe + * @return current row */ public int getCurrentRow() { @@ -141,7 +141,7 @@ public final class DataStatusEvent extends EventObject implements Serializable /** * Get total rows - * @return total rows + * @return total number of rows */ public int getTotalRows() { @@ -173,7 +173,6 @@ public final class DataStatusEvent extends EventObject implements Serializable } // setInserting /** - * Are we inserting * @return true if inserting */ public boolean isInserting() @@ -182,8 +181,8 @@ public final class DataStatusEvent extends EventObject implements Serializable } // isInserting /** - * Get Message Info - * @return Message + * Get AD Message + * @return AD Message */ public String getAD_Message() { @@ -191,8 +190,8 @@ public final class DataStatusEvent extends EventObject implements Serializable } // getAD_Message /** - * Get Message Info - * @return Info + * Get info for AD Message + * @return info for AD Message */ public String getInfo() { @@ -236,10 +235,10 @@ public final class DataStatusEvent extends EventObject implements Serializable /** * String representation of Status. *

    {@code
    -	 *		*1/20 		Change - automatic commit
    -	 *		?1/20		Change - manual confirm
    -	 *		 1/56->200	Loading
    -	 *		 1/20		Normal
    +	 *      *1/20       Change - automatic commit
    +	 *      ?1/20       Change - manual confirm
    +	 *       1/56->200  Loading
    +	 *       1/20       Normal
     	 *     +*1/20       Inserting, changed - automatic commit
     	 *  The row number is converted from zero based representation
     	 *  }
    @@ -299,7 +298,7 @@ public final class DataStatusEvent extends EventObject implements Serializable /** * Set Changed Column - * @param col column + * @param col column index * @param columnName column name */ public void setChangedColumn (int col, String columnName) @@ -310,7 +309,7 @@ public final class DataStatusEvent extends EventObject implements Serializable /** * Get Changed Column - * @return changed column + * @return changed column index */ public int getChangedColumn() { @@ -344,6 +343,10 @@ public final class DataStatusEvent extends EventObject implements Serializable return m_confirmed; } // isConfirmed + /** + * @param e + * @return true if equal with e + */ public boolean isEqual(DataStatusEvent e) { if (e == null) return false; @@ -358,16 +361,15 @@ public final class DataStatusEvent extends EventObject implements Serializable e.isInitEdit == isInitEdit; } - /** - * @return indicate this event is by user start edit this field but not yet complete edit + * @return true if this event is by user start edit this field but not yet completed edit */ public boolean isInitEdit() { return isInitEdit; } /** - * @param isInitEdit indicate this event is by user start edit this field but not yet complete edit + * @param isInitEdit indicate this event is by user start edit this field but not yet completed edit */ public void setIsInitEdit(boolean isInitEdit) { this.isInitEdit = isInitEdit; diff --git a/org.adempiere.base/src/org/compiere/model/DataStatusListener.java b/org.adempiere.base/src/org/compiere/model/DataStatusListener.java index 7d65ffe59e..2c4e9ba31b 100644 --- a/org.adempiere.base/src/org/compiere/model/DataStatusListener.java +++ b/org.adempiere.base/src/org/compiere/model/DataStatusListener.java @@ -19,7 +19,7 @@ package org.compiere.model; import java.util.EventListener; /** - * Data Status Interface + * Listener Interface for {@link DataStatusEvent} * * @author Jorg Janke * @version $Id: DataStatusListener.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $ diff --git a/org.adempiere.base/src/org/compiere/model/DatabaseKey.java b/org.adempiere.base/src/org/compiere/model/DatabaseKey.java index aa7f6046bb..6bfb4391f4 100644 --- a/org.adempiere.base/src/org/compiere/model/DatabaseKey.java +++ b/org.adempiere.base/src/org/compiere/model/DatabaseKey.java @@ -15,9 +15,8 @@ package org.compiere.model; /** - * + * Database foreign or primary key * @author Elaine - * */ public class DatabaseKey { @@ -26,6 +25,12 @@ public class DatabaseKey private String[] keyColumns; private short deleteRule; + /** + * @param keyName + * @param keyTable + * @param keyColumns + * @param deleteRule + */ public DatabaseKey(String keyName, String keyTable, String[] keyColumns, short deleteRule) { this.keyName = keyName; @@ -34,34 +39,58 @@ public class DatabaseKey this.deleteRule = deleteRule; } + /** + * @return constraint name + */ public String getKeyName() { return keyName; } + /** + * @param keyName + */ public void setKeyName(String keyName) { this.keyName = keyName; } + /** + * @return table name + */ public String getKeyTable() { return keyTable; } + /** + * @param keyTable table name + */ public void setKeyTable(String keyTable) { this.keyTable = keyTable; } + /** + * @return columns + */ public String[] getKeyColumns() { return keyColumns; } + /** + * @param keyColumns + */ public void setKeyColumns(String[] keyColumns) { this.keyColumns = keyColumns; } + /** + * @return delete rule (no action, cascade, set null or prevent) + */ public short getDeleteRule() { return deleteRule; } + /** + * @param deleteRule + */ public void setDeleteRule(short deleteRule) { this.deleteRule = deleteRule; } diff --git a/org.adempiere.base/src/org/compiere/model/DocWorkflowMgr.java b/org.adempiere.base/src/org/compiere/model/DocWorkflowMgr.java index d4f32e7dc3..9a48ce433c 100644 --- a/org.adempiere.base/src/org/compiere/model/DocWorkflowMgr.java +++ b/org.adempiere.base/src/org/compiere/model/DocWorkflowMgr.java @@ -16,7 +16,6 @@ *****************************************************************************/ package org.compiere.model; - /** * Document Value Workflow Manager * diff --git a/org.adempiere.base/src/org/compiere/model/FactsValidator.java b/org.adempiere.base/src/org/compiere/model/FactsValidator.java index a3484d22fc..290a59cd4a 100644 --- a/org.adempiere.base/src/org/compiere/model/FactsValidator.java +++ b/org.adempiere.base/src/org/compiere/model/FactsValidator.java @@ -1,23 +1,45 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.util.List; import org.compiere.acct.Fact; +/** + * Interface for posting validator + */ public interface FactsValidator { /** - * Get Client to be monitored * @return AD_Client_ID */ public int getAD_Client_ID(); /** - * * @param facts * @param po * @return error message or null - - * if not null, the pocument will be marked as Invalid. + * if not null, the document will be marked as Invalid. */ public String factsValidate(MAcctSchema schema, List facts, PO po); } diff --git a/org.adempiere.base/src/org/compiere/model/GridField.java b/org.adempiere.base/src/org/compiere/model/GridField.java index 8a48c153ae..cb584b7176 100644 --- a/org.adempiere.base/src/org/compiere/model/GridField.java +++ b/org.adempiere.base/src/org/compiere/model/GridField.java @@ -55,10 +55,9 @@ import org.idempiere.util.ParseSeq; * and AD_Column (the storage attributes). *

    * The Field maintains the current edited value. If the value is changed, - * it fire PropertyChange "FieldValue". - * If the background is changed the PropertyChange "FieldAttribute" is fired. + * it fire PropertyChange "FieldValue" event. *
    - * Usually editors listen to their fields. + * Usually editors listen to PropertyChange event of their fields. * * @author Jorg Janke * @author Victor Perez , e-Evolution.SC FR [ 1757088 ], [1877902] Implement JSR 223 Scripting APIs to Callout @@ -81,7 +80,7 @@ public class GridField implements Serializable, Evaluatee, Cloneable { /** - * + * generated serial id */ private static final long serialVersionUID = -4496344553246662012L; @@ -125,7 +124,7 @@ public class GridField private boolean m_lockedRecord = false; /** - * Dispose + * Clean up */ protected void dispose() { @@ -143,7 +142,6 @@ public class GridField /** New Row / inserting */ private boolean m_inserting = false; - /** Max Display Length = 60 */ public static final int MAXDISPLAY_LENGTH = 60; @@ -174,10 +172,9 @@ public class GridField /** Logger */ private static CLogger log = CLogger.getCLogger(GridField.class); - - - /************************************************************************** - * Set Lookup for columns with lookup + + /** + * Set Lookup for columns with lookup and IsDisplayed=true */ public void loadLookup() { @@ -211,7 +208,7 @@ public class GridField } /*** - * bypass isdisplay validation, used by findwindow + * Skip isDisplay checking */ public void loadLookupNoValidate() { if (m_vo.lookupInfo == null && isLookup()) { @@ -233,7 +230,7 @@ public class GridField } /** - * Wait until Load is complete + * Wait until loading of lookup is complete */ public void lookupLoadComplete() { @@ -272,7 +269,7 @@ public class GridField } // isLookup /** - * Refresh Lookup if the lookup is unstable + * Refresh Lookup if necessary * @return true if lookup is validated */ public boolean refreshLookup() @@ -280,7 +277,7 @@ public class GridField if (m_lookup == null) return true; - // if there is a validation string, the lookup is unstable - read-only fields are not loaded initially + // if there is a validation string, the lookup might need refresh - read-only fields are not loaded initially if (m_lookup.getValidation().length() == 0 && m_lookup.isLoaded()) return true; // @@ -290,9 +287,13 @@ public class GridField } // refreshLookup /** - * Get a list of variables, this field is dependent on. - * - for display purposes or - * - for lookup purposes + *

    +	 *  Get a list of variables that this field is dependent on.
    +	 *  - for display logic or
    +	 *  - for readonly logic or
    +	 *  - for mandatory or
    +	 *  - for lookup validation
    +	 *  
    * @return ArrayList */ public ArrayList getDependentOn() @@ -318,11 +319,10 @@ public class GridField } return list; } // getDependentOn - - /************************************************************************** + /** * Set Error. - * Used by editors to set the color + * Used by editors to set the color. * @param error true if error */ public void setError (boolean error) @@ -331,24 +331,21 @@ public class GridField } // setBackground /** - * Get Background Error. - * @return error + * @return true if there's error */ public boolean isError() { return m_error; } // isError - /** * Is it Mandatory to enter for user? - * Mandatory checking is dome in MTable.getMandatory * @param checkContext - check environment (requires correct row position) * @return true if mandatory */ public boolean isMandatory (boolean checkContext) { -// Do we have a mandatory rule + // Do we have a mandatory rule if (checkContext && m_vo.MandatoryLogic.length() > 0) { boolean retValue = false; @@ -413,7 +410,7 @@ public class GridField } /** - * Is it Editable - checks IsActive, IsUpdateable, and isDisplayed + * Is it Editable * @param checkContext if true checks Context for Active, IsProcessed, LinkColumn * @return true, if editable */ @@ -423,8 +420,8 @@ public class GridField } /** - * Is it Editable in Grid- checks IsActive, IsUpdateable, and isDisplayedGrid - * @param checkContext if true checks Context for Active, IsProcessed, LinkColumn + * Is it Editable in Grid + * @param checkContext if true checks environment context * @return true, if editable */ public boolean isEditableGrid (boolean checkContext) @@ -433,8 +430,8 @@ public class GridField } /** - * Is it Editable - checks IsActive, IsUpdateable, and isDisplayed - * @param checkContext if true checks Context for Active, IsProcessed, LinkColumn + * Is it Editable + * @param checkContext if true checks environment context * @return true, if editable */ public boolean isEditable (Properties ctx, boolean checkContext,boolean isGrid) @@ -443,7 +440,7 @@ public class GridField return false; if (m_lockedRecord) return false; - // Fields always enabled (are usually not updateable) + // Fields always enabled (are usually not updatable) if (m_vo.ColumnName.equals("Posted") || (m_vo.ColumnName.equals("Record_ID") && m_vo.displayType == DisplayType.Button)) // Zoom return true; @@ -455,7 +452,7 @@ public class GridField return false; } - // Fields always updateable + // Fields always updatable if (m_vo.IsAlwaysUpdateable) { return true; @@ -493,7 +490,7 @@ public class GridField } } - // Not Updateable - only editable if new updateable row + // Not updatable - only editable if new updatable row if (!m_vo.IsUpdateable && !m_inserting) { if (log.isLoggable(Level.FINEST)) log.finest(m_vo.ColumnName + " NO - FieldUpdateable=" + m_vo.IsUpdateable); @@ -586,15 +583,13 @@ public class GridField // Record is not Active if (checkContext && getGridTab() != null && !Env.getContext(ctx, m_vo.WindowNo,m_vo.TabNo, "IsActive").equals("Y")) return false; - - return isDisplayed (ctx, checkContext); } // isEditable /** - * Set Inserting (allows to enter not updateable fields). - * Reset when setting the Field Value + * Set Inserting (allows to enter not updatable fields). + * Reset when setting the Field Value. * @param inserting true if inserting */ public void setInserting (boolean inserting) @@ -602,16 +597,22 @@ public class GridField m_inserting = inserting; } // setInserting + /** + * @param defaultValue + */ public void setDefaultLogic(String defaultValue) { m_vo.DefaultValue = defaultValue; } + /** + * @param defaultValue2 default value for range field + */ public void setDefault2Logic(String defaultValue2) { m_vo.DefaultValue2 = defaultValue2; } - /************************************************************************** - * Create default value. + /** + * Get default value. *
    {@code
     	 *		(a) Key/Parent/IsActive/SystemAccess
     	 *      (b) SQL Default
    @@ -623,8 +624,6 @@ public class GridField
     	 *  Don't default from Context => use explicit defaultValue
     	 *  (would otherwise copy previous record)
     	 *  }
    - * this method code in mind GirdField lie at standard window, and default is receive when new record. - * maybe it will don't suitable for use at other place as info panel parameter,... * @return default value or null */ public Object getDefault() @@ -649,7 +648,7 @@ public class GridField } // getDefault /** - * get default of field when field don't lie down at standard window + * Get default of field when field not inside standard AD window (i.e not AD_Tab+AD_Field) * @return */ public Object getDefaultForPanel (){ @@ -673,7 +672,7 @@ public class GridField /** * Get default value with priority define by seqGetDefaultValue * @param seqGetDefaultValue - * @return + * @return default value */ public Object getDefault(ParseSeq seqGetDefaultValue){ Object defaultValue = null; @@ -691,15 +690,18 @@ public class GridField } /** - * "1" mean from special case - * "2" mean from sql default - * "3" mean from default logic - * "4" mean user preference - * "5" mean from system preference - * "6" mean preference for field lie down at panel as process parameter, info parameter,... - * "7" mean data-type default + *
    +	 * defaultValueType:
    +	 * "1" special case
    +	 * "2" sql default
    +	 * "3" default logic
    +	 * "4" user preference
    +	 * "5" system preference
    +	 * "6" preference for field as process parameter, info parameter,...
    +	 * "7" data-type default
    +	 * 
    * @param defaultValueType - * @return + * @return default value */ protected Object getDefaultValueByType (Character defaultValueType){ if (defaultValueType.equals(SPECIAL_CASE_DEFAULT)) { @@ -719,6 +721,9 @@ public class GridField return null; } + /** + * @return true to ignore default value + */ protected boolean isIgnoreDefault (){ // No defaults for these fields return (m_vo.IsKey || m_vo.displayType == DisplayType.RowID @@ -728,11 +733,11 @@ public class GridField } /** - * When field lie down at standard window, for make new record, some column is fix will special logic - * example: reference column at child tab always use parent value - * active column always true - * in system client always use system for client - * @return + * When field is inside standard AD window, for new record, some column is fix with special logic.
    + * For example: reference column at child tab always uses parent value.
    + * Active column always true.
    + * In system client, always use system for client. + * @return default value or null */ protected Object defaultForSpecialCase (){ Object defaultValue = null; @@ -754,6 +759,10 @@ public class GridField return null; } + /** + * Get default value from parent tab + * @return default value or null + */ protected Object defaultFromParent (){ // Set Parent to context if not explicitly set if (isParentValue() @@ -766,6 +775,9 @@ public class GridField return null; } + /** + * @return default value or null + */ protected Object defaultForActiveField (){ // Always Active if (m_vo.ColumnName.equals("IsActive")) @@ -777,6 +789,10 @@ public class GridField return null; } + /** + * Default value for AD_Org_ID and AD_Client_ID + * @return default value or null + */ protected Object defaultForClientOrg (){ // Set Client & Org to System, if System access if (X_AD_Table.ACCESSLEVEL_SystemOnly.equals(Env.getContext(m_vo.ctx, m_vo.WindowNo, m_vo.TabNo, GridTab.CTX_AccessLevel)) @@ -796,6 +812,10 @@ public class GridField return null; } + /** + * Default value from SQL + * @return default value or null + */ protected Object defaultFromSQLExpression () { /** * (b) SQL Statement (for data integity & consistency) @@ -850,6 +870,10 @@ public class GridField return null; } + /** + * Default value from expression + * @return default value or null + */ protected Object defaultFromExpression (){ /** * (c) Field DefaultValue === similar code in AStartRPDialog.getDefault === @@ -881,8 +905,8 @@ public class GridField } /** - * get preference when field don't lie down at standard window - * @return + * Get preference when field not inside standard AD window + * @return default value or null */ protected Object defaultFromPreferenceForPanel() { String defStr = ""; @@ -950,7 +974,7 @@ public class GridField /** * @param defaultValueType "4" for user preference and "5" for system preference - * @return + * @return default value or null */ protected Object defaultFromPreference(Character defaultValueType) { String defStr = ""; @@ -983,6 +1007,10 @@ public class GridField return null; } + /** + * Default value by data type + * @return default value or null + */ protected Object defaultFromDatatype (){ /** * (f) DataType defaults @@ -1015,7 +1043,7 @@ public class GridField } /** - * Create Default Object type. + * Convert value to the expected type *
     	 *		Integer 	(IDs, Integer)
     	 *		BigDecimal 	(Numbers)
    @@ -1023,7 +1051,7 @@ public class GridField
     	 *		Boolean		(YesNo)
     	 *		default: String
     	 *  
    - * @param value string + * @param value default value * @return type dependent converted object */ private Object createDefault (String value) @@ -1098,8 +1126,8 @@ public class GridField } // createDefault /** - * Validate initial Field Value. Do not push direct value if it doesn't exist - * Called from GridTab.dataNew when inserting + * Validate initial Field Value. Do not push direct value if it doesn't exist. + * Called from GridTab.dataNew when inserting. * @return true if valid */ public boolean validateValueNoDirect() @@ -1240,7 +1268,7 @@ public class GridField return false; } // validateValue - /************************************************************************** + /** * Is the Column Visible ? * @param checkContext - check environment (requires correct row position) * @return true, if visible @@ -1250,8 +1278,9 @@ public class GridField return isDisplayed(m_vo.ctx, checkContext); } - /************************************************************************** + /** * Is the Column Visible ? + * @param ctx * @param checkContext - check environment (requires correct row position) * @return true, if visible */ @@ -1284,8 +1313,8 @@ public class GridField return true; } // isDisplayed - /************************************************************************** - * Is the Displayed Grid Column Visible ? + /** + * Is the Grid Column Visible ? * @param checkContext - check environment (requires correct row position) * @return true, if visible */ @@ -1294,8 +1323,9 @@ public class GridField return isDisplayedGrid(m_vo.ctx, checkContext); } - /************************************************************************** - * Is the Displayed Grid Column Visible ? + /** + * Is the Grid Column Visible ? + * @param ctx * @param checkContext - check environment (requires correct row position) * @return true, if visible */ @@ -1329,7 +1359,7 @@ public class GridField } // isDisplayedGrid /** - * Get Variable Value (Evaluatee) + * Get variable value (Evaluatee) as string * @param variableName name * @return value */ @@ -1339,7 +1369,8 @@ public class GridField } /** - * Get Variable Value (Evaluatee) + * Get variable value (Evaluatee) as string + * @param ctx * @param variableName name * @return value */ @@ -1353,10 +1384,9 @@ public class GridField return new DefaultEvaluatee(getGridTab(), m_vo.WindowNo, m_vo.TabNo).get_ValueAsString(ctx, variableName); } // get_ValueAsString - /** - * Add Display Dependencies to given List. - * Source: DisplayLogic + * Add display dependencies to given List. + * Source: DisplayLogic. * @param list list to be added to */ public void addDependencies (ArrayList list) @@ -1384,9 +1414,8 @@ public class GridField } } } // addDependencies - - /************************************************************************** + /** * Get Column Name * @return column name */ @@ -1439,7 +1468,7 @@ public class GridField /** * Is Virtual Column - * @return column is virtual + * @return true if column is virtual */ public boolean isVirtualColumn() { @@ -1447,8 +1476,8 @@ public class GridField } // isVirtualColumn /** - * Is Virtual DB Column - * @return column is virtual DB + * Is Virtual DB Column (not using @SQL= and loaded as part of main query) + * @return true if column is virtual DB */ public boolean isVirtualDBColumn() { @@ -1456,7 +1485,7 @@ public class GridField } // isVirtualDBColumn /** - * Is Virtual UI Column + * Is Virtual UI Column (using @SQL= and loaded separately from main query) * @return column is virtual UI */ public boolean isVirtualUIColumn() @@ -1465,7 +1494,7 @@ public class GridField } // isVirtualUIColumn /** - * Is Virtual search Column + * Is Virtual search Column (using @SQLFIND= and it is for find window usage only) * @return column is virtual search */ public boolean isVirtualSearchColumn() @@ -1483,7 +1512,7 @@ public class GridField } /** * Get Display Type - * @return dt + * @return display type */ public int getDisplayType() { @@ -1491,7 +1520,7 @@ public class GridField } /** * Get AD_Reference_Value_ID - * @return reference value + * @return AD_Reference_ID */ public int getAD_Reference_Value_ID() { @@ -1499,15 +1528,14 @@ public class GridField } /** * Get AD_Window_ID - * @return window + * @return AD_Window_ID */ public int getAD_Window_ID() { return m_vo.AD_Window_ID; } /** - * in case this field lie on parameter process panel, AD_Process_ID_Of_Panel is id of process will run in this panel - * it's difference with AD_Process_ID + * @return AD_Process_ID of containing panel */ public int getAD_Process_ID_Of_Panel() { @@ -1515,27 +1543,29 @@ public class GridField } /** - * in case this field lie on parameter process panel, AD_Process_ID_Of_Panel is id of process will run in this panel - * it's difference with AD_Process_ID + * @return AD_Window_ID of containing panel */ public int getAD_Window_ID_Of_Panel() { return m_vo.AD_Window_ID_Of_Panel > 0 ? m_vo.AD_Window_ID_Of_Panel : m_vo.AD_Window_ID; } + /** + * @return AD_InfoWindow_ID of containing panel + */ public int getAD_InfoWindow_ID_of_Panel(){ return m_vo.AD_InfoWindow_ID_Of_Panel; } - /** get AD_Chart_ID - * @return chart id + /** + * get AD_Chart_ID + * @return AD_Chart_ID */ public int getAD_Chart_ID() { return m_vo.AD_Chart_ID; } - - + /** * Get Window No * @return window no @@ -1546,7 +1576,7 @@ public class GridField } /** * Get AD_Column_ID - * @return column + * @return AD_Column_ID */ public int getAD_Column_ID() { @@ -1554,7 +1584,7 @@ public class GridField } /** * Get Display Length - * @return display + * @return display length */ public int getDisplayLength() { @@ -1562,7 +1592,7 @@ public class GridField } /** * Is SameLine - * @return trie if same line + * @return true if same line with previous field */ public boolean isSameLine() { @@ -1576,22 +1606,25 @@ public class GridField { return m_vo.IsDisplayed; } + /** * Is Displayed - * @return true if displayed + * @return true if displayed in grid mode */ public boolean isDisplayedGrid() { return m_vo.IsDisplayedGrid; } + /** * Grid sequence number - * @return sequence number + * @return grid sequence number */ public int getSeqNoGrid() { return m_vo.SeqNoGrid; } + /** * Get DisplayLogic * @return display logic @@ -1600,16 +1633,22 @@ public class GridField { return m_vo.DisplayLogic; } + /** * Get Default Value - * @return default + * @see #getDefault() + * @return default value */ public String getDefaultValue() { return m_vo.DefaultValue; } + /** * Is ReadOnly + * @see #isEditable(boolean) + * @see #isEditableGrid(boolean) + * @see #isEditablePara(boolean) * @return true if read only */ public boolean isReadOnly() @@ -1618,9 +1657,10 @@ public class GridField return true; return m_vo.IsReadOnly; } + /** - * Is Updateable - * @return true if updateable + * Is Updatable + * @return true if updatable */ public boolean isUpdateable() { @@ -1628,6 +1668,7 @@ public class GridField return false; return m_vo.IsUpdateable; } + /** * Is Autocomplete * @return true if autocomplete @@ -1635,9 +1676,10 @@ public class GridField public boolean isAutocomplete() { return m_vo.IsAutocomplete; } + /** * Is Allow Copy - * @return true if allow copy + * @return true if allow copy value of field to new record */ public boolean isAllowCopy() { /* IDEMPIERE-67 @@ -1672,9 +1714,10 @@ public class GridField return false; return m_vo.IsAllowCopy; } + /** * Is Always Updateable - * @return true if always updateable + * @return true if field is always updatable */ public boolean isAlwaysUpdateable() { @@ -1682,33 +1725,37 @@ public class GridField return false; return m_vo.IsAlwaysUpdateable; } + /** * Is Heading - * @return heading + * @return true if heading only (no field editor) */ public boolean isHeading() { return m_vo.IsHeading; } + /** * Is Field Only - * @return field only + * @return true if field editor only (no label) */ public boolean isFieldOnly() { return m_vo.IsFieldOnly; } + /** * Is Encrypted Field (display) - * @return encrypted field + * @return true if encrypted field */ public boolean isEncryptedField() { return m_vo.IsEncryptedField; } + /** * Is Encrypted Field (display) or obscured - * @return encrypted field + * @return true if encrypted or obscured field */ public boolean isEncrypted() { @@ -1719,54 +1766,61 @@ public class GridField return true; return m_vo.ColumnName.equals("Password"); } + /** * Is Encrypted Column (data) - * @return encrypted column + * @return true if encrypted column */ public boolean isEncryptedColumn() { return m_vo.IsEncryptedColumn; } + /** * Is Selection Column - * @return selection + * @return true if selection column (column in simple find window) */ public boolean isSelectionColumn() { return m_vo.IsSelectionColumn; } + /** * Is HTML Field (display) - * @return html field + * @return true if it is html field */ public boolean isHtml() { return m_vo.IsHtml; } + /** * Selection column sequence - * @return SeqNoSelection + * @return Selection column sequence */ public int getSeqNoSelection() { return m_vo.SeqNoSelection; } + /** * Get Obscure Type - * @return obscure + * @return obscure type */ public String getObscureType() { return m_vo.ObscureType; } + /** * Get Sort No - * @return sort + * @return sequence in sort */ public int getSortNo() { return m_vo.SortNo; } + /** * Get Field Length * @return field length @@ -1775,37 +1829,42 @@ public class GridField { return m_vo.FieldLength; } + /** * Get VFormat - * @return format + * @return value format */ public String getVFormat() { return m_vo.VFormat; } + /** * Get Format Pattern - * @return format pattern + * @return value format pattern */ public String getFormatPattern() { return m_vo.FormatPattern; } + /** * Get Value Min - * @return min + * @return min value */ public String getValueMin() { return m_vo.ValueMin; } + /** * Get Value Max - * @return max + * @return max value */ public String getValueMax() { return m_vo.ValueMax; } + /** * Get Field Group * @return field group @@ -1814,6 +1873,7 @@ public class GridField { return m_vo.FieldGroup; } + /** * Get Field Group Type * @return field group type @@ -1822,17 +1882,19 @@ public class GridField { return m_vo.FieldGroupType; } + /** * Key - * @return key + * @return true if this is key field */ public boolean isKey() { return m_vo.IsKey; } + /** * UUID - * @return is UUID + * @return true if this is UUID field */ public boolean isUUID() { @@ -1843,17 +1905,19 @@ public class GridField } return false; } + /** * Parent Column - * @return parent column + * @return true if this is a parent column */ public boolean isParentColumn() { return m_vo.IsParent; } + /** * Parent Link Value - * @return parent value + * @return true if this is field for parent link column */ public boolean isParentValue() { @@ -1891,20 +1955,22 @@ public class GridField /** * Get AD_Process_ID - * @return process + * @return AD_Process_ID */ public int getAD_Process_ID() { return m_vo.AD_Process_ID; } + /** * Get AD_InfoWindow_ID - * @return info window + * @return AD_InfoWindow_ID */ public int getAD_InfoWindow_ID() { return m_vo.AD_InfoWindow_ID; } + /** * Get Description * @return description @@ -1913,6 +1979,7 @@ public class GridField { return m_vo.Description; } + /** * Get Help * @return help @@ -1921,6 +1988,7 @@ public class GridField { return m_vo.Help; } + /** * Get AD_Tab_ID * @return tab @@ -1929,6 +1997,7 @@ public class GridField { return m_vo.AD_Tab_ID; } + /** * Get VO * @return value object @@ -1940,7 +2009,7 @@ public class GridField /** * Default Focus - * @return focus + * @return true if this is the default focus field */ public boolean isDefaultFocus() { @@ -1958,7 +2027,7 @@ public class GridField /** * Get AD_Field_ID - * @return field + * @return AD_Field_ID */ public int getAD_Field_ID() { @@ -1968,8 +2037,8 @@ public class GridField /** * Set Value to null. *

    - * Do not update context - called from GridTab.setCurrentRow - * Send Bean PropertyChange if there is a change + * Do not update context - called from GridTab.setCurrentRow. + * Send Bean PropertyChange event if there is a change (i.e current value is not null). */ public void setValue () { @@ -1986,8 +2055,8 @@ public class GridField /** * Set Value to null. *

    - * Do update context - called from GridTab.setCurrentRow - * Send Bean PropertyChange if there is a change + * Do update context - called from GridTab.setCurrentRow. + * Send Bean PropertyChange event if there is a change (i.e curent value is not null). */ public void setValueAndUpdateContext () { @@ -2008,7 +2077,7 @@ public class GridField * Set Value. *

    * Update context, if not text or RowID; - * Send Bean PropertyChange if there is a change + * Send Bean PropertyChange event if there is a change. * @param newValue new value * @param inserting true if inserting */ @@ -2089,11 +2158,17 @@ public class GridField } } + /** + * @return AD_LabelStyle_ID + */ public int getAD_LabelStyle_ID() { return m_vo.AD_LabelStyle_ID; } + /** + * @return AD_FieldStyle_ID + */ public int getAD_FieldStyle_ID() { return m_vo.AD_FieldStyle_ID; @@ -2171,8 +2246,6 @@ public class GridField if (!DisplayType.isID(dt)) return null; - //TODO: setValueValidate - return null; } // setValueValidate @@ -2186,9 +2259,6 @@ public class GridField } // getValue /** - * Set old/previous Value. - * (i.e. don't fire Property change) - * Used by VColor.setField * @param value if false property change will always be fires */ public void setValueNoFire (boolean value) @@ -2198,7 +2268,7 @@ public class GridField /** * Get old/previous Value. - * Called from MTab.processCallout + * Called from MTab.processCallout. * @return old value */ public Object getOldValue() @@ -2207,8 +2277,8 @@ public class GridField } // getOldValue /** - * Set Error Value (the value, which cuased some Error) - * @param errorValue error message + * Set Error Value (the value, which caused some Error) + * @param errorValue error value */ public void setErrorValue (String errorValue) { @@ -2217,7 +2287,7 @@ public class GridField } // setErrorValue /** - * Get Error Value (the value, which cuased some Error) AND reset it to null + * Get Error Value (the value, which caused some Error) AND reset error value to null * @return error value */ public String getErrorValue () @@ -2229,8 +2299,8 @@ public class GridField } // getErrorValue /** - * Return true, if value has Error (for HTML interface) AND reset it to false - * @return has error + * Get error value flag AND reset error value flag to false + * @return true if error value is set */ public boolean isErrorValue() { @@ -2250,13 +2320,12 @@ public class GridField /** * Overwrite Displayed - * @param displayed trie if displayed + * @param displayed true if displayed */ public void setDisplayed (boolean displayed) { m_vo.IsDisplayed = displayed; } // setDisplayed - /** * Create Mnemonic for field @@ -2289,7 +2358,6 @@ public class GridField { m_mnemonic = mnemonic; } // setMnemonic - /** * String representation @@ -2321,8 +2389,7 @@ public class GridField return sb.toString(); } // toStringX - - /************************************************************************* + /** * Remove Property Change Listener * @param l listener */ @@ -2340,10 +2407,8 @@ public class GridField m_propertyChangeListeners.addPropertyChangeListener(l); } - - /************************************************************************** - * Create Fields. - * Used by APanel.cmd_find and Viewer.cmd_find + /** + * Create GridFields for AD_Tab * @param ctx context * @param WindowNo window * @param TabNo tab no @@ -2393,8 +2458,8 @@ public class GridField /** * bug[1637757] - * Check whether is indirect parent. - * @return boolean + * Check whether is indirect parent link field (i.e not immediate parent tab) + * @return true if it is indirect parent link field */ private boolean isIndirectParentValue() { @@ -2446,7 +2511,7 @@ public class GridField } /** - * Restore the backup value if any + * Restore the backup value (if available) * author teo_sarca [ 1699826 ] */ public void restoreValue() { @@ -2478,7 +2543,7 @@ public class GridField /** * Feature Request FR [ 1757088 ] * Get the id tab include - * @return id Tab + * @return Included_Tab_ID */ public int getIncluded_Tab_ID () { @@ -2495,15 +2560,15 @@ public class GridField /** * Get the default state of collapse field group type + * @param true if field group should collapsed by default */ public boolean getIsCollapsedByDefault() { return m_vo.IsCollapsedByDefault; } /** - * Returns a list containing all existing entries of this field - * with the actual AD_Client_ID. - * @return List of existing entries for this field + * Returns a list containing all existing values of this field (for current login client). + * @return List of existing values for this field */ public List getEntries() { /* TODO: consider caching the list to avoid repeating queries on every window open (twice, for find and for field) */ @@ -2560,7 +2625,7 @@ public class GridField /** * @param columnName - * @return true if columnName also exist in parent tab + * @return true if columnName also exist in parent tab (immediate or indirect) */ private boolean isParentTabField(String columnName) { @@ -2577,14 +2642,16 @@ public class GridField } /** - * - * @return true if this field (m_vo.ColumnName) also exist in parent tab + * @return true if this field (m_vo.ColumnName) also exist in parent tab (immediate or indirect) */ private boolean isParentTabField() { return isParentTabField(m_vo.ColumnName); } + /** + * @return true if field will update window context + */ private boolean isUpdateWindowContext() { if (getGridTab() != null) @@ -2593,59 +2660,95 @@ public class GridField return true; } - /*IDEMPIERE-358*/ - + /** + * IDEMPIERE-358 + * @return X position in form + */ public int getXPosition() { return m_vo.XPosition; } + /** + * @return column span (for form) + */ public int getColumnSpan() { return m_vo.ColumnSpan; } + /** + * @return number of lines (for form) + */ public int getNumLines() { return m_vo.NumLines; } + /** + * @return true if render as toolbar button + */ public boolean isToolbarButton() { return m_vo.displayType == DisplayType.Button && (MColumn.ISTOOLBARBUTTON_Toolbar.equals(m_vo.IsToolbarButton) || MColumn.ISTOOLBARBUTTON_Both.equals(m_vo.IsToolbarButton)); } + /** + * @return true if only render as toolbar button + */ public boolean isToolbarOnlyButton() { return m_vo.displayType == DisplayType.Button && MColumn.ISTOOLBARBUTTON_Toolbar.equals(m_vo.IsToolbarButton); } + /** + * @return true if record is lock + */ public boolean isLockedRecord() { return m_lockedRecord; } + /** + * @param lockedRecord + */ public void setLockedRecord(boolean lockedRecord) { this.m_lockedRecord = lockedRecord; } + /** + * @return PA_DashboardContent_ID + */ public int getPA_DashboardContent_ID() { return m_vo.PA_DashboardContent_ID; } + /** + * @return place holder text for editor + */ public String getPlaceholder() { return m_vo.Placeholder; } + /** + * @return place holder text 2 for editor (for range field) + */ public String getPlaceholder2() { return m_vo.Placeholder2; } + /** + * @param placeholder + */ public void setPlaceholder(String placeholder) { m_vo.Placeholder = placeholder; } + /** + * @param ctx + * @return clone GridField + */ public GridField clone(Properties ctx) { try { @@ -2677,6 +2780,7 @@ public class GridField { return m_lookupEditorSettingValue; } + /** * Is Quick Form * @return true if displayed in Quick Form @@ -2693,6 +2797,9 @@ public class GridField return m_vo.dateRangeOption; } + /** + * Load virtual UI column + */ public void processUIVirtualColumn() { String sql = m_vo.ColumnSQL.substring(5); sql = Env.parseContext(Env.getCtx(), getWindowNo(), sql, false); diff --git a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java index 451ebc4a3d..c9c3c621b1 100644 --- a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java +++ b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java @@ -30,7 +30,6 @@ import org.compiere.util.CLogger; import org.compiere.util.DisplayType; import org.compiere.util.Env; - /** * Field Model Value Object * @@ -44,12 +43,13 @@ import org.compiere.util.Env; public class GridFieldVO implements Serializable, Cloneable { /** - * + * generated serial id */ private static final long serialVersionUID = -4069340866487289281L; /** - * Return the SQL statement used for the MFieldVO.create + * Get the SQL statement used for {@link #create(Properties, int, int, int, int, boolean, ResultSet)} or + * {@link #createFromResultSet(Properties, int, int, int, int, boolean, ResultSet)}. * @param ctx context * @return SQL with or w/o translation and 1 parameter */ @@ -77,10 +77,9 @@ public class GridFieldVO implements Serializable, Cloneable return sql.toString(); } // getSQL - /** * Create Field Value Object. - * The vo return is not safe to cache directly or through clone + * The VO return is not safe to cache directly or through clone. * @param ctx context * @param WindowNo window * @param TabNo tab @@ -99,7 +98,7 @@ public class GridFieldVO implements Serializable, Cloneable } // create /** - * Additional processing after a new vo have been created from db or cloned from cache + * Additional processing after a new vo have been created from db or cloned from cache. * This include asp customization, user customization and loading of lookup info. * @return GridFieldVO */ @@ -189,13 +188,11 @@ public class GridFieldVO implements Serializable, Cloneable if (userDef.getPlaceholder() != null) vo.Placeholder = userDef.getPlaceholder(); - //devCoffee 8535 if (userDef.getAD_FieldGroup_ID() > 0) { vo.FieldGroup = ((X_AD_FieldGroup)userDef.getAD_FieldGroup()).get_Translation(I_AD_FieldGroup.COLUMNNAME_Name); vo.FieldGroupType = userDef.getAD_FieldGroup().getFieldGroupType(); } - //fim devCoffee 8535 if (userDef.getIsAutocomplete() != null) vo.IsAutocomplete = "Y".equals(userDef.getIsAutocomplete()); @@ -209,7 +206,7 @@ public class GridFieldVO implements Serializable, Cloneable /** * Create GridFieldVO from db resultset. - * No further processing is apply to the vo and the vo is safe to cache through clone + * No further processing is apply to the VO and the VO is safe to cache through clone. * @param ctx * @param WindowNo * @param TabNo @@ -320,7 +317,7 @@ public class GridFieldVO implements Serializable, Cloneable } /** - * Init Field for Process Parameter + * Create Field VO for Process Parameter * @param ctx context * @param WindowNo window * @param ProcessIDOfPanel @@ -334,11 +331,15 @@ public class GridFieldVO implements Serializable, Cloneable return GridFieldVO.createParameter(ctx, WindowNo, 0, ProcessIDOfPanel, WindowIDOfPanel, InfoWindowIDOfPanel, rs); } /** - * Init Field for Process Parameter + * Create Field VO for Process Parameter * @param ctx context * @param WindowNo window + * @param TabNo + * @param ProcessIDOfPanel + * @param WindowIDOfPanel + * @param InfoWindowIDOfPanel * @param rs result set AD_Process_Para - * @return MFieldVO + * @return GridFieldVO */ public static GridFieldVO createParameter (Properties ctx, int WindowNo, int TabNo, int ProcessIDOfPanel, int WindowIDOfPanel, int InfoWindowIDOfPanel, ResultSet rs) { @@ -354,7 +355,7 @@ public class GridFieldVO implements Serializable, Cloneable try { vo.AD_Table_ID = 0; - vo.AD_Column_ID = rs.getInt("AD_Process_Para_ID"); // ** + vo.AD_Column_ID = rs.getInt("AD_Process_Para_ID"); vo.ColumnName = rs.getString("ColumnName"); vo.Header = rs.getString("Name"); vo.Description = rs.getString("Description"); @@ -542,13 +543,13 @@ public class GridFieldVO implements Serializable, Cloneable } /** - * Make a standard field (Created/Updated/By) + * Create standard field (Created/Updated/By) VO. * @param ctx context * @param WindowNo window * @param TabNo tab * @param AD_Window_ID window * @param AD_Tab_ID tab - * @param tabReadOnly rab is r/o + * @param tabReadOnly tab is r/o * @param isCreated is Created field * @param isTimestamp is the timestamp (not by) * @return GridFieldVO @@ -572,9 +573,8 @@ public class GridFieldVO implements Serializable, Cloneable vo.initFinish(); return vo; } // initStdField - - /************************************************************************** + /** * Private constructor. * @param Ctx context * @param windowNo window @@ -603,8 +603,8 @@ public class GridFieldVO implements Serializable, Cloneable /** AD_Winmdow_ID */ public int AD_Window_ID; /** - * in case this field lie on parameter process panel, AD_Process_ID_Of_Panel is id of process will run in this panel - * it's difference with AD_Process_ID + * When this field is inside process parameter panel, AD_Process_ID_Of_Panel is id of process that will run in this panel. + * This is different from AD_Process_ID of field. */ public int AD_Process_ID_Of_Panel; /** @@ -612,7 +612,7 @@ public class GridFieldVO implements Serializable, Cloneable */ public int AD_Window_ID_Of_Panel; /** - * AD_Infowindow_ID call process. user in case from info window call process. + * AD_Infowindow_ID of containing panel */ public int AD_InfoWindow_ID_Of_Panel; /** AD_Tab_ID */ @@ -775,7 +775,7 @@ public class GridFieldVO implements Serializable, Cloneable public boolean IsShowNegateButton = false; /** - * Set Context including contained elements + * Set context including context of lookupInfo. * @param newCtx new context */ public void setCtx (Properties newCtx) @@ -814,7 +814,6 @@ public class GridFieldVO implements Serializable, Cloneable if (Placeholder == null) Placeholder = ""; - // Create Lookup, if not ID if (DisplayType.isLookup(displayType) && IsDisplayed) { @@ -843,7 +842,7 @@ public class GridFieldVO implements Serializable, Cloneable } /** - * Clone Field. + * Clone Field VO. * @param Ctx ctx * @param windowNo window no * @param tabNo tab no @@ -902,7 +901,7 @@ public class GridFieldVO implements Serializable, Cloneable } // toString /** - * + * Comparator for GridFieldVO.SeqNo * @author a42niem * IDEMPIERE-1120 Implement Field SeqNo customization */ diff --git a/org.adempiere.base/src/org/compiere/model/GridTab.java b/org.adempiere.base/src/org/compiere/model/GridTab.java index 8c41859f08..1b27fd52f7 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTab.java +++ b/org.adempiere.base/src/org/compiere/model/GridTab.java @@ -41,6 +41,7 @@ import javax.swing.event.EventListenerList; import org.adempiere.base.Core; import org.adempiere.base.IColumnCallout; +import org.adempiere.base.IColumnCalloutFactory; import org.adempiere.model.MTabCustomization; import org.adempiere.util.ContextRunnable; import org.adempiere.util.ICalloutUI; @@ -69,7 +70,7 @@ import org.compiere.util.ValueNamePair; * *

      *  Event Hierarchies:
    - *      - dataChanged (from MTable)
    + *      - dataChanged (from GridTable)
      *          - setCurrentRow
      *              - Update all Field Values
      *
    @@ -111,7 +112,7 @@ import org.compiere.util.ValueNamePair;
     public class GridTab implements DataStatusListener, Evaluatee, Serializable
     {
     	/**
    -	 * 
    +	 * generated serial id
     	 */
     	private static final long serialVersionUID = 3039046293468517959L;
     
    @@ -131,10 +132,10 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
     	}
     
     	/**
    -	 *	Create Tab (Model) from Value Object.
    +	 *	Create Tab Model from Value Object.
     	 *  

    - * MTab provides a property listener for changed rows and a - * DataStatusListener for communicating changes of the underlying data + * GridTab provides a property listener for changed rows and a + * DataStatusListener for communicating changes of the underlying data. * @param vo Value Object * @param w * @param virtual @@ -217,7 +218,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable private ArrayList selection = null; public boolean isQuickForm = false; - // Context property names: + // Context property names for Tab Info: public static final String CTX_KeyColumnName = "_TabInfo_KeyColumnName"; public static final String CTX_LinkColumnName = "_TabInfo_LinkColumnName"; public static final String CTX_TabLevel = "_TabInfo_TabLevel"; @@ -234,10 +235,10 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable public static final String CTX_IsLookupOnlySelection = "_TabInfo_IsLookupOnlySelection"; public static final String CTX_IsAllowAdvancedLookup = "_TabInfo_IsAllowAdvancedLookup"; - /************************************************************************** + /** * Tab loader for Tabs > 0 */ - class Loader extends ContextRunnable + protected class Loader extends ContextRunnable { /** * Async Loading of Tab > 0 @@ -249,7 +250,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // Loader /** - * Wait until load is complete + * Wait until loading is complete */ private void waitLoadCompete() { @@ -269,14 +270,17 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable log.config ("fini"); } // waitLoadComplete + /** + * @return true if GridTab loaded. + */ public boolean isLoadComplete() { return m_loadComplete; } /** - * Initialize Tab with record from AD_Tab_v - * @param async async + * Initialize Tab with data from AD_Tab_v + * @param async asynchronous * @return true, if correctly initialized (ignored) */ public boolean initTab (boolean async) @@ -304,6 +308,9 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } } // initTab + /** + * @return true if loaded + */ protected boolean loadTab() { m_extendedWhere = m_vo.WhereClause; @@ -352,10 +359,9 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } } // dispose - /** - * Get Field data and add to MTable, if it's required or displayed. - * Required fields are keys, parents, or standard Columns + * Get Field data and add to GridTable, if it's required or displayed. + * Required fields are keys, parents, or standard columns. * @return true if fields loaded */ private boolean loadFields() @@ -462,8 +468,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // loadFields /** - * Get a list of variables, this tab is dependent on. - * - for display purposes + * Get a list of variables that this tab is dependent on:
    + * - for display logic * @return ArrayList */ public ArrayList getDependentOn() @@ -494,7 +500,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Get TableModel. * Do not directly communicate with the table model, - * but through the methods of this class + * but through the methods of this class. * @return Table Model */ public GridTable getTableModel() @@ -516,8 +522,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable return mImage.getIcon(); } // getIcon - - /************************************************************************** + /** * Has this field dependents ? * @param columnName column name * @return true if column has dependent @@ -538,8 +543,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable return m_depOnField.getValues(columnName); } // getDependentFields - - /************************************************************************** + /** * Set Query * @param query query */ @@ -573,7 +577,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Is Query New Record - * @return true if query active + * @return true if query is to create new record */ public boolean isQueryNewRecord() { @@ -583,7 +587,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // isQueryNewRecord /** - * Enable Events - enable data events of tabs (add listeners) + * Enable Events - listen to events from GridTable. */ public void enableEvents() { @@ -601,13 +605,13 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // getTabType /** - * Assemble whereClause and query MTable and position to row 0. + * Assemble whereClause and query GridTable and position to row 0. *

     	 *		Scenarios:
    -	 *		- Never opened 					(full query)
    -	 *		- query changed 				(full query)
    -	 *		- Detail link value changed		(full query)
    -	 *		- otherwise 					(refreshAll)
    +	 *		- Never opened                  (full query)
    +	 *		- query changed                 (full query)
    +	 *		- Detail link value changed     (full query)
    +	 *		- otherwise                     (refreshAll)
     	 *  
    * @param onlyCurrentRows only current rows (1 day) */ @@ -617,13 +621,13 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // query /** - * Assemble whereClause and query MTable and position to row 0. + * Assemble whereClause and query GridTable and position to row 0. *
     	 *		Scenarios:
    -	 *		- Never opened 					(full query)
    -	 *		- query changed 				(full query)
    -	 *		- Detail link value changed		(full query)
    -	 *		- otherwise 					(refreshAll)
    +	 *		- Never opened                  (full query)
    +	 *		- query changed                 (full query)
    +	 *		- Detail link value changed     (full query)
    +	 *		- otherwise                     (refreshAll)
     	 *  
    * @param onlyCurrentRows only current rows * @param onlyCurrentDays if only current row, how many days back @@ -742,7 +746,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // query /** - * reset detail data grid when parent tab current record is new and not saved yet + * Reset detail GridTab when parent tab current record is new and not saved yet */ public void resetDetailForNewParentRecord() { if (m_mTable.isOpen()) @@ -766,7 +770,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Validate Query. - * If query column is not a tab column create EXISTS query + * If query column is not a tab column, create EXISTS query. * @param query query * @return where clause */ @@ -863,8 +867,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable return result.toString(); } // validateQuery - - /************************************************************************** + /** * Refresh all data */ public void dataRefreshAll () @@ -872,7 +875,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable dataRefreshAll(true); } - /************************************************************************** + /** * Refresh all data * @param fireEvent */ @@ -881,9 +884,10 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable dataRefreshAll(fireEvent, false); } - /************************************************************************** + /** * Refresh all data * @param fireEvent + * @param retainedCurrentRow */ public void dataRefreshAll (boolean fireEvent, boolean retainedCurrentRow) { @@ -957,11 +961,10 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable fireStateChangeEvent(new StateChangeEvent(this, StateChangeEvent.DATA_REFRESH)); } // dataRefresh - - /************************************************************************** - * Unconditionally Save data - * @param manualCmd if true, no vetoable PropertyChange will be fired for save confirmation from MTable - * @return true if save complete (or nor required) + /** + * Save data + * @param manualCmd if true, no vetoable PropertyChange event will be fired for save confirmation from GridTable + * @return true if save complete (or not required) */ public boolean dataSave(boolean manualCmd) { @@ -1002,8 +1005,10 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable return m_mTable.isNeedSaveAndMandatoryFill(); } - // Validate if the current tab record has changed in database or any parent record - // Return if there are changes + /** + * Validate if current tab or parent tab record has changed in database + * @return true if if there are changes + */ public boolean hasChangedCurrentTabAndParents() { String msg = null; // Carlos Ruiz / globalqss - [ adempiere-Bugs-1985481 ] Processed documents can be edited @@ -1051,6 +1056,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * refresh current row of parent tabs + * @param fireParentEvent */ public void refreshParentTabs(boolean fireParentEvent) { if (isDetail()) { @@ -1096,7 +1102,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // isDataChanged /** - * Ignore data changes + * Ignore/undo data changes */ public void dataIgnore() { @@ -1115,10 +1121,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable if (log.isLoggable(Level.FINE)) log.fine("#" + m_vo.TabNo + "- fini"); } // dataIgnore - /** - * Create (copy) new Row - * and process Callouts + * Create (copy) new Row and process Callouts. * @param copy copy * @return true if copied/new */ @@ -1223,8 +1227,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // getTabLevel /** - * Get Commit Warning - * @return commit warning + * Get commit/save Warning + * @return commit/save warning */ public String getCommitWarning() { @@ -1233,7 +1237,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Return Table Model - * @return MTable + * @return GridTable */ protected GridTable getMTable() { @@ -1249,6 +1253,9 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable return m_keyColumnName; } // getKeyColumnName + /** + * @return key column index + */ public int getKeyColumnIndex() { return m_mTable.getKeyColumnIndex(); @@ -1264,7 +1271,6 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } /** - * Return Name of link column * @return link column name */ public String getLinkColumnName() @@ -1274,9 +1280,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Set Name of link column. - * Set from MWindow.loadTabData - * Used in MTab.isCurreny, (.setCurrentRow) .query - APanel.cmd_report - * and MField.isEditable and .isDefault via context + * Set from GridWindow.loadTabData. * @param linkColumnName name of column - or sets name to AD_Column_ID, if exists */ public void setLinkColumnName (String linkColumnName) @@ -1287,8 +1291,6 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable if ( m_parentColumnName == null ) m_parentColumnName = ""; - - if (linkColumnName != null) m_linkColumnName = linkColumnName; else @@ -1306,12 +1308,12 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // setLinkColumnName /** - * Is the tab current?. + * Is the tab current? *
    -	 *	Yes 	- Table must be open
    -	 *			- Query String is the same
    -	 *			- Not Detail
    -	 *			- Old link column value is same as current one
    +	 *	Yes     - Table must be open
    +	 *	        - Query String is the same
    +	 *	        - Not Detail Tab
    +	 *	        - Old link column value is same as current one
     	 *  
    * @return true if current */ @@ -1345,11 +1347,12 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable return false; } // isCurrent - /** * Is Tab Included in other Tab * @return true if included + * @deprecated */ + @Deprecated public boolean isIncluded() { if (! m_includedAlreadyCalc) { @@ -1372,6 +1375,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable * @param isIncluded true if included * @deprecated The method getIncluded now validate against the structure, this method is called nowhere */ + @Deprecated public void setIncluded(boolean isIncluded) { m_included = isIncluded; @@ -1385,6 +1389,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable { return m_vo.onlyCurrentRows; } // isOnlyCurrentRows + /** * Return Parent ArrayList * @return parent column names @@ -1395,7 +1400,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // getParentColumnNames /** - * Returns true if this is a detail record + * Returns true if this is a detail tab * @return true if not parent tab */ public boolean isDetail() @@ -1438,7 +1443,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Get Process ID - * @return Process ID + * @return AD_Process_ID */ public int getAD_Process_ID() { @@ -1497,7 +1502,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Tab contains Always Update Field - * @return true if field with always updateable + * @return true if has field that is always updatable */ public boolean isAlwaysUpdateField() { @@ -1512,7 +1517,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Can we Insert Records? - * @return true not read only and allowed + * @return true if can insert new record */ public boolean isInsertRecord() { @@ -1523,7 +1528,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Can we Delete Records? - * @return true not read only and allowed + * @return true if can delete existing record */ public boolean isDeleteRecord() { @@ -1534,7 +1539,6 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Is the Tab Visible. - * Called when constructing the window. * @return true, if displayed */ public boolean isDisplayed () @@ -1551,9 +1555,9 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // isDisplayed /** - * Get Variable Value (Evaluatee) + * Get Variable Value (Evaluatee) as string * @param variableName name - * @return value + * @return value as string */ public String get_ValueAsString (String variableName) { @@ -1561,10 +1565,10 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // get_ValueAsString /** - * Get Variable Value (Evaluatee) + * Get Variable Value (Evaluatee) as string * @param ctx context * @param variableName name - * @return value + * @return value as string */ public String get_ValueAsString (Properties ctx, String variableName) { @@ -1573,7 +1577,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Is Single Row - * @return true if single row + * @return true if default to single row (i.e form presentation) */ public boolean isSingleRow() { @@ -1584,7 +1588,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // isSingleRow; /** - * Set Single Row. + * Set Single Row (form presentation) * Temporary store of current value * @param isSingleRow toggle */ @@ -1614,7 +1618,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Get Tab ID - * @return Tab ID + * @return AD_Tab_ID */ public int getAD_Tab_ID() { @@ -1623,7 +1627,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Get Table ID - * @return Table ID + * @return AD_Table_ID */ public int getAD_Table_ID() { @@ -1632,7 +1636,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Get Window ID - * @return Window ID + * @return AD_Window_ID */ public int getAD_Window_ID() { @@ -1642,8 +1646,9 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Get Included Tab ID * @return Included_Tab_ID - * @deprecated the functionality related to AD_Tab.Included_Tab_ID was not developed + * @deprecated the functionality related to AD_Tab.Included_Tab_ID is deprecated */ + @Deprecated public int getIncluded_Tab_ID() { return m_vo.Included_Tab_ID; @@ -1669,7 +1674,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Is Sort Tab - * @return true if sort tab + * @return true if this is sort tab */ public boolean isSortTab() { @@ -1678,7 +1683,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Get Order column for sort tab - * @return AD_Column_ID + * @return AD_Column_ID for sorting */ public int getAD_ColumnSortOrder_ID() { @@ -1687,15 +1692,14 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Get Yes/No column for sort tab - * @return AD_Column_ID + * @return AD_Column_ID for yes/no flag */ public int getAD_ColumnSortYesNo_ID() { return m_vo.AD_ColumnSortYesNo_ID; } // getAD_ColumnSortYesNo_ID - - /************************************************************************** + /** * Get extended Where Clause (parent link) * @return parent link */ @@ -1740,8 +1744,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable return m_vo.OrderByClause; } // getOrderByClause - - /************************************************************************** + /** * Transaction support. * Depending on Table returns transaction info * @return info @@ -1981,10 +1984,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable return null; } // getTrxInfo - /************************************************************************** - * Status Line support - * Depending on Window/Tab returns transaction info - * @return info + /** + * @return status line text */ public String getStatusLine() { @@ -1998,10 +1999,9 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable return null; } // getStatusLine - /************************************************************************** - * Widget support - * Depending on Window/Tab returns widget lines info - * @return info + /** + * Get status line for this tab + * @return status line text */ public String getStatusLinesWidget() { MStatusLine[] wls = MStatusLine.getStatusLinesWidget(getAD_Window_ID(), getAD_Tab_ID(), getAD_Table_ID()); @@ -2098,8 +2098,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Can this tab have Attachments?. *

    - * It can have an attachment if it has a key column ending with _ID. - * The key column is empty, if there is no single identifying key. + * A tab can have attachment if it has single key column ending with _ID or _UU. * @return true if record can have attachment */ public boolean canHaveAttachment() @@ -2120,7 +2119,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Get Attachment_ID for current record. - * @return ID or 0, if not found + * @return AD_AttachmentID or 0 if no attachment. */ public int getAD_AttachmentID() { @@ -2131,8 +2130,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // getAttachmentID /** - * Returns true, if current row has a Chat - * @return true if record has chat + * Returns true, if current row has chat records. + * @return true if current row has chat records. */ public boolean hasChat() { @@ -2141,7 +2140,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Get Chat_ID for this record. - * @return ID or 0, if not found + * @return CM_Chat_ID or 0 if no chat records */ public int getCM_ChatID() { @@ -2151,6 +2150,9 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable return MChat.getID(m_vo.AD_Table_ID, recordUU); } // getCM_ChatID + /** + * @return true if current row has post it note records. + */ public boolean hasPostIt() { return getAD_PostIt_ID() > 0; @@ -2158,7 +2160,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Get PostItID for this record. - * @return ID or 0, if not found + * @return AD_PostIt_ID or 0 if no post it note records. */ public int getAD_PostIt_ID() { @@ -2169,8 +2171,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // getAD_PostIt_ID /** - * Returns true, if current row has Label(s) - * @return true if record has Label(s) + * @return true if current row has Label records. */ public boolean hasLabel() { @@ -2181,16 +2182,15 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // hasLabel /** - * Returns true, if this tab have templates allowed with current role - * @return true if record has templates + * @return true if this has import templates */ public boolean hasTemplate() { return MImportTemplate.getTemplates(Env.getAD_Role_ID(Env.getCtx()), getAD_Tab_ID()).size() > 0; } // hasChat - /************************************************************************** - * Load Locks for Table and User + /** + * Load Record Locks for Table and User */ public void loadLocks() { @@ -2235,8 +2235,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // loadLooks /** - * Record Is Locked - * @return true if locked + * @return true if record is locked */ public boolean isLocked() { @@ -2252,10 +2251,10 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // isLocked /** - * Lock Record + * Lock or unlock Record * @param ctx context * @param Record_ID id - * @param lock true if lock, otherwise unlock + * @param lock true to lock, false to unlock */ public void lock (Properties ctx, int Record_ID, boolean lock) { @@ -2271,14 +2270,16 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable loadLocks(); } // lock - - /************************************************************************** - * Data Status Listener from MTable. + /** + *

    +	 *  Data Status event from GridTable.
     	 *  - get raw info and add current row information
    -	 *  - update the current row
    +	 *  - update current row
     	 *  - redistribute (fire) Data Status event
    +	 *  
    * @param e event */ + @Override public void dataStatusChanged (DataStatusEvent e) { if (log.isLoggable(Level.FINE)) log.fine("#" + m_vo.TabNo + " - " + e.toString()); @@ -2335,7 +2336,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // dataStatusChanged /** - * Inform Listeners and build WHO info + * Fire data status change event * @param e event */ private void fireDataStatusChanged (DataStatusEvent e) @@ -2360,7 +2361,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // fireDataStatusChanged /** - * update {@link DataStatusEvent} properties from gridTab + * Update {@link DataStatusEvent} properties from gridTab * @param e */ public void updateDataStatusEventProperties(DataStatusEvent e) { @@ -2402,7 +2403,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable * Create and fire Data Status Error Event * @param AD_Message message * @param info info - * @param isError if not true, it is a Warning + * @param isError true for Error, false for Warning */ public void fireDataStatusEEvent(String AD_Message, String info, boolean isError) { @@ -2421,7 +2422,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Get Current Row - * @return current row + * @return current row index */ public int getCurrentRow() { @@ -2429,8 +2430,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // getCurrentRow /** - * Get Current Table Key ID - * @return Record_ID + * @return Key id of current row (for e.g C_Order_ID value) */ public int getRecord_ID() { @@ -2439,7 +2439,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Get Current Table UUID - * @return Record_UU + * @return UUID value of current row (for e.g C_Order_UU value) */ public String getRecord_UU() { @@ -2468,11 +2468,13 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // getKeyUUID /** + *
     	 *  Navigate absolute - goto Row - (zero based).
    -	 *  - does nothing, if in current row
    -	 *  - saves old row if required
    +	 *  - does nothing, if target row = current row
    +	 *  - saves current row if required
    +	 *  
    * @param targetRow target row - * @return current row + * @return new current row index */ public int navigate (int targetRow) { @@ -2502,8 +2504,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Navigate relatively - i.e. plus/minus from current position - * @param rowChange row change - * @return current row + * @param rowChange offset from current position + * @return new current row index */ public int navigateRelative (int rowChange) { @@ -2512,7 +2514,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Navigate to current now (reload) - * @return current row + * @return current row index */ public int navigateCurrent() { @@ -2522,8 +2524,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Row Range check - * @param targetRow target row - * @return checked row + * @param targetRow target row index + * @return checked row index */ private int verifyRow (int targetRow) { @@ -2560,10 +2562,10 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Set current row and load data into fields. - * If there is no row - load nulls + * If there is no row - load nulls. * @param newCurrentRow new current row * @param fireEvents fire events - * @return current row + * @return current row index */ public int setCurrentRow (int newCurrentRow, boolean fireEvents) { @@ -2644,6 +2646,9 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable return m_currentRow; } // setCurrentRow + /** + * Update window context's IsSOTrx value. + */ private void setIsSOTrxContext() { final String IsSOTrx = "IsSOTrx"; final String C_DocType_ID = "C_DocType_ID"; @@ -2686,16 +2691,15 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } } - /** * Set current row - used for deleteSelection + * @param row */ public void setCurrentRow(int row){ setCurrentRow(row, false); } - - /************************************************************************** + /** * Get RowCount * @return row count */ @@ -2726,8 +2730,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Get Field by index - * @param index index - * @return MField + * @param index field index + * @return GridField */ public GridField getField (int index) { @@ -2737,7 +2741,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Get Field by DB column name * @param columnName column name - * @return MField + * @return GridField */ public GridField getField (String columnName) { @@ -2746,7 +2750,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Get all Fields - * @return MFields + * @return GridFields */ public GridField[] getFields () { @@ -2790,9 +2794,10 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } int col = m_mTable.findColumn(field.getColumnName()); + //will trigger processFieldChange through data status change event m_mTable.setValueAt(value, m_currentRow, col, false); // - return ""; // processFieldChange (field); // here we don't need to call processFieldChange, it was called on GridController.dataStatusChanged + return ""; } // setValue /** @@ -2816,8 +2821,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Process Field Change - evaluate Dependencies and process Callouts. - * - * called from MTab.setValue or GridController.dataStatusChanged + *

    + * Usually called from UI side data status change listener. * @param changedField changed field * @return error message or "" */ @@ -2872,7 +2877,6 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // for all dependent fields } // processDependencies - private List activeCallouts = new ArrayList(); private List activeCalloutInstance = new ArrayList(); @@ -2882,7 +2886,6 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable private int m_parentTabNo = -1; /** - * * @return list of active call out for this tab */ public String[] getActiveCallouts() @@ -2892,7 +2895,6 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } /** - * * @return list of active call out instance for this tab */ public Callout[] getActiveCalloutInstance() @@ -2901,20 +2903,17 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable return activeCalloutInstance.toArray(list); } - /************************************************************************** - * Process Callout(s). - *

    - * The Callout is in the string of - * "class.method;class.method;" - * If there is no class name, i.e. only a method name, the class is regarded - * as CalloutSystem. + /** + * Process Callout(s). + *

    + * The traditional column callout is in the format of "class.method;class.method;".
    * The class needs to comply with the Interface Callout. - * - * For a limited time, the old notation of Sx_matheod / Ux_menthod is maintained. - * + *

    + * Newer callout implement the {@link IColumnCallout} interface and discover via {@link IColumnCalloutFactory} service. * @param field field * @return error message or "" * @see org.compiere.model.Callout + * @see IColumnCallout */ public String processCallout (GridField field) { @@ -3002,7 +3001,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable int methodStart = cmd.lastIndexOf('.'); try { - if (methodStart != -1) // no class + if (methodStart != -1) // has class name { String className = cmd.substring(0,methodStart); // IDEMPIERE-2732 @@ -3103,7 +3102,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // getValue /** - * Get Boolean Value of Field with columnName. + * Get Boolean Value of Field with columnName.
    * If there is no column with the given name, the context for current window will be checked. * @param columnName column name * @return boolean value or false if the field was not found @@ -3136,8 +3135,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } // getValue /** - * Get Value of Field in row - * @param row row + * Get Value of Field for a row. + * @param row row index * @param columnName column name * @return value */ @@ -3163,14 +3162,14 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable return retValue; } // toString - - /************************************************************************** + /** * @param l listener */ public synchronized void removePropertyChangeListener(PropertyChangeListener l) { m_propertyChangeSupport.removePropertyChangeListener(l); } + /** * @param l listener */ @@ -3186,6 +3185,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable { m_listenerList.remove(DataStatusListener.class, l); } + /** * @param l listener */ @@ -3213,8 +3213,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Feature Request [1707462] * Enable runtime change of VFormat - * @param identifier field indent - * @param strNewFormat new mask + * @param identifier column name + * @param strNewFormat new input mask * author fer_luck */ public void setFieldVFormat (String identifier, String strNewFormat) @@ -3298,6 +3298,10 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable navigate(to); } + /** + * Fire state change event + * @param e + */ private void fireStateChangeEvent(StateChangeEvent e) { StateChangeListener[] listeners = m_listenerList.getListeners(StateChangeListener.class); @@ -3310,7 +3314,6 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } /** - * * @return list of all tabs included in this tab */ public List getIncludedTabs() @@ -3337,7 +3340,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable //BF [ 2910358 ] /** * get Parent Tab No - * @return Tab No + * @return Parent Tab No */ private int getParentTabNo() { @@ -3358,6 +3361,9 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable return (m_parentTabNo = tabNo); } + /** + * @return parent GridTab + */ public GridTab getParentTab() { int parentTabNo = getParentTabNo(); @@ -3366,6 +3372,9 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable return m_window.getTab(parentTabNo); } + /** + * @return number of columns in form presentation + */ public int getNumColumns() { int maxcol=0; for (GridField gridField : getFields()) @@ -3385,38 +3394,65 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable return maxcol; } + /** + * @return true if current row is a new record row + */ public boolean isNew() { return isOpen() && getCurrentRow() >= 0 && getCurrentRow() == m_mTable.getNewRow(); } + /** + * @return AD_Tab_UU + */ public String getAD_Tab_UU() { return m_vo.AD_Tab_UU; } + /** + * @return AD_Process_UU + */ public String getAD_Process_UU() { return m_vo.AD_Process_UU; } + /** + * @return true if tab will update window context + */ public boolean isUpdateWindowContext() { return m_updateWindowContext ; } + /** + * @param updateWindowContext + */ public void setUpdateWindowContext(boolean updateWindowContext) { m_updateWindowContext = updateWindowContext; } + /** + * Add row index to selection + * @param rowIndex + */ public void addToSelection(int rowIndex) { if (!selection.contains(rowIndex)) selection.add(rowIndex); } + /** + * Remove row index from selection + * @param rowIndex + * @return true if rowIndex is found and remove + */ public boolean removeFromSelection(int rowIndex) { return selection.remove((Integer)rowIndex); } + /** + * @return selected indexes + */ public int[] getSelection() { int[] selected = new int[selection.size()]; @@ -3428,45 +3464,70 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable return selected; } + /** + * @param rowIndex + * @return true if rowIndex is in current selection + */ public boolean isSelected(int rowIndex) { return selection.contains((Integer)rowIndex); } + /** + * clear row selection + */ public void clearSelection() { selection.clear(); } + /** + * @return true if tab is in quick form + */ public boolean isQuickForm() { return isQuickForm; } + /** + * @param isQuickForm + */ public void setQuickForm(boolean isQuickForm) { this.isQuickForm = isQuickForm; } + /** + * @return GridWindow + */ public GridWindow getGridWindow() { return this.m_window; } + /** + * @return GridTabVO + */ public GridTabVO getVO() { return m_vo; } + /** + * @return ICalloutUI + */ public ICalloutUI getCalloutUI() { return calloutUI; } + /** + * @param calloutUI + */ public void setCalloutUI(ICalloutUI calloutUI) { this.calloutUI = calloutUI; } /** * Get Delete Confirmation Logic - * @return String + * @return Delete Confirmation Logic */ public String getDeleteConfirmationLogic() { return m_vo.deleteConfirmationLogic; @@ -3480,8 +3541,10 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable m_vo.deleteConfirmationLogic = deleteConfirmationLogic; } - /** Get Max Query Records. - * @return If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records + /** + * Get Max Query Records.
    + * If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records. + * @return Max Query Records */ public int getMaxQueryRecords() { // minimum between AD_Tab.MaxQueryRecords and AD_Role.MaxQueryRecords @@ -3495,7 +3558,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Require Query * @param noRecords records - * @return true if query required + * @return true if query is required */ public boolean isQueryRequire (int noRecords) { @@ -3511,7 +3574,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Over max Query * @param noRecords records - * @return true if over max query + * @return true if over max query records */ public boolean isQueryMax (int noRecords) { @@ -3519,7 +3582,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable return max > 0 && noRecords > max; } // isQueryMax - /*** + /** * reset to empty */ public void reset() { diff --git a/org.adempiere.base/src/org/compiere/model/GridTabVO.java b/org.adempiere.base/src/org/compiere/model/GridTabVO.java index 21fdcc2115..f5be5bfe56 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTabVO.java +++ b/org.adempiere.base/src/org/compiere/model/GridTabVO.java @@ -33,7 +33,7 @@ import org.compiere.util.Evaluatee; import org.compiere.util.Util; /** - * Model Tab Value Object + * Tab Model Value Object * * @author Jorg Janke * @version $Id: GridTabVO.java,v 1.4 2006/07/30 00:58:38 jjanke Exp $ @@ -42,12 +42,12 @@ public class GridTabVO implements Evaluatee, Serializable { /** - * + * generated serial id */ private static final long serialVersionUID = 8781340605954851838L; - /************************************************************************** - * Create MTab VO + /** + * Create GridTabVO VO * * @param wVO value object * @param TabNo tab no @@ -59,7 +59,8 @@ public class GridTabVO implements Evaluatee, Serializable public static GridTabVO create (GridWindowVO wVO, int TabNo, ResultSet rs, boolean isRO, boolean onlyCurrentRows) { - CLogger.get().config("#" + TabNo); + if (CLogger.get().isLoggable(Level.CONFIG)) + CLogger.get().config("#" + TabNo); GridTabVO vo = new GridTabVO (wVO.ctx, wVO.WindowNo); vo.AD_Window_ID = wVO.AD_Window_ID; @@ -70,7 +71,8 @@ public class GridTabVO implements Evaluatee, Serializable if (isRO) { - CLogger.get().fine("Tab is ReadOnly"); + if (CLogger.get().isLoggable(Level.FINE)) + CLogger.get().fine("Tab is ReadOnly"); vo.IsReadOnly = true; } vo.onlyCurrentRows = onlyCurrentRows; @@ -132,25 +134,28 @@ public class GridTabVO implements Evaluatee, Serializable showTrl = false; if (!showTrl) { - CLogger.get().config("TrlTab Not displayed - AD_Tab_ID=" - + vo.AD_Tab_ID + "=" + vo.Name + ", Table=" + vo.TableName - + ", BaseTrl=" + Env.isBaseTranslation(vo.TableName) - + ", MultiLingual=" + Env.isMultiLingualDocument(vo.ctx)); + if (CLogger.get().isLoggable(Level.CONFIG)) + CLogger.get().config("TrlTab Not displayed - AD_Tab_ID=" + + vo.AD_Tab_ID + "=" + vo.Name + ", Table=" + vo.TableName + + ", BaseTrl=" + Env.isBaseTranslation(vo.TableName) + + ", MultiLingual=" + Env.isMultiLingualDocument(vo.ctx)); return false; } } // Advanced Tab ** if (!showAdvanced && rs.getString("IsAdvancedTab").equals("Y")) { - CLogger.get().config("AdvancedTab Not displayed - AD_Tab_ID=" - + vo.AD_Tab_ID + " " + vo.Name); + if (CLogger.get().isLoggable(Level.CONFIG)) + CLogger.get().config("AdvancedTab Not displayed - AD_Tab_ID=" + + vo.AD_Tab_ID + " " + vo.Name); return false; } // Accounting Info Tab ** if (!showAcct && rs.getString("IsInfoTab").equals("Y")) { - CLogger.get().fine("AcctTab Not displayed - AD_Tab_ID=" - + vo.AD_Tab_ID + " " + vo.Name); + if (CLogger.get().isLoggable(Level.FINE)) + CLogger.get().fine("AcctTab Not displayed - AD_Tab_ID=" + + vo.AD_Tab_ID + " " + vo.Name); return false; } @@ -163,7 +168,8 @@ public class GridTabVO implements Evaluatee, Serializable vo.AccessLevel = rs.getString("AccessLevel"); if (!role.canView (vo.ctx, vo.AccessLevel)) // No Access { - CLogger.get().fine("No Role Access - AD_Tab_ID=" + vo.AD_Tab_ID + " " + vo. Name); + if (CLogger.get().isLoggable(Level.FINE)) + CLogger.get().fine("No Role Access - AD_Tab_ID=" + vo.AD_Tab_ID + " " + vo. Name); return false; } // Used by MField.getDefault Env.setContext(vo.ctx, vo.WindowNo, vo.TabNo, GridTab.CTX_AccessLevel, vo.AccessLevel); @@ -173,8 +179,9 @@ public class GridTabVO implements Evaluatee, Serializable Env.setContext(vo.ctx, vo.WindowNo, vo.TabNo, GridTab.CTX_AD_Table_ID, String.valueOf(vo.AD_Table_ID)); if (!role.isTableAccess(vo.AD_Table_ID, true)) { - CLogger.get().config("No Table Access - AD_Tab_ID=" - + vo.AD_Tab_ID + " " + vo. Name); + if (CLogger.get().isLoggable(Level.CONFIG)) + CLogger.get().config("No Table Access - AD_Tab_ID=" + + vo.AD_Tab_ID + " " + vo. Name); return false; } vo.AD_Table_UU = rs.getString("AD_Table_UU"); @@ -319,8 +326,8 @@ public class GridTabVO implements Evaluatee, Serializable private static final CCache> s_gridFieldCache = new CCache>(MField.Table_Name, "GridFieldVO Cache", 100, CCache.DEFAULT_EXPIRE_MINUTE, false, 1000); - /************************************************************************** - * Create Tab Fields + /** + * Create GridFieldVOs * @param mTabVO tab value object * @return true if fields were created */ @@ -385,7 +392,7 @@ public class GridTabVO implements Evaluatee, Serializable } // createFields /** - * Return the SQL statement used for the MTabVO.create + * Get the SQL statement used for GridTabVO.create * @param ctx context * @return SQL SELECT String */ @@ -455,9 +462,8 @@ public class GridTabVO implements Evaluatee, Serializable } return sql.toString(); } // getSQL - - - /************************************************************************** + + /** * Private constructor - must use Factory * @param Ctx context * @param windowNo window @@ -569,6 +575,9 @@ public class GridTabVO implements Evaluatee, Serializable /** Delete Confirmation Logic of AD_Tab or AD_UserDef_Tab */ public String deleteConfirmationLogic = null; + /** + * @return GridFieldVOs + */ public ArrayList getFields() { if (!initFields) createFields(this); @@ -593,9 +602,9 @@ public class GridTabVO implements Evaluatee, Serializable } // setCtx /** - * Get Variable Value (Evaluatee) + * Get Variable Value (Evaluatee) as string * @param variableName name - * @return value + * @return value as string */ public String get_ValueAsString (String variableName) { @@ -606,7 +615,7 @@ public class GridTabVO implements Evaluatee, Serializable * Clone * @param Ctx context * @param windowNo no - * @return MTabVO or null + * @return GridTabVO or null */ protected GridTabVO clone(Properties Ctx, int windowNo) { @@ -677,7 +686,7 @@ public class GridTabVO implements Evaluatee, Serializable } // clone /** - * @return the initFields + * @return true if fields have been created */ public boolean isInitFields() { return initFields; diff --git a/org.adempiere.base/src/org/compiere/model/GridTable.java b/org.adempiere.base/src/org/compiere/model/GridTable.java index c4a8335277..03d7209efb 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTable.java +++ b/org.adempiere.base/src/org/compiere/model/GridTable.java @@ -61,7 +61,7 @@ import org.compiere.util.Util; import org.compiere.util.ValueNamePair; /** - * Grid Table Model for JDBC access including buffering. + * Grid Table Model for JDBC table access, including buffering. *

      *		The following data types are handled
      *			Integer		for all IDs
    @@ -74,8 +74,7 @@ import org.compiere.util.ValueNamePair;
      *
      *  
    * The model maintains and fires the requires TableModelEvent changes, - * the DataChanged events (loading, changed, etc.) - * as well as Vetoable Change event "RowChange" + * the DataChanged events (loading, changed, etc.) as well as Vetoable Change event "RowChange" * (for row changes initiated by moving the row in the table grid). * * @author Jorg Janke @@ -96,7 +95,7 @@ public class GridTable extends AbstractTableModel implements Serializable { /** - * + * generated serial id */ private static final long serialVersionUID = -5564364545827057092L; @@ -182,11 +181,14 @@ public class GridTable extends AbstractTableModel /** Is the Resultset open? */ private boolean m_open = false; /** Compare to DB before save */ + @Deprecated private boolean m_compareDB = true; // set to true after every save - // The buffer for all data + /** Data buffer */ private volatile ArrayList m_buffer = new ArrayList(100); + /** Sort order for {@link #m_buffer} */ private volatile ArrayList m_sort = new ArrayList(100); + /** Record ID:Values */ private volatile Map m_virtualBuffer = new HashMap(100); /** Original row data */ private Object[] m_rowData = null; @@ -271,7 +273,7 @@ public class GridTable extends AbstractTableModel } // getTableName /** - * Set Where Clause (w/o the WHERE and w/o History). + * Set Where Clause (w/o the WHERE keyword and w/o History). * @param newWhereClause sql where clause * @param onlyCurrentRows only current rows * @param onlyCurrentDays how many days back for current @@ -294,7 +296,7 @@ public class GridTable extends AbstractTableModel } // setWhereClause /** - * Get record set Where Clause (w/o the WHERE and w/o History) + * Get Where Clause (w/o the WHERE keyword and w/o History) * @return where clause */ public String getSelectWhereClause() @@ -312,7 +314,7 @@ public class GridTable extends AbstractTableModel } // isHistoryDisplayed /** - * Set Order Clause (w/o the ORDER BY) + * Set Order Clause (w/o the ORDER BY keyword) * @param newOrderClause sql order by clause */ public void setOrderClause(String newOrderClause) @@ -323,7 +325,7 @@ public class GridTable extends AbstractTableModel } // setOrderClause /** - * Get Order Clause (w/o the ORDER BY) + * Get Order By Clause (w/o the ORDER BY keyword) * @return order by clause */ public String getOrderClause() @@ -332,8 +334,7 @@ public class GridTable extends AbstractTableModel } // getOrderClause /** - * Assemble & store - * m_SQL and m_countSQL + * Assemble & store {@link #m_SQL}, {@link #m_SQL_Select} and {@link #m_SQL_Count}. * @return m_SQL */ private String createSelectSql() @@ -473,8 +474,8 @@ public class GridTable extends AbstractTableModel /** * Returns database column name * - * @param index the column being queried - * @return column name + * @param index column index + * @return column name or empty string (if index is invalid) */ public String getColumnName (int index) { @@ -489,7 +490,7 @@ public class GridTable extends AbstractTableModel } // getColumnName /** - * Returns a column given its name. + * Find column index via column name. * * @param columnName string containing name of column to be located * @return the column index with columnName, or -1 if not found @@ -508,8 +509,8 @@ public class GridTable extends AbstractTableModel /** * Returns Class of database column/field * - * @param index the column being queried - * @return the class + * @param index column index + * @return Java class for column */ public Class getColumnClass (int index) { @@ -552,7 +553,7 @@ public class GridTable extends AbstractTableModel /** - * Get Column at index + * Get GridField at index * @param index index * @return GridField */ @@ -561,10 +562,10 @@ public class GridTable extends AbstractTableModel if (index < 0 || index >= m_fields.size()) return null; return (GridField)m_fields.get(index); - } // getColumn + } // getField /** - * Return Columns with Identifier (ColumnName) + * Get GridField with ColumnName * @param identifier column name * @return GridField */ @@ -593,9 +594,10 @@ public class GridTable extends AbstractTableModel return retValue; } // getField - /************************************************************************** + /** * Open connection to db and load data from table. - * If already opened, data is refreshed + * If already opened, data is refreshed.
    + * Loading of data is perform asynchronously in background thread. * @param maxRows maximum number of rows or 0 for all * @return true if success */ @@ -605,7 +607,8 @@ public class GridTable extends AbstractTableModel m_maxRows = maxRows; if (m_open) { - log.fine("already open"); + if (log.isLoggable(Level.FINE)) + log.fine("already open"); dataRefreshAll(); return true; } @@ -656,6 +659,9 @@ public class GridTable extends AbstractTableModel return true; } // open + /** + * Verify whether use of virtual buffer is supported + */ private void verifyVirtual() { if (m_indexKeyColumn == -1) @@ -675,8 +681,7 @@ public class GridTable extends AbstractTableModel } /** - * Wait until async loader of Table and Lookup Fields is complete - * Used for performance tests + * Wait until asynchronous loading of Table and Lookup Fields is complete. */ public void loadComplete() { @@ -742,7 +747,7 @@ public class GridTable extends AbstractTableModel /** * Close Resultset - * @param finalCall final call + * @param finalCall true for final call and perform clean up */ public void close (boolean finalCall) { @@ -767,7 +772,8 @@ public class GridTable extends AbstractTableModel // Stop loader while (m_loaderFuture != null && !m_loaderFuture.isDone()) { - log.fine("Interrupting Loader ..."); + if (log.isLoggable(Level.FINE)) + log.fine("Interrupting Loader ..."); m_loaderFuture.cancel(true); try { @@ -802,13 +808,14 @@ public class GridTable extends AbstractTableModel } // Fields are disposed from MTab - log.fine(""); + if (log.isLoggable(Level.FINE)) + log.fine(""); m_open = false; } // close /** - * Dispose MTable. - * Called by close-final + * Clean up. + * Called by close-final. */ private void dispose() { @@ -835,7 +842,7 @@ public class GridTable extends AbstractTableModel } // dispose /** - * Get total database column count (displayed and not displayed) + * Get column count * @return column count */ public int getColumnCount() @@ -844,7 +851,7 @@ public class GridTable extends AbstractTableModel } // getColumnCount /** - * Get (displayed) field count + * Get field count * @return field count */ public int getFieldCount() @@ -896,9 +903,10 @@ public class GridTable extends AbstractTableModel /** - * Sort Entries by Column. - * actually the rows are not sorted, just the access pointer ArrayList - * with the same size as m_buffer with MSort entities + * Sort records by Column. + *

    + * Actually the rows are not sorted, just the access pointer ArrayList + * with the same size as m_buffer ({@link #m_sort}). * @param col col * @param ascending ascending */ @@ -1020,7 +1028,7 @@ public class GridTable extends AbstractTableModel /** * Get Key ID or -1 of none - * @param row row + * @param row row index * @return ID or -1 */ public int getKeyID (int row) @@ -1044,8 +1052,8 @@ public class GridTable extends AbstractTableModel /** * Get Key UUID or null of none - * @param row row - * @return ID or null + * @param row row index + * @return UUID or null */ public String getKeyUUID (int row) { @@ -1068,7 +1076,7 @@ public class GridTable extends AbstractTableModel /** * Get UUID or null of none - * @param row row + * @param row row index * @return UUID or null */ public UUID getUUID (int row) @@ -1090,12 +1098,11 @@ public class GridTable extends AbstractTableModel return ""; } // getKeyColumnName - - /************************************************************************** + /** * Get Value at row and column * @param row row * @param col col - * @return Object of that row/column + * @return Value at row/column */ public Object getValueAt (int row, int col) { @@ -1156,11 +1163,20 @@ public class GridTable extends AbstractTableModel } } + /** + * @param row row index + * @return data at row index + */ private Object[] getDataAtRow(int row) { return getDataAtRow(row, true); } + /** + * @param row row index + * @param fetchIfNotFound + * @return data at row index + */ private Object[] getDataAtRow(int row, boolean fetchIfNotFound) { waitLoadingForRow(row); @@ -1181,6 +1197,10 @@ public class GridTable extends AbstractTableModel return rowData; } + /** + * @param row row index + * @param rowData + */ private void setDataAtRow(int row, Object[] rowData) { MSort sort = m_sort.get(row); if (m_virtual) @@ -1198,6 +1218,11 @@ public class GridTable extends AbstractTableModel } + /** + * Fill virtual buffer ({@link #m_virtualBuffer}. + * @param start + * @param fetchSize + */ private void fillBuffer(int start, int fetchSize) { //adjust start if needed @@ -1297,8 +1322,7 @@ public class GridTable extends AbstractTableModel } // setChanged /** - * Set Value in data and update GridField. - * (called directly or from JTable.editingStopped()) + * Set value at row and column * * @param value value to assign to cell * @param row row index of cell @@ -1311,7 +1335,6 @@ public class GridTable extends AbstractTableModel /** * call {@link #setValueAt(Object, int, int, boolean, boolean)} with isInitEdit = false - * (called directly or from JTable.editingStopped()) * * @param value value to assign to cell * @param row row index of cell @@ -1324,8 +1347,7 @@ public class GridTable extends AbstractTableModel } // setValueAt /** - * Set Value in data and update GridField. - * (called directly or from JTable.editingStopped()) + * Set value in row data and update GridField. * * @param value value to assign to cell * @param row row index of cell @@ -1409,10 +1431,10 @@ public class GridTable extends AbstractTableModel } // getOldValue /** - * Check if the current row needs to be saved. + * Check if {@link #m_rowChanged} needs to be saved. * @param onlyRealChange if true the value of a field was actually changed * (e.g. for new records, which have not been changed) - default false - * @return true it needs to be saved + * @return true if needs to be saved */ public boolean needSave(boolean onlyRealChange) { @@ -1420,9 +1442,8 @@ public class GridTable extends AbstractTableModel } // needSave /** - * Check if the row needs to be saved. - * - only if nothing was changed - * @return true it needs to be saved + * Check if {@link #m_rowChanged} needs to be saved. + * @return true if needs to be saved */ public boolean needSave() { @@ -1430,11 +1451,9 @@ public class GridTable extends AbstractTableModel } // needSave /** - * Check if the row needs to be saved. - * - only when row changed - * - only if nothing was changed + * Check if newRow needs to be saved. * @param newRow to check - * @return true it needs to be saved + * @return true if needs to be saved */ public boolean needSave(int newRow) { @@ -1446,8 +1465,8 @@ public class GridTable extends AbstractTableModel * - only when row changed * - only if nothing was changed * @param newRow to check - * @param onlyRealChange if true the value of a field was actually changed - * (e.g. for new records, which have not been changed) - default false + * @param onlyRealChange if true, only if the value of a field was actually changed + * (e.g. for new record with default value, which have not been changed) - default false * @return true it needs to be saved */ public boolean needSave(int newRow, boolean onlyRealChange) @@ -1483,8 +1502,8 @@ public class GridTable extends AbstractTableModel /** * Check if it needs to be saved and save it. - * @param newRow row - * @param manualCmd manual command to save + * @param newRow row index + * @param manualCmd true if initiated from user action * @return true if not needed to be saved or successful saved */ public boolean dataSave (int newRow, boolean manualCmd) @@ -1502,8 +1521,8 @@ public class GridTable extends AbstractTableModel } // dataSave /** - * Save unconditional. - * @param manualCmd if true, no vetoable PropertyChange will be fired for save confirmation + * Save changes. + * @param manualCmd if true (i.e initiated from user action), no vetoable PropertyChange will be fired for save confirmation * @return OK Or Error condition * Error info (Access*, FillMandatory, SaveErrorNotUnique, * SaveErrorRowNotFound, SaveErrorDataChanged) is saved in the log @@ -1520,7 +1539,6 @@ public class GridTable extends AbstractTableModel if (m_rowChanged == -1) { if (log.isLoggable(Level.CONFIG)) log.config("NoNeed - Changed=" + m_changed + ", Row=" + m_rowChanged); - // return SAVE_ERROR; if (!manualCmd) return SAVE_OK; } @@ -1529,14 +1547,16 @@ public class GridTable extends AbstractTableModel { //reset out of sync variable m_rowChanged = -1; - log.fine("No Changes"); + if (log.isLoggable(Level.FINE)) + log.fine("No Changes"); return SAVE_ERROR; } if (m_readOnly) // If Processed - not editable (Find always editable) -> ok for changing payment terms, etc. { - log.warning("IsReadOnly - ignored"); + if (log.isLoggable(Level.WARNING)) + log.warning("IsReadOnly - ignored"); dataIgnore(); return SAVE_ACCESS; } @@ -1585,7 +1605,6 @@ public class GridTable extends AbstractTableModel String missingColumns = getMandatory(rowData); if (missingColumns.length() != 0) { - // Trace.printStack(false, false); fireDataStatusEEvent("FillMandatory", missingColumns + "\n", true); return SAVE_MANDATORY; } @@ -1833,7 +1852,7 @@ public class GridTable extends AbstractTableModel } // dataSavePO /** - * Get Record Where Clause from data (single key or multi-parent) + * Get Record Where Clause from data (single key or multi-key) * @param rowData data * @return where clause or null */ @@ -1925,7 +1944,7 @@ public class GridTable extends AbstractTableModel /** * Get Mandatory empty columns * @param rowData row data - * @return String with missing column headers/labels + * @return Mandatory columns that's empty (separated by comma) */ private String getMandatory(Object[] rowData) { @@ -1958,7 +1977,6 @@ public class GridTable extends AbstractTableModel } // getMandatory /** - * * @return true if need save and all mandatory field has value */ public boolean isNeedSaveAndMandatoryFill() { @@ -2012,10 +2030,10 @@ public class GridTable extends AbstractTableModel private int m_currentRow = -1; - /************************************************************************** - * New Record after current Row + /** + * Append new row after current row * @param currentRow row - * @param copyCurrent copy + * @param copyCurrent true to copy value from current row * @return true if success - * Error info (Access*, AccessCannotInsert) is saved in the log */ @@ -2032,7 +2050,6 @@ public class GridTable extends AbstractTableModel // see if we need to save dataSave(-2, false); - m_inserting = true; // Setup the buffer first so that event will be handle properly @@ -2124,10 +2141,9 @@ public class GridTable extends AbstractTableModel return true; } // dataNew - - /************************************************************************** - * Delete Data - * @param row row + /** + * Delete data at row index + * @param row row index * @return true if success - * Error info (Access*, AccessNotDeleteable, DeleteErrorDependent, * DeleteError) is saved in the log @@ -2269,9 +2285,8 @@ public class GridTable extends AbstractTableModel if (log.isLoggable(Level.FINE)) log.fine("Row=" + row + " complete"); return true; } // dataDelete - - /************************************************************************** + /** * Ignore/Undo changes */ public void dataIgnore() @@ -2328,7 +2343,6 @@ public class GridTable extends AbstractTableModel fireDataStatusIEvent(DATA_IGNORED_MESSAGE, ""); } // dataIgnore - /** * Refresh Row - ignore changes * @param row row @@ -2438,10 +2452,10 @@ public class GridTable extends AbstractTableModel /** * Refresh all Rows - ignore changes * @param fireStatusEvent + * @param rowToRetained */ public void dataRefreshAll(boolean fireStatusEvent, int rowToRetained) { - log.info(""); m_inserting = false; // should not happen dataIgnore(); String retainedWhere = null; @@ -2481,7 +2495,7 @@ public class GridTable extends AbstractTableModel /** - * Requery with new whereClause + * Re-query with new whereClause * @param whereClause sql where clause * @param onlyCurrentRows only current rows * @param onlyCurrentDays how many days back @@ -2513,7 +2527,7 @@ public class GridTable extends AbstractTableModel } // dataRequery /** - * + * Delegate to {@link #dataRequery(String, boolean, int, boolean)} with fireEvents=true * @param whereClause * @param onlyCurrentRows * @param onlyCurrentDays @@ -2524,11 +2538,10 @@ public class GridTable extends AbstractTableModel return dataRequery (whereClause, onlyCurrentRows, onlyCurrentDays, true); } // dataRequery - /************************************************************************** + /** * Is Cell Editable. - * Is queried from JTable before checking VCellEditor.isCellEditable - * @param row the row index being queried - * @param col the column index being queried + * @param row row index + * @param col column index * @return true, if editable */ public boolean isCellEditable (int row, int col) @@ -2555,10 +2568,9 @@ public class GridTable extends AbstractTableModel return ((GridField)m_fields.get(col)).isEditable(false); } // IsCellEditable - /** - * Is Current Row Editable - * @param row row + * Is row editable + * @param row row index * @return true if editable */ public boolean isRowEditable (int row) @@ -2601,7 +2613,7 @@ public class GridTable extends AbstractTableModel /** * Get Client Org for row - * @param row row + * @param row row index * @return array [0] = Client [1] = Org - a value of -1 is not defined/found */ private int[] getClientOrg (int row) @@ -2656,7 +2668,9 @@ public class GridTable extends AbstractTableModel * If Set to false, save overwrites the record, regardless of DB changes. * (When a payment is changed in Sales Order, the payment reversal clears the payment id) * @param compareDB compare DB - false forces overwrite + * @deprecated */ + @Deprecated public void setCompareDB (boolean compareDB) { m_compareDB = compareDB; @@ -2666,13 +2680,14 @@ public class GridTable extends AbstractTableModel * Get Compare DB. * @return false if save overwrites the record, regardless of DB changes * (false forces overwrite). + * @deprecated */ + @Deprecated public boolean getCompareDB () { return m_compareDB; } // getCompareDB - /** * Can Table rows be deleted * @param value new deleteable value @@ -2682,10 +2697,9 @@ public class GridTable extends AbstractTableModel if (log.isLoggable(Level.FINE)) log.fine("Deleteable=" + value); m_deleteable = value; } // setDeleteable - - /************************************************************************** - * Read Data from Recordset + /** + * Read data from result set * @param rs result set * @return Data Array */ @@ -2771,6 +2785,7 @@ public class GridTable extends AbstractTableModel /** * Decrypt * @param yy encrypted data + * @param AD_Client_ID * @return clear data */ private Object decrypt (Object yy, int AD_Client_ID) @@ -2780,6 +2795,10 @@ public class GridTable extends AbstractTableModel return SecureEngine.decrypt(yy, AD_Client_ID); } // decrypt + /** + * @param rs + * @return AD_Client_ID or -1 + */ private int getAD_Client_ID(ResultSet rs) { int AD_Client_ID = -1; try { @@ -2794,6 +2813,9 @@ public class GridTable extends AbstractTableModel return AD_Client_ID; } + /** + * @return AD_Client_ID + */ private int getAD_Client_ID() { int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); @@ -2804,7 +2826,7 @@ public class GridTable extends AbstractTableModel return AD_Client_ID; } - /************************************************************************** + /** * Remove Data Status Listener * @param l listener */ @@ -2823,7 +2845,7 @@ public class GridTable extends AbstractTableModel } // addDataStatusListener /** - * Inform Listeners + * Fire data status changed event * @param e event */ private void fireDataStatusChanged (DataStatusEvent e) @@ -2834,8 +2856,8 @@ public class GridTable extends AbstractTableModel } // fireDataStatusChanged /** - * Create Data Status Event - * @return data status event + * Create new Data Status Event instance + * @return new data status event instance */ private DataStatusEvent createDSE() { @@ -2861,7 +2883,7 @@ public class GridTable extends AbstractTableModel if (SORTED_DSE_EVENT.equals(AD_Message) && m_currentRow >= 0) e.setCurrentRow(m_currentRow); fireDataStatusChanged (e); - } // fireDataStatusEvent + } // fireDataStatusIEvent /** * Create and fire Data Status Error Event @@ -2890,20 +2912,19 @@ public class GridTable extends AbstractTableModel if (isError) log.saveWarning(AD_Message, info); fireDataStatusChanged (e); - } // fireDataStatusEvent + } // fireDataStatusEEvent /** - * Create and fire Data Status Event (from Error Log) + * Create and fire Data Status Error Event (from Error Log) * @param errorLog error log info */ protected void fireDataStatusEEvent (ValueNamePair errorLog) { if (errorLog != null) fireDataStatusEEvent (errorLog.getValue(), errorLog.getName(), true); - } // fireDataStatusEvent - + } // fireDataStatusEEvent - /************************************************************************** + /** * Remove Vetoable change listener for row changes * @param l listener */ @@ -2951,13 +2972,13 @@ public class GridTable extends AbstractTableModel return m_newRow; } - /************************************************************************** - * ASync Loader + /** + * Asynchronous Loader */ - class Loader implements Serializable, Runnable + protected class Loader implements Serializable, Runnable { /** - * + * generated serial id */ private static final long serialVersionUID = -6866671239509705988L; @@ -3093,6 +3114,9 @@ public class GridTable extends AbstractTableModel } } // run + /** + * Fill buffer from result set + */ private void doRun() { try { @@ -3220,8 +3244,8 @@ public class GridTable extends AbstractTableModel /** * Feature Request [1707462] * Enable runtime change of VFormat - * @param identifier field ident - * @param strNewFormat new mask + * @param identifier column name + * @param strNewFormat new input mask * author fer_luck */ protected void setFieldVFormat (String identifier, String strNewFormat) @@ -3239,9 +3263,9 @@ public class GridTable extends AbstractTableModel } // setFieldVFormat /** - * verify if the record at row has changed - * @param row - * @return true if has changes + * Verify if the record at row has been changed at DB (by other user or process) + * @param row row index + * @return true if record at row has been changed at DB */ public boolean hasChanged(int row) { // not so aggressive (it can has still concurrency problems) @@ -3264,8 +3288,7 @@ public class GridTable extends AbstractTableModel // no columns updated or processed to compare return false; } - - + // todo: temporary fix for carlos assumption that all windows have _id column if ( findColumn(m_tableName + "_ID") == -1) return false; @@ -3332,7 +3355,11 @@ public class GridTable extends AbstractTableModel return false; } - // verify if the current record has changed + /** + * Verify if po has been changed at DB (by other user or process) + * @param po + * @return true if po has been changed at DB + */ private boolean hasChanged(PO po) { if (m_rowChanged < 0) return false; @@ -3381,7 +3408,7 @@ public class GridTable extends AbstractTableModel /** * get Parent Tab No - * @return Tab No + * @return Parent Tab No */ private int getParentTabNo() { @@ -3409,6 +3436,10 @@ public class GridTable extends AbstractTableModel return m_TabNo; } + /** + * @param value + * @return true if value is not null and is empty string + */ private boolean isNotNullAndIsEmpty (Object value) { if (value != null && (value instanceof String) @@ -3422,6 +3453,11 @@ public class GridTable extends AbstractTableModel } + /** + * @param oldValue + * @param value + * @return true if oldValue and value is different + */ @SuppressWarnings("unchecked") private boolean isValueChanged(Object oldValue, Object value) { @@ -3459,7 +3495,7 @@ public class GridTable extends AbstractTableModel /** * Load PO for row - * @param row + * @param row row index * @return PO */ public PO getPO(int row) { @@ -3481,7 +3517,6 @@ public class GridTable extends AbstractTableModel } /** - * * @param importing import mode * @param trxName optional trx name */ @@ -3491,7 +3526,6 @@ public class GridTable extends AbstractTableModel } /** - * * @return true if it is in import mode */ public boolean isImporting() { @@ -3499,7 +3533,6 @@ public class GridTable extends AbstractTableModel } /** - * * @return trx name */ public String get_TrxName() { @@ -3515,7 +3548,6 @@ public class GridTable extends AbstractTableModel } /** - * * @return index of primary key column */ public int getKeyColumnIndex() { @@ -3523,7 +3555,7 @@ public class GridTable extends AbstractTableModel } /** - * Index of updated row's + * Index of change row */ public int getRowChanged() { diff --git a/org.adempiere.base/src/org/compiere/model/GridWindow.java b/org.adempiere.base/src/org/compiere/model/GridWindow.java index 32689ff4d1..d5d746ab4c 100644 --- a/org.adempiere.base/src/org/compiere/model/GridWindow.java +++ b/org.adempiere.base/src/org/compiere/model/GridWindow.java @@ -56,7 +56,7 @@ import org.compiere.util.WebDoc; public class GridWindow implements Serializable { /** - * + * generated serial id */ private static final long serialVersionUID = 3342733142743698614L; @@ -89,7 +89,7 @@ public class GridWindow implements Serializable return new GridWindow(mWindowVO, virtual); } // get - /************************************************************************** + /** * Constructor * @param vo value object */ @@ -98,10 +98,10 @@ public class GridWindow implements Serializable this(vo, false); } - /************************************************************************** + /** * Constructor * @param vo value object - * @param virtual + * @param virtual true to use virtual buffer */ public GridWindow (GridWindowVO vo, boolean virtual) { @@ -125,7 +125,7 @@ public class GridWindow implements Serializable /** Logger */ private static CLogger log = CLogger.getCLogger(GridWindow.class); - /************************************************************************** + /** * Dispose */ public void dispose() @@ -138,9 +138,7 @@ public class GridWindow implements Serializable } // dispose /** - * Load is complete. - * Return when async load is complete - * Used for performance tests (Base.test()) + * Wait until asynchronous loading of all tab is complete. */ public void loadCompete () { @@ -150,13 +148,11 @@ public class GridWindow implements Serializable } // loadComplete /** - * Get Tab data and create MTab(s) + * Get Tab data and create GridTab(s) * @return true if tab loaded */ private boolean loadTabData() { - log.config(""); - if (m_vo.Tabs == null) return false; @@ -175,8 +171,8 @@ public class GridWindow implements Serializable /** * Is tab initialize - * @param index - * @return boolean + * @param index tab index + * @return true if tab at index have been initialized */ public boolean isTabInitialized(int index) { @@ -185,8 +181,8 @@ public class GridWindow implements Serializable } /** - * Initialise tab - * @param index + * Initialize tab + * @param index tab index */ public void initTab(int index) { @@ -298,21 +294,20 @@ public class GridWindow implements Serializable } // getColor /** - * SO Trx Window - * @return true if SO Trx + * @return true if window is for SO Trx */ public boolean isSOTrx() { return m_vo.IsSOTrx; } // isSOTrx - - + /** - * Open and query first Tab (events should be enabled) and get first row. + * Open and query first Tab (events should be enabled) and navigate to first row. */ public void query() { - log.info(""); + if (log.isLoggable(Level.INFO)) + log.info(""); GridTab tab = getTab(0); tab.query(false, 0, 0); if (tab.getRowCount() > 0) @@ -320,7 +315,7 @@ public class GridWindow implements Serializable } // open /** - * Enable Events - enable data events of tabs (add listeners) + * Enable events for all tabs (listen for GridTable events) */ private void enableEvents() { @@ -338,9 +333,8 @@ public class GridWindow implements Serializable } // getTabCount /** - * Get i-th MTab - null if not valid - * @param i index - * @return MTab + * @param i tab index + * @return GridTab at tab index or null if tab index is invalid */ public GridTab getTab (int i) { @@ -349,6 +343,10 @@ public class GridWindow implements Serializable return (GridTab)m_tabs.get(i); } // getTab + /** + * @param tab + * @return tab index + */ public int getTabIndex(GridTab tab) { return m_tabs.indexOf(tab); @@ -410,7 +408,7 @@ public class GridWindow implements Serializable /** * Is Transaction Window - * @return true if transaction + * @return true if this is transaction window */ public boolean isTransaction() { @@ -440,8 +438,8 @@ public class GridWindow implements Serializable /** * Get Help HTML Document - * @param javaClient true if java client false for browser - * @return help + * @param javaClient true if java client, false for browser + * @return help document */ public WebDoc getHelpDoc (boolean javaClient) { @@ -562,8 +560,8 @@ public class GridWindow implements Serializable /** * Get Model last Updated - * @param recalc recalculate again - * @return date + * @param recalc true to always re-query from DB + * @return last updated timestamp */ public Timestamp getModelUpdated (boolean recalc) { @@ -613,6 +611,9 @@ public class GridWindow implements Serializable return m_modelUpdated; } // getModelUpdated + /** + * @return AD_Window_UU + */ public String getAD_Window_UU() { return m_vo.AD_Window_UU; } diff --git a/org.adempiere.base/src/org/compiere/model/GridWindowVO.java b/org.adempiere.base/src/org/compiere/model/GridWindowVO.java index b0a53bf035..3127f363ef 100644 --- a/org.adempiere.base/src/org/compiere/model/GridWindowVO.java +++ b/org.adempiere.base/src/org/compiere/model/GridWindowVO.java @@ -30,7 +30,7 @@ import org.compiere.util.DB; import org.compiere.util.Env; /** - * Model Window Value Object + * Window Model Value Object * * @author Jorg Janke * @version $Id: GridWindowVO.java,v 1.4 2006/07/30 00:58:04 jjanke Exp $ @@ -38,7 +38,7 @@ import org.compiere.util.Env; public class GridWindowVO implements Serializable { /** - * + * generated serial id */ private static final long serialVersionUID = 6884332743173214735L; @@ -49,7 +49,6 @@ public class GridWindowVO implements Serializable = new CCache(I_AD_Window.Table_Name, I_AD_Window.Table_Name+"|GridWindowVO", 10); /** - * * @param AD_Window_ID * @param windowNo * @return {@link GridWindowVO} @@ -60,7 +59,6 @@ public class GridWindowVO implements Serializable } /** - * * @param AD_Window_ID * @param windowNo * @param AD_Menu_ID @@ -90,7 +88,7 @@ public class GridWindowVO implements Serializable * Create Window Value Object * @param WindowNo window no for ctx * @param AD_Window_ID window id - * @return MWindowVO + * @return GridWindowVO */ public static GridWindowVO create (int WindowNo, int AD_Window_ID) { @@ -102,7 +100,7 @@ public class GridWindowVO implements Serializable * @param ctx context * @param WindowNo window no for ctx * @param AD_Window_ID window id - * @return MWindowVO + * @return GridWindowVO */ public static GridWindowVO create (Properties ctx, int WindowNo, int AD_Window_ID) { @@ -116,12 +114,13 @@ public class GridWindowVO implements Serializable * @param WindowNo window no for ctx * @param AD_Window_ID window id * @param AD_Menu_ID menu id - * @return MWindowVO + * @return GridWindowVO */ public static GridWindowVO create (Properties ctx, int WindowNo, int AD_Window_ID, int AD_Menu_ID) { - CLogger.get().config("#" + WindowNo - + " - AD_Window_ID=" + AD_Window_ID + "; AD_Menu_ID=" + AD_Menu_ID); + if (CLogger.get().isLoggable(Level.CONFIG)) + CLogger.get().config("#" + WindowNo + + " - AD_Window_ID=" + AD_Window_ID + "; AD_Menu_ID=" + AD_Menu_ID); GridWindowVO vo = new GridWindowVO (ctx, WindowNo); vo.AD_Window_ID = AD_Window_ID; @@ -160,7 +159,8 @@ public class GridWindowVO implements Serializable DB.close(rs, pstmt); rs = null; pstmt = null; } - CLogger.get().config("AD_Window_ID=" + vo.AD_Window_ID); + if (CLogger.get().isLoggable(Level.CONFIG)) + CLogger.get().config("AD_Window_ID=" + vo.AD_Window_ID); } // -- Get Window @@ -299,9 +299,8 @@ public class GridWindowVO implements Serializable Env.setContext(mWindowVO.ctx, mWindowVO.WindowNo, "BaseTable_ID", mWindowVO.AD_Table_ID); return true; } // createTabs - - /************************************************************************** + /** * Private Constructor * @param Ctx context * @param windowNo window no @@ -355,7 +354,7 @@ public class GridWindowVO implements Serializable public static final String WINDOWTYPE_MMAINTAIN = "M"; /** - * Set Context including contained elements + * Set window context including context of GridTabVO * @param newCtx context */ public void setCtx (Properties newCtx) @@ -371,7 +370,7 @@ public class GridWindowVO implements Serializable /** * Clone * @param windowNo no - * @return WindowVO + * @return GridWindowVO */ public GridWindowVO clone (int windowNo) { @@ -412,5 +411,5 @@ public class GridWindowVO implements Serializable return clone; } // clone -} // MWindowVO +} // GridWindowVO diff --git a/org.adempiere.base/src/org/compiere/model/IArchiveStore.java b/org.adempiere.base/src/org/compiere/model/IArchiveStore.java index f766168694..181b297806 100644 --- a/org.adempiere.base/src/org/compiere/model/IArchiveStore.java +++ b/org.adempiere.base/src/org/compiere/model/IArchiveStore.java @@ -13,15 +13,44 @@ *****************************************************************************/ package org.compiere.model; +/** + * Store provider interface for storage of archive content + */ public interface IArchiveStore { + /** + * Load binary content of archive + * @param archive + * @param prov + * @return byte[] content + */ public byte[] loadLOBData(MArchive archive,MStorageProvider prov); + /** + * Save content of archive + * @param archive + * @param prov + * @param inflatedData byte[] content of archive + */ public void save(MArchive archive, MStorageProvider prov,byte[] inflatedData); + /** + * Delete stored archive content + * @param archive + * @param prov + * @return true if successfully deleted + */ public boolean deleteArchive(MArchive archive, MStorageProvider prov); + /** + * @return true if archive content is being buffered and pending flush to destination storage + */ public boolean isPendingFlush(); + /** + * Flush buffer archive content to destination storage + * @param archive + * @param prov + */ public void flush(MArchive archive,MStorageProvider prov); } diff --git a/org.adempiere.base/src/org/compiere/model/IAttachmentLazyDataSource.java b/org.adempiere.base/src/org/compiere/model/IAttachmentLazyDataSource.java index e926000343..48504f9d0c 100644 --- a/org.adempiere.base/src/org/compiere/model/IAttachmentLazyDataSource.java +++ b/org.adempiere.base/src/org/compiere/model/IAttachmentLazyDataSource.java @@ -28,7 +28,7 @@ package org.compiere.model; /** - * IDEMPIERE-4889 + * IDEMPIERE-4889 interface for lazy loading of attachment content * @author Carlos Ruiz - globalqss */ public interface IAttachmentLazyDataSource { @@ -36,7 +36,7 @@ public interface IAttachmentLazyDataSource { /** * Return a byte array containing the data from the Attachment Entry * Usually the implementing class must have a constructor with the variable(s) required for loading later the data - * @return + * @return byte[] attachment content */ public byte[] getData(); diff --git a/org.adempiere.base/src/org/compiere/model/IAttachmentStore.java b/org.adempiere.base/src/org/compiere/model/IAttachmentStore.java index 2d53832bce..a45e61166a 100644 --- a/org.adempiere.base/src/org/compiere/model/IAttachmentStore.java +++ b/org.adempiere.base/src/org/compiere/model/IAttachmentStore.java @@ -17,16 +17,42 @@ package org.compiere.model; - - +/** + * Store provider interface for storage of attachment content + */ public interface IAttachmentStore { + /** + * Load binary attachment content + * @param attach + * @param prov + * @return true if successfully loaded + */ public boolean loadLOBData(MAttachment attach,MStorageProvider prov); + /** + * Save attachment content + * @param attach + * @param prov + * @return true if successfully save + */ boolean save(MAttachment attach, MStorageProvider prov); + /** + * Delete stored attachment content + * @param attach + * @param prov + * @return true if successfully deleted + */ public boolean delete(MAttachment attach, MStorageProvider prov); + /** + * Delete attachment content by index + * @param mAttachment + * @param provider + * @param index index of content to delete (for e.g zip entry #2 of a zip file) + * @return true if successfully deleted + */ public boolean deleteEntry(MAttachment mAttachment, MStorageProvider provider, int index); } diff --git a/org.adempiere.base/src/org/compiere/model/IImageStore.java b/org.adempiere.base/src/org/compiere/model/IImageStore.java index bed0e409af..18e1cb0fe9 100644 --- a/org.adempiere.base/src/org/compiere/model/IImageStore.java +++ b/org.adempiere.base/src/org/compiere/model/IImageStore.java @@ -13,15 +13,44 @@ *****************************************************************************/ package org.compiere.model; +/** + * Store provider interface for storage of image content + */ public interface IImageStore { + /** + * Load image content + * @param image + * @param prov + * @return byte[] image content + */ public byte[] load(MImage image, MStorageProvider prov); + /** + * Save image content + * @param image + * @param prov + * @param inflatedData image content + */ public void save(MImage image, MStorageProvider prov, byte[] inflatedData); + /** + * Delete stored image content + * @param image + * @param prov + * @return true if deleted successfully + */ public boolean delete(MImage image, MStorageProvider prov); + /** + * @return true if image content is being buffered and pending flush to destination storage + */ public boolean isPendingFlush(); + /** + * Flush buffer image content to destination storage + * @param image + * @param prov + */ public void flush(MImage image,MStorageProvider prov); } diff --git a/org.adempiere.base/src/org/compiere/model/IMFAMechanism.java b/org.adempiere.base/src/org/compiere/model/IMFAMechanism.java index 0e00b490b5..7ce7d9c131 100644 --- a/org.adempiere.base/src/org/compiere/model/IMFAMechanism.java +++ b/org.adempiere.base/src/org/compiere/model/IMFAMechanism.java @@ -27,26 +27,29 @@ package org.compiere.model; import java.util.Properties; +/** + * Interface for multi-factor authentication + */ public interface IMFAMechanism { /** - * Registration mechanism for the method + * Registration mechanism for the method. * Here the registration method executes the actions expected for this method, like sending an email, or an SMS, or nothing - * and creates the registration record + * and creates the registration record. * @param ctx * @param method * @param prm optional, for example the email * @param trxName - * @return Object[] - first object is the String with the instructions to follow - * second object is the registration generated + * @return Object[] - first object is the String with the instructions to follow.
    + * second object is the registration generated.
    * third and posterior objects are optional additional information for the method - * like QRCode image for example, or html img object, or URL, or File + * like QRCode image for example, or html img object, or URL, or File. */ Object[] register(Properties ctx, MMFAMethod method, String prm, String trxName); /** - * Complete/Validate a previous registration - * Here it must check for validity of the mechanism, mark the record as valid or throw exception when not + * Complete/Validate a previous registration. + * Here it must check for validity of the mechanism, mark the record as valid or throw exception when not valid. * @param ctx * @param reg The registration object * @param code The code to be validated @@ -60,7 +63,7 @@ public interface IMFAMechanism { /** * Generate a validation code (when needed depending on the method) * @param reg - * @return + * @return validation code */ String generateValidationCode(MMFARegistration reg); diff --git a/org.adempiere.base/src/org/compiere/model/ImageDBStorageImpl.java b/org.adempiere.base/src/org/compiere/model/ImageDBStorageImpl.java index 0834eb0ff9..bce1cfe7b5 100644 --- a/org.adempiere.base/src/org/compiere/model/ImageDBStorageImpl.java +++ b/org.adempiere.base/src/org/compiere/model/ImageDBStorageImpl.java @@ -24,12 +24,11 @@ import java.util.zip.ZipOutputStream; import org.compiere.util.CLogger; /** + * DB backed implementation of {@link IImageStore} * @author hengsin - * */ public class ImageDBStorageImpl implements IImageStore { - private final CLogger log = CLogger.getCLogger(getClass()); @Override diff --git a/org.adempiere.base/src/org/compiere/model/ImageFileStorageImpl.java b/org.adempiere.base/src/org/compiere/model/ImageFileStorageImpl.java index 3d3178f615..df863b8cec 100644 --- a/org.adempiere.base/src/org/compiere/model/ImageFileStorageImpl.java +++ b/org.adempiere.base/src/org/compiere/model/ImageFileStorageImpl.java @@ -44,8 +44,8 @@ import org.xml.sax.SAXException; import org.w3c.dom.Element; /** + * File system backed implementation of {@link IImageStore} * @author hengsin - * */ public class ImageFileStorageImpl implements IImageStore { @@ -158,6 +158,12 @@ public class ImageFileStorageImpl implements IImageStore { } + /** + * Write image data to file + * @param image + * @param prov + * @param inflatedData + */ private void write(MImage image, MStorageProvider prov, byte[] inflatedData) { BufferedOutputStream out = null; try { @@ -219,6 +225,10 @@ public class ImageFileStorageImpl implements IImageStore { } } + /** + * @param prov + * @return root path + */ private String getImagePathRoot(MStorageProvider prov) { String imagePathRoot = prov.getFolder(); if (imagePathRoot == null) diff --git a/org.adempiere.base/src/org/compiere/model/InfoColumnVO.java b/org.adempiere.base/src/org/compiere/model/InfoColumnVO.java index 46e9066808..0f9281a0e9 100644 --- a/org.adempiere.base/src/org/compiere/model/InfoColumnVO.java +++ b/org.adempiere.base/src/org/compiere/model/InfoColumnVO.java @@ -42,7 +42,7 @@ import org.compiere.util.Evaluator; public class InfoColumnVO implements Serializable, Cloneable { /** - * + * generated serial id */ private static final long serialVersionUID = 7401407425423442841L; /** Properties */ @@ -275,7 +275,7 @@ public class InfoColumnVO implements Serializable, Cloneable { /** * @param ctx * @param windowNo - * @return boolean + * @return true if column should be displayed */ public boolean isDisplayed(final Properties ctx, final int windowNo) { if (!isDisplayed()) @@ -294,142 +294,247 @@ public class InfoColumnVO implements Serializable, Cloneable { return retValue; } + /** + * @return column name + */ public String getColumnName() { return ColumnName; } + /** + * @return true if column is mandatory + */ public boolean isMandatory() { return isMandatory; } + /** + * @return true if this is for user to enter query criteria + */ public boolean isQueryCriteria() { return isQueryCriteria; } + /** + * @return true if info window should auto execute query after user have make changes to this info column + */ public boolean isQueryAfterChange() { return isQueryAfterChange; } + /** + * @return translated name (in login language) + */ public String getNameTrl() { return NameTrl; } + /** + * @return name + */ public String getName() { return Name; } + /** + * @return AD_Reference_ID + */ public int getAD_Reference_ID() { return AD_Reference_ID; } + /** + * @return AD_Reference_Value_ID + */ public int getAD_Reference_Value_ID() { return AD_Reference_Value_ID; } + /** + * @return translated place holder text (in login language) + */ public String getPlaceHolderTrl() { return PlaceHolderTrl; } + /** + * @return place holder text + */ public String getPlaceholder() { return Placeholder; } + /** + * @return place holder text for to editor of range type column + */ public String getPlaceholder2() { return Placeholder2; } + /** + * @return true if column is read only + */ public boolean isReadOnly() { return isReadOnly; } + /** + * @return select clause + */ public String getSelectClause() { return SelectClause; } + /** + * @return display logic + */ public String getDisplayLogic() { return DisplayLogic; } + /** + * @return true if visible + */ public boolean isDisplayed() { return isDisplayed; } + /** + * @return SQL validation for input field + */ public String getInputFieldValidation() { return InputFieldValidation; } + /** + * @return true if column is identifier + */ public boolean isIdentifier() { return isIdentifier; } + /** + * @return query operator (=, <, >, etc) + */ public String getQueryOperator() { return QueryOperator; } + /** + * @return sequence for query criteria + */ public int getSeqNoSelection() { return SeqNoSelection; } + /** + * @return SQL function for query criteria field + */ public String getQueryFunction() { return QueryFunction; } + /** + * @return true if this is a key column + */ public boolean isKey() { return isKey; } + /** + * @return description text + */ public String getDescription() { return Description; } + /** + * @return translated description text + */ public String getDescriptionTrl() { return DescriptionTrl; } + /** + * @return MInfoColumn + */ public MInfoColumn getAD_InfoColumn() { return infoColumn; } + /** + * @return AD_Val_Rule_ID + */ public int getAD_Val_Rule_ID() { return AD_Val_Rule_ID; } + /** + * @return default value + */ public String getDefaultValue() { return DefaultValue; } + /** + * @return default value for to editor of range type column + */ public String getDefaultValue2() { return DefaultValue2; } + /** + * @return translated help text (in login language) + */ public String getHelpTrl() { return HelpTrl; } + /** + * @return help text + */ public String getHelp() { return Help; } + /** + * @return AD_FieldStyle_ID + */ public int getAD_FieldStyle_ID() { return AD_FieldStyle_ID; } + /** + * @return true if auto complete is on for lookup field + */ public boolean isAutocomplete() { return isAutocomplete; } + /** + * @return AD_InfoColumn_ID + */ public int getAD_InfoColumn_ID() { return AD_InfoColumn_ID; } + /** + * @return validation code for lookup + */ public String getValidationCode() { return ValidationCode; } + /** + * @return sequence number + */ public int getSeqNo() { return SeqNo; } + /** + * @return true if this is a range type column + */ public boolean isRange() { return isRange; } diff --git a/org.adempiere.base/src/org/compiere/model/InfoRelatedVO.java b/org.adempiere.base/src/org/compiere/model/InfoRelatedVO.java index 80a02dcc68..43c3914b03 100644 --- a/org.adempiere.base/src/org/compiere/model/InfoRelatedVO.java +++ b/org.adempiere.base/src/org/compiere/model/InfoRelatedVO.java @@ -15,14 +15,14 @@ import org.compiere.util.Evaluator; import org.compiere.util.Util; /** - * Info Related Value Object + * Related Info Value Object * @author Igor Pojzl, Cloudempiere * @version $Id$ */ public class InfoRelatedVO implements Serializable, Cloneable, IInfoColumn { /** - * + * generated serial id */ private static final long serialVersionUID = 3683704870522235708L; @@ -77,6 +77,9 @@ public class InfoRelatedVO implements Serializable, Cloneable, IInfoColumn { this.afterCreate(); } + /** + * Process user define customization + */ public void afterCreate() { InfoRelatedVO vo = this; @@ -125,34 +128,58 @@ public class InfoRelatedVO implements Serializable, Cloneable, IInfoColumn { return infoRelatedVOList.toArray(new InfoRelatedVO[infoRelatedVOList.size()]); } + /** + * @return AD_InfoWindow_ID of related info window + */ public int getRelatedInfo_ID() { return infoRelated.getRelatedInfo_ID(); } + /** + * @return link column name + */ public String getLinkColumnName() { return infoRelated.getLinkColumnName(); } + /** + * @return parent related AD_InfoColumn_ID + */ public int getParentRelatedColumn_ID() { return infoRelated.getParentRelatedColumn_ID(); } + /** + * @return related I_AD_InfoWindow + */ public I_AD_InfoWindow getRelatedInfo() { return infoRelated.getRelatedInfo(); } + /** + * @return Link MInfoColumn + */ public MInfoColumn getLinkInfoColumn() { return infoRelated.getLinkInfoColumn(); } + /** + * @return name + */ public String getName() { return Name; } + /** + * @return parent related I_AD_InfoColumn + */ public I_AD_InfoColumn getParentRelatedColumn() { return infoRelated.getParentRelatedColumn(); } + /** + * @return sequence number + */ public int getSeqNo() { return this.SeqNo; } @@ -173,11 +200,14 @@ public class InfoRelatedVO implements Serializable, Cloneable, IInfoColumn { return (MInfoColumn) getParentRelatedColumn(); } + /** + * @return display logic + */ public String getDisplayLogic() { return DisplayLogic; } - /************************************************************************** + /** * Is the Related Window Visible ? * @return true, if visible */ @@ -201,12 +231,11 @@ public class InfoRelatedVO implements Serializable, Cloneable, IInfoColumn { return retValue; } // isDisplayed - - + /** - * Get Variable Value (Evaluatee) + * Get Variable Value (Evaluatee) as string * @param variableName name - * @return value + * @return value as string */ public String get_ValueAsString (Properties ctx, String variableName) { diff --git a/org.adempiere.base/src/org/compiere/model/Lookup.java b/org.adempiere.base/src/org/compiere/model/Lookup.java index d71d2f9407..ea8cc1a602 100644 --- a/org.adempiere.base/src/org/compiere/model/Lookup.java +++ b/org.adempiere.base/src/org/compiere/model/Lookup.java @@ -30,10 +30,9 @@ import org.compiere.util.NamePair; import org.compiere.util.ValueNamePair; /** - * Base Class for MLookup, MLocator. - * as well as for MLocation, MAccount (only single value) - * Maintains selectable data as NamePairs in ArrayList - * The objects itself may be shared by the lookup implementation (ususally HashMap) + * Base Class for MLookup, MLocator, MLocation and MAccount (only single value).
    + * Maintains selectable data as NamePairs in ArrayList.
    + * The objects itself may be shared by the lookup implementation (usually HashMap). * * @author Jorg Janke * @version $Id: Lookup.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $ @@ -42,7 +41,7 @@ public abstract class Lookup extends AbstractListModel implements MutableComboBoxModel, Serializable { /** - * + * generated serial id */ private static final long serialVersionUID = -2500275921218601088L; @@ -97,13 +96,13 @@ public abstract class Lookup extends AbstractListModel { return m_WindowNo; } // getWindowNo - - /************************************************************************** - * Set the value of the selected item. The selected item may be null. + /** + * Set selected item by value. The selected item may be null. *

    - * @param anObject The combo box value or null for no selection. + * @param anObject Value of selected item or null for no selection. */ + @Override public void setSelectedItem(Object anObject) { if ((m_selectedObject != null && !m_selectedObject.equals( anObject )) @@ -123,8 +122,8 @@ public abstract class Lookup extends AbstractListModel } // setSelectedItem /** - * Return previously selected Item - * @return value + * Return selected Item + * @return value of selected item */ public Object getSelectedItem() { @@ -143,7 +142,7 @@ public abstract class Lookup extends AbstractListModel /** * Get Element at Index * @param index index - * @return value + * @return value at index */ public Object getElementAt (int index) { @@ -154,8 +153,7 @@ public abstract class Lookup extends AbstractListModel * Returns the index-position of the specified object in the list. * * @param anObject object - * @return an int representing the index position, where 0 is - * the first position + * @return index position, where 0 is the first position */ public int getIndexOf (Object anObject) { @@ -229,9 +227,8 @@ public abstract class Lookup extends AbstractListModel m_loaded = false; } // removeAllElements - - /************************************************************************** - * Put Value + /** + * Append {@link ValueNamePair} to list * @param key key * @param value value */ @@ -242,7 +239,7 @@ public abstract class Lookup extends AbstractListModel } // put /** - * Put Value + * Append {@link KeyNamePair} to list * @param key key * @param value value */ @@ -253,12 +250,13 @@ public abstract class Lookup extends AbstractListModel } // put /** - * Fill ComboBox with lookup data (async using Worker). + * Fill ComboBox with lookup data (asynchronous using Worker).
    * - try to maintain selected item * @param mandatory has mandatory data only (i.e. no "null" selection) * @param onlyValidated only validated * @param onlyActive onlt active * @param temporary save current values - restore via fillComboBox (true) + * @param shortList */ public void fillComboBox (boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary, boolean shortList) // IDEMPIERE 90 @@ -274,7 +272,6 @@ public abstract class Lookup extends AbstractListModel p_data.toArray(m_tempData); } - Object obj = m_selectedObject; p_data.clear(); @@ -301,8 +298,8 @@ public abstract class Lookup extends AbstractListModel } // fillComboBox /** - * Fill ComboBox with old saved data (if exists) or all data available - * @param restore if true, use saved data - else fill it with all data + * Fill UI component with temporary buffered data (if exists) or load from DB + * @param restore if true, use temporary buffered data - else load from DB */ public void fillComboBox (boolean restore) { @@ -327,29 +324,28 @@ public abstract class Lookup extends AbstractListModel if (p_data != null) fillComboBox(isMandatory(), true, true, false, false); // IDEMPIERE 90 } // fillComboBox - - /************************************************************************** - * Get Display of Key Value - * @param key key - * @return String + /** + * Get Display Text of Key Value + * @param key key value + * @return Display Text */ public abstract String getDisplay (Object key); /** - * Get Object of Key Value - * @param key key - * @return Object or null + * Get {@link NamePair} of Key Value + * @param key key value + * @return NamePair or null */ public abstract NamePair get (Object key); - /** - * Fill ComboBox with Data (Value/KeyNamePair) + * Load Data (Value/KeyNamePair) from DB. * @param mandatory has mandatory data only (i.e. no "null" selection) * @param onlyValidated only validated * @param onlyActive only active * @param temporary force load for temporary display + * @param shortlist * @return ArrayList */ public abstract ArrayList getData (boolean mandatory, @@ -357,7 +353,6 @@ public abstract class Lookup extends AbstractListModel /** * Get underlying fully qualified Table.Column Name. - * Used for VLookup.actionButton (Zoom) * @return column name */ public abstract String getColumnName(); @@ -370,13 +365,13 @@ public abstract class Lookup extends AbstractListModel public abstract boolean containsKey (Object key); /** - * The Lookup contains the key, do not push direct + * The Lookup contains the key (do not check the direct lookup list) * @param key key * @return true if contains key */ public abstract boolean containsKeyNoDirect (Object key); - /************************************************************************** + /** * Refresh Values - default implementation * @return size */ @@ -396,7 +391,7 @@ public abstract class Lookup extends AbstractListModel /** * Get dynamic Validation SQL (none) - * @return validation + * @return validation SQL */ public String getValidation() { @@ -405,7 +400,7 @@ public abstract class Lookup extends AbstractListModel /** * Has Inactive records - default implementation - * @return true if inactive + * @return true if has inactive records */ public boolean hasInactive() { @@ -433,7 +428,7 @@ public abstract class Lookup extends AbstractListModel /** * Get Zoom - default implementation * @param query query - * @return Zoom Window - here 0 + * @return Zoom AD_Window_ID */ public int getZoom(MQuery query) { @@ -441,7 +436,7 @@ public abstract class Lookup extends AbstractListModel } // getZoom /** - * Get Zoom Query String - default implementation + * Get Zoom Query Object * @return Zoom Query */ public MQuery getZoomQuery() @@ -450,26 +445,32 @@ public abstract class Lookup extends AbstractListModel } // getZoomQuery /** - * Get Data Direct from Table. - * Default implementation - does not requery - * @param key key + * Perform Direct Lookup from Table. + * @param key key value * @param saveInCache save in cache for r/w * @param cacheLocal cache locally for r/o * @param trxName the transaction name - * @return value + * @return NamePair */ public NamePair getDirect (Object key, boolean saveInCache, boolean cacheLocal, String trxName) { return get (key); } // getDirect + /** + * Perform Direct Lookup from Table. + * @param key + * @param saveInCache + * @param cacheLocal + * @return NamePair + */ public NamePair getDirect (Object key, boolean saveInCache, boolean cacheLocal) { return get (key); } // getDirect /** - * + * Perform direct lookup for keys * @param keys * @return name pair arrays */ @@ -497,7 +498,7 @@ public abstract class Lookup extends AbstractListModel } // dispose /** - * Wait until async Load Complete + * Wait until asynchronous loading complete */ public void loadComplete() { @@ -536,6 +537,9 @@ public abstract class Lookup extends AbstractListModel m_shortList = shortlist; } + /** + * @return true if lookup should return a short list + */ public boolean isShortList() { return m_shortList; diff --git a/org.adempiere.base/src/org/compiere/model/LookupDisplayColumn.java b/org.adempiere.base/src/org/compiere/model/LookupDisplayColumn.java index 9036bc546f..06e5f2b946 100644 --- a/org.adempiere.base/src/org/compiere/model/LookupDisplayColumn.java +++ b/org.adempiere.base/src/org/compiere/model/LookupDisplayColumn.java @@ -34,7 +34,7 @@ import org.compiere.util.Util; public class LookupDisplayColumn implements Serializable { /** - * + * generated serial id */ private static final long serialVersionUID = 5876427657897043394L; @@ -53,7 +53,6 @@ public class LookupDisplayColumn implements Serializable } // /** - * Lookup Column Value Object * @param columnName column name * @param columnSQL column SQL (in case is virtual column) * @param isTranslated translated @@ -80,7 +79,7 @@ public class LookupDisplayColumn implements Serializable public boolean IsTranslated; /** Display Type */ public int DisplayType; - /** Value Reference */ + /** table/list reference id (AD_Reference_Value_ID) */ public int AD_Reference_ID; /** Column SQL */ public final String ColumnSQL; diff --git a/org.adempiere.base/src/org/compiere/model/MAccessLog.java b/org.adempiere.base/src/org/compiere/model/MAccessLog.java index 57f7076c6e..1da2d817dd 100644 --- a/org.adempiere.base/src/org/compiere/model/MAccessLog.java +++ b/org.adempiere.base/src/org/compiere/model/MAccessLog.java @@ -30,16 +30,16 @@ public class MAccessLog extends X_AD_AccessLog { /** - * + * generated serial id */ private static final long serialVersionUID = -7169782622717772940L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_AccessLog_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_AccessLog_UU UUID key + * @param trxName Transaction + */ public MAccessLog(Properties ctx, String AD_AccessLog_UU, String trxName) { super(ctx, AD_AccessLog_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MAccount.java b/org.adempiere.base/src/org/compiere/model/MAccount.java index 39210878e8..bd1682e19c 100644 --- a/org.adempiere.base/src/org/compiere/model/MAccount.java +++ b/org.adempiere.base/src/org/compiere/model/MAccount.java @@ -29,8 +29,7 @@ import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; /** - * Account Object Entity to maintain all segment values. - * C_ValidCombination + * Combination of account element and segment values * * @author Jorg Janke * @author victor.perez@e-evolution.com, www.e-evolution.com @@ -40,7 +39,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MAccount extends X_C_ValidCombination implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 1927316490582718406L; @@ -67,7 +66,7 @@ public class MAccount extends X_C_ValidCombination implements ImmutablePOSupport } /** - * Get existing Account or create it + * Get existing account combination or create a new one (if not exists) * @param ctx context * @param AD_Client_ID * @param AD_Org_ID @@ -288,7 +287,7 @@ public class MAccount extends X_C_ValidCombination implements ImmutablePOSupport return acct; } // get - /************************************************************************** + /** * Factory: default combination * @param ctx context * @param C_AcctSchema_ID accounting schema @@ -304,10 +303,10 @@ public class MAccount extends X_C_ValidCombination implements ImmutablePOSupport } // getDefault /** - * Factory: default combination + * Factory: create new account with default combination * @param acctSchema accounting schema * @param optionalNull if true, the optional values are null - * @return Account + * @return new MAccount record */ public static MAccount getDefault (MAcctSchema acctSchema, boolean optionalNull) { @@ -413,21 +412,19 @@ public class MAccount extends X_C_ValidCombination implements ImmutablePOSupport /** Logger */ private static CLogger s_log = CLogger.getCLogger (MAccount.class); - - /** - * UUID based Constructor - * @param ctx Context - * @param C_ValidCombination_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_ValidCombination_UU UUID key + * @param trxName Transaction + */ public MAccount(Properties ctx, String C_ValidCombination_UU, String trxName) { super(ctx, C_ValidCombination_UU, trxName); if (Util.isEmpty(C_ValidCombination_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Default constructor * @param ctx context * @param C_ValidCombination_ID combination @@ -503,9 +500,8 @@ public class MAccount extends X_C_ValidCombination implements ImmutablePOSupport /** Account Segment */ private MElementValue m_accountEV = null; - - /************************************************************************** + /** * Return String representation * @return String */ @@ -556,7 +552,7 @@ public class MAccount extends X_C_ValidCombination implements ImmutablePOSupport } // toString /** - * Set Account_ID + * Set account element id * @param Account_ID id */ public void setAccount_ID (int Account_ID) @@ -566,8 +562,7 @@ public class MAccount extends X_C_ValidCombination implements ImmutablePOSupport } // setAccount /** - * Set Account_ID - * @return element value + * @return account element value */ public MElementValue getAccount () { @@ -583,7 +578,6 @@ public class MAccount extends X_C_ValidCombination implements ImmutablePOSupport return m_accountEV; } // setAccount - /** * Get Account Type * @return Account Type of Account Element @@ -602,7 +596,7 @@ public class MAccount extends X_C_ValidCombination implements ImmutablePOSupport /** * Is this a Balance Sheet Account - * @return boolean + * @return true if this is a balance sheet account */ public boolean isBalanceSheet() { @@ -622,8 +616,8 @@ public class MAccount extends X_C_ValidCombination implements ImmutablePOSupport } // isActive /** - * Is this a Passiva Account - * @return boolean + * Is this a Liability Account + * @return true if this is a liability account */ public boolean isPassiva() { @@ -892,8 +886,7 @@ public class MAccount extends X_C_ValidCombination implements ImmutablePOSupport setValueDescription(); return validate(); } // beforeSave - - + @Override public MAccount markImmutable() { if (is_Immutable()) @@ -904,25 +897,5 @@ public class MAccount extends X_C_ValidCombination implements ImmutablePOSupport m_accountEV.markImmutable(); return this; } - - /** - * Test - * @param args - */ - public static void main (String[] args) - { - org.compiere.Adempiere.startup(true); - MAccount acct = get (Env.getCtx(), 11, 11, 101, 600, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - System.out.println(acct); - System.out.println(acct.get_xmlString(new StringBuffer ("xxxx"))); - - // - MAccount acct2 = get (Env.getCtx(), 11, 12, 101, 600, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - System.out.println(acct2); - - } // main - } // Account diff --git a/org.adempiere.base/src/org/compiere/model/MAccountLookup.java b/org.adempiere.base/src/org/compiere/model/MAccountLookup.java index 328a82864f..1cf61cda7d 100644 --- a/org.adempiere.base/src/org/compiere/model/MAccountLookup.java +++ b/org.adempiere.base/src/org/compiere/model/MAccountLookup.java @@ -37,7 +37,7 @@ import org.compiere.util.NamePair; public final class MAccountLookup extends Lookup implements Serializable { /** - * + * generated serial id */ private static final long serialVersionUID = -6307559127917670193L; @@ -60,10 +60,11 @@ public final class MAccountLookup extends Lookup implements Serializable private String Description; /** - * Get Display for Value + * Get Display Text for Value * @param value value - * @return String + * @return Display text */ + @Override public String getDisplay (Object value) { if (!containsKey (value)){ @@ -74,10 +75,11 @@ public final class MAccountLookup extends Lookup implements Serializable } // getDisplay /** - * Get Object of Key Value - * @param value value - * @return Object or null + * Get KeyNamePair of Key Value + * @param value key value + * @return KeyNamePair or null */ + @Override public NamePair get (Object value) { if (value == null) @@ -92,6 +94,7 @@ public final class MAccountLookup extends Lookup implements Serializable * @param key key * @return true if exists */ + @Override public boolean containsKey (Object key) { int intValue = 0; @@ -103,6 +106,10 @@ public final class MAccountLookup extends Lookup implements Serializable return load (intValue); } // containsKey + /** + * Delegate to {@link #containsKey(Object)} + */ + @Override public boolean containsKeyNoDirect (Object key) { return containsKey(key); @@ -160,6 +167,7 @@ public final class MAccountLookup extends Lookup implements Serializable * Get underlying fully qualified Table.Column Name * @return "" */ + @Override public String getColumnName() { return ""; @@ -167,13 +175,14 @@ public final class MAccountLookup extends Lookup implements Serializable /** * Return data as sorted Array. - * Used in Web Interface * @param mandatory mandatory * @param onlyValidated only valid * @param onlyActive only active * @param temporary force load for temporary display + * @param isshortlist ignore * @return ArrayList with KeyNamePair */ + @Override public ArrayList getData (boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary, boolean isshortlist) // IDEMPIERE 90 { diff --git a/org.adempiere.base/src/org/compiere/model/MAcctProcessor.java b/org.adempiere.base/src/org/compiere/model/MAcctProcessor.java index 7b015986c5..c699147927 100644 --- a/org.adempiere.base/src/org/compiere/model/MAcctProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MAcctProcessor.java @@ -39,7 +39,7 @@ public class MAcctProcessor extends X_C_AcctProcessor implements AdempiereProcessor, AdempiereProcessor2 { /** - * + * generated serial id */ private static final long serialVersionUID = -4760475718973777369L; @@ -57,11 +57,11 @@ public class MAcctProcessor extends X_C_AcctProcessor } // getActive /** - * UUID based Constructor - * @param ctx Context - * @param C_AcctProcessor_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_AcctProcessor_UU UUID key + * @param trxName Transaction + */ public MAcctProcessor(Properties ctx, String C_AcctProcessor_UU, String trxName) { super(ctx, C_AcctProcessor_UU, trxName); if (Util.isEmpty(C_AcctProcessor_UU)) @@ -149,6 +149,7 @@ public class MAcctProcessor extends X_C_AcctProcessor * Get Server ID * @return id */ + @Override public String getServerID () { StringBuilder msgreturn = new StringBuilder("AcctProcessor").append(get_ID()); @@ -160,6 +161,7 @@ public class MAcctProcessor extends X_C_AcctProcessor * @param requery requery * @return date next run */ + @Override public Timestamp getDateNextRun (boolean requery) { if (requery) @@ -171,6 +173,7 @@ public class MAcctProcessor extends X_C_AcctProcessor * Get Logs * @return logs */ + @Override public AdempiereProcessorLog[] getLogs () { String whereClause = "C_AcctProcessor_ID=? "; diff --git a/org.adempiere.base/src/org/compiere/model/MAcctProcessorLog.java b/org.adempiere.base/src/org/compiere/model/MAcctProcessorLog.java index d2f092dab0..266b1f1758 100644 --- a/org.adempiere.base/src/org/compiere/model/MAcctProcessorLog.java +++ b/org.adempiere.base/src/org/compiere/model/MAcctProcessorLog.java @@ -31,16 +31,16 @@ public class MAcctProcessorLog extends X_C_AcctProcessorLog { /** - * + * generated serial id */ private static final long serialVersionUID = 3668544104375224987L; /** - * UUID based Constructor - * @param ctx Context - * @param C_AcctProcessorLog_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_AcctProcessorLog_UU UUID key + * @param trxName Transaction + */ public MAcctProcessorLog(Properties ctx, String C_AcctProcessorLog_UU, String trxName) { super(ctx, C_AcctProcessorLog_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MAcctSchema.java b/org.adempiere.base/src/org/compiere/model/MAcctSchema.java index 9f9b244c78..8976261c95 100644 --- a/org.adempiere.base/src/org/compiere/model/MAcctSchema.java +++ b/org.adempiere.base/src/org/compiere/model/MAcctSchema.java @@ -34,7 +34,7 @@ import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; /** - * Accounting Schema Model (base) + * Accounting Schema Model * * @author Jorg Janke * @author victor.perez@e-evolution.com, www.e-evolution.com @@ -44,7 +44,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 405097978362430053L; @@ -187,21 +187,20 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport private static CCache s_schema = new CCache(I_AD_ClientInfo.Table_Name, I_AD_ClientInfo.Table_Name+"|MAcctSchema[]", 3, 120, false); // 3 clients /** Cache of AcctSchemas **/ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 3, 120); // 3 accounting schemas - - + /** - * UUID based Constructor - * @param ctx Context - * @param C_AcctSchema_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_AcctSchema_UU UUID key + * @param trxName Transaction + */ public MAcctSchema(Properties ctx, String C_AcctSchema_UU, String trxName) { super(ctx, C_AcctSchema_UU, trxName); if (Util.isEmpty(C_AcctSchema_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_AcctSchema_ID id @@ -263,7 +262,7 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport } // MAcctSchema /** - * + * Copy constructor * @param copy */ public MAcctSchema(MAcctSchema copy) @@ -272,7 +271,7 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -282,7 +281,7 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -322,9 +321,9 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport /** Only Post Org Childs */ private Integer[] m_onlyOrgs = null; - /************************************************************************** + /** * AcctSchema Elements - * @return ArrayList of AcctSchemaElement + * @return Array of AcctSchemaElement */ public MAcctSchemaElement[] getAcctSchemaElements() { @@ -332,7 +331,7 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport } // getAcctSchemaElements /** - * Get AcctSchema Element + * Get AcctSchema Element via element type * @param elementType segment type - AcctSchemaElement.ELEMENTTYPE_ * @return AcctSchemaElement */ @@ -347,7 +346,6 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport } // getAcctSchemaElement /** - * Has AcctSchema Element * @param segmentType segment type - AcctSchemaElement.SEGMENT_ * @return true if schema has segment type */ @@ -392,7 +390,7 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport /** * String representation - * @return String rep + * @return String representation */ public String toString() { @@ -404,7 +402,7 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport /** * Is Suspense Balancing active - * @return suspense balancing + * @return true if schema is using suspense balancing account */ public boolean isSuspenseBalancing() { @@ -414,8 +412,8 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport } // isSuspenseBalancing /** - * Get Suspense Error Account - * @return suspense error account + * Get Suspense Balancing Account + * @return suspense balancing account */ public MAccount getSuspenseBalancing_Acct() { @@ -430,7 +428,7 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport /** * Is Currency Balancing active - * @return suspense balancing + * @return true if schema is using currency balancing account */ public boolean isCurrencyBalancing() { @@ -495,7 +493,6 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport */ public void setOnlyOrgs (Integer[] orgs) { -// m_onlyOrgs = orgs; throw new IllegalStateException("The OnlyOrgs are now fetched automatically"); } // setOnlyOrgs @@ -516,7 +513,7 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport /** * Skip creating postings for this Org. * @param AD_Org_ID - * @return true if to skip + * @return true if to skip posting */ public synchronized boolean isSkipOrg (int AD_Org_ID) { @@ -601,7 +598,7 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport /** * Is Client Costing Level (default) - * @return true if Client + * @return true if schema costing is at client level */ public boolean isCostingLevelClient() { @@ -613,7 +610,7 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport /** * Is Org Costing Level - * @return true if Org + * @return true if schema costing is at organization level */ public boolean isCostingLevelOrg() { @@ -622,7 +619,7 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport /** * Is Batch Costing Level - * @return true if Batch + * @return true if schema costing is at lot/batch level */ public boolean isCostingLevelBatch() { @@ -630,8 +627,7 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport } // isCostingLevelBatch /** - * Create PO Commitment Accounting - * @return true if creaet commitments + * @return true if using commitments accounting for PO */ public boolean isCreatePOCommitment() { @@ -645,8 +641,7 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport } // isCreateCommitment /** - * Create SO Commitment Accounting - * @return true if creaet commitments + * @return true if using commitments accounting for SO */ public boolean isCreateSOCommitment() { @@ -659,8 +654,7 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport } // isCreateCommitment /** - * Create Commitment/Reservation Accounting - * @return true if create reservations + * @return true if create reservations for PO */ public boolean isCreateReservation() { @@ -673,7 +667,7 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport /** * Get Tax Correction Type - * @return tax correction type + * @return tax correction type (discount, write off or none) */ public String getTaxCorrectionType() { @@ -685,7 +679,7 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport /** * Tax Correction - * @return true if not none + * @return true if tax correction type is not none */ public boolean isTaxCorrection() { @@ -693,8 +687,7 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport } // isTaxCorrection /** - * Tax Correction for Discount - * @return true if tax is corrected for Discount + * @return true if tax correction type is discount or write off+discount */ public boolean isTaxCorrectionDiscount() { @@ -703,8 +696,7 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport } // isTaxCorrectionDiscount /** - * Tax Correction for WriteOff - * @return true if tax is corrected for WriteOff + * @return true if tax correction type is write off or write off+discount */ public boolean isTaxCorrectionWriteOff() { @@ -743,6 +735,10 @@ public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport return true; } // beforeSave + /** + * Get products that has costing detail records. + * @return comma separated product values + */ private String getProductsWithCost() { StringBuilder products = new StringBuilder(); StringBuilder sql = new StringBuilder("SELECT DISTINCT p.Value FROM M_Product p JOIN M_CostDetail d ON p.M_Product_ID=d.M_Product_ID"); diff --git a/org.adempiere.base/src/org/compiere/model/MAcctSchemaDefault.java b/org.adempiere.base/src/org/compiere/model/MAcctSchemaDefault.java index dc505f6907..594fac5b7d 100644 --- a/org.adempiere.base/src/org/compiere/model/MAcctSchemaDefault.java +++ b/org.adempiere.base/src/org/compiere/model/MAcctSchemaDefault.java @@ -37,7 +37,7 @@ public class MAcctSchemaDefault extends X_C_AcctSchema_Default implements Immuta { /** - * + * generated serial id */ private static final long serialVersionUID = -7966846617443248102L; @@ -59,11 +59,11 @@ public class MAcctSchemaDefault extends X_C_AcctSchema_Default implements Immuta protected static CLogger s_log = CLogger.getCLogger(MAcctSchemaDefault.class); /** - * UUID based Constructor - * @param ctx Context - * @param C_AcctSchema_Default_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_AcctSchema_Default_UU UUID key + * @param trxName Transaction + */ public MAcctSchemaDefault(Properties ctx, String C_AcctSchema_Default_UU, String trxName) { super(ctx, C_AcctSchema_Default_UU, trxName); } @@ -91,7 +91,7 @@ public class MAcctSchemaDefault extends X_C_AcctSchema_Default implements Immuta } // MAcctSchemaDefault /** - * + * Copy constructor * @param copy */ public MAcctSchemaDefault(MAcctSchemaDefault copy) @@ -100,7 +100,7 @@ public class MAcctSchemaDefault extends X_C_AcctSchema_Default implements Immuta } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -110,7 +110,7 @@ public class MAcctSchemaDefault extends X_C_AcctSchema_Default implements Immuta } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -122,8 +122,8 @@ public class MAcctSchemaDefault extends X_C_AcctSchema_Default implements Immuta } /** - * Get Acct Info list - * @return list + * Get value of all columns that ends with Acct + * @return KeyNamePair(id, column name) list */ public ArrayList getAcctInfo() { @@ -156,6 +156,7 @@ public class MAcctSchemaDefault extends X_C_AcctSchema_Default implements Immuta * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getAD_Org_ID() != 0) diff --git a/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java b/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java index dc156444d2..12cea9ac60 100644 --- a/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java +++ b/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java @@ -43,14 +43,14 @@ import org.idempiere.cache.ImmutablePOSupport; public class MAcctSchemaElement extends X_C_AcctSchema_Element implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -747934131394469553L; /** - * Get ArrayList of Account Schema Elements from cache + * Get array of Account Schema Elements from cache * @param as Accounting Schema - * @return ArrayList with Elements + * @return Elements array */ public static MAcctSchemaElement[] getAcctSchemaElements (MAcctSchema as) { @@ -181,28 +181,27 @@ public class MAcctSchemaElement extends X_C_AcctSchema_Element implements Immuta } // return ""; - } // getColumnName + } // getValueQuery /** Logger */ private static CLogger s_log = CLogger.getCLogger (MAcctSchemaElement.class); /** Cache */ private static CCache s_cache = new CCache(Table_Name, 10); - - + /** - * UUID based Constructor - * @param ctx Context - * @param C_AcctSchema_Element_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_AcctSchema_Element_UU UUID key + * @param trxName Transaction + */ public MAcctSchemaElement(Properties ctx, String C_AcctSchema_Element_UU, String trxName) { super(ctx, C_AcctSchema_Element_UU, trxName); if (Util.isEmpty(C_AcctSchema_Element_UU)) setInitialDefaults(); } - /************************************************************************* + /** * Standard Constructor * @param ctx context * @param C_AcctSchema_Element_ID id @@ -246,7 +245,7 @@ public class MAcctSchemaElement extends X_C_AcctSchema_Element implements Immuta } // MAcctSchemaElement /** - * + * Copy constructor * @param copy */ public MAcctSchemaElement(MAcctSchemaElement copy) @@ -255,7 +254,7 @@ public class MAcctSchemaElement extends X_C_AcctSchema_Element implements Immuta } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -265,7 +264,7 @@ public class MAcctSchemaElement extends X_C_AcctSchema_Element implements Immuta } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -281,7 +280,7 @@ public class MAcctSchemaElement extends X_C_AcctSchema_Element implements Immuta private String m_ColumnName = null; /** - * Set Organization Type + * Set value for Organization element Type * @param SeqNo sequence * @param Name name * @param Org_ID id @@ -295,7 +294,7 @@ public class MAcctSchemaElement extends X_C_AcctSchema_Element implements Immuta } // setTypeOrg /** - * Set Type Account + * Set value for Account element type * @param SeqNo squence * @param Name name * @param C_Element_ID element @@ -311,7 +310,7 @@ public class MAcctSchemaElement extends X_C_AcctSchema_Element implements Immuta } // setTypeAccount /** - * Set Type BPartner + * Set value for BPartner element type * @param SeqNo sequence * @param Name name * @param C_BPartner_ID id @@ -325,7 +324,7 @@ public class MAcctSchemaElement extends X_C_AcctSchema_Element implements Immuta } // setTypeBPartner /** - * Set Type Product + * Set value for Product element type * @param SeqNo sequence * @param Name name * @param M_Product_ID id @@ -339,7 +338,7 @@ public class MAcctSchemaElement extends X_C_AcctSchema_Element implements Immuta } // setTypeProduct /** - * Set Type Project + * Set value for Project element type * @param SeqNo sequence * @param Name name * @param C_Project_ID id @@ -355,7 +354,7 @@ public class MAcctSchemaElement extends X_C_AcctSchema_Element implements Immuta /** * Is Element Type * @param elementType type - * @return ELEMENTTYPE type + * @return true if this is an instance of elementType */ public boolean isElementType (String elementType) { @@ -405,7 +404,6 @@ public class MAcctSchemaElement extends X_C_AcctSchema_Element implements Immuta return defaultValue; } // getDefault - /** * Get Acct Fact ColumnName * @return column name @@ -431,7 +429,6 @@ public class MAcctSchemaElement extends X_C_AcctSchema_Element implements Immuta } return getColumnName(et); } // getDisplayColumnName - /** * String representation @@ -445,8 +442,6 @@ public class MAcctSchemaElement extends X_C_AcctSchema_Element implements Immuta .append(",Pos=").append(getSeqNo()).append("]"); return msgreturn.toString(); } // toString - - /** * Before Save @@ -540,9 +535,9 @@ public class MAcctSchemaElement extends X_C_AcctSchema_Element implements Immuta } // afterSave /** - * Update ValidCombination and Fact with mandatory value - * @param element element - * @param id new default + * Update ValidCombination and Fact with mandatory element value (where existing element value is null) + * @param element element column name + * @param id element id */ private void updateData (String element, int id) { diff --git a/org.adempiere.base/src/org/compiere/model/MAcctSchemaGL.java b/org.adempiere.base/src/org/compiere/model/MAcctSchemaGL.java index e81a394bbf..4de3c774d0 100644 --- a/org.adempiere.base/src/org/compiere/model/MAcctSchemaGL.java +++ b/org.adempiere.base/src/org/compiere/model/MAcctSchemaGL.java @@ -26,8 +26,6 @@ import org.compiere.util.KeyNamePair; import org.compiere.util.Util; import org.idempiere.cache.ImmutablePOSupport; - - /** * Accounting Schema GL info * @@ -38,9 +36,8 @@ import org.idempiere.cache.ImmutablePOSupport; */ public class MAcctSchemaGL extends X_C_AcctSchema_GL implements ImmutablePOSupport { - /** - * + * generated serial id */ private static final long serialVersionUID = -53120274583638950L; @@ -60,14 +57,13 @@ public class MAcctSchemaGL extends X_C_AcctSchema_GL implements ImmutablePOSuppo /** Logger */ protected static CLogger s_log = CLogger.getCLogger(MAcctSchemaGL.class); - - + /** - * UUID based Constructor - * @param ctx Context - * @param C_AcctSchema_GL_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_AcctSchema_GL_UU UUID key + * @param trxName Transaction + */ public MAcctSchemaGL(Properties ctx, String C_AcctSchema_GL_UU, String trxName) { super(ctx, C_AcctSchema_GL_UU, trxName); if (Util.isEmpty(C_AcctSchema_GL_UU)) @@ -108,7 +104,7 @@ public class MAcctSchemaGL extends X_C_AcctSchema_GL implements ImmutablePOSuppo } // MAcctSchemaGL /** - * + * Copy constructor * @param copy */ public MAcctSchemaGL(MAcctSchemaGL copy) @@ -117,7 +113,7 @@ public class MAcctSchemaGL extends X_C_AcctSchema_GL implements ImmutablePOSuppo } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -127,7 +123,7 @@ public class MAcctSchemaGL extends X_C_AcctSchema_GL implements ImmutablePOSuppo } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -139,8 +135,8 @@ public class MAcctSchemaGL extends X_C_AcctSchema_GL implements ImmutablePOSuppo } /** - * Get Acct Info list - * @return list + * Get value of all columns that ends with Acct + * @return KeyNamePair(id, column name) list */ public ArrayList getAcctInfo() { @@ -173,6 +169,7 @@ public class MAcctSchemaGL extends X_C_AcctSchema_GL implements ImmutablePOSuppo * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getAD_Org_ID() != 0) diff --git a/org.adempiere.base/src/org/compiere/model/MAchievement.java b/org.adempiere.base/src/org/compiere/model/MAchievement.java index 76e004bf75..e68ac169c3 100644 --- a/org.adempiere.base/src/org/compiere/model/MAchievement.java +++ b/org.adempiere.base/src/org/compiere/model/MAchievement.java @@ -72,16 +72,16 @@ public class MAchievement extends X_PA_Achievement private static CLogger s_log = CLogger.getCLogger (MAchievement.class); /** - * UUID based Constructor - * @param ctx Context - * @param PA_Achievement_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param PA_Achievement_UU UUID key + * @param trxName Transaction + */ public MAchievement(Properties ctx, String PA_Achievement_UU, String trxName) { super(ctx, PA_Achievement_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param PA_Achievement_ID id @@ -119,6 +119,7 @@ public class MAchievement extends X_PA_Achievement * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (isAchieved()) @@ -137,6 +138,7 @@ public class MAchievement extends X_PA_Achievement * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (success) @@ -149,6 +151,7 @@ public class MAchievement extends X_PA_Achievement * @param success success * @return success */ + @Override protected boolean afterDelete (boolean success) { if (success) @@ -157,7 +160,7 @@ public class MAchievement extends X_PA_Achievement } // afterDelete /** - * Update Goals with Achievement + * Update measurement goals with achievement */ private void updateAchievementGoals() { diff --git a/org.adempiere.base/src/org/compiere/model/MActivity.java b/org.adempiere.base/src/org/compiere/model/MActivity.java index f14b010712..19a64b4dbc 100644 --- a/org.adempiere.base/src/org/compiere/model/MActivity.java +++ b/org.adempiere.base/src/org/compiere/model/MActivity.java @@ -36,7 +36,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MActivity extends X_C_Activity implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -5939026057597689130L; @@ -82,11 +82,11 @@ public class MActivity extends X_C_Activity implements ImmutablePOSupport } /** - * UUID based Constructor - * @param ctx Context - * @param C_Activity_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Activity_UU UUID key + * @param trxName Transaction + */ public MActivity(Properties ctx, String C_Activity_UU, String trxName) { super(ctx, C_Activity_UU, trxName); } @@ -114,7 +114,7 @@ public class MActivity extends X_C_Activity implements ImmutablePOSupport } // MActivity /** - * + * Copy constructor * @param copy */ public MActivity(MActivity copy) @@ -123,7 +123,7 @@ public class MActivity extends X_C_Activity implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -133,7 +133,7 @@ public class MActivity extends X_C_Activity implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -144,6 +144,12 @@ public class MActivity extends X_C_Activity implements ImmutablePOSupport copyPO(copy); } + /** + * @param ctx + * @param C_Activity_ID + * @param trxName + * @param virtualColumns + */ public MActivity(Properties ctx, int C_Activity_ID, String trxName, String... virtualColumns) { super(ctx, C_Activity_ID, trxName, virtualColumns); } @@ -156,6 +162,7 @@ public class MActivity extends X_C_Activity implements ImmutablePOSupport * @param success save success * @return true if saved */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -177,6 +184,7 @@ public class MActivity extends X_C_Activity implements ImmutablePOSupport * @param success * @return deleted */ + @Override protected boolean afterDelete (boolean success) { if (success) diff --git a/org.adempiere.base/src/org/compiere/model/MAddressTransaction.java b/org.adempiere.base/src/org/compiere/model/MAddressTransaction.java index ca409fbcd6..ce28faa7c1 100644 --- a/org.adempiere.base/src/org/compiere/model/MAddressTransaction.java +++ b/org.adempiere.base/src/org/compiere/model/MAddressTransaction.java @@ -23,32 +23,42 @@ import org.compiere.util.Env; import org.compiere.util.Msg; /** - * Address transaction model + * Model to record address validation transaction (usually online) * @author Elaine * */ public class MAddressTransaction extends X_C_AddressTransaction { /** - * + * generated serial id */ private static final long serialVersionUID = 8572809249265680649L; /** - * UUID based Constructor - * @param ctx Context - * @param C_AddressTransaction_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_AddressTransaction_UU UUID key + * @param trxName Transaction + */ public MAddressTransaction(Properties ctx, String C_AddressTransaction_UU, String trxName) { super(ctx, C_AddressTransaction_UU, trxName); } - + + /** + * @param ctx + * @param C_AddressTransaction_ID + * @param trxName + */ public MAddressTransaction(Properties ctx, int C_AddressTransaction_ID, String trxName) { super(ctx, C_AddressTransaction_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MAddressTransaction(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); @@ -76,8 +86,8 @@ public class MAddressTransaction extends X_C_AddressTransaction } /** - * Get address validation - * @return address validation + * Get address validation model + * @return address validation model */ public MAddressValidation getMAddressValidation() { @@ -85,7 +95,7 @@ public class MAddressTransaction extends X_C_AddressTransaction } /** - * Online process address validation + * Online address validation * @return true if valid */ public boolean processOnline() diff --git a/org.adempiere.base/src/org/compiere/model/MAddressValidation.java b/org.adempiere.base/src/org/compiere/model/MAddressValidation.java index 0f3e62f164..94820197e3 100644 --- a/org.adempiere.base/src/org/compiere/model/MAddressValidation.java +++ b/org.adempiere.base/src/org/compiere/model/MAddressValidation.java @@ -31,7 +31,7 @@ import org.compiere.util.DB; public class MAddressValidation extends X_C_AddressValidation { /** - * + * generated serial id */ private static final long serialVersionUID = 8194097022422808757L; @@ -39,11 +39,11 @@ public class MAddressValidation extends X_C_AddressValidation { private static CLogger s_log = CLogger.getCLogger(MAddressValidation.class); /** - * Get default address validation + * Get default address validation model * @param ctx * @param AD_Client_ID * @param trxName - * @return address validation + * @return address validation model */ public static MAddressValidation getDefaultAddressValidation(Properties ctx, int AD_Client_ID, String trxName) { @@ -54,11 +54,11 @@ public class MAddressValidation extends X_C_AddressValidation { } /** - * Get address validations + * Get address validation models * @param ctx * @param AD_Client_ID * @param trxName - * @return array of address validation + * @return array of address validation model */ public static MAddressValidation[] getAddressValidation(Properties ctx, int AD_Client_ID, String trxName) { @@ -105,59 +105,93 @@ public class MAddressValidation extends X_C_AddressValidation { } /** - * UUID based Constructor - * @param ctx Context - * @param C_AddressValidation_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_AddressValidation_UU UUID key + * @param trxName Transaction + */ public MAddressValidation(Properties ctx, String C_AddressValidation_UU, String trxName) { super(ctx, C_AddressValidation_UU, trxName); } - + + /** + * @param ctx + * @param C_AddressValidation_ID + * @param trxName + */ public MAddressValidation(Properties ctx, int C_AddressValidation_ID, String trxName) { super(ctx, C_AddressValidation_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MAddressValidation(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } + /** + * @return Java class name of address validation service + */ public String getAddressValidationClass() { return getC_AddressValidationCfg().getAddressValidationClass(); } + /** + * @return host address of address validation service + */ public String getHostAddress() { return getC_AddressValidationCfg().getHostAddress(); } + /** + * @return host port of address validation service + */ public int getHostPort() { return getC_AddressValidationCfg().getHostPort(); } + /** + * @return proxy address of address validation service + */ public String getProxyAddress() { return getC_AddressValidationCfg().getProxyAddress(); } + /** + * @return proxy port of address validation service + */ public int getProxyPort() { return getC_AddressValidationCfg().getProxyPort(); } + /** + * @return proxy logon of address validation service + */ public String getProxyLogon() { return getC_AddressValidationCfg().getProxyLogon(); } + /** + * @return proxy password of of address validation service + */ public String getProxyPassword() { return getC_AddressValidationCfg().getProxyPassword(); } + /** + * @return service path of address validation service + */ public String getServicePath() { return getC_AddressValidationCfg().getServicePath(); diff --git a/org.adempiere.base/src/org/compiere/model/MAging.java b/org.adempiere.base/src/org/compiere/model/MAging.java index 537641dd45..2f98d902c3 100644 --- a/org.adempiere.base/src/org/compiere/model/MAging.java +++ b/org.adempiere.base/src/org/compiere/model/MAging.java @@ -33,16 +33,16 @@ import org.compiere.util.Util; public class MAging extends X_T_Aging { /** - * + * generated serial id */ private static final long serialVersionUID = 3067400117623770188L; /** - * UUID based Constructor - * @param ctx Context - * @param T_Aging_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param T_Aging_UU UUID key + * @param trxName Transaction + */ public MAging(Properties ctx, String T_Aging_UU, String trxName) { super(ctx, T_Aging_UU, trxName); if (Util.isEmpty(T_Aging_UU)) @@ -96,7 +96,6 @@ public class MAging extends X_T_Aging } /** - * Full Constructor * @param ctx context * @param AD_PInstance_ID instance * @param StatementDate statement date @@ -148,6 +147,7 @@ public class MAging extends X_T_Aging * * @deprecated - better use the new constructor with organization included */ + @Deprecated(forRemoval = true, since = "11") public MAging (Properties ctx, int AD_PInstance_ID, Timestamp StatementDate, int C_BPartner_ID, int C_Currency_ID, int C_Invoice_ID, int C_InvoicePaySchedule_ID, @@ -186,7 +186,7 @@ public class MAging extends X_T_Aging private int m_daysDueSum = 0; /** - * Add Amount to Buckets + * Add Amount to Buckets (by days due) * @param DueDate due date * @param daysDue positive due - negative not due * @param invoicedAmt invoiced amount diff --git a/org.adempiere.base/src/org/compiere/model/MAlert.java b/org.adempiere.base/src/org/compiere/model/MAlert.java index cc711ee07a..c9667e67bb 100644 --- a/org.adempiere.base/src/org/compiere/model/MAlert.java +++ b/org.adempiere.base/src/org/compiere/model/MAlert.java @@ -38,16 +38,16 @@ import org.compiere.util.Util; public class MAlert extends X_AD_Alert { /** - * + * generated serial id */ private static final long serialVersionUID = -5684705878618526801L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Alert_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Alert_UU UUID key + * @param trxName Transaction + */ public MAlert(Properties ctx, String AD_Alert_UU, String trxName) { super(ctx, AD_Alert_UU, trxName); if (Util.isEmpty(AD_Alert_UU)) @@ -86,7 +86,6 @@ public class MAlert extends X_AD_Alert { super(ctx, rs, trxName); } // MAlert - /** The Rules */ private MAlertRule[] m_rules = null; @@ -95,7 +94,7 @@ public class MAlert extends X_AD_Alert /** * Get Rules - * @param reload reload data + * @param reload true to always reload from DB * @return array of rules */ public MAlertRule[] getRules (boolean reload) @@ -143,7 +142,7 @@ public class MAlert extends X_AD_Alert } // getRecipients /** - * Get First Role if exist + * Get First Recipient Role if exist * @return AD_Role_ID or -1 */ public int getFirstAD_Role_ID() diff --git a/org.adempiere.base/src/org/compiere/model/MAlertProcessor.java b/org.adempiere.base/src/org/compiere/model/MAlertProcessor.java index 9dfb04514c..19c5b127e7 100644 --- a/org.adempiere.base/src/org/compiere/model/MAlertProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MAlertProcessor.java @@ -25,7 +25,6 @@ import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Util; - /** * Alert Processor * @@ -36,14 +35,14 @@ public class MAlertProcessor extends X_AD_AlertProcessor implements AdempiereProcessor, AdempiereProcessor2 { /** - * + * generated serial id */ private static final long serialVersionUID = -6566030540146374829L; /** - * Get Active + * Get active alert processors * @param ctx context - * @return active processors + * @return active alert processors */ public static MAlertProcessor[] getActive (Properties ctx) { @@ -58,19 +57,18 @@ public class MAlertProcessor extends X_AD_AlertProcessor /** Static Logger */ @SuppressWarnings("unused") private static CLogger s_log = CLogger.getCLogger (MAlertProcessor.class); - /** - * UUID based Constructor - * @param ctx Context - * @param AD_AlertProcessor_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_AlertProcessor_UU UUID key + * @param trxName Transaction + */ public MAlertProcessor(Properties ctx, String AD_AlertProcessor_UU, String trxName) { super(ctx, AD_AlertProcessor_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param AD_AlertProcessorLog_ID id @@ -99,6 +97,7 @@ public class MAlertProcessor extends X_AD_AlertProcessor * Get Server ID * @return id */ + @Override public String getServerID () { return "AlertProcessor" + get_ID(); @@ -109,6 +108,7 @@ public class MAlertProcessor extends X_AD_AlertProcessor * @param requery requery * @return date next run */ + @Override public Timestamp getDateNextRun (boolean requery) { if (requery) @@ -120,6 +120,7 @@ public class MAlertProcessor extends X_AD_AlertProcessor * Get Logs * @return logs */ + @Override public AdempiereProcessorLog[] getLogs () { final String whereClause ="AD_AlertProcessor_ID=?"; @@ -146,11 +147,10 @@ public class MAlertProcessor extends X_AD_AlertProcessor int no = DB.executeUpdate(sql, get_TrxName()); return no; } // deleteLog - /** * Get Alerts - * @param reload reload data + * @param reload true to always reload from DB * @return array of alerts */ public MAlert[] getAlerts (boolean reload) diff --git a/org.adempiere.base/src/org/compiere/model/MAlertProcessorLog.java b/org.adempiere.base/src/org/compiere/model/MAlertProcessorLog.java index b1c4f64799..3c53ff5225 100644 --- a/org.adempiere.base/src/org/compiere/model/MAlertProcessorLog.java +++ b/org.adempiere.base/src/org/compiere/model/MAlertProcessorLog.java @@ -30,16 +30,16 @@ public class MAlertProcessorLog extends X_AD_AlertProcessorLog implements AdempiereProcessorLog { /** - * + * generated serial id */ private static final long serialVersionUID = -6720267177398838915L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_AlertProcessorLog_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_AlertProcessorLog_UU UUID key + * @param trxName Transaction + */ public MAlertProcessorLog(Properties ctx, String AD_AlertProcessorLog_UU, String trxName) { super(ctx, AD_AlertProcessorLog_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MAlertRecipient.java b/org.adempiere.base/src/org/compiere/model/MAlertRecipient.java index a318f881a8..e152fab711 100644 --- a/org.adempiere.base/src/org/compiere/model/MAlertRecipient.java +++ b/org.adempiere.base/src/org/compiere/model/MAlertRecipient.java @@ -19,7 +19,6 @@ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; - /** * Alert Recipient * @@ -29,16 +28,16 @@ import java.util.Properties; public class MAlertRecipient extends X_AD_AlertRecipient { /** - * + * generated serial id */ private static final long serialVersionUID = -7388195934030609324L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_AlertRecipient_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_AlertRecipient_UU UUID key + * @param trxName Transaction + */ public MAlertRecipient(Properties ctx, String AD_AlertRecipient_UU, String trxName) { super(ctx, AD_AlertRecipient_UU, trxName); } @@ -64,9 +63,7 @@ public class MAlertRecipient extends X_AD_AlertRecipient { super(ctx, rs, trxName); } // MAlertRecipient - - - + /** * Get User * @return AD_User_ID or -1 if none diff --git a/org.adempiere.base/src/org/compiere/model/MAlertRule.java b/org.adempiere.base/src/org/compiere/model/MAlertRule.java index 4c58b10c96..f51f6e5e81 100644 --- a/org.adempiere.base/src/org/compiere/model/MAlertRule.java +++ b/org.adempiere.base/src/org/compiere/model/MAlertRule.java @@ -27,7 +27,6 @@ import org.adempiere.exceptions.AdempiereException; import org.compiere.util.DB; import org.compiere.util.Util; - /** * Alert Rule Model * @@ -39,11 +38,11 @@ public class MAlertRule extends X_AD_AlertRule private static final long serialVersionUID = -1267260460210893262L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_AlertRule_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_AlertRule_UU UUID key + * @param trxName Transaction + */ public MAlertRule(Properties ctx, String AD_AlertRule_UU, String trxName) { super(ctx, AD_AlertRule_UU, trxName); } @@ -95,7 +94,7 @@ public class MAlertRule extends X_AD_AlertRule /** * Get Sql * @return sql - * @deprecated Use {@link #getSql(boolean)} instead + * @deprecated Use {@link #getSql(boolean)} instead */ public String getSql() { @@ -139,7 +138,7 @@ public class MAlertRule extends X_AD_AlertRule } // getSql /** - * Create Report File + * Create Empty Report File * @param extension file extension * @return newly created File */ @@ -183,6 +182,7 @@ public class MAlertRule extends X_AD_AlertRule * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (newRecord) @@ -207,7 +207,7 @@ public class MAlertRule extends X_AD_AlertRule } /** - * Update parent flags + * Update parent IsValid flag * @return true if success */ private boolean updateParent() { diff --git a/org.adempiere.base/src/org/compiere/model/MAllocationHdr.java b/org.adempiere.base/src/org/compiere/model/MAllocationHdr.java index 270a20dfdb..5629688586 100644 --- a/org.adempiere.base/src/org/compiere/model/MAllocationHdr.java +++ b/org.adempiere.base/src/org/compiere/model/MAllocationHdr.java @@ -37,8 +37,8 @@ import org.compiere.util.Msg; import org.compiere.util.Util; /** - * Payment Allocation Model. - * Allocation Trigger update C_BPartner + * Allocation Model. + * Allocation Trigger update of C_BPartner balance. * * @author Jorg Janke * @version $Id: MAllocationHdr.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $ @@ -53,7 +53,7 @@ import org.compiere.util.Util; public class MAllocationHdr extends X_C_AllocationHdr implements DocAction { /** - * + * generated serial id */ private static final long serialVersionUID = -7787519874581251920L; @@ -61,8 +61,8 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction * Get Allocations of Payment * @param ctx context * @param C_Payment_ID payment + * @param trxName transaction * @return allocations of payment - * @param trxName transaction */ public static MAllocationHdr[] getOfPayment (Properties ctx, int C_Payment_ID, String trxName) { @@ -99,8 +99,8 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction * Get Allocations of Invoice * @param ctx context * @param C_Invoice_ID payment + * @param trxName transaction * @return allocations of payment - * @param trxName transaction */ public static MAllocationHdr[] getOfInvoice (Properties ctx, int C_Invoice_ID, String trxName) { @@ -133,13 +133,12 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction return retValue; } // getOfInvoice - //FR [ 1866214 ] /** * Get Allocations of Cash * @param ctx context * @param C_Cash_ID Cash ID + * @param trxName transaction * @return allocations of payment - * @param trxName transaction */ public static MAllocationHdr[] getOfCash (Properties ctx, int C_Cash_ID, String trxName) { @@ -158,21 +157,20 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction /** Logger */ private static CLogger s_log = CLogger.getCLogger(MAllocationHdr.class); - - + /** - * UUID based Constructor - * @param ctx Context - * @param C_AllocationHdr_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_AllocationHdr_UU UUID key + * @param trxName Transaction + */ public MAllocationHdr(Properties ctx, String C_AllocationHdr_UU, String trxName) { super(ctx, C_AllocationHdr_UU, trxName); if (Util.isEmpty(C_AllocationHdr_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_AllocationHdr_ID id @@ -243,9 +241,9 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction private MAllocationLine[] m_lines = null; /** - * Get Lines + * Get Allocation Lines * @param requery if true requery - * @return lines + * @return allocation lines */ public MAllocationLine[] getLines (boolean requery) { @@ -289,6 +287,7 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction * Set Processed * @param processed Processed */ + @Override public void setProcessed (boolean processed) { super.setProcessed (processed); @@ -301,13 +300,13 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction m_lines = null; if (log.isLoggable(Level.FINE)) log.fine(processed + " - #" + no); } // setProcessed - - - /************************************************************************** + + /** * Before Save * @param newRecord * @return save */ + @Override protected boolean beforeSave (boolean newRecord) { // Changed from Not to Active @@ -325,6 +324,7 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction * Before Delete. * @return true if acct was deleted */ + @Override protected boolean beforeDelete () { String trxName = get_TrxName(); @@ -374,16 +374,18 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction * @param success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { return success; } // afterSave - /************************************************************************** + /** * Process document * @param processAction document action * @return true if performed */ + @Override public boolean processIt (String processAction) { m_processMsg = null; @@ -400,6 +402,7 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction * Unlock Document. * @return true if success */ + @Override public boolean unlockIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -411,6 +414,7 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction * Invalidate Document * @return true if success */ + @Override public boolean invalidateIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -422,6 +426,7 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction * Prepare Document * @return new status (In Progress or Invalid) */ + @Override public String prepareIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -501,6 +506,7 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction * Approve Document * @return true if success */ + @Override public boolean approveIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -512,6 +518,7 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction * Reject Approval * @return true if success */ + @Override public boolean rejectIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -523,6 +530,7 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction * Complete Document * @return new status (Complete, In Progress, Invalid, Waiting ..) */ + @Override public String completeIt() { // Re-Check @@ -569,9 +577,9 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction /** * Void Document. - * Same as Close. * @return true if success */ + @Override public boolean voidIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -649,9 +657,9 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction /** * Close Document. - * Cancel not delivered Qunatities * @return true if success */ + @Override public boolean closeIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -671,9 +679,10 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction } // closeIt /** - * Reverse Correction + * Reverse Correction (using original DateAcct) * @return true if success */ + @Override public boolean reverseCorrectIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -694,9 +703,10 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction } // reverseCorrectionIt /** - * Reverse Accrual - none + * Reverse Accrual (using current date as DateAcct) * @return false */ + @Override public boolean reverseAccrualIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -720,6 +730,7 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction * Re-activate * @return false */ + @Override public boolean reActivateIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -740,6 +751,7 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MAllocationHdr["); @@ -751,6 +763,7 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction * Get Document Info * @return document info (untranslated) */ + @Override public String getDocumentInfo() { StringBuilder msgreturn = new StringBuilder().append(Msg.getElement(getCtx(), "C_AllocationHdr_ID")).append(" ").append(getDocumentNo()); @@ -761,6 +774,7 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction * Create PDF * @return File or null */ + @Override public File createPDF () { try @@ -777,22 +791,20 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction } // getPDF /** - * Create PDF file + * Create PDF file. * @param file output file - * @return file if success + * @return not implemented, always return null */ public File createPDF (File file) { - // ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.INVOICE, getC_Invoice_ID()); - // if (re == null) - return null; - // return re.getPDF(file); + return null; } // createPDF - /************************************************************************* + /** * Get Summary * @return Summary of Document */ + @Override public String getSummary() { StringBuilder sb = new StringBuilder(); @@ -811,6 +823,7 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction * Get Process Message * @return clear text error message */ + @Override public String getProcessMsg() { return m_processMsg; @@ -820,6 +833,7 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction * Get Document Owner (Responsible) * @return AD_User_ID */ + @Override public int getDoc_User_ID() { return getCreatedBy(); @@ -838,9 +852,10 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction setDescription(desc + " | " + description); } // addDescription - /************************************************************************** + /** * Reverse Allocation. - * Period needs to be open + * Period needs to be open. + * @param accrual true for reverse accrual (current date), false for reverse correct (original accounting date) * @return true if reversed */ private boolean reverseIt(boolean accrual) @@ -948,6 +963,10 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction return true; } // reverse + /** + * Update open balance of BP + * @return true if updated successfully + */ private boolean updateBP() { List bps = new ArrayList(); @@ -965,7 +984,7 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction } // updateBP /** - * Document Status is Complete or Closed + * Document Status is Complete, Closed or Reversed * @return true if CO, CL or RE */ public boolean isComplete() @@ -978,7 +997,7 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction /** * Create new Allocation by copying - * @param from allocation + * @param from source allocation to copy from * @param dateAcct date of the document accounting date * @param dateTrx date of the document transaction. * @param trxName @@ -1014,7 +1033,7 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction /** * Copy Lines From other Allocation. - * @param otherAllocation allocation + * @param otherAllocation other allocation to copy from * @return number of lines copied */ public int copyLinesFrom (MAllocationHdr otherAllocation) @@ -1066,14 +1085,18 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction /** * Is Reversal - * @return reversal + * @return true if it is a reversal document */ private boolean isReversal() { return m_reversal; } // isReversal - /** Returns a description parsing the bpartner defined in the Allocation form and then the allocation itself */ + /** + * @param bpartnerID + * @param trxName + * @return Returns a description parsing the bpartner in allocation header and then the allocation document itself + */ public String getDescriptionForManualAllocation(int bpartnerID, String trxName) { String sysconfig_desc = MSysConfig.getValue(MSysConfig.ALLOCATION_DESCRIPTION, "@#AD_User_Name@", getAD_Client_ID()); diff --git a/org.adempiere.base/src/org/compiere/model/MAllocationLine.java b/org.adempiere.base/src/org/compiere/model/MAllocationLine.java index 5a72b3fd93..02bdafcd23 100644 --- a/org.adempiere.base/src/org/compiere/model/MAllocationLine.java +++ b/org.adempiere.base/src/org/compiere/model/MAllocationLine.java @@ -28,7 +28,6 @@ import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.Util; - /** * Allocation Line Model * @@ -38,16 +37,16 @@ import org.compiere.util.Util; public class MAllocationLine extends X_C_AllocationLine { /** - * + * generated serial id */ private static final long serialVersionUID = 5532305715886380749L; /** - * UUID based Constructor - * @param ctx Context - * @param C_AllocationLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_AllocationLine_UU UUID key + * @param trxName Transaction + */ public MAllocationLine(Properties ctx, String C_AllocationLine_UU, String trxName) { super(ctx, C_AllocationLine_UU, trxName); if (Util.isEmpty(C_AllocationLine_UU)) @@ -149,7 +148,7 @@ public class MAllocationLine extends X_C_AllocationLine /** * Get Parent Trx Date - * @return date trx + * @return parent trx date */ public Timestamp getDateTrx () { @@ -205,13 +204,13 @@ public class MAllocationLine extends X_C_AllocationLine m_invoice = new MInvoice (getCtx(), getC_Invoice_ID(), get_TrxName()); return m_invoice; } // getInvoice - - /************************************************************************** + /** * Before Save * @param newRecord * @return save */ + @Override protected boolean beforeSave (boolean newRecord) { if (newRecord && getParent().isProcessed()) { @@ -233,12 +232,12 @@ public class MAllocationLine extends X_C_AllocationLine // return true; } // beforeSave - /** * Before Delete * @return true if reversed */ + @Override protected boolean beforeDelete () { setIsActive(false); @@ -250,6 +249,7 @@ public class MAllocationLine extends X_C_AllocationLine * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MAllocationLine["); @@ -270,9 +270,9 @@ public class MAllocationLine extends X_C_AllocationLine return sb.toString (); } // toString - /************************************************************************** - * Process Allocation (does not update line). - * - Update and Link Invoice/Payment/Cash + /** + * Process Allocation (does not update line).
    + * - Update and Link Invoice/Payment/Cash. * @param reverse if true allocation is reversed * @return C_BPartner_ID */ diff --git a/org.adempiere.base/src/org/compiere/model/MArchive.java b/org.adempiere.base/src/org/compiere/model/MArchive.java index 36a1b63c9a..d97ceb72aa 100644 --- a/org.adempiere.base/src/org/compiere/model/MArchive.java +++ b/org.adempiere.base/src/org/compiere/model/MArchive.java @@ -46,7 +46,7 @@ import org.compiere.util.Util; */ public class MArchive extends X_AD_Archive { /** - * + * generated serial id */ private static final long serialVersionUID = 1195510484179775189L; @@ -97,17 +97,17 @@ public class MArchive extends X_AD_Archive { private static CLogger s_log = CLogger.getCLogger(MArchive.class); /** - * UUID based Constructor - * @param ctx Context - * @param AD_Archive_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Archive_UU UUID key + * @param trxName Transaction + */ public MArchive(Properties ctx, String AD_Archive_UU, String trxName) { super(ctx, AD_Archive_UU, trxName); initArchiveStoreDetails(ctx, trxName); } - /*************************************************************************** + /** * Standard Constructor * * @param ctx @@ -162,7 +162,7 @@ public class MArchive extends X_AD_Archive { protected MStorageProvider provider; /** - * Get the isStoreArchiveOnFileSystem and archivePath for the client. + * Initialize storage provider * * @param ctx * @param trxName @@ -181,6 +181,7 @@ public class MArchive extends X_AD_Archive { * * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder("MArchive["); sb.append(get_ID()).append(",Name=").append(getName()); @@ -193,6 +194,7 @@ public class MArchive extends X_AD_Archive { * * @return byte[] or null */ + @Override public byte[] getBinaryData() { IArchiveStore prov = provider.getArchiveStore(); if (prov != null) @@ -218,6 +220,7 @@ public class MArchive extends X_AD_Archive { * @param inflatedData * inflated data */ + @Override public void setBinaryData(byte[] inflatedData) { IArchiveStore prov = provider.getArchiveStore(); if (prov != null) @@ -257,7 +260,7 @@ public class MArchive extends X_AD_Archive { * id. The process, table and record id are only included when they are not * null. * - * @return String + * @return archive path */ public String getArchivePathSnippet() { StringBuilder path = new StringBuilder().append(this.getAD_Client_ID()).append(File.separator).append(this.getAD_Org_ID()) @@ -302,6 +305,7 @@ public class MArchive extends X_AD_Archive { * new * @return true if can be saved */ + @Override protected boolean beforeSave(boolean newRecord) { // Binary Data is Mandatory byte[] data = super.getBinaryData(); @@ -318,6 +322,9 @@ public class MArchive extends X_AD_Archive { return true; } // beforeSave + /** + * Ask provider to remove archive content + */ @Override protected boolean postDelete() { @@ -328,6 +335,9 @@ public class MArchive extends X_AD_Archive { } + /** + * Ask provider to flush buffer data (if any) + */ @Override protected void saveNew_afterSetID() { @@ -337,8 +347,8 @@ public class MArchive extends X_AD_Archive { } /** - * Set Storage Provider - * Used temporarily for the process to migrate storage provider + * Set Storage Provider. + * Also used temporarily for the migration of storage provider. * @param p Storage provider */ public void setStorageProvider(MStorageProvider p) { @@ -426,7 +436,7 @@ public class MArchive extends X_AD_Archive { * Get number of document and report archive by table and record UUID * * @param AD_Table_ID - * @param Record_ID - record ID used when UUID comes empty, or C_BPartner_ID when searching for this table + * @param Record_ID - record ID used when UUID is empty, or as C_BPartner_ID when searching for C_BPartner * @param Record_UU - record UUID * @param trxName * @return int[], [0] = report count and [1] = document count diff --git a/org.adempiere.base/src/org/compiere/model/MAsset.java b/org.adempiere.base/src/org/compiere/model/MAsset.java index b173ef8180..debfe850e5 100644 --- a/org.adempiere.base/src/org/compiere/model/MAsset.java +++ b/org.adempiere.base/src/org/compiere/model/MAsset.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.math.BigDecimal; @@ -42,7 +63,7 @@ public class MAsset extends X_A_Asset { * @param ctx * @param M_Product_ID (optional) * @param M_ASI_ID - * @return array of MAsset + * @return collection of MAsset */ public static Collection forASI(Properties ctx, int M_Product_ID, int M_ASI_ID) { @@ -60,18 +81,22 @@ public class MAsset extends X_A_Asset { } /** - * UUID based Constructor - * @param ctx Context - * @param A_Asset_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Asset_UU UUID key + * @param trxName Transaction + */ public MAsset(Properties ctx, String A_Asset_UU, String trxName) { super(ctx, A_Asset_UU, trxName); if (Util.isEmpty(A_Asset_UU)) setInitialDefaults(); } - /** Create constructor */ + /** + * @param ctx + * @param A_Asset_ID + * @param trxName + */ public MAsset (Properties ctx, int A_Asset_ID, String trxName) { super (ctx, A_Asset_ID,trxName); @@ -186,6 +211,12 @@ public class MAsset extends X_A_Asset { setDescription(project.getDescription()); } + /** + * Create asset from material receipt line + * @param mInOut + * @param sLine + * @param deliveryCount + */ public MAsset(MInOut mInOut, MInOutLine sLine, int deliveryCount) { this(mInOut.getCtx(), 0, mInOut.get_TrxName()); setIsOwned(false); @@ -250,15 +281,11 @@ public class MAsset extends X_A_Asset { setProcessed(true); } - //added by @win setA_Asset_Status(A_ASSET_STATUS_New); - //end added by @win - - } /** - * + * Copy constructor * @param copy */ public MAsset(MAsset copy) @@ -267,7 +294,7 @@ public class MAsset extends X_A_Asset { } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -277,7 +304,7 @@ public class MAsset extends X_A_Asset { } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -294,13 +321,16 @@ public class MAsset extends X_A_Asset { } /** - * Set Asset Group; also it sets other default fields + * Set Asset Group * @param assetGroup */ public void setAssetGroup(MAssetGroup assetGroup) { setA_Asset_Group_ID(assetGroup.getA_Asset_Group_ID()); } + /** + * @return MAssetGroup + */ public MAssetGroup getAssetGroup() { return MAssetGroup.getCopy(getCtx(), getA_Asset_Group_ID(), get_TrxName()); } @@ -320,7 +350,7 @@ public class MAsset extends X_A_Asset { * @param newRecord new * @return true */ - + @Override protected boolean beforeSave (boolean newRecord) { // Set parent asset: @@ -366,7 +396,7 @@ public class MAsset extends X_A_Asset { return true; } // beforeSave - + @Override protected boolean afterSave (boolean newRecord, boolean success) { if(!success) @@ -454,7 +484,7 @@ public class MAsset extends X_A_Asset { return true; } // afterSave - + @Override protected boolean beforeDelete() { // delete addition @@ -474,10 +504,10 @@ public class MAsset extends X_A_Asset { if (log.isLoggable(Level.INFO)) log.info("@C_InvoiceLine@ @Updated@ #" + no); } return true; - } // beforeDelete + } // beforeDelete /** - * + * Update various status related flag * @see #beforeSave(boolean) */ public void updateStatus() @@ -532,7 +562,7 @@ public class MAsset extends X_A_Asset { } // Disposal if(newStatus.equals(A_ASSET_STATUS_Disposed)) - { // casat, vandut + { setAssetDisposalDate(date); } @@ -540,42 +570,48 @@ public class MAsset extends X_A_Asset { setA_Asset_Status(newStatus); } // changeStatus - // Temporary used variables: - /** */ + /** Temporary variables for {@link MDepreciationWorkfile}: */ + /** useful life in months */ private int m_UseLifeMonths_F = 0; public int getUseLifeMonths_F() { return m_UseLifeMonths_F; } public void setUseLifeMonths_F(int UseLifeMonths_F) { m_UseLifeMonths_F = UseLifeMonths_F; } - /** */ + /** current period id */ private int m_A_Current_Period = 0; public int getA_Current_Period() { return m_A_Current_Period; } public void setA_Current_Period(int A_Current_Period) { m_A_Current_Period = A_Current_Period; } - /** */ + /** accounting date */ private Timestamp m_DateAcct = null; public Timestamp getDateAcct() { return m_DateAcct; } public void setDateAcct(Timestamp DateAcct) { m_DateAcct = DateAcct; } - /** */ + /** A_Depreciation_ID */ private int m_A_Depreciation_ID = 0; public int getA_Depreciation_ID() { return m_A_Depreciation_ID; } public void setA_Depreciation_ID(int A_Depreciation_ID) { m_A_Depreciation_ID = A_Depreciation_ID; } - /** */ + /** A_Depreciation_Forecast_ID */ private int m_A_Depreciation_F_ID = 0; public int getA_Depreciation_F_ID() { return m_A_Depreciation_F_ID; } public void setA_Depreciation_F_ID(int A_Depreciation_F_ID) { m_A_Depreciation_F_ID = A_Depreciation_F_ID; } - /** */ - private BigDecimal m_A_Asset_Cost = Env.ZERO; - private BigDecimal m_A_Accumulated_Depr = Env.ZERO; - private BigDecimal m_A_Accumulated_Depr_F = Env.ZERO; + /** Asset cost */ + private BigDecimal m_A_Asset_Cost = Env.ZERO; public BigDecimal getA_Asset_Cost() { return m_A_Asset_Cost; } public void setA_Asset_Cost(BigDecimal A_Asset_Cost) { m_A_Asset_Cost = A_Asset_Cost; } + /** Accumulated depreciation */ + private BigDecimal m_A_Accumulated_Depr = Env.ZERO; public BigDecimal getA_Accumulated_Depr() { return m_A_Accumulated_Depr; } public void setA_Accumulated_Depr(BigDecimal A_Accumulated_Depr) { m_A_Accumulated_Depr = A_Accumulated_Depr; } + /** Accumulated depreciation forecast */ + private BigDecimal m_A_Accumulated_Depr_F = Env.ZERO; public BigDecimal getA_Accumulated_Depr_F() { return m_A_Accumulated_Depr_F; } public void setA_Accumulated_Depr_F(BigDecimal A_Accumulated_Depr_F) { m_A_Accumulated_Depr_F = A_Accumulated_Depr_F; } - + /** Fixed asset import */ private MIFixedAsset m_I_FixedAsset = null; public MIFixedAsset getI_FixedAsset() { return m_I_FixedAsset; } public void setI_FixedAsset(MIFixedAsset I_FixedAsset) { m_I_FixedAsset = I_FixedAsset; } + /** + * Methods below have been created for compilation of org.compiere.process.AssetDelivery and it is not working in any meaningful way. + */ + public MAssetDelivery confirmDelivery(EMail email, int ad_User_ID) { // TODO Auto-generated method stub return null; diff --git a/org.adempiere.base/src/org/compiere/model/MAssetAcct.java b/org.adempiere.base/src/org/compiere/model/MAssetAcct.java index a70f27bae2..a069bb5499 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetAcct.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetAcct.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.math.BigDecimal; @@ -21,16 +42,16 @@ public class MAssetAcct extends X_A_Asset_Acct implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -8898773839204909595L; /** - * UUID based Constructor - * @param ctx Context - * @param A_Asset_Acct_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Asset_Acct_UU UUID key + * @param trxName Transaction + */ public MAssetAcct(Properties ctx, String A_Asset_Acct_UU, String trxName) { super(ctx, A_Asset_Acct_UU, trxName); if (Util.isEmpty(A_Asset_Acct_UU)) @@ -54,13 +75,18 @@ public class MAssetAcct extends X_A_Asset_Acct implements ImmutablePOSupport setA_Salvage_Value(Env.ZERO); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MAssetAcct (Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } /** - * + * Copy constructor * @param copy */ public MAssetAcct(MAssetAcct copy) @@ -69,7 +95,7 @@ public class MAssetAcct extends X_A_Asset_Acct implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -79,7 +105,7 @@ public class MAssetAcct extends X_A_Asset_Acct implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -181,24 +207,29 @@ public class MAssetAcct extends X_A_Asset_Acct implements ImmutablePOSupport } setA_Period_Start(1); setA_Period_End(asset.getUseLifeMonths()); - //~ setProcessing(false); dump(); } /** - * + * @param fiscal true for fiscal, false for non-fiscal + * @return depreciation variable percentage */ public BigDecimal getA_Depreciation_Variable_Perc(boolean fiscal) { return fiscal ? getA_Depreciation_Variable_Perc_F() : getA_Depreciation_Variable_Perc(); } - + @Override public MAcctSchema getC_AcctSchema() { return MAcctSchema.getCopy(getCtx(), getC_AcctSchema_ID(), get_TrxName()); } + /** + * + * @param M_Product_ID + * @return Product asset account + */ public MAccount getP_Asset_Acct(int M_Product_ID) { MAcctSchema as = getC_AcctSchema(); diff --git a/org.adempiere.base/src/org/compiere/model/MAssetAddition.java b/org.adempiere.base/src/org/compiere/model/MAssetAddition.java index 5f2af89ef6..5ed8063a9b 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetAddition.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetAddition.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.io.File; @@ -27,7 +48,6 @@ import org.idempiere.fa.exceptions.AssetNotSupportedException; import org.idempiere.fa.feature.UseLifeImpl; import org.idempiere.fa.util.POCacheLocal; - /** * Asset Addition Model * @author Teo Sarca, SC ARHIPAC SERVICE SRL @@ -38,7 +58,7 @@ public class MAssetAddition extends X_A_Asset_Addition implements DocAction { /** - * + * generated serial id */ private static final long serialVersionUID = 5977180589101094202L; @@ -46,17 +66,22 @@ public class MAssetAddition extends X_A_Asset_Addition private static CLogger s_log = CLogger.getCLogger(MAssetAddition.class); /** - * UUID based Constructor - * @param ctx Context - * @param A_Asset_Addition_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Asset_Addition_UU UUID key + * @param trxName Transaction + */ public MAssetAddition(Properties ctx, String A_Asset_Addition_UU, String trxName) { super(ctx, A_Asset_Addition_UU, trxName); if (Util.isEmpty(A_Asset_Addition_UU)) setInitialDefaults(); } - + + /** + * @param ctx + * @param A_Asset_Addition_ID + * @param trxName + */ public MAssetAddition (Properties ctx, int A_Asset_Addition_ID, String trxName) { super (ctx, A_Asset_Addition_ID, trxName); @@ -73,12 +98,17 @@ public class MAssetAddition extends X_A_Asset_Addition setProcessed(false); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MAssetAddition (Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } // MAAssetAddition - + @Override protected boolean beforeSave (boolean newRecord) { setA_CreateAsset(); @@ -154,7 +184,6 @@ public class MAssetAddition extends X_A_Asset_Addition return assetAdd; } - //@win create asset from Project /** * Create Asset and asset Addition from MProject. MAssetAddition is saved. * Addition from Project only allows initial addition (will definitely create new asset) @@ -185,9 +214,10 @@ public class MAssetAddition extends X_A_Asset_Addition return assetAdd; } - //end @win create asset from Project + /** * Create Asset + * @return MAsset */ private MAsset createAsset() { @@ -209,9 +239,7 @@ public class MAssetAddition extends X_A_Asset_Addition } else if (A_SOURCETYPE_Project.equals(sourceType)) { - //@win add code for generate from Project asset = new MAsset(getC_Project(false)); - //end @win add code for generate from Project } else { @@ -237,9 +265,7 @@ public class MAssetAddition extends X_A_Asset_Addition setC_DocType_ID(); } - //added by @win /** - * @author @win * Construct addition from Project * @param project */ @@ -272,17 +298,26 @@ public class MAssetAddition extends X_A_Asset_Addition } private final POCacheLocal m_cacheCProject = POCacheLocal.newInstance(this, MProject.class); + + /** + * @param requery + * @return MProject + */ public MProject getC_Project(boolean requery) { return m_cacheCProject.get(requery); } + + /** + * @param project + */ private void setC_Project(MProject project) { set_Value("C_Project_ID", project.get_ID()); m_cacheCProject.set(project); } - //end added by @win - /**IDR + + /** * Construct addition from import * @param ifa fixed asset import */ @@ -328,13 +363,16 @@ public class MAssetAddition extends X_A_Asset_Addition /** * @param requery - * @return + * @return MMatchInv */ private MMatchInv getMatchInv(boolean requery) { return m_cacheMatchInv.get(requery); } + /** + * @param mi + */ private void setM_MatchInv(MMatchInv mi) { mi.load(get_TrxName()); @@ -412,15 +450,24 @@ public class MAssetAddition extends X_A_Asset_Addition SetGetUtil.updateColumns(model, null, query, trxName); - s_log.fine("Leaving: RETURN TRUE"); return true; } private final POCacheLocal m_cacheIFixedAsset = POCacheLocal.newInstance(this, MIFixedAsset.class); + + /** + * @param requery + * @return MIFixedAsset + */ public MIFixedAsset getI_FixedAsset(boolean requery) { return m_cacheIFixedAsset.get(requery); } + + /** + * Set fixed asset import model + * @param ifa + */ private void setI_FixedAsset(MIFixedAsset ifa) { setI_FixedAsset_ID(ifa.get_ID()); @@ -442,6 +489,10 @@ public class MAssetAddition extends X_A_Asset_Addition null); } + /** + * Set source amount + * @param amt + */ public void setSourceAmt(BigDecimal amt) { setAssetAmtEntered(amt); @@ -449,7 +500,7 @@ public class MAssetAddition extends X_A_Asset_Addition } /** - * + * Set IsApproved to true if current role can approved it, false otherwise. */ public void setIsApproved() { @@ -461,7 +512,7 @@ public class MAssetAddition extends X_A_Asset_Addition } } - + @Override public Timestamp getDateAcct() { Timestamp dateAcct = super.getDateAcct(); @@ -472,7 +523,7 @@ public class MAssetAddition extends X_A_Asset_Addition return dateAcct; } - + @Override public boolean processIt (String processAction) { m_processMsg = null; @@ -485,21 +536,21 @@ public class MAssetAddition extends X_A_Asset_Addition /** Just Prepared Flag */ private boolean m_justPrepared = false; - + @Override public boolean unlockIt() { if (log.isLoggable(Level.INFO)) log.info("unlockIt - " + toString()); return true; } // unlockIt - + @Override public boolean invalidateIt() { if (log.isLoggable(Level.INFO)) log.info("invalidateIt - " + toString()); return false; } // invalidateIt - + @Override public String prepareIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -583,7 +634,7 @@ public class MAssetAddition extends X_A_Asset_Addition return DocAction.STATUS_InProgress; } // prepareIt - + @Override public boolean approveIt() { if (log.isLoggable(Level.INFO)) log.info("approveIt - " + toString()); @@ -591,7 +642,7 @@ public class MAssetAddition extends X_A_Asset_Addition return true; } // approveIt - + @Override public boolean rejectIt() { if (log.isLoggable(Level.INFO)) log.info("rejectIt - " + toString()); @@ -599,7 +650,7 @@ public class MAssetAddition extends X_A_Asset_Addition return true; } // rejectIt - + @Override public String completeIt() { // Re-Check @@ -739,7 +790,7 @@ public class MAssetAddition extends X_A_Asset_Addition return DocAction.STATUS_Completed; } // completeIt - + @Override public boolean voidIt() { // Before Void @@ -763,6 +814,9 @@ public class MAssetAddition extends X_A_Asset_Addition return true; } // voidIt + /** + * @param isReActivate + */ private void reverseIt(boolean isReActivate) { if (DOCSTATUS_Closed.equals(getDocStatus()) @@ -847,7 +901,7 @@ public class MAssetAddition extends X_A_Asset_Addition updateSourceDocument(true); } - + @Override public boolean closeIt() { if (log.isLoggable(Level.INFO)) log.info("closeIt - " + toString()); @@ -855,19 +909,19 @@ public class MAssetAddition extends X_A_Asset_Addition return true; } // closeIt - + @Override public boolean reverseCorrectIt() { throw new AssetNotImplementedException("reverseCorrectIt"); } // reverseCorrectionIt - + @Override public boolean reverseAccrualIt() { throw new AssetNotImplementedException("reverseAccrualIt"); } // reverseAccrualIt - + @Override public boolean reActivateIt() { // Before @@ -890,7 +944,7 @@ public class MAssetAddition extends X_A_Asset_Addition return true; } // reActivateIt - + @Override public String getSummary() { MAsset asset = getA_Asset(false); @@ -906,19 +960,19 @@ public class MAssetAddition extends X_A_Asset_Addition return Msg.parseTranslation(getCtx(), sb.toString()); } // getSummary - + @Override public String getProcessMsg() { return m_processMsg; } // getProcessMsg - + @Override public int getDoc_User_ID() { return getCreatedBy(); } // getDoc_User_ID - + @Override public BigDecimal getApprovalAmt() { return getAssetValueAmt(); @@ -948,7 +1002,7 @@ public class MAssetAddition extends X_A_Asset_Addition m_cacheAsset.set(asset); } // setAsset - + @Override protected boolean afterSave (boolean newRecord, boolean success) { if(!success) @@ -1032,8 +1086,9 @@ public class MAssetAddition extends X_A_Asset_Addition // Manual else if (A_SOURCETYPE_Manual.equals(sourceType) && isProcessed()) { - // nothing to do - log.fine("Nothing to do"); + // nothing to do + if (log.isLoggable(Level.FINE)) + log.fine("Nothing to do"); } } @@ -1056,7 +1111,7 @@ public class MAssetAddition extends X_A_Asset_Addition } /** - * Creating/Updating asset product + * Creating/Updating asset product (MAssetProduct) * @param isReversal */ private void updateA_Asset_Product(boolean isReversal) @@ -1095,6 +1150,9 @@ public class MAssetAddition extends X_A_Asset_Addition } } + /** + * @return true if assert value <= 0 + */ public boolean hasZeroValues() { return @@ -1102,19 +1160,19 @@ public class MAssetAddition extends X_A_Asset_Addition ; } - + @Override public File createPDF () { return null; } // createPDF - + @Override public String getDocumentInfo() { return getDocumentNo() + " / " + getDateDoc(); } // getDocumentInfo - + @Override public String toString() { StringBuilder sb = new StringBuilder("@DocumentNo@: " + getDocumentNo()); @@ -1126,6 +1184,9 @@ public class MAssetAddition extends X_A_Asset_Addition return sb.toString(); } // toString + /** + * Update A_CreateAsset flag + */ private void setA_CreateAsset() { if (DOCSTATUS_Voided.equals(getDocStatus())) @@ -1161,9 +1222,12 @@ public class MAssetAddition extends X_A_Asset_Addition } } + /** + * Set C_DocType_ID value by DocBaseType (FAA) + */ private void setC_DocType_ID() { - StringBuilder sql = new StringBuilder ("SELECT C_DocType_ID FROM C_DocType ") + StringBuilder sql = new StringBuilder ("SELECT C_DocType_ID FROM C_DocType ") .append( "WHERE AD_Client_ID=? AND AD_Org_ID IN (0,").append( getAD_Org_ID()) .append( ") AND DocBaseType='FAA' ") .append( "ORDER BY AD_Org_ID DESC, IsDefault DESC"); diff --git a/org.adempiere.base/src/org/compiere/model/MAssetChange.java b/org.adempiere.base/src/org/compiere/model/MAssetChange.java index 43471b865f..b688cc910e 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetChange.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetChange.java @@ -20,14 +20,14 @@ import java.util.logging.Level; import org.compiere.util.CLogger; /** - * Asset Addition Model + * Asset Change Model (to record changes to asset) * @author Teo Sarca, SC ARHIPAC SERVICE SRL * */ public class MAssetChange extends X_A_Asset_Change { /** - * + * generated serial id */ private static final long serialVersionUID = 4083373951793617528L; @@ -35,11 +35,11 @@ public class MAssetChange extends X_A_Asset_Change private static CLogger s_log = CLogger.getCLogger(MAssetChange.class); /** - * UUID based Constructor - * @param ctx Context - * @param A_Asset_Change_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Asset_Change_UU UUID key + * @param trxName Transaction + */ public MAssetChange(Properties ctx, String A_Asset_Change_UU, String trxName) { super(ctx, A_Asset_Change_UU, trxName); } @@ -65,11 +65,12 @@ public class MAssetChange extends X_A_Asset_Change super (ctx, rs, trxName); } // MInventoryLine - /** + /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { String textDetails = getTextDetails(); @@ -79,6 +80,12 @@ public class MAssetChange extends X_A_Asset_Change return true; } // beforeSave + /** + * Create and save new MAssetChange record + * @param assetAdd + * @param assetwk + * @return MAssetChange + */ public static MAssetChange createAddition(MAssetAddition assetAdd, MDepreciationWorkfile assetwk) { MAssetChange change = new MAssetChange (assetAdd.getCtx(), 0, assetAdd.get_TrxName()); change.setAD_Org_ID(assetAdd.getAD_Org_ID()); //@win added @@ -94,6 +101,13 @@ public class MAssetChange extends X_A_Asset_Change return change; } + /** + * @param ctx + * @param changeType + * @param pos + * @param trxName + * @return MAssetChange + */ public static MAssetChange create(Properties ctx, String changeType, PO[] pos, String trxName) { return create(ctx, changeType, pos, false, trxName); } @@ -110,6 +124,15 @@ public class MAssetChange extends X_A_Asset_Change return null; } + /** + * + * @param ctx + * @param changeType + * @param pos + * @param save + * @param trxName + * @return MAssetChange + */ public static MAssetChange create(Properties ctx, String changeType, PO[] pos, boolean save, String trxName) { if (s_log.isLoggable(Level.FINE)) s_log.fine("Entering: changeType=" + changeType); if (pos == null || pos.length == 0) { @@ -129,6 +152,10 @@ public class MAssetChange extends X_A_Asset_Change return change; } + /** + * TODO + * @param po + */ public void addChanges(PO po) { if (log.isLoggable(Level.FINE)) log.fine("Entering: po=" + po); if (po == null) { @@ -137,7 +164,6 @@ public class MAssetChange extends X_A_Asset_Change // if (log.isLoggable(Level.FINE)) log.fine("Leaving: po=" + po); } - /** ARHIPAC: TEO: END ------------------------------------------------------------------ */ /** * @param ctx @@ -145,7 +171,7 @@ public class MAssetChange extends X_A_Asset_Change * @param changeType * @param trxName * @param C_AcctSchema_ID - * @return + * @return MAssetChange */ public static MAssetChange get (Properties ctx, int A_Asset_ID, String changeType, String trxName, int C_AcctSchema_ID) { diff --git a/org.adempiere.base/src/org/compiere/model/MAssetClass.java b/org.adempiere.base/src/org/compiere/model/MAssetClass.java index fc588d33b7..b8f706f5be 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetClass.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetClass.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.sql.ResultSet; @@ -12,30 +33,32 @@ import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; import org.idempiere.fa.feature.UseLifeImpl; -/** Asset Class +/** + * Asset Class * @author Teo Sarca, SC Arhipac SRL * @version $Id$ */ public class MAssetClass extends X_A_Asset_Class implements ImmutablePOSupport -{ - +{ /** - * + * generated serial id */ private static final long serialVersionUID = -7805056592418891872L; /** - * UUID based Constructor - * @param ctx Context - * @param A_Asset_Class_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Asset_Class_UU UUID key + * @param trxName Transaction + */ public MAssetClass(Properties ctx, String A_Asset_Class_UU, String trxName) { super(ctx, A_Asset_Class_UU, trxName); } /** - * + * @param ctx + * @param A_Asset_Class_ID + * @param trxName */ public MAssetClass(Properties ctx, int A_Asset_Class_ID, String trxName) { @@ -53,7 +76,7 @@ public class MAssetClass extends X_A_Asset_Class implements ImmutablePOSupport } // MAssetClass /** - * + * Copy constructor * @param copy */ public MAssetClass(MAssetClass copy) @@ -62,7 +85,7 @@ public class MAssetClass extends X_A_Asset_Class implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -72,7 +95,7 @@ public class MAssetClass extends X_A_Asset_Class implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -83,10 +106,11 @@ public class MAssetClass extends X_A_Asset_Class implements ImmutablePOSupport copyPO(copy); } - /** */ + /** immutable cache */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 20); - /** Get Asset Class from cache + /** + * Get Asset Class from cache * @param id A_Asset_Class_ID * @return MAssetClass or null if not found */ @@ -94,7 +118,8 @@ public class MAssetClass extends X_A_Asset_Class implements ImmutablePOSupport return get(Env.getCtx(), id); } - /** Get Asset Class from cache + /** + * Get Asset Class from cache (immutable) * @param ctx context * @param id A_Asset_Class_ID * @return MAssetClass or null if not found @@ -118,7 +143,9 @@ public class MAssetClass extends X_A_Asset_Class implements ImmutablePOSupport } // get /** - * + * Get MAssetClass via Value from DB + * @param ctx + * @param value */ public static MAssetClass get(Properties ctx, String value) { @@ -131,7 +158,7 @@ public class MAssetClass extends X_A_Asset_Class implements ImmutablePOSupport } // get /** - * + * Set description value */ public void setDescription() { StringBuilder description = new StringBuilder(); @@ -148,7 +175,7 @@ public class MAssetClass extends X_A_Asset_Class implements ImmutablePOSupport } /** - * + * Set fixed asset group level */ public void setLevels() { setMFX_Grupa(0); @@ -176,7 +203,8 @@ public class MAssetClass extends X_A_Asset_Class implements ImmutablePOSupport } /** - * + * @param serviceDate + * @return Life period min or life period 2004 min */ public int getA_Life_Period_Min(Timestamp serviceDate) { Calendar cal = TimeUtil.getCalendar(serviceDate); @@ -188,7 +216,13 @@ public class MAssetClass extends X_A_Asset_Class implements ImmutablePOSupport } } - /** Validate */ + /** + * Validate A_Life_Period of asset + * @param saveError + * @param A_Life_Period Useful life period in months + * @param serviceDate + * @return error message or empty string + */ public String validate(boolean saveError, int A_Life_Period, Timestamp serviceDate) { log.fine("Entering"); int A_Life_Period_Min = 0; @@ -218,21 +252,22 @@ public class MAssetClass extends X_A_Asset_Class implements ImmutablePOSupport return errmsg; } - log.fine("Leaving: OK!"); return ""; } - /** Validate UseLifeImpl model + /** + * Validate UseLifeImpl model + * @param asset */ public boolean validate(UseLifeImpl asset) { if (log.isLoggable(Level.FINE)) log.fine("Entering: UseLifeImpl=" + asset); if (!asset.isFiscal()) { - log.fine("Leaving: fiscal=false [RETURN TRUE]"); + if(log.isLoggable(Level.FINE)) log.fine("Leaving: fiscal=false [RETURN TRUE]"); return true; } else { - log.fine("asset is fiscal"); + if(log.isLoggable(Level.FINE)) log.fine("asset is fiscal"); } int A_Life_Period = asset.getUseLifeMonths(); @@ -244,16 +279,15 @@ public class MAssetClass extends X_A_Asset_Class implements ImmutablePOSupport return ok; } - /** Depreciated check - * + /** + * Depreciated check + * @return true if assert have been fully depreciated */ public boolean isDepreciated() { return !(getA_Life_Period_Min() == 0 && getA_Life_Period_Max() ==0); } - /** - * - */ + @Override public boolean beforeSave (boolean newRecord) { setDescription(); if (is_ValueChanged("Value")) { diff --git a/org.adempiere.base/src/org/compiere/model/MAssetDelivery.java b/org.adempiere.base/src/org/compiere/model/MAssetDelivery.java index c05282e1d6..0d23420b67 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetDelivery.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetDelivery.java @@ -34,16 +34,16 @@ import org.compiere.util.Util; public class MAssetDelivery extends X_A_Asset_Delivery { /** - * + * generated serial id */ private static final long serialVersionUID = -1731010685101745675L; /** - * UUID based Constructor - * @param ctx Context - * @param A_Asset_Delivery_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Asset_Delivery_UU UUID key + * @param trxName Transaction + */ public MAssetDelivery(Properties ctx, String A_Asset_Delivery_UU, String trxName) { super(ctx, A_Asset_Delivery_UU, trxName); if (Util.isEmpty(A_Asset_Delivery_UU)) @@ -140,6 +140,7 @@ public class MAssetDelivery extends X_A_Asset_Delivery * String representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MAssetDelivery[") diff --git a/org.adempiere.base/src/org/compiere/model/MAssetDisposed.java b/org.adempiere.base/src/org/compiere/model/MAssetDisposed.java index ce746f449d..903cdac7b2 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetDisposed.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetDisposed.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.io.File; @@ -18,8 +39,6 @@ import org.idempiere.fa.exceptions.AssetNotSupportedException; import org.idempiere.fa.exceptions.AssetStatusChangedException; import org.idempiere.fa.util.POCacheLocal; - - /** * Asset Disposal Model * @author Teo Sarca, SC ARHIPAC SERVICE SRL @@ -28,22 +47,27 @@ public class MAssetDisposed extends X_A_Asset_Disposed implements DocAction { /** - * + * generated serial id */ private static final long serialVersionUID = 1763997880662445638L; /** - * UUID based Constructor - * @param ctx Context - * @param A_Asset_Disposed_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Asset_Disposed_UU UUID key + * @param trxName Transaction + */ public MAssetDisposed(Properties ctx, String A_Asset_Disposed_UU, String trxName) { super(ctx, A_Asset_Disposed_UU, trxName); if (Util.isEmpty(A_Asset_Disposed_UU)) setInitialDefaults(); } + /** + * @param ctx + * @param A_Asset_Disposed_ID + * @param trxName + */ public MAssetDisposed (Properties ctx, int A_Asset_Disposed_ID, String trxName) { super (ctx, A_Asset_Disposed_ID, trxName); @@ -59,13 +83,20 @@ implements DocAction setProcessing (false); } - //@win: autocreate asset disposal from ar invoice + /** + * Create asset disposal from AR invoice + * @param invLine + * @return MAssetDisposed + */ public static MAssetDisposed createAssetDisposed (MInvoiceLine invLine) { MAssetDisposed assetDisposed = new MAssetDisposed(invLine); assetDisposed.dump(); return assetDisposed; } + /** + * @param invLine + */ private MAssetDisposed (MInvoiceLine invLine) { this(invLine.getCtx(),0,invLine.get_TrxName()); if (log.isLoggable(Level.FINEST)) log.finest("Entering: Project=" + invLine); @@ -82,28 +113,45 @@ implements DocAction } private final POCacheLocal m_cacheInvoiceLine = POCacheLocal.newInstance(this, MInvoiceLine.class); + + /** + * @param requery + * @return MInvoiceLine + */ public MInvoiceLine getM_InvoiceLine(boolean requery) { return m_cacheInvoiceLine.get(requery); } + + /** + * Set cached invoice line + * @param invLine + */ private void setM_InvoiceLine(MInvoiceLine invLine) { set_Value("C_InvoiceLine_ID", invLine.get_ID()); m_cacheInvoiceLine.set(invLine); } - //end @win: autocreate asset disposal from ar invoice - + + /** + * @param ctx + * @param rs + * @param trxName + */ public MAssetDisposed (Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } + /** + * @return MAsset + */ public MAsset getAsset() { return MAsset.get(getCtx(), getA_Asset_ID(), null); } - + @Override public boolean processIt (String processAction) { m_processMsg = null; @@ -116,20 +164,20 @@ implements DocAction /** Just Prepared Flag */ private boolean m_justPrepared = false; - + @Override public boolean unlockIt() { setProcessing(false); return true; } // unlockIt - + @Override public boolean invalidateIt() { return false; } // invalidateIt - + @Override public String prepareIt() { m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); @@ -140,9 +188,8 @@ implements DocAction MPeriod.testPeriodOpen(getCtx(), getDateAcct(), MDocType.DOCBASETYPE_GLDocument, getAD_Org_ID()); - //saveEx() //commented by @win updateFromAsset(this); - saveEx(get_TrxName()); //added by @win + saveEx(get_TrxName()); if (is_Changed()) { throw new AssetStatusChangedException(); @@ -167,7 +214,7 @@ implements DocAction return DocAction.STATUS_InProgress; } // prepareIt - + @Override public boolean approveIt() { if (log.isLoggable(Level.INFO)) log.info("approveIt - " + toString()); @@ -175,7 +222,7 @@ implements DocAction return true; } // approveIt - + @Override public boolean rejectIt() { if (log.isLoggable(Level.INFO)) log.info("rejectIt - " + toString()); @@ -183,7 +230,7 @@ implements DocAction return true; } // rejectIt - + @Override public String completeIt() { // Re-Check @@ -255,7 +302,6 @@ implements DocAction asset.saveEx(get_TrxName()); - // User Validation valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); if (valid != null) @@ -270,39 +316,38 @@ implements DocAction return DocAction.STATUS_Completed; } // completeIt - + @Override public boolean voidIt() { throw new AssetNotImplementedException(""); } // voidIt - + @Override public boolean closeIt() { setDocAction(DOCACTION_None); return true; } // closeIt - + @Override public boolean reverseCorrectIt() { throw new AssetNotImplementedException(""); } // reverseCorrectionIt - + @Override public boolean reverseAccrualIt() { throw new AssetNotImplementedException(""); } - + @Override public boolean reActivateIt() { throw new AssetNotImplementedException(""); } - - - + + @Override public String getSummary() { return new StringBuilder() @@ -310,31 +355,31 @@ implements DocAction .toString(); } - + @Override public String getProcessMsg() { return m_processMsg; } // getProcessMsg - + @Override public int getDoc_User_ID() { return getCreatedBy(); } - + @Override public BigDecimal getApprovalAmt() { return Env.ZERO; } - + @Override public int getC_Currency_ID() { return MClient.get(getCtx(), getAD_Client_ID()).getAcctSchema().getC_Currency_ID(); } - + @Override protected boolean beforeSave (boolean newRecord) { if (getDateAcct() == null) @@ -349,12 +394,6 @@ implements DocAction { setA_Disposed_Date(getDateAcct()); } - /* commented by @win - asset type - if (!MAssetType.isFixedAsset(getA_Asset_ID())) - { - throw new AssetException("This is not a Fixed Asset!"); - } - */ return true; } @@ -388,13 +427,13 @@ implements DocAction } } - + @Override public File createPDF () { return null; } // createPDF - + @Override public String getDocumentInfo() { return getDocumentNo(); @@ -402,13 +441,17 @@ implements DocAction /** * Check if this is a disposal (if the asset is not disposed) - * @return true if is disposal + * @return true if asset has been disposed */ public boolean isDisposal() { return !isDisposed(); } + /** + * Set asset disposal amount + * @param bean + */ public static void setA_Disposal_Amt(I_A_Asset_Disposed bean) { int precision = 2; @@ -428,6 +471,9 @@ implements DocAction bean.setExpense(Expense); } + /** + * Process disposal + */ private void createDisposal() { for (MDepreciationWorkfile assetwk : MDepreciationWorkfile.forA_Asset_ID(getCtx(), getA_Asset_ID(), get_TrxName())) diff --git a/org.adempiere.base/src/org/compiere/model/MAssetGroup.java b/org.adempiere.base/src/org/compiere/model/MAssetGroup.java index 167b798831..8ad16bcaa6 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetGroup.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetGroup.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.sql.ResultSet; @@ -13,10 +34,9 @@ import org.idempiere.cache.ImmutablePOSupport; * @author Teo Sarca, SC ARHIPAC SERVICE SRL */ public class MAssetGroup extends X_A_Asset_Group implements ImmutablePOSupport -{ - +{ /** - * + * generated serial id */ private static final long serialVersionUID = 2605166916393528396L; @@ -24,11 +44,11 @@ public class MAssetGroup extends X_A_Asset_Group implements ImmutablePOSupport private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 10, 0); /** - * UUID based Constructor - * @param ctx Context - * @param A_Asset_Group_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Asset_Group_UU UUID key + * @param trxName Transaction + */ public MAssetGroup(Properties ctx, String A_Asset_Group_UU, String trxName) { super(ctx, A_Asset_Group_UU, trxName); } @@ -54,7 +74,7 @@ public class MAssetGroup extends X_A_Asset_Group implements ImmutablePOSupport } // MAssetGroup /** - * + * Copy constructor * @param copy */ public MAssetGroup(MAssetGroup copy) @@ -63,7 +83,7 @@ public class MAssetGroup extends X_A_Asset_Group implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -73,7 +93,7 @@ public class MAssetGroup extends X_A_Asset_Group implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -85,7 +105,7 @@ public class MAssetGroup extends X_A_Asset_Group implements ImmutablePOSupport } /** - * Get Asset Group [CACHE] + * Get Asset Group [cache, immutable] * @param A_Asset_Group_ID asset group id * @return asset group or null */ @@ -95,7 +115,7 @@ public class MAssetGroup extends X_A_Asset_Group implements ImmutablePOSupport } /** - * Get Asset Group [CACHE] + * Get Asset Group [cache, immutable] * @param ctx context * @param A_Asset_Group_ID asset group id * @return asset group or null @@ -154,7 +174,7 @@ public class MAssetGroup extends X_A_Asset_Group implements ImmutablePOSupport } /** - * Update Asset + * Update Asset
    * - updates asset M_AssetGroup_ID if is null */ public static void updateAsset(SetGetModel m, int A_Asset_Group_ID) @@ -163,17 +183,15 @@ public class MAssetGroup extends X_A_Asset_Group implements ImmutablePOSupport A_Asset_Group_ID = MAssetGroup.getDefault_ID(SetGetUtil.wrap(m)); m.set_AttrValue(MAsset.COLUMNNAME_A_Asset_Group_ID, A_Asset_Group_ID); } - - //end modify by @win } - + @Override protected boolean beforeSave (boolean newRecord) { return true; } - + @Override protected boolean afterSave (boolean newRecord, boolean success) { if(!success) diff --git a/org.adempiere.base/src/org/compiere/model/MAssetGroupAcct.java b/org.adempiere.base/src/org/compiere/model/MAssetGroupAcct.java index d8865f31fa..ed4633d2a9 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetGroupAcct.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetGroupAcct.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.sql.ResultSet; @@ -17,13 +38,10 @@ public class MAssetGroupAcct extends X_A_Asset_Group_Acct implements UseLife { /** - * + * generated serial id */ private static final long serialVersionUID = -2436949294592742530L; - /** - * Get Asset Group Accountings for given group - */ /** * @param ctx * @param A_Asset_Group_ID @@ -49,6 +67,11 @@ public class MAssetGroupAcct extends X_A_Asset_Group_Acct /** * Get Asset Group Accountings for given group + * @param ctx + * @param A_Asset_Group_ID + * @param postingType + * @param trxName + * @return list of MAssetGroupAcct */ public static List forA_Asset_Group_ID(Properties ctx, int A_Asset_Group_ID, String postingType, String trxName) { @@ -65,11 +88,11 @@ public class MAssetGroupAcct extends X_A_Asset_Group_Acct } /** - * UUID based Constructor - * @param ctx Context - * @param A_Asset_Group_Acct_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Asset_Group_Acct_UU UUID key + * @param trxName Transaction + */ public MAssetGroupAcct(Properties ctx, String A_Asset_Group_Acct_UU, String trxName) { super(ctx, A_Asset_Group_Acct_UU, trxName); } @@ -99,6 +122,7 @@ public class MAssetGroupAcct extends X_A_Asset_Group_Acct /** * Get Asset Group + * @return MAssetGroup */ public MAssetGroup getParent() { @@ -110,6 +134,7 @@ public class MAssetGroupAcct extends X_A_Asset_Group_Acct return m_parent; } + @Override public Timestamp getAssetServiceDate() { return null; @@ -128,6 +153,7 @@ public class MAssetGroupAcct extends X_A_Asset_Group_Acct return newAcct; } + @Override public boolean beforeSave(boolean newRecord) { if (! UseLifeImpl.get(this).validate()) @@ -141,26 +167,37 @@ public class MAssetGroupAcct extends X_A_Asset_Group_Acct return true; } + @Override public boolean set_AttrValue(String ColumnName, Object value) { int index = get_ColumnIndex(ColumnName); if (index < 0) return false; return set_ValueNoCheck(ColumnName, value); } + + @Override public Object get_AttrValue(String ColumnName) { int index = get_ColumnIndex(ColumnName); if (index < 0) return null; return get_Value(index); } + + @Override public boolean is_AttrValueChanged(String ColumnName) { int index = get_ColumnIndex(ColumnName); if (index < 0) return false; return is_ValueChanged(index); } + /** * Get Asset Group Accountings for given group + * @param ctx + * @param A_Asset_Group_ID + * @param postingType + * @param C_AcctSchema_ID + * @return MAssetGroupAcct */ public static MAssetGroupAcct forA_Asset_Group_ID(Properties ctx, int A_Asset_Group_ID, String postingType, int C_AcctSchema_ID) { @@ -169,7 +206,5 @@ public class MAssetGroupAcct extends X_A_Asset_Group_Acct .setParameters(new Object[]{A_Asset_Group_ID, postingType, C_AcctSchema_ID}) .firstOnly(); } - - } // MAssetGroupAcct diff --git a/org.adempiere.base/src/org/compiere/model/MAssetProduct.java b/org.adempiere.base/src/org/compiere/model/MAssetProduct.java index 73b4569931..65f9dbe1fb 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetProduct.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetProduct.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.math.BigDecimal; @@ -10,23 +31,26 @@ import java.util.Properties; */ public class MAssetProduct extends X_A_Asset_Product { - /** - * + * generated serial id */ private static final long serialVersionUID = 2459915999284269350L; /** - * UUID based Constructor - * @param ctx Context - * @param A_Asset_Product_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Asset_Product_UU UUID key + * @param trxName Transaction + */ public MAssetProduct(Properties ctx, String A_Asset_Product_UU, String trxName) { super(ctx, A_Asset_Product_UU, trxName); } - /** Standard Constructor */ + /** + * @param ctx + * @param A_Asset_Product_ID + * @param trxName + */ public MAssetProduct (Properties ctx, int A_Asset_Product_ID, String trxName) { super (ctx, A_Asset_Product_ID, trxName); @@ -95,7 +119,7 @@ public class MAssetProduct extends X_A_Asset_Product /** * Update given asset. - * Note: does not save asset + * Note: does not save asset. */ public void updateAsset(MAsset asset) { diff --git a/org.adempiere.base/src/org/compiere/model/MAssetReval.java b/org.adempiere.base/src/org/compiere/model/MAssetReval.java index f4a3d68328..a6644fb1d2 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetReval.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetReval.java @@ -1,6 +1,24 @@ -/** - * - */ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.io.File; @@ -16,33 +34,36 @@ import org.compiere.util.Env; import org.compiere.util.TimeUtil; import org.compiere.util.Util; - /** * @author Anca Bradau www.arhipac.ro * */ public class MAssetReval extends X_A_Asset_Reval implements DocAction -{ - +{ /** - * + * generated serial id */ private static final long serialVersionUID = -3937514008250840440L; private boolean m_justPrepared = false; /** - * UUID based Constructor - * @param ctx Context - * @param A_Asset_Reval_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Asset_Reval_UU UUID key + * @param trxName Transaction + */ public MAssetReval(Properties ctx, String A_Asset_Reval_UU, String trxName) { super(ctx, A_Asset_Reval_UU, trxName); if (Util.isEmpty(A_Asset_Reval_UU)) setInitialDefaults(); } + /** + * @param ctx + * @param X_A_Asset_Reval_ID + * @param trxName + */ public MAssetReval(Properties ctx, int X_A_Asset_Reval_ID, String trxName) { super(ctx, X_A_Asset_Reval_ID, trxName); @@ -59,21 +80,29 @@ implements DocAction setProcessed(false); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MAssetReval(Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } + @Override public boolean approveIt() { return false; } + @Override public boolean closeIt() { setDocAction(DOCACTION_None); return true; } + @Override public String prepareIt() { m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); @@ -128,7 +157,11 @@ implements DocAction setDocAction(DOCACTION_Complete); return DocAction.STATUS_InProgress; } - //return true if is last record depreciated + + /** + * @param date + * @return true if date argument equals last recorded depreciation date + */ public boolean isLastDepreciated(Timestamp date) { MDepreciationWorkfile assetwk = MDepreciationWorkfile.get(getCtx(), getA_Asset_ID(), getPostingType()); @@ -138,6 +171,7 @@ implements DocAction } + @Override public String completeIt() { if (!m_justPrepared) @@ -173,37 +207,43 @@ implements DocAction return DocAction.STATUS_Completed; } + @Override public File createPDF() { return null; } + @Override public BigDecimal getApprovalAmt() { return Env.ZERO; } + @Override public int getC_Currency_ID() { return 0; } + @Override public int getDoc_User_ID() { return getCreatedBy(); } + @Override public String getDocumentInfo() { return getDocumentNo() + "/" + getDateAcct(); } + @Override public String getProcessMsg() { return m_processMsg; } private String m_processMsg = null; - + @Override public String getSummary() { StringBuilder sb = new StringBuilder(); @@ -211,11 +251,13 @@ implements DocAction return sb.toString(); } + @Override public boolean invalidateIt() { return false; } + @Override public boolean processIt(String action) throws Exception { m_processMsg = null; @@ -223,36 +265,43 @@ implements DocAction return engine.processIt (action, getDocAction()); } - + @Override public boolean reActivateIt() { return false; } + @Override public boolean rejectIt() { return false; } + @Override public boolean reverseAccrualIt() { return false; } + @Override public boolean reverseCorrectIt() { return false; } + @Override public boolean unlockIt() { return false; } + @Override public boolean voidIt() { return false; } + + @Override public String getDocumentNo() { return null; diff --git a/org.adempiere.base/src/org/compiere/model/MAssetTransfer.java b/org.adempiere.base/src/org/compiere/model/MAssetTransfer.java index 58865a4a48..50f4d6cc7a 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetTransfer.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetTransfer.java @@ -25,7 +25,6 @@ import org.compiere.util.Env; import org.compiere.util.Util; import org.idempiere.fa.exceptions.AssetAlreadyDepreciatedException; - /** * Asset Transfer Model * @author www.arhipac.ro @@ -35,24 +34,29 @@ public class MAssetTransfer extends X_A_Asset_Transfer implements DocAction { /** - * + * generated serial id */ private static final long serialVersionUID = 2997284714883099922L; /** Just Prepared Flag */ private boolean m_justPrepared = false; /** - * UUID based Constructor - * @param ctx Context - * @param A_Asset_Transfer_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Asset_Transfer_UU UUID key + * @param trxName Transaction + */ public MAssetTransfer(Properties ctx, String A_Asset_Transfer_UU, String trxName) { super(ctx, A_Asset_Transfer_UU, trxName); if (Util.isEmpty(A_Asset_Transfer_UU)) setInitialDefaults(); } - + + /** + * @param ctx + * @param X_A_Asset_Transfer_ID + * @param trxName + */ public MAssetTransfer (Properties ctx, int X_A_Asset_Transfer_ID, String trxName) { super (ctx,X_A_Asset_Transfer_ID, trxName); @@ -69,18 +73,26 @@ implements DocAction setProcessed(false); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MAssetTransfer (Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } - + @Override protected boolean beforeSave(boolean newRecord) { setC_Period_ID(); return true; } + /** + * Set C_Period_ID value from DateAcct + */ public void setC_Period_ID() { MPeriod period = MPeriod.get(getCtx(), getDateAcct(), getAD_Org_ID(), get_TrxName()); @@ -91,52 +103,61 @@ implements DocAction setC_Period_ID(period.get_ID()); } - + @Override public boolean approveIt() { return false; } + @Override public boolean closeIt() { setDocAction(DOCACTION_None); return true; } + @Override public File createPDF() { return null; } + @Override public BigDecimal getApprovalAmt() { return Env.ZERO; } + @Override public int getC_Currency_ID() { return 0; } + @Override public int getDoc_User_ID() { return getCreatedBy(); } + @Override public String getDocumentInfo() { return getDocumentNo() + "/" + getDateAcct(); } + @Override public String getProcessMsg() { return m_processMsg; } private String m_processMsg = null; - + @Override public String getSummary() { StringBuilder sb = new StringBuilder(); sb.append("@DocumentNo@ #").append(getDocumentNo()); return sb.toString(); } + @Override public boolean invalidateIt() { return false; } + @Override public String prepareIt() { m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); @@ -196,7 +217,7 @@ implements DocAction return DocAction.STATUS_InProgress; } - + @Override public String completeIt() { // Re-Check @@ -238,38 +259,44 @@ implements DocAction return DocAction.STATUS_Completed; } - + @Override public boolean processIt(String action) throws Exception { m_processMsg = null; DocumentEngine engine = new DocumentEngine (this, getDocStatus()); return engine.processIt (action, getDocAction()); } + @Override public boolean reActivateIt() { return false; } + @Override public boolean rejectIt() { return false; } + @Override public boolean reverseAccrualIt() { return false; } + @Override public boolean reverseCorrectIt() { return false; } + @Override public boolean unlockIt() { return false; } + @Override public boolean voidIt() { return false; } - + @Override public String getDocumentNo() { // TODO Auto-generated method stub return null; diff --git a/org.adempiere.base/src/org/compiere/model/MAssetType.java b/org.adempiere.base/src/org/compiere/model/MAssetType.java index 554648ebda..e3e5b9dcd5 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetType.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetType.java @@ -15,7 +15,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MAssetType extends X_A_Asset_Type implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -5511421754249363729L; @@ -71,29 +71,37 @@ public class MAssetType extends X_A_Asset_Type implements ImmutablePOSupport } /** - * UUID based Constructor - * @param ctx Context - * @param A_Asset_Type_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Asset_Type_UU UUID key + * @param trxName Transaction + */ public MAssetType(Properties ctx, String A_Asset_Type_UU, String trxName) { super(ctx, A_Asset_Type_UU, trxName); } - /** Standard Constructor */ + /** + * @param ctx + * @param A_Asset_Type_ID + * @param trxName + */ public MAssetType (Properties ctx, int A_Asset_Type_ID, String trxName) { super (ctx, A_Asset_Type_ID, trxName); } - /** Load Constructor */ + /** + * @param ctx + * @param rs + * @param trxName + */ public MAssetType (Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } /** - * + * Copy constructor * @param copy */ public MAssetType(MAssetType copy) @@ -102,7 +110,7 @@ public class MAssetType extends X_A_Asset_Type implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -112,7 +120,7 @@ public class MAssetType extends X_A_Asset_Type implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -123,24 +131,38 @@ public class MAssetType extends X_A_Asset_Type implements ImmutablePOSupport copyPO(copy); } - /** Is Fixed Asset + /** + * @return true if this is of Fixed Asset type */ public boolean isFixedAsset() { return A_ASSET_TYPE_MFX.equals(getValue()); } + /** + * @param A_Asset_ID + * @return true if asset is of Fixed Asset type + */ public static boolean isFixedAsset(int A_Asset_ID) { MAsset asset = MAsset.get(Env.getCtx(), A_Asset_ID, null); return isFixedAsset(asset); } + /** + * @param asset + * @return true if asset is of Fixed Asset type + */ public static boolean isFixedAsset(MAsset asset) { return asset != null && A_ASSET_TYPE_MFX.equals(asset.getA_Asset_Type().getValue()); } + /** + * @param ctx + * @param A_Asset_Group_ID + * @return true if asset group is of Fixed Asset type + */ public static boolean isFixedAssetGroup(Properties ctx, int A_Asset_Group_ID) { if (A_Asset_Group_ID <= 0) @@ -155,13 +177,19 @@ public class MAssetType extends X_A_Asset_Type implements ImmutablePOSupport return assetType.isFixedAsset(); } - /** Is Inventory Object + /** + * @return true if this if of Inventory Object type */ public boolean isInventoryObject() { return A_ASSET_TYPE_INV.equals(getValue()); } - /** Convert an Yes-No-Unknown field to Boolean */ + /** + * Convert an Yes-No-Unknown field to Boolean + * @param value N=FALSE, Y=FALSE, X=default(use second character as default) + * @param useDefaults + * @return converted Boolean value or null + */ protected static Boolean getBoolean (String value, boolean useDefaults) { if (value == null || value.length() == 0) @@ -214,10 +242,10 @@ public class MAssetType extends X_A_Asset_Type implements ImmutablePOSupport * Update the given SetGetModel; Does not set A_Asset_Type_ID * @param model * @param useDefaults in case is not a concrete value, use defaults + * @return always return true */ public boolean update(SetGetModel model, boolean useDefaults) { -// boolean useDefaults = true; Boolean f = getBoolean(getIsOwned(), useDefaults); if (f != null) model.set_AttrValue("IsOwned", f); @@ -247,9 +275,17 @@ public class MAssetType extends X_A_Asset_Type implements ImmutablePOSupport return this; } - /** Callout Class */ + /** Callout Class for A_Asset_Type_ID */ public static class Callout extends CalloutEngine { + /** + * @param ctx + * @param WindowNo + * @param mTab + * @param mField + * @param value + * @return error message or empty string + */ public String assetType(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value) { if (isCalloutActive()) return ""; diff --git a/org.adempiere.base/src/org/compiere/model/MAssetUse.java b/org.adempiere.base/src/org/compiere/model/MAssetUse.java index 7dc3db64b4..8978bc700f 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetUse.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetUse.java @@ -1,28 +1,57 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; +import java.util.logging.Level; import org.compiere.util.DB; -/** Generated Model for A_Asset_Use - ** @version $Id: X_A_Asset.java,v 1.88 2004/08/27 21:26:37 jjanke Exp $ */ + +/** + * Asset use model + */ public class MAssetUse extends X_A_Asset_Use { /** - * + * generated serial id */ private static final long serialVersionUID = -1247516669047870893L; /** - * UUID based Constructor - * @param ctx Context - * @param A_Asset_Use_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Asset_Use_UU UUID key + * @param trxName Transaction + */ public MAssetUse(Properties ctx, String A_Asset_Use_UU, String trxName) { super(ctx, A_Asset_Use_UU, trxName); } - + + /** + * @param ctx + * @param A_Asset_Use_ID + * @param trxName + */ public MAssetUse (Properties ctx, int A_Asset_Use_ID, String trxName) { super (ctx, A_Asset_Use_ID, trxName); @@ -38,43 +67,34 @@ public class MAssetUse extends X_A_Asset_Use super (ctx, rs, trxName); } // MAssetUse -/** - * After Save - * @param newRecord new - * @return true - */ -protected boolean afterSave (boolean newRecord,boolean success) -{ - log.info ("afterSave"); - if (!success) - return success; - int p_A_Asset_ID = 0; - int total_unitsused = 0; - p_A_Asset_ID = getA_Asset_ID(); - - - String sql = "SELECT SUM(USEUNITS) FROM A_Asset_use WHERE A_Asset_ID=? and usedate <= getDate()"; - total_unitsused = DB.getSQLValueEx(null, sql, getA_Asset_ID()); - - MAsset asset = MAsset.get(getCtx(), p_A_Asset_ID, null); - asset.setUseUnits(total_unitsused); - asset.setProcessing(false); - asset.saveEx(); - - - MAssetChange change = new MAssetChange (getCtx(), 0,null); + @Override + protected boolean afterSave (boolean newRecord,boolean success) + { + if(log.isLoggable(Level.INFO)) log.info ("afterSave"); + if (!success) + return success; + int p_A_Asset_ID = 0; + int total_unitsused = 0; + p_A_Asset_ID = getA_Asset_ID(); + + String sql = "SELECT SUM(USEUNITS) FROM A_Asset_use WHERE A_Asset_ID=? and usedate <= getDate()"; + total_unitsused = DB.getSQLValueEx(null, sql, getA_Asset_ID()); - change.setA_Asset_ID(p_A_Asset_ID); - change.setChangeType("USE"); - change.setTextDetails(MRefList.getListDescription (getCtx(),"A_Update_Type" , "USE")); - change.setUseUnits(getUseUnits()); - change.saveEx(); - - return success; - - -} // afterSave - - + MAsset asset = MAsset.get(getCtx(), p_A_Asset_ID, null); + asset.setUseUnits(total_unitsused); + asset.setProcessing(false); + asset.saveEx(); + + MAssetChange change = new MAssetChange (getCtx(), 0,null); + + change.setA_Asset_ID(p_A_Asset_ID); + change.setChangeType("USE"); + change.setTextDetails(MRefList.getListDescription (getCtx(),"A_Update_Type" , "USE")); + change.setUseUnits(getUseUnits()); + change.saveEx(); + + return success; + + } // afterSave } diff --git a/org.adempiere.base/src/org/compiere/model/MAssignmentSlot.java b/org.adempiere.base/src/org/compiere/model/MAssignmentSlot.java index b4524ed190..554783a5eb 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssignmentSlot.java +++ b/org.adempiere.base/src/org/compiere/model/MAssignmentSlot.java @@ -28,7 +28,7 @@ import org.compiere.util.TimeUtil; /** * Assignment Slot. - * Display Information about Assignment Slot + * Display Information about Assignment Slot. * * @author Jorg Janke * @version $Id: MAssignmentSlot.java,v 1.2 2006/07/30 00:51:03 jjanke Exp $ @@ -44,7 +44,7 @@ public class MAssignmentSlot implements Comparator } // MAssignmentSlot /** - * Timeslot Constructor + * Time slot Constructor * @param startTime start time * @param endTime end time */ @@ -55,9 +55,9 @@ public class MAssignmentSlot implements Comparator } // MAssignmentSlot /** - * Timeslot Constructor - * @param startTime start time - * @param endTime end time + * Time slot Constructor + * @param startTime start time in millisecond + * @param endTime end time in millisecond */ public MAssignmentSlot (long startTime, long endTime) { @@ -96,20 +96,20 @@ public class MAssignmentSlot implements Comparator /** Not Available Code */ public static final int STATUS_NotAvailable = 0; - /** Not Available Code */ + /** Un-Available Code */ public static final int STATUS_UnAvailable = 11; - /** Not Available Code */ + /** Non-business Code */ public static final int STATUS_NonBusinessDay = 12; - /** Not Available Code */ + /** Not in slot day Code */ public static final int STATUS_NotInSlotDay = 21; - /** Not Available Code */ + /** Not in slot time Code */ public static final int STATUS_NotInSlotTime = 22; - /** Assignment Code */ + /** Not confirmed Assignment Code */ public static final int STATUS_NotConfirmed = 101; - /** Assignment Code */ + /** Confirmed Assignment Code */ public static final int STATUS_Confirmed = 102; - /** Assignment Code */ + /** Open Time Slot Code */ public static final int STATUS_TimeSlot = 100000; /** Start Time */ @@ -153,8 +153,6 @@ public class MAssignmentSlot implements Comparator /** DisplayMode */ private int m_displayMode = DISPLAY_FULL; - /*************************************************************************/ - /** * Set Status * @param status STATUS_.. @@ -174,8 +172,8 @@ public class MAssignmentSlot implements Comparator } // getStatus /** - * Is the Slot an Assignment? - * @return true if slot is an assignment + * Is this Slot an Assignment? + * @return true if this slot is an assignment */ public boolean isAssignment() { @@ -217,8 +215,6 @@ public class MAssignmentSlot implements Comparator return background ? Color.black : Color.white; } // getColor - /*************************************************************************/ - /** * Get Start time * @return start time @@ -261,8 +257,6 @@ public class MAssignmentSlot implements Comparator m_endTime = endTime; } - /*************************************************************************/ - /** * Set Assignment * @param assignment MAssignment @@ -333,8 +327,6 @@ public class MAssignmentSlot implements Comparator return m_description; } // getDescription - /*************************************************************************/ - /** * Set Y position * @param yStart zero based Y start index @@ -386,16 +378,14 @@ public class MAssignmentSlot implements Comparator } // setXPos /** - * Get X columns - * @return number of parallel columns + * Get max X columns + * @return number of max parallel columns */ public int getXMax() { return m_xMax; } // setXMax - /*************************************************************************/ - /** * Set Language * @param language language @@ -419,6 +409,7 @@ public class MAssignmentSlot implements Comparator * String representation * @return info */ + @Override public String toString() { if (m_displayMode == DISPLAY_TIME_FROM) @@ -505,8 +496,6 @@ public class MAssignmentSlot implements Comparator return sb.toString(); } // getInfo - /*************************************************************************/ - /** * Returns true if time is between start and end Time. * Date part is ignored. @@ -517,7 +506,7 @@ public class MAssignmentSlot implements Comparator * - inSlot (10:00, true) -> 1 // end time * } * @param time time of the day - * @param endTime if true, the end time is included + * @param endTime if true, the slot end time is included * @return true if within slot */ public boolean inSlot (Timestamp time, boolean endTime) @@ -582,8 +571,6 @@ public class MAssignmentSlot implements Comparator return false; } // inSlot - /*************************************************************************/ - /** * Compares its two arguments for order. Returns a negative integer, * zero, or a positive integer as the first argument is less than, equal @@ -597,6 +584,7 @@ public class MAssignmentSlot implements Comparator * @throws ClassCastException if the arguments' types prevent them from * being compared by this Comparator. */ + @Override public int compare(Object o1, Object o2) { if (!(o1 instanceof MAssignmentSlot && o2 instanceof MAssignmentSlot)) @@ -635,6 +623,7 @@ public class MAssignmentSlot implements Comparator * @see java.lang.Object#equals(java.lang.Object) * @see java.lang.Object#hashCode() */ + @Override public boolean equals(Object obj) { if (obj instanceof MAssignmentSlot) @@ -652,7 +641,7 @@ public class MAssignmentSlot implements Comparator /** * HashCode of MAssignmentSlot - * @return has code + * @return hash code of startTime+endTime+status+name+description */ public int hashCode() { diff --git a/org.adempiere.base/src/org/compiere/model/MAttachment.java b/org.adempiere.base/src/org/compiere/model/MAttachment.java index c868e43e42..b00083f35d 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttachment.java +++ b/org.adempiere.base/src/org/compiere/model/MAttachment.java @@ -38,13 +38,11 @@ import org.compiere.tools.FileUtil; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; -import org.compiere.util.MimeType; import org.compiere.util.Util; - /** * Attachment Model. - * One Attachment can have multiple entries + * One Attachment can have multiple entries (usually stored as zip files). * * @author Jorg Janke * @@ -57,12 +55,11 @@ import org.compiere.util.Util; public class MAttachment extends X_AD_Attachment { /** - * + * generated serial id */ private static final long serialVersionUID = 5615231734722570658L; /** - * * @param ctx * @param AD_Table_ID * @param Record_ID @@ -74,7 +71,7 @@ public class MAttachment extends X_AD_Attachment } /** - * Get Attachment (if there are more than one attachment it gets the first in no specific order) + * Get Attachment (if there are more than one attachment, it gets the first in no specific order) * @param ctx context * @param AD_Table_ID table * @param Record_ID record @@ -87,7 +84,7 @@ public class MAttachment extends X_AD_Attachment } // get /** - * Get Attachment (if there are more than one attachment it gets the first in no specific order) + * Get Attachment (if there are more than one attachment, it gets the first in no specific order) * @param ctx context * @param AD_Table_ID table * @param Record_ID record @@ -121,20 +118,19 @@ public class MAttachment extends X_AD_Attachment private static CLogger s_log = CLogger.getCLogger (MAttachment.class); private MStorageProvider provider; - /** - * UUID based Constructor - * @param ctx Context - * @param AD_Attachment_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Attachment_UU UUID key + * @param trxName Transaction + */ public MAttachment(Properties ctx, String AD_Attachment_UU, String trxName) { super(ctx, AD_Attachment_UU, trxName); initAttachmentStoreDetails(ctx, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param AD_Attachment_ID id @@ -148,7 +144,6 @@ public class MAttachment extends X_AD_Attachment } // MAttachment /** - * New Constructor * @param ctx context * @param AD_Table_ID table * @param Record_ID record @@ -162,7 +157,6 @@ public class MAttachment extends X_AD_Attachment } /** - * New Constructor * @param ctx context * @param AD_Table_ID table * @param Record_ID record @@ -217,7 +211,7 @@ public class MAttachment extends X_AD_Attachment public final String ATTACHMENT_FOLDER_PLACEHOLDER = "%ATTACHMENT_FOLDER%"; /** - * Get the isStoreAttachmentsOnFileSystem and attachmentPath for the client. + * Initialize storage provider * @param ctx * @param trxName */ @@ -236,6 +230,7 @@ public class MAttachment extends X_AD_Attachment * @param AD_Client_ID client * @param AD_Org_ID org */ + @Override public void setClientOrg(int AD_Client_ID, int AD_Org_ID) { super.setClientOrg(AD_Client_ID, AD_Org_ID); @@ -259,6 +254,7 @@ public class MAttachment extends X_AD_Attachment * Get Text Msg * @return trimmed message */ + @Override public String getTextMsg () { String msg = super.getTextMsg (); @@ -271,6 +267,7 @@ public class MAttachment extends X_AD_Attachment * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder("MAttachment["); @@ -289,8 +286,8 @@ public class MAttachment extends X_AD_Attachment } // toString /** - * Add new Data Entry - * @param file file + * Add new item to attachment + * @param file file content of new item * @return true if added */ public boolean addEntry (File file) @@ -349,9 +346,9 @@ public class MAttachment extends X_AD_Attachment } // addEntry /** - * Add new Data Entry - * @param name name - * @param data data + * Add new item to attachment + * @param name name of new item + * @param data data content of new item * @return true if added */ public boolean addEntry (String name, byte[] data) @@ -362,7 +359,7 @@ public class MAttachment extends X_AD_Attachment } // addEntry /** - * Add Entry + * Add item to attachment * @param item attachment entry * @return true if added */ @@ -411,7 +408,7 @@ public class MAttachment extends X_AD_Attachment /** * Get Attachment Entries as array - * @return array or null + * @return array of attachment item or null */ public MAttachmentEntry[] getEntries () { @@ -426,7 +423,7 @@ public class MAttachment extends X_AD_Attachment * Delete Entry * * @param index - * index + * index of item to delete * @return true if deleted */ public boolean deleteEntry(int index) { @@ -456,13 +453,12 @@ public class MAttachment extends X_AD_Attachment loadLOBData(); return m_items.size(); } // getEntryCount - - + /** * Get Entry Name * * @param index - * index + * index of item * @return name or null */ public String getEntryName(int index) { @@ -482,7 +478,7 @@ public class MAttachment extends X_AD_Attachment } // getEntryName /** - * Dump Entry Names + * Dump Entry Names to standard out */ public void dumpEntryNames() { @@ -503,7 +499,7 @@ public class MAttachment extends X_AD_Attachment /** * Get Entry Data - * @param index index + * @param index index of item * @return data or null */ public byte[] getEntryData (int index) @@ -516,9 +512,9 @@ public class MAttachment extends X_AD_Attachment /** * Get Entry File with name - * @param index index + * @param index index of item * @param fileName optional file name - * @return file + * @return file or null */ public File getEntryFile (int index, String fileName) { @@ -530,9 +526,9 @@ public class MAttachment extends X_AD_Attachment /** * Get Entry File with name - * @param index index + * @param index index of item * @param file file - * @return file + * @return file or null */ public File getEntryFile (int index, File file) { @@ -543,7 +539,7 @@ public class MAttachment extends X_AD_Attachment } // getEntryFile /** - * Save Entry Data in Zip File format + * Save attachment content through storage provider * @return true if saved */ private boolean saveLOBData() @@ -555,7 +551,7 @@ public class MAttachment extends X_AD_Attachment } /** - * Load Data into local m_data + * Ask storage provider to load attachment data into local m_data * @return true if success */ private boolean loadLOBData () @@ -571,6 +567,7 @@ public class MAttachment extends X_AD_Attachment * @param newRecord new * @return true if can be saved */ + @Override protected boolean beforeSave (boolean newRecord) { if (Util.isEmpty(getTitle())) @@ -585,7 +582,7 @@ public class MAttachment extends X_AD_Attachment } // beforeSave /** - * Delete Entry Data in Zip File format + * Ask storage provider to remove attachment content * @return true if saved */ @Override @@ -599,56 +596,10 @@ public class MAttachment extends X_AD_Attachment return true; } // postDelete - /************************************************************************** - * Test - * @param args ignored - */ - public static void main (String[] args) - { - // System.setProperty("javax.activation.debug", "true"); - - System.out.println(MimeType.getMimeType("data.xls")); - System.out.println(MimeType.getMimeType("data.cvs")); - System.out.println(MimeType.getMimeType("data.txt")); - System.out.println(MimeType.getMimeType("data.log")); - System.out.println(MimeType.getMimeType("data.html")); - System.out.println(MimeType.getMimeType("data.htm")); - System.out.println(MimeType.getMimeType("data.png")); - System.out.println(MimeType.getMimeType("data.gif")); - System.out.println(MimeType.getMimeType("data.jpg")); - System.out.println(MimeType.getMimeType("data.xml")); - System.out.println(MimeType.getMimeType("data.rtf")); - - System.exit(0); - - org.compiere.Adempiere.startupEnvironment(true); - MAttachment att = new MAttachment(Env.getCtx(), 100, 0, null); - att.addEntry(new File ("C:\\Adempiere\\Dev.properties")); - att.addEntry(new File ("C:\\Adempiere\\index.html")); - att.saveEx(); - System.out.println (att); - att.dumpEntryNames(); - int AD_Attachment_ID = att.getAD_Attachment_ID(); - // - System.out.println ("==========================================="); - att = new MAttachment (Env.getCtx(), AD_Attachment_ID, null); - System.out.println (att); - att.dumpEntryNames(); - System.out.println ("==========================================="); - MAttachmentEntry[] entries = att.getEntries(); - for (int i = 0; i < entries.length; i++) - { - MAttachmentEntry entry = entries[i]; - entry.dump(); - } - System.out.println ("==========================================="); - att.delete(true); - } // main - /** * Update existing entry - * @param i - * @param file + * @param i index of item + * @param file file content of item * @return true if success, false otherwise */ public boolean updateEntry(int i, File file) @@ -689,8 +640,8 @@ public class MAttachment extends X_AD_Attachment /** * Update existing entry - * @param i - * @param data + * @param i index of item + * @param data byte[] content of item * @return true if success, false otherwise */ public boolean updateEntry(int i, byte[] data) @@ -718,7 +669,7 @@ public class MAttachment extends X_AD_Attachment /** * IDEMPIERE-530 - * Get the attachment ID based on table_id and record_id + * Get the attachment ID based on table_id and record_uu * @param Table_ID * @param Record_UU record UUID * @return AD_Attachment_ID @@ -729,6 +680,10 @@ public class MAttachment extends X_AD_Attachment return attachid; } + /** + * Save attachment as zip file + * @return zip file + */ public File saveAsZip() { if (getEntryCount() < 1) { return null; @@ -785,8 +740,8 @@ public class MAttachment extends X_AD_Attachment } /** - * Set Storage Provider - * Used temporarily for the process to migrate storage provider + * Set Storage Provider. + * Used temporarily by the storage migration process to migrate storage provider. * @param p Storage provider */ public void setStorageProvider(MStorageProvider p) { diff --git a/org.adempiere.base/src/org/compiere/model/MAttachmentEntry.java b/org.adempiere.base/src/org/compiere/model/MAttachmentEntry.java index 8b8d8c7152..07f7c0fccd 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttachmentEntry.java +++ b/org.adempiere.base/src/org/compiere/model/MAttachmentEntry.java @@ -28,7 +28,6 @@ import java.util.logging.Level; import org.compiere.util.CLogger; import org.compiere.util.MimeType; - /** * Individual Attachment Entry of MAttachment * @@ -49,7 +48,7 @@ public class MAttachmentEntry setName (name); setData (data); setIndex(index); - } // MAttachmentItem + } // MAttachmentEntry /** * Attachment Entry @@ -59,10 +58,10 @@ public class MAttachmentEntry public MAttachmentEntry (String name, byte[] data) { this (name, data, 0); - } // MAttachmentItem + } // MAttachmentEntry /** - * Constructor for delayed load + * Constructor for delayed loading of content * @param name * @param index * @param ds lazy data source @@ -112,7 +111,7 @@ public class MAttachmentEntry private boolean m_isUpdated = false; /** - * @return Returns the data. + * @return byte[] content */ public byte[] getData () { @@ -121,6 +120,7 @@ public class MAttachmentEntry } return m_data; } + /** * @param data The data to set. */ @@ -129,8 +129,9 @@ public class MAttachmentEntry m_data = data; m_isDataSet = true; } + /** - * @return Returns the name. + * @return name of entry */ public String getName () { @@ -149,8 +150,8 @@ public class MAttachmentEntry } // setName /** - * Get Attachment Index - * @return int index + * Get entry Index + * @return entry index */ public int getIndex() { @@ -161,6 +162,7 @@ public class MAttachmentEntry * To String * @return name */ + @Override public String toString () { return m_name; @@ -197,10 +199,9 @@ public class MAttachmentEntry sb.append(" - ").append(getContentType()); return sb.toString(); } // toStringX - /** - * Dump Data + * Dump Data to standard out */ public void dump () { @@ -294,8 +295,8 @@ public class MAttachmentEntry } // isPDF /** - * Is attachment entry a Graphic - * @return true if *.gif, *.jpg, *.png + * Is attachment entry an image + * @return true if *.gif, *.jpg or *.png */ public boolean isGraphic() { @@ -324,6 +325,10 @@ public class MAttachmentEntry return new ByteArrayInputStream(getData()); } // getInputStream + /** + * Set entry index + * @param index + */ public void setIndex(int index) { if (index > 0) m_index = index; @@ -355,15 +360,17 @@ public class MAttachmentEntry return m_ds; } - /** Set the updated property + /** + * Set the updated property * @param updated */ public void setUpdated(boolean updated) { m_isUpdated = updated; } - /** Get the updated property - * @return updated + /** + * Get the updated property + * @return true if updated */ public boolean isUpdated() { return m_isUpdated; diff --git a/org.adempiere.base/src/org/compiere/model/MAttachmentNote.java b/org.adempiere.base/src/org/compiere/model/MAttachmentNote.java index 75840815ff..ccfd8911e4 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttachmentNote.java +++ b/org.adempiere.base/src/org/compiere/model/MAttachmentNote.java @@ -30,16 +30,16 @@ import org.compiere.util.Env; public class MAttachmentNote extends X_AD_AttachmentNote { /** - * + * generated serial id */ private static final long serialVersionUID = 5902789937430504039L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_AttachmentNote_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_AttachmentNote_UU UUID key + * @param trxName Transaction + */ public MAttachmentNote(Properties ctx, String AD_AttachmentNote_UU, String trxName) { super(ctx, AD_AttachmentNote_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MAttribute.java b/org.adempiere.base/src/org/compiere/model/MAttribute.java index a0c9b558e5..785bd3ad76 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttribute.java +++ b/org.adempiere.base/src/org/compiere/model/MAttribute.java @@ -43,7 +43,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MAttribute extends X_M_Attribute implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 8266487405778526776L; @@ -94,11 +94,11 @@ public class MAttribute extends X_M_Attribute implements ImmutablePOSupport } // getOfClient /** - * UUID based Constructor - * @param ctx Context - * @param M_Attribute_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_Attribute_UU UUID key + * @param trxName Transaction + */ public MAttribute(Properties ctx, String M_Attribute_UU, String trxName) { super(ctx, M_Attribute_UU, trxName); if (Util.isEmpty(M_Attribute_UU)) @@ -139,7 +139,7 @@ public class MAttribute extends X_M_Attribute implements ImmutablePOSupport } // MAttribute /** - * + * Copy constructor * @param copy */ public MAttribute(MAttribute copy) @@ -148,7 +148,7 @@ public class MAttribute extends X_M_Attribute implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -158,7 +158,7 @@ public class MAttribute extends X_M_Attribute implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -175,8 +175,8 @@ public class MAttribute extends X_M_Attribute implements ImmutablePOSupport } /** - * Get Values if List - * @return Values or null if not list + * Get Values List + * @return Values or null if not of type list */ public MAttributeValue[] getMAttributeValues() { @@ -196,6 +196,11 @@ public class MAttribute extends X_M_Attribute implements ImmutablePOSupport return m_values; } // getValues + /** + * @param ctx + * @param M_Attribute_ID + * @return MAttribute + */ public static MAttribute get(Properties ctx, int M_Attribute_ID) { Integer key = Integer.valueOf(M_Attribute_ID); @@ -211,7 +216,7 @@ public class MAttribute extends X_M_Attribute implements ImmutablePOSupport return retValue; } // get - /************************************************************************** + /** * Get Attribute Instance * @param M_AttributeSetInstance_ID attribute set instance * @return Attribute Instance or null @@ -227,9 +232,9 @@ public class MAttribute extends X_M_Attribute implements ImmutablePOSupport } // getAttributeInstance /** - * Set Attribute Instance + * Update or create new Attribute Instance * @param M_AttributeSetInstance_ID id - * @param value value + * @param value attribute value */ public void setMAttributeInstance (int M_AttributeSetInstance_ID, MAttributeValue value) { @@ -261,7 +266,7 @@ public class MAttribute extends X_M_Attribute implements ImmutablePOSupport } // setAttributeInstance /** - * Set Attribute Instance + * Update or create new Attribute Instance * @param M_AttributeSetInstance_ID id * @param value string value */ @@ -277,9 +282,9 @@ public class MAttribute extends X_M_Attribute implements ImmutablePOSupport } // setAttributeInstance /** - * Set Attribute Instance + * Update or create new Attribute Instance * @param M_AttributeSetInstance_ID id - * @param value number value + * @param value numeric value */ public void setMAttributeInstance (int M_AttributeSetInstance_ID, BigDecimal value) { @@ -293,9 +298,9 @@ public class MAttribute extends X_M_Attribute implements ImmutablePOSupport } // setAttributeInstance /** - * Set Attribute Instance + * Update or create new Attribute Instance * @param M_AttributeSetInstance_ID id - * @param value int + * @param value integer value */ public void setMAttributeInstance (int M_AttributeSetInstance_ID, int value) { @@ -309,7 +314,7 @@ public class MAttribute extends X_M_Attribute implements ImmutablePOSupport } // setAttributeInstance /** - * Set Attribute Instance + * Update or create new Attribute Instance * * @param M_AttributeSetInstance_ID id * @param value KeyNamePair @@ -325,7 +330,7 @@ public class MAttribute extends X_M_Attribute implements ImmutablePOSupport } // setAttributeInstance /** - * Set Attribute Instance + * Update or create new Attribute Instance * * @param M_AttributeSetInstance_ID id * @param value Timestamp @@ -345,6 +350,7 @@ public class MAttribute extends X_M_Attribute implements ImmutablePOSupport * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MAttribute["); @@ -377,6 +383,7 @@ public class MAttribute extends X_M_Attribute implements ImmutablePOSupport * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -396,6 +403,9 @@ public class MAttribute extends X_M_Attribute implements ImmutablePOSupport return success; } // afterSave + /** + * @return true if it is of type reference + */ public boolean isAttributeValueTypeReference() { return ATTRIBUTEVALUETYPE_Reference.equals(getAttributeValueType()); diff --git a/org.adempiere.base/src/org/compiere/model/MAttributeInstance.java b/org.adempiere.base/src/org/compiere/model/MAttributeInstance.java index 70b8de5958..ab55b7a89b 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttributeInstance.java +++ b/org.adempiere.base/src/org/compiere/model/MAttributeInstance.java @@ -26,7 +26,7 @@ import org.compiere.util.DisplayType; import org.compiere.util.KeyNamePair; /** - * Product Attribute Set + * Attribute Instance Model (Instance of attribute for a particular attribute set instance record) * * @author Jorg Janke * @version $Id: MAttributeInstance.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $ @@ -34,23 +34,22 @@ import org.compiere.util.KeyNamePair; public class MAttributeInstance extends X_M_AttributeInstance { /** - * + * generated serial id */ private static final long serialVersionUID = 5697542928282761922L; /** - * UUID based Constructor - * @param ctx Context - * @param M_AttributeInstance_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_AttributeInstance_UU UUID key + * @param trxName Transaction + */ public MAttributeInstance(Properties ctx, String M_AttributeInstance_UU, String trxName) { super(ctx, M_AttributeInstance_UU, trxName); } /** - * Persistency Constructor * @param ctx context * @param ignored ignored * @param trxName transaction @@ -180,6 +179,12 @@ public class MAttributeInstance extends X_M_AttributeInstance setValueKeyNamePair(value); } // MAttributeInstance + /** + * @param ctx + * @param M_AttributeInstance_ID + * @param trxName + * @param virtualColumns + */ public MAttributeInstance(Properties ctx, int M_AttributeInstance_ID, String trxName, String... virtualColumns) { super(ctx, M_AttributeInstance_ID, trxName, virtualColumns); } @@ -272,7 +277,7 @@ public class MAttributeInstance extends X_M_AttributeInstance /** * Get Value as Integer * - * @return + * @return integer value */ public int getValueInt() { @@ -297,6 +302,7 @@ public class MAttributeInstance extends X_M_AttributeInstance * String Representation * @return info */ + @Override public String toString() { return getValue(); diff --git a/org.adempiere.base/src/org/compiere/model/MAttributeSet.java b/org.adempiere.base/src/org/compiere/model/MAttributeSet.java index 9ad60b16f3..c83cc17705 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttributeSet.java +++ b/org.adempiere.base/src/org/compiere/model/MAttributeSet.java @@ -43,12 +43,12 @@ import org.idempiere.cache.ImmutablePOSupport; public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -6570475541239019293L; /** - * Get MAttributeSet from Cache + * Get MAttributeSet from Cache (Immutable) * @param M_AttributeSet_ID id * @return MAttributeSet */ @@ -58,7 +58,7 @@ public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSuppor } /** - * Get MAttributeSet from Cache + * Get MAttributeSet from Cache (Immutable) * @param ctx context * @param M_AttributeSet_ID id * @return MAttributeSet @@ -98,11 +98,11 @@ public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSuppor /** - * UUID based Constructor - * @param ctx Context - * @param M_AttributeSet_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_AttributeSet_UU UUID key + * @param trxName Transaction + */ public MAttributeSet(Properties ctx, String M_AttributeSet_UU, String trxName) { super(ctx, M_AttributeSet_UU, trxName); if (Util.isEmpty(M_AttributeSet_UU)) @@ -149,7 +149,7 @@ public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSuppor } // MAttributeSet /** - * + * Copy constructor * @param copy */ public MAttributeSet(MAttributeSet copy) @@ -158,7 +158,7 @@ public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSuppor } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -168,7 +168,7 @@ public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSuppor } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -197,8 +197,8 @@ public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSuppor private MSerNoCtlExclude[] m_excludeSerNos = null; /** - * Get Attribute Array - * @param instanceAttributes true if for instance + * Get instance or product attributes + * @param instanceAttributes true for instance attributes, false for product attributes * @return instance or product attribute array */ public MAttribute[] getMAttributes (boolean instanceAttributes) @@ -297,9 +297,9 @@ public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSuppor } // isMandatoryShipping /** - * Exclude column entry - * @param AD_Column_ID column - * @param isSOTrx sales order + * Check if mandatory checking is excluded for a table + * @param AD_Column_ID column of table to check + * @param isSOTrx true for sales transactions, false otherwise * @return true if excluded */ public boolean excludeEntry (int AD_Column_ID, boolean isSOTrx) @@ -309,9 +309,9 @@ public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSuppor } // excludeEntry /** - * Exclude table entry + * Check if mandatory checking is excluded for a table * @param AD_Table_ID column - * @param isSOTrx sales order + * @param isSOTrx true for sales transactions, false otherwise * @return true if excluded */ public boolean excludeTableEntry (int AD_Table_ID, boolean isSOTrx) @@ -330,6 +330,9 @@ public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSuppor return false; } // excludeTableEntry + /** + * Load MAttributeSetExclude records + */ private void loadExcludes() { if (m_excludes == null) { @@ -344,8 +347,8 @@ public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSuppor } /** - * Exclude Lot creation - * @param AD_Column_ID column + * Check if Lot creation is excluded for a table + * @param AD_Column_ID column of table to check * @param isSOTrx SO * @return true if excluded */ @@ -378,9 +381,9 @@ public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSuppor } // isExcludeLot /** - * Exclude SerNo creation - * @param AD_Column_ID column - * @param isSOTrx SO + * Check if SerNo creation is excluded for a table + * @param AD_Column_ID column of table to check + * @param isSOTrx true for sales transactions, false otherwise * @return true if excluded */ public boolean isExcludeSerNo (int AD_Column_ID, boolean isSOTrx) @@ -413,7 +416,7 @@ public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSuppor /** * Get Lot Char Start - * @return defined or \u00ab + * @return defined start character or \u00ab */ public String getLotCharStart() { @@ -425,7 +428,7 @@ public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSuppor /** * Get Lot Char End - * @return defined or \u00bb + * @return defined end character or \u00bb */ public String getLotCharEnd() { @@ -437,7 +440,7 @@ public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSuppor /** * Get SerNo Char Start - * @return defined or # + * @return defined start character or # */ public String getSerNoCharStart() { @@ -449,7 +452,7 @@ public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSuppor /** * Get SerNo Char End - * @return defined or none + * @return defined end character or empty string */ public String getSerNoCharEnd() { @@ -458,14 +461,14 @@ public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSuppor return s; return ""; } // getSerNoCharEnd - - + /** - * Before Save. + * Before Save.
    * - set instance attribute flag * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (!isInstanceAttribute() @@ -476,12 +479,13 @@ public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSuppor /** - * After Save. + * After Save.
    * - Verify Instance Attribute * @param newRecord new * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { // Set Instance Attribute @@ -544,7 +548,6 @@ public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSuppor } /** - * * @return Arrays of {@link MAttributeUse} */ public MAttributeUse[] getMAttributeUse() diff --git a/org.adempiere.base/src/org/compiere/model/MAttributeSetExclude.java b/org.adempiere.base/src/org/compiere/model/MAttributeSetExclude.java index bce0428e8b..6b1f0e7e22 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttributeSetExclude.java +++ b/org.adempiere.base/src/org/compiere/model/MAttributeSetExclude.java @@ -37,16 +37,16 @@ import org.compiere.util.Env; public class MAttributeSetExclude extends X_M_AttributeSetExclude { /** - * + * generated serial id */ private static final long serialVersionUID = -2977401481745176882L; /** - * UUID based Constructor - * @param ctx Context - * @param M_AttributeSetExclude_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_AttributeSetExclude_UU UUID key + * @param trxName Transaction + */ public MAttributeSetExclude(Properties ctx, String M_AttributeSetExclude_UU, String trxName) { super(ctx, M_AttributeSetExclude_UU, trxName); } @@ -70,7 +70,7 @@ public class MAttributeSetExclude extends X_M_AttributeSetExclude { } /** - * + * Copy constructor * @param copy */ public MAttributeSetExclude(MAttributeSetExclude copy) { @@ -78,7 +78,7 @@ public class MAttributeSetExclude extends X_M_AttributeSetExclude { } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -87,7 +87,7 @@ public class MAttributeSetExclude extends X_M_AttributeSetExclude { } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MAttributeSetInstance.java b/org.adempiere.base/src/org/compiere/model/MAttributeSetInstance.java index 10e172d437..17a7eb50d0 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttributeSetInstance.java +++ b/org.adempiere.base/src/org/compiere/model/MAttributeSetInstance.java @@ -36,23 +36,22 @@ import org.compiere.util.TimeUtil; * @author Jorg Janke * @version $Id: MAttributeSetInstance.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $ * - * @author Teo Sarca, www.arhipac.ro + * @author Teo Sarca, www.arhipac.ro *
  • BF [ 2675699 ] MAttributeSetInstance.create should create Lot/Serial/Guaran */ public class MAttributeSetInstance extends X_M_AttributeSetInstance { /** - * + * generated serial id */ private static final long serialVersionUID = -7870720973216607658L; - /** - * Get Attribute Set Instance from ID or Product + * Get Attribute Set Instance from M_AttributeSetInstance_ID or create new MAttributeSetInstance for M_Product_ID * @param ctx context - * @param M_AttributeSetInstance_ID id or 0 - * @param M_Product_ID required if id is 0 - * @return Attribute Set Instance or null if error + * @param M_AttributeSetInstance_ID M_AttributeSetInstance_ID or 0 + * @param M_Product_ID required if M_AttributeSetInstance_ID is 0 + * @return Attribute Set Instance or null */ public static MAttributeSetInstance get (Properties ctx, int M_AttributeSetInstance_ID, int M_Product_ID) @@ -64,7 +63,7 @@ public class MAttributeSetInstance extends X_M_AttributeSetInstance if (s_log.isLoggable(Level.FINE)) s_log.fine("From M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID); return new MAttributeSetInstance (ctx, M_AttributeSetInstance_ID, null); } - // Get new from Product + // Create new MAttributeSetInstance from Product if (s_log.isLoggable(Level.FINE)) s_log.fine("From M_Product_ID=" + M_Product_ID); if (M_Product_ID == 0) return null; @@ -100,19 +99,18 @@ public class MAttributeSetInstance extends X_M_AttributeSetInstance } // get private static CLogger s_log = CLogger.getCLogger (MAttributeSetInstance.class); - /** - * UUID based Constructor - * @param ctx Context - * @param M_AttributeSetInstance_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_AttributeSetInstance_UU UUID key + * @param trxName Transaction + */ public MAttributeSetInstance(Properties ctx, String M_AttributeSetInstance_UU, String trxName) { super(ctx, M_AttributeSetInstance_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param M_AttributeSetInstance_ID id @@ -165,7 +163,7 @@ public class MAttributeSetInstance extends X_M_AttributeSetInstance /** * Get Attribute Set - * @return Attrbute Set or null + * @return Attribute Set or null */ public MAttributeSet getMAttributeSet() { @@ -175,12 +173,14 @@ public class MAttributeSetInstance extends X_M_AttributeSetInstance } // getMAttributeSet /** - * Set Description. - * - Product Values - * - Instance Values - * - SerNo = #123 - * - Lot = \u00ab123\u00bb - * - GuaranteeDate = 10/25/2003 + *
    +	 *  Set Description.
    +	 *  - Product Values
    +	 *  - Instance Values
    +	 *  - SerNo = #123
    +	 *  - Lot   = \u00ab123\u00bb
    +	 *  - GuaranteeDate = 10/25/2003
    +	 *  
    */ public void setDescription() { @@ -246,7 +246,6 @@ public class MAttributeSetInstance extends X_M_AttributeSetInstance setDescription (sb.toString()); } // setDescription - /** * Get Guarantee Date * @param getNew if true calculates/sets guarantee date @@ -281,8 +280,8 @@ public class MAttributeSetInstance extends X_M_AttributeSetInstance /** * Create Lot - * @param M_Product_ID product used if new - * @return lot info + * @param M_Product_ID product + * @return KeyNamePair(M_Lot_ID,Name) */ public KeyNamePair createLot (int M_Product_ID) { @@ -300,7 +299,7 @@ public class MAttributeSetInstance extends X_M_AttributeSetInstance } // createLot /** - * To to find lot and set Lot/ID + * To find lot and set Lot/ID * @param Lot lot * @param M_Product_ID product */ @@ -314,9 +313,9 @@ public class MAttributeSetInstance extends X_M_AttributeSetInstance } // setLot /** - * Exclude Lot creation - * @param AD_Column_ID column - * @param isSOTrx SO + * Check is Lot creation excluded for a table + * @param AD_Column_ID column of table to check + * @param isSOTrx true for sales transaction, false otherwise * @return true if excluded */ public boolean isExcludeLot (int AD_Column_ID, boolean isSOTrx) @@ -347,9 +346,9 @@ public class MAttributeSetInstance extends X_M_AttributeSetInstance } // getSerNo /** - * Exclude SerNo creation - * @param AD_Column_ID column - * @param isSOTrx SO + * Check is SerNo creation excluded for a table + * @param AD_Column_ID column of table to check + * @param isSOTrx true for sales transaction, false otherwise * @return true if excluded */ public boolean isExcludeSerNo (int AD_Column_ID, boolean isSOTrx) @@ -416,7 +415,7 @@ public class MAttributeSetInstance extends X_M_AttributeSetInstance /** * AutoGenerate and save a new ASI for given product. - * Automatically creates Lot# + * Automatically creates Lot#. * @param ctx * @param product * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MAttributeUse.java b/org.adempiere.base/src/org/compiere/model/MAttributeUse.java index 0110f61ac3..7f84f70f54 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttributeUse.java +++ b/org.adempiere.base/src/org/compiere/model/MAttributeUse.java @@ -22,7 +22,6 @@ import java.util.Properties; import org.compiere.util.DB; import org.compiere.util.Msg; - /** * Attribute Use Model * @@ -32,22 +31,21 @@ import org.compiere.util.Msg; public class MAttributeUse extends X_M_AttributeUse { /** - * + * generated serial id */ private static final long serialVersionUID = -9159120094145438975L; /** - * UUID based Constructor - * @param ctx Context - * @param M_AttributeUse_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_AttributeUse_UU UUID key + * @param trxName Transaction + */ public MAttributeUse(Properties ctx, String M_AttributeUse_UU, String trxName) { super(ctx, M_AttributeUse_UU, trxName); } /** - * Persistency Constructor * @param ctx context * @param ignored ignored * @param trxName transaction @@ -103,6 +101,7 @@ public class MAttributeUse extends X_M_AttributeUse * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -139,13 +138,13 @@ public class MAttributeUse extends X_M_AttributeUse return success; } // afterSave - - + /** * After Delete * @param success success * @return success */ + @Override protected boolean afterDelete (boolean success) { afterSave(false, success); diff --git a/org.adempiere.base/src/org/compiere/model/MAttributeValue.java b/org.adempiere.base/src/org/compiere/model/MAttributeValue.java index 0e399376aa..f1df2c0980 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttributeValue.java +++ b/org.adempiere.base/src/org/compiere/model/MAttributeValue.java @@ -30,16 +30,16 @@ import org.compiere.util.Env; public class MAttributeValue extends X_M_AttributeValue { /** - * + * generated serial id */ private static final long serialVersionUID = 4105427429027399512L; /** - * UUID based Constructor - * @param ctx Context - * @param M_AttributeValue_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_AttributeValue_UU UUID key + * @param trxName Transaction + */ public MAttributeValue(Properties ctx, String M_AttributeValue_UU, String trxName) { super(ctx, M_AttributeValue_UU, trxName); } @@ -67,7 +67,7 @@ public class MAttributeValue extends X_M_AttributeValue } // MAttributeValue /** - * + * Copy constructor * @param copy */ public MAttributeValue(MAttributeValue copy) @@ -76,7 +76,7 @@ public class MAttributeValue extends X_M_AttributeValue } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -86,7 +86,7 @@ public class MAttributeValue extends X_M_AttributeValue } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -96,10 +96,12 @@ public class MAttributeValue extends X_M_AttributeValue this(ctx, 0, trxName); copyPO(copy); } + /** * String Representation * @return info */ + @Override public String toString() { return getName(); diff --git a/org.adempiere.base/src/org/compiere/model/MAuthorizationAccount.java b/org.adempiere.base/src/org/compiere/model/MAuthorizationAccount.java index 93b9d418ae..7eacb6bc24 100644 --- a/org.adempiere.base/src/org/compiere/model/MAuthorizationAccount.java +++ b/org.adempiere.base/src/org/compiere/model/MAuthorizationAccount.java @@ -52,16 +52,16 @@ import com.google.api.client.json.gson.GsonFactory; */ public class MAuthorizationAccount extends X_AD_AuthorizationAccount { /** - * + * generated serial id */ private static final long serialVersionUID = -6808970904951033494L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_AuthorizationAccount_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_AuthorizationAccount_UU UUID key + * @param trxName Transaction + */ public MAuthorizationAccount(Properties ctx, String AD_AuthorizationAccount_UU, String trxName) { super(ctx, AD_AuthorizationAccount_UU, trxName); } @@ -90,7 +90,7 @@ public class MAuthorizationAccount extends X_AD_AuthorizationAccount { /** * Try to find a refresh token from another account with same email in the same credential - * @return + * @return refresh token or null */ public String findRefreshToken() { final String where = "AD_AuthorizationCredential_ID=? " @@ -191,7 +191,7 @@ public class MAuthorizationAccount extends X_AD_AuthorizationAccount { /** * Get a valid account from this email * @param email - * @return + * @return MAuthorizationAccount or null */ public static MAuthorizationAccount getEMailAccount(String email) { String where = "EMail=? AND IsIntersectCSV(AD_AuthorizationScopes,"+DB.TO_STRING(AD_AUTHORIZATIONSCOPES_EMail)+")='Y' AND AD_Client_ID IN (0,?) AND IsAccessRevoked='N' AND IsAuthorized='Y'"; @@ -204,7 +204,7 @@ public class MAuthorizationAccount extends X_AD_AuthorizationAccount { } /** - * + * Get authorized accounts for a user * @param AD_User_ID * @param scopes * @return list of {@link MAuthorizationAccount} @@ -220,8 +220,8 @@ public class MAuthorizationAccount extends X_AD_AuthorizationAccount { } /** - * Get an authorization token - refresh it if expired - * @return AuthorizationToken + * Get access token - refresh it if expired + * @return access token * @throws GeneralSecurityException * @throws IOException */ @@ -231,7 +231,7 @@ public class MAuthorizationAccount extends X_AD_AuthorizationAccount { } /** - * + * Get document upload services for authorized accounts * @return map of {@link MAuthorizationAccount} and {@link IUploadService} */ public static Map getUserUploadServices() { diff --git a/org.adempiere.base/src/org/compiere/model/MAuthorizationCredential.java b/org.adempiere.base/src/org/compiere/model/MAuthorizationCredential.java index 148f2476a6..cd44f071c0 100644 --- a/org.adempiere.base/src/org/compiere/model/MAuthorizationCredential.java +++ b/org.adempiere.base/src/org/compiere/model/MAuthorizationCredential.java @@ -56,16 +56,16 @@ import com.google.api.client.json.gson.GsonFactory; */ public class MAuthorizationCredential extends X_AD_AuthorizationCredential { /** - * + * generated serial id */ private static final long serialVersionUID = -5410915257751308490L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_AuthorizationCredential_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_AuthorizationCredential_UU UUID key + * @param trxName Transaction + */ public MAuthorizationCredential(Properties ctx, String AD_AuthorizationCredential_UU, String trxName) { super(ctx, AD_AuthorizationCredential_UU, trxName); } @@ -96,7 +96,7 @@ public class MAuthorizationCredential extends X_AD_AuthorizationCredential { * Create or Update an Account based on the token received * @param code * @param pinstance - * @return String message indicating success + * @return error message or null */ public String processToken(String code, MPInstance pinstance) { String msg = null; @@ -137,7 +137,7 @@ public class MAuthorizationCredential extends X_AD_AuthorizationCredential { * @param code * @param paramScope * @param pilog MPInstanceLog to set the log message and record_ID, it is not saved, the caller must save it - * @return String message indicating success + * @return error message or null */ public String processToken(Properties ctx, String code, String paramScope, MPInstanceLog pilog) { String msg = null; @@ -281,7 +281,7 @@ public class MAuthorizationCredential extends X_AD_AuthorizationCredential { /** * Get the scope URL for the authorization provider * @param scopes - * @return scope url + * @return scope urls (separated by space) */ private String findScopeUrl(String scopes) { StringBuilder urlBuilder = new StringBuilder(); diff --git a/org.adempiere.base/src/org/compiere/model/MAuthorizationProvider.java b/org.adempiere.base/src/org/compiere/model/MAuthorizationProvider.java index 66f16f1b1e..50e91ce64b 100644 --- a/org.adempiere.base/src/org/compiere/model/MAuthorizationProvider.java +++ b/org.adempiere.base/src/org/compiere/model/MAuthorizationProvider.java @@ -32,16 +32,16 @@ import java.util.Properties; */ public class MAuthorizationProvider extends X_AD_AuthorizationProvider { /** - * + * generated serial id */ private static final long serialVersionUID = -5486619727437115587L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_AuthorizationProvider_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_AuthorizationProvider_UU UUID key + * @param trxName Transaction + */ public MAuthorizationProvider(Properties ctx, String AD_AuthorizationProvider_UU, String trxName) { super(ctx, AD_AuthorizationProvider_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MAuthorizationScopeProv.java b/org.adempiere.base/src/org/compiere/model/MAuthorizationScopeProv.java index db99c7f200..511787d3dd 100644 --- a/org.adempiere.base/src/org/compiere/model/MAuthorizationScopeProv.java +++ b/org.adempiere.base/src/org/compiere/model/MAuthorizationScopeProv.java @@ -28,26 +28,26 @@ import java.sql.ResultSet; import java.util.Properties; /** - * Authorization ScopeProvider + * Authorization Scope Provider */ public class MAuthorizationScopeProv extends X_AD_AuthorizationScopeProv { /** - * + * generated serial id */ private static final long serialVersionUID = -1862019802912162492L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_AuthorizationScopeProv_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_AuthorizationScopeProv_UU UUID key + * @param trxName Transaction + */ public MAuthorizationScopeProv(Properties ctx, String AD_AuthorizationScopeProv_UU, String trxName) { super(ctx, AD_AuthorizationScopeProv_UU, trxName); } /** - * Create empty Authorization ScopeProvider + * Create empty Authorization Scope Provider * * @param ctx context * @param AD_AuthorizationScopeProv_ID ID @@ -58,7 +58,7 @@ public class MAuthorizationScopeProv extends X_AD_AuthorizationScopeProv { } // MAuthorizationScopeProv /** - * Create Authorization ScopeProvider from current row in ResultSet + * Create Authorization Scope Provider from current row in ResultSet * * @param ctx context * @param rs ResultSet diff --git a/org.adempiere.base/src/org/compiere/model/MBOM.java b/org.adempiere.base/src/org/compiere/model/MBOM.java index f4c05f4e9c..a792b15635 100644 --- a/org.adempiere.base/src/org/compiere/model/MBOM.java +++ b/org.adempiere.base/src/org/compiere/model/MBOM.java @@ -35,10 +35,11 @@ import org.idempiere.cache.ImmutablePOSupport; * @author Jorg Janke * @version $Id: MBOM.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $ */ +@Deprecated(forRemoval = true, since = "11") public class MBOM extends X_M_BOM implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -6311001492891936078L; diff --git a/org.adempiere.base/src/org/compiere/model/MBOMProduct.java b/org.adempiere.base/src/org/compiere/model/MBOMProduct.java index 4a647d5ce7..c7d186004d 100644 --- a/org.adempiere.base/src/org/compiere/model/MBOMProduct.java +++ b/org.adempiere.base/src/org/compiere/model/MBOMProduct.java @@ -34,10 +34,11 @@ import org.compiere.util.Util; * @author Jorg Janke * @version $Id: MBOMProduct.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $ */ +@Deprecated(forRemoval = true, since = "11") public class MBOMProduct extends X_M_BOMProduct { /** - * + * generated serial id */ private static final long serialVersionUID = 3431041011059529621L; diff --git a/org.adempiere.base/src/org/compiere/model/MBPBankAccount.java b/org.adempiere.base/src/org/compiere/model/MBPBankAccount.java index 0dbedd3fa9..e4c9ff85d7 100644 --- a/org.adempiere.base/src/org/compiere/model/MBPBankAccount.java +++ b/org.adempiere.base/src/org/compiere/model/MBPBankAccount.java @@ -36,7 +36,7 @@ import org.compiere.util.Util; public class MBPBankAccount extends X_C_BP_BankAccount { /** - * + * generated serial id */ private static final long serialVersionUID = 6826961806519015878L; @@ -44,7 +44,7 @@ public class MBPBankAccount extends X_C_BP_BankAccount * Get Accounts Of BPartner * @param ctx context * @param C_BPartner_ID bpartner - * @return + * @return array of MBPBankAccount */ public static MBPBankAccount[] getOfBPartner (Properties ctx, int C_BPartner_ID) { @@ -64,18 +64,18 @@ public class MBPBankAccount extends X_C_BP_BankAccount private static CLogger s_log = CLogger.getCLogger(MBPBankAccount.class); /** - * UUID based Constructor - * @param ctx Context - * @param C_BP_BankAccount_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_BP_BankAccount_UU UUID key + * @param trxName Transaction + */ public MBPBankAccount(Properties ctx, String C_BP_BankAccount_UU, String trxName) { super(ctx, C_BP_BankAccount_UU, trxName); if (Util.isEmpty(C_BP_BankAccount_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Constructor * @param ctx context * @param C_BP_BankAccount_ID BP bank account @@ -132,7 +132,7 @@ public class MBPBankAccount extends X_C_BP_BankAccount } // MBP_BankAccount /** - * + * Copy constructor * @param copy */ public MBPBankAccount(MBPBankAccount copy) @@ -141,7 +141,7 @@ public class MBPBankAccount extends X_C_BP_BankAccount } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -151,7 +151,7 @@ public class MBPBankAccount extends X_C_BP_BankAccount } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -168,7 +168,7 @@ public class MBPBankAccount extends X_C_BP_BankAccount /** * Is Direct Deposit - * @return true if dd + * @return true if account is for direct deposit */ public boolean isDirectDeposit() { @@ -182,7 +182,7 @@ public class MBPBankAccount extends X_C_BP_BankAccount /** * Is Direct Debit - * @return true if dd + * @return true if account is for direct debit */ public boolean isDirectDebit() { @@ -193,8 +193,7 @@ public class MBPBankAccount extends X_C_BP_BankAccount return true; return (s.equals(BPBANKACCTUSE_Both) || s.equals(BPBANKACCTUSE_DirectDebit)); } // isDirectDebit - - + /** * Get Bank * @return bank @@ -211,7 +210,7 @@ public class MBPBankAccount extends X_C_BP_BankAccount /** * Get Routing No - * @return routing No + * @return bank routing No */ public String getRoutingNo() { @@ -224,7 +223,7 @@ public class MBPBankAccount extends X_C_BP_BankAccount /** * Get SwiftCode - * @return SwiftCode + * @return bank Swift Code */ public String getSwiftCode() { @@ -239,6 +238,7 @@ public class MBPBankAccount extends X_C_BP_BankAccount * @param newRecord new * @return true */ + @Override protected boolean beforeSave(boolean newRecord) { // maintain routing on bank level @@ -276,6 +276,7 @@ public class MBPBankAccount extends X_C_BP_BankAccount * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MBP_BankAccount[") diff --git a/org.adempiere.base/src/org/compiere/model/MBPGroup.java b/org.adempiere.base/src/org/compiere/model/MBPGroup.java index 63acc6b6e1..7ea89ad771 100644 --- a/org.adempiere.base/src/org/compiere/model/MBPGroup.java +++ b/org.adempiere.base/src/org/compiere/model/MBPGroup.java @@ -40,7 +40,7 @@ import org.idempiere.cache.IntPOCopyCache; public class MBPGroup extends X_C_BP_Group implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 1155912422087010656L; @@ -150,7 +150,7 @@ public class MBPGroup extends X_C_BP_Group implements ImmutablePOSupport } // get /** - * Get MBPGroup from Business Partner + * Get MBPGroup of Business Partner * @param ctx context * @param C_BPartner_ID business partner id * @return MBPGroup @@ -200,11 +200,11 @@ public class MBPGroup extends X_C_BP_Group implements ImmutablePOSupport private static CLogger s_log = CLogger.getCLogger (MBPGroup.class); /** - * UUID based Constructor - * @param ctx Context - * @param C_BP_Group_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_BP_Group_UU UUID key + * @param trxName Transaction + */ public MBPGroup(Properties ctx, String C_BP_Group_UU, String trxName) { super(ctx, C_BP_Group_UU, trxName); if (Util.isEmpty(C_BP_Group_UU)) @@ -245,7 +245,7 @@ public class MBPGroup extends X_C_BP_Group implements ImmutablePOSupport } // MBPGroup /** - * + * Copy constructor * @param copy */ public MBPGroup(MBPGroup copy) @@ -254,7 +254,7 @@ public class MBPGroup extends X_C_BP_Group implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -264,7 +264,7 @@ public class MBPGroup extends X_C_BP_Group implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -275,6 +275,12 @@ public class MBPGroup extends X_C_BP_Group implements ImmutablePOSupport copyPO(copy); } + /** + * @param ctx + * @param C_BP_Group_ID + * @param trxName + * @param virtualColumns + */ public MBPGroup(Properties ctx, int C_BP_Group_ID, String trxName, String... virtualColumns) { super(ctx, C_BP_Group_ID, trxName, virtualColumns); } @@ -307,7 +313,6 @@ public class MBPGroup extends X_C_BP_Group implements ImmutablePOSupport @Override protected boolean beforeSave (boolean newRecord) { - // TODO Auto-generated method stub return true; } @@ -317,6 +322,7 @@ public class MBPGroup extends X_C_BP_Group implements ImmutablePOSupport * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (newRecord && success) diff --git a/org.adempiere.base/src/org/compiere/model/MBPartner.java b/org.adempiere.base/src/org/compiere/model/MBPartner.java index 454bd64d3f..510a804522 100644 --- a/org.adempiere.base/src/org/compiere/model/MBPartner.java +++ b/org.adempiere.base/src/org/compiere/model/MBPartner.java @@ -48,15 +48,15 @@ import org.idempiere.cache.ImmutablePOSupport; public class MBPartner extends X_C_BPartner implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 2256035503713773448L; /** - * Get Empty Template Business Partner + * Create new Business Partner from template (not save) * @param ctx context * @param AD_Client_ID client - * @return Template Business Partner or null + * @return new Business Partner created from template or null */ public static MBPartner getTemplate (Properties ctx, int AD_Client_ID) { @@ -96,7 +96,7 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport } // getTemplate /** - * Get Cash Trx Business Partner + * Get Cash Trx Business Partner (as template for new BP) * @param ctx context * @param AD_Client_ID client * @return Cash Trx Business Partner or null @@ -156,7 +156,7 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport } // getFirstWithTaxID /** - * Get BPartner with Value + * Get BPartner with id * @param ctx context * @param C_BPartner_ID * @return BPartner or null @@ -168,7 +168,7 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport /** - * Get BPartner with Value in a transaction + * Get BPartner with id in a transaction * @param ctx context * @param C_BPartner_ID * @param trxName transaction @@ -218,13 +218,11 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport } return retValue; } // getNotInvoicedAmt - /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MBPartner.class); - - /************************************************************************** + /** * Constructor for new BPartner from Template * @param ctx context */ @@ -234,7 +232,6 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport } // MBPartner /** - * Default Constructor * @param ctx context * @param rs ResultSet to load from * @param trxName transaction @@ -245,11 +242,11 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport } // MBPartner /** - * UUID based Constructor - * @param ctx Context - * @param C_BPartner_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_BPartner_UU UUID key + * @param trxName Transaction + */ public MBPartner(Properties ctx, String C_BPartner_UU, String trxName) { super(ctx, C_BPartner_UU, trxName); if (Util.isEmpty(C_BPartner_UU)) @@ -257,7 +254,6 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport } /** - * Default Constructor * @param ctx context * @param C_BPartner_ID partner or 0 or -1 (load from template) * @param trxName transaction @@ -339,7 +335,7 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport } // MBPartner /** - * + * Copy constructor * @param copy */ public MBPartner(MBPartner copy) @@ -348,7 +344,7 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -358,7 +354,7 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -375,11 +371,16 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport this.m_group = copy.m_group != null ? new MBPGroup(ctx, copy.m_group, trxName) : null; } + /** + * @param ctx + * @param C_BPartner_ID + * @param trxName + * @param virtualColumns + */ public MBPartner(Properties ctx, int C_BPartner_ID, String trxName, String... virtualColumns) { super(ctx, C_BPartner_ID, trxName, virtualColumns); } - /** Users */ protected MUser[] m_contacts = null; /** Addressed */ @@ -394,7 +395,7 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport protected MBPGroup m_group = null; /** - * Load Default BPartner + * Initialize BPartner record from template * @param AD_Client_ID client * @return true if loaded */ @@ -442,10 +443,9 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport return success; } // getTemplate - /** * Get All Contacts - * @param reload if true users will be requeried + * @param reload true to reload from DB * @return contacts */ public MUser[] getContacts (boolean reload) @@ -499,11 +499,10 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport } return users[0]; } // getContact - - + /** * Get All Locations (only active) - * @param reload if true locations will be requeried + * @param reload true to reload from DB * @return locations */ public MBPartnerLocation[] getLocations (boolean reload) @@ -542,7 +541,7 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport } // getLocations /** - * Get explicit or first bill Location + * Get location for C_BPartner_Location_ID or first bill Location or first location * @param C_BPartner_Location_ID optional explicit location * @return location or null */ @@ -567,7 +566,7 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport /** * Get Bank Accounts - * @param requery requery + * @param requery true to reload from DB * @return Bank Accounts */ public MBPBankAccount[] getBankAccounts (boolean requery) @@ -602,12 +601,12 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport list.toArray(m_accounts); return m_accounts; } // getBankAccounts - - /************************************************************************** + /** * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MBPartner[ID=") @@ -624,6 +623,7 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport * @param AD_Client_ID client * @param AD_Org_ID org */ + @Override public void setClientOrg (int AD_Client_ID, int AD_Org_ID) { super.setClientOrg(AD_Client_ID, AD_Org_ID); @@ -637,13 +637,14 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport * @return AD_Org_ID if BP * @deprecated */ + @Deprecated(forRemoval = true, since = "11") public int getAD_OrgBP_ID_Int() { return getAD_OrgBP_ID(); } // getAD_OrgBP_ID_Int /** - * Get Primary C_BPartner_Location_ID (BillTo or First) + * Get Primary C_BPartner_Location_ID (First BillTo or First) * @return C_BPartner_Location_ID */ public int getPrimaryC_BPartner_Location_ID() @@ -685,7 +686,7 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport /** * Get Primary AD_User_ID - * @return AD_User_ID + * @return AD_User_ID or 0 */ public int getPrimaryAD_User_ID() { @@ -717,11 +718,9 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport { m_primaryAD_User_ID = Integer.valueOf(AD_User_ID); } // setPrimaryAD_User_ID - - + /** * Calculate Total Open Balance and SO_CreditUsed. - * (includes drafted invoices) */ public void setTotalOpenBalance () { @@ -773,7 +772,7 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport } // setTotalOpenBalance /** - * Set Actual Life Time Value from DB + * Calculate Actual Life Time Invoiced Value from DB */ public void setActualLifeTimeValue() { @@ -809,7 +808,7 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport } // setActualLifeTimeValue /** - * Set Credit Status + * Update Credit Status for sales transaction */ public void setSOCreditStatus () { @@ -833,12 +832,11 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport setSOCreditStatus (SOCREDITSTATUS_CreditOK); } } // setSOCreditStatus - - + /** * Get SO CreditStatus with additional amount * @param additionalAmt additional amount in Accounting Currency - * @return sinulated credit status + * @return simulated credit status */ public String getSOCreditStatus (BigDecimal additionalAmt) { @@ -903,7 +901,7 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport } // getBPGroup /** - * Get BP Group + * Set BP Group * @param group group */ public void setBPGroup(MBPGroup group) @@ -925,8 +923,8 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport } // setBPGroup /** - * Get PriceList - * @return price List + * Get PriceList ID + * @return BP M_PriceList_ID or BP Group M_PriceList_ID */ public int getM_PriceList_ID () { @@ -937,8 +935,8 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport } // getM_PriceList_ID /** - * Get PO PriceList - * @return price list + * Get PO PriceList ID + * @return BP PO price list id or BP Group PO price list id */ public int getPO_PriceList_ID () { @@ -949,8 +947,8 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport } // /** - * Get DiscountSchema - * @return Discount Schema + * Get DiscountSchema id + * @return Discount Schema id */ public int getM_DiscountSchema_ID () { @@ -961,8 +959,8 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport } // getM_DiscountSchema_ID /** - * Get PO DiscountSchema - * @return po discount + * Get PO DiscountSchema id + * @return po discount schema id */ public int getPO_DiscountSchema_ID () { @@ -977,6 +975,7 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (newRecord || is_ValueChanged("C_BP_Group_ID")) @@ -992,12 +991,13 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport return true; } // beforeSave - /************************************************************************** + /** * After Save * @param newRecord new * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -1031,6 +1031,7 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport * @param success * @return deleted */ + @Override protected boolean afterDelete (boolean success) { if (success) diff --git a/org.adempiere.base/src/org/compiere/model/MBPartnerInfo.java b/org.adempiere.base/src/org/compiere/model/MBPartnerInfo.java index 411db6266e..ce815087a2 100644 --- a/org.adempiere.base/src/org/compiere/model/MBPartnerInfo.java +++ b/org.adempiere.base/src/org/compiere/model/MBPartnerInfo.java @@ -26,7 +26,7 @@ import org.compiere.util.CLogger; import org.compiere.util.DB; /** - * Business Partner Info Model for Query + * Business Partner Info Model for report view * * @author Jorg Janke * @version $Id: MBPartnerInfo.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $ @@ -34,7 +34,7 @@ import org.compiere.util.DB; public class MBPartnerInfo extends X_RV_BPartner { /** - * + * generated serial id */ private static final long serialVersionUID = 7947336480731180299L; @@ -47,7 +47,7 @@ public class MBPartnerInfo extends X_RV_BPartner * @param EMail Contact/User EMail * @param Phone phone * @param City city - * @return array if of info + * @return array of MBPartnerInfo */ public static MBPartnerInfo[] find (Properties ctx, String Value, String Name, String Contact, String EMail, String Phone, String City) @@ -136,22 +136,21 @@ public class MBPartnerInfo extends X_RV_BPartner list.toArray(retValue); return retValue; } // find - - + /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MBPartnerInfo.class); /** - * UUID based Constructor - * @param ctx Context - * @param RV_BPartner_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param RV_BPartner_UU UUID key + * @param trxName Transaction + */ public MBPartnerInfo(Properties ctx, String RV_BPartner_UU, String trxName) { super(ctx, RV_BPartner_UU, trxName); } - /************************************************************************** + /** * Load Constructor * @param ctx context * @param rs result set diff --git a/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java b/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java index 1113695125..3a4234c880 100644 --- a/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java +++ b/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java @@ -34,7 +34,7 @@ import org.compiere.util.Util; */ public class MBPartnerLocation extends X_C_BPartner_Location { /** - * + * generated serial id */ private static final long serialVersionUID = -8412652367051443276L; @@ -49,6 +49,7 @@ public class MBPartnerLocation extends X_C_BPartner_Location { * @deprecated Since 3.5.3a. Please use * {@link #getForBPartner(Properties, int, String)}. */ + @Deprecated(forRemoval = true, since = "11") public static MBPartnerLocation[] getForBPartner(Properties ctx, int C_BPartner_ID) { return getForBPartner(ctx, C_BPartner_ID, null); @@ -74,18 +75,18 @@ public class MBPartnerLocation extends X_C_BPartner_Location { } // getForBPartner /** - * UUID based Constructor - * @param ctx Context - * @param C_BPartner_Location_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_BPartner_Location_UU UUID key + * @param trxName Transaction + */ public MBPartnerLocation(Properties ctx, String C_BPartner_Location_UU, String trxName) { super(ctx, C_BPartner_Location_UU, trxName); if (Util.isEmpty(C_BPartner_Location_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Default Constructor * * @param ctx @@ -142,7 +143,7 @@ public class MBPartnerLocation extends X_C_BPartner_Location { } // MBPartner_Location /** - * + * Copy constructor * @param copy */ public MBPartnerLocation(MBPartnerLocation copy) @@ -151,7 +152,7 @@ public class MBPartnerLocation extends X_C_BPartner_Location { } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -161,7 +162,7 @@ public class MBPartnerLocation extends X_C_BPartner_Location { } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -175,6 +176,12 @@ public class MBPartnerLocation extends X_C_BPartner_Location { this.m_unique = copy.m_unique; } + /** + * @param ctx + * @param C_BPartner_Location_ID + * @param trxName + * @param virtualColumns + */ public MBPartnerLocation(Properties ctx, int C_BPartner_Location_ID, String trxName, String... virtualColumns) { super(ctx, C_BPartner_Location_ID, trxName, virtualColumns); } @@ -202,6 +209,7 @@ public class MBPartnerLocation extends X_C_BPartner_Location { * * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder("MBPartner_Location[ID=") .append(get_ID()).append(",C_Location_ID=") @@ -217,6 +225,7 @@ public class MBPartnerLocation extends X_C_BPartner_Location { * new * @return save */ + @Override protected boolean beforeSave(boolean newRecord) { if (getC_Location_ID() == 0) return false; @@ -280,6 +289,10 @@ public class MBPartnerLocation extends X_C_BPartner_Location { } } // makeUnique + /** + * @param address + * @return unique BP location name for address + */ public String getBPLocName(MLocation address) { if (isPreserveCustomName()) @@ -298,7 +311,7 @@ public class MBPartnerLocation extends X_C_BPartner_Location { // Check uniqueness MBPartnerLocation[] locations = getForBPartner(getCtx(), - getC_BPartner_ID()); + getC_BPartner_ID(), null); boolean unique = locations.length == 0; while (!unique) { unique = true; diff --git a/org.adempiere.base/src/org/compiere/model/MBPartnerProduct.java b/org.adempiere.base/src/org/compiere/model/MBPartnerProduct.java index a15f04e3a2..977f134355 100644 --- a/org.adempiere.base/src/org/compiere/model/MBPartnerProduct.java +++ b/org.adempiere.base/src/org/compiere/model/MBPartnerProduct.java @@ -20,40 +20,54 @@ * Created on May 10, 2006 */ - package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; - public class MBPartnerProduct extends X_C_BPartner_Product { /** - * + * generated serial id */ private static final long serialVersionUID = -3890764013045208949L; /** - * UUID based Constructor - * @param ctx Context - * @param C_BPartner_Product_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_BPartner_Product_UU UUID key + * @param trxName Transaction + */ public MBPartnerProduct(Properties ctx, String C_BPartner_Product_UU, String trxName) { super(ctx, C_BPartner_Product_UU, trxName); } + /** + * @param ctx + * @param C_BpartnerProduct_ID + * @param m_trxName + */ public MBPartnerProduct(Properties ctx, int C_BpartnerProduct_ID, String m_trxName) { super(ctx, C_BpartnerProduct_ID, m_trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MBPartnerProduct(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } + /** + * @param ctx + * @param C_BPartner_Product_ID + * @param trxName + * @param virtualColumns + */ public MBPartnerProduct(Properties ctx, int C_BPartner_Product_ID, String trxName, String... virtualColumns) { super(ctx, C_BPartner_Product_ID, trxName, virtualColumns); } diff --git a/org.adempiere.base/src/org/compiere/model/MBank.java b/org.adempiere.base/src/org/compiere/model/MBank.java index 9b6b726911..30f7581459 100644 --- a/org.adempiere.base/src/org/compiere/model/MBank.java +++ b/org.adempiere.base/src/org/compiere/model/MBank.java @@ -32,7 +32,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MBank extends X_C_Bank implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 5093713970786841175L; @@ -88,16 +88,16 @@ public class MBank extends X_C_Bank implements ImmutablePOSupport /** - * UUID based Constructor - * @param ctx Context - * @param C_Bank_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Bank_UU UUID key + * @param trxName Transaction + */ public MBank(Properties ctx, String C_Bank_UU, String trxName) { super(ctx, C_Bank_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_Bank_ID bank @@ -120,7 +120,7 @@ public class MBank extends X_C_Bank implements ImmutablePOSupport } // MBank /** - * + * Copy constructor * @param copy */ public MBank(MBank copy) @@ -129,7 +129,7 @@ public class MBank extends X_C_Bank implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -139,7 +139,7 @@ public class MBank extends X_C_Bank implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -150,6 +150,12 @@ public class MBank extends X_C_Bank implements ImmutablePOSupport copyPO(copy); } + /** + * @param ctx + * @param C_Bank_ID + * @param trxName + * @param virtualColumns + */ public MBank(Properties ctx, int C_Bank_ID, String trxName, String... virtualColumns) { super(ctx, C_Bank_ID, trxName, virtualColumns); } @@ -167,6 +173,7 @@ public class MBank extends X_C_Bank implements ImmutablePOSupport * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MBank["); diff --git a/org.adempiere.base/src/org/compiere/model/MBankAccount.java b/org.adempiere.base/src/org/compiere/model/MBankAccount.java index 149bc82492..d1cfff5431 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankAccount.java +++ b/org.adempiere.base/src/org/compiere/model/MBankAccount.java @@ -26,7 +26,6 @@ import org.compiere.util.Util; import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; - /** * Bank Account Model * @@ -36,7 +35,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MBankAccount extends X_C_BankAccount implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -3792366454862697171L; @@ -72,7 +71,7 @@ public class MBankAccount extends X_C_BankAccount implements ImmutablePOSupport } // get /** - * Get updateable copy of MBankAccount from cache + * Get updateable copy of MBankAccount from cache (immutable) * @param ctx * @param C_BankAccount_ID * @param trxName @@ -91,11 +90,11 @@ public class MBankAccount extends X_C_BankAccount implements ImmutablePOSupport = new ImmutableIntPOCache(Table_Name, 5); /** - * UUID based Constructor - * @param ctx Context - * @param C_BankAccount_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_BankAccount_UU UUID key + * @param trxName Transaction + */ public MBankAccount(Properties ctx, String C_BankAccount_UU, String trxName) { super(ctx, C_BankAccount_UU, trxName); if (Util.isEmpty(C_BankAccount_UU)) @@ -137,7 +136,7 @@ public class MBankAccount extends X_C_BankAccount implements ImmutablePOSupport } // MBankAccount /** - * + * Copy constructor * @param copy */ public MBankAccount(MBankAccount copy) @@ -146,7 +145,7 @@ public class MBankAccount extends X_C_BankAccount implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -156,7 +155,7 @@ public class MBankAccount extends X_C_BankAccount implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -171,6 +170,7 @@ public class MBankAccount extends X_C_BankAccount implements ImmutablePOSupport * String representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MBankAccount[") @@ -205,7 +205,7 @@ public class MBankAccount extends X_C_BankAccount implements ImmutablePOSupport * @param newRecord new record * @return success */ - + @Override protected boolean beforeSave(boolean newRecord) { if (MSysConfig.getBooleanValue(MSysConfig.IBAN_VALIDATION, true, Env.getAD_Client_ID(Env.getCtx()))) { @@ -227,6 +227,7 @@ public class MBankAccount extends X_C_BankAccount implements ImmutablePOSupport * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (newRecord && success) diff --git a/org.adempiere.base/src/org/compiere/model/MBankAccountProcessor.java b/org.adempiere.base/src/org/compiere/model/MBankAccountProcessor.java index c8d044d764..766a998485 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankAccountProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MBankAccountProcessor.java @@ -35,13 +35,24 @@ import org.compiere.util.Msg; public class MBankAccountProcessor extends X_C_BankAccount_Processor { /** - * + * generated serial id */ private static final long serialVersionUID = -9082774421123292838L; /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MBankAccountProcessor.class); + /** + * @param ctx + * @param tender + * @param CCType + * @param AD_Client_ID + * @param AD_Org_ID + * @param C_Currency_ID + * @param Amt + * @param trxName + * @return Array of Bank Account Payment Processor or null + */ public static MBankAccountProcessor[] find (Properties ctx, String tender, String CCType, int AD_Client_ID, int AD_Org_ID, int C_Currency_ID, BigDecimal Amt, String trxName) @@ -58,7 +69,7 @@ public class MBankAccountProcessor extends X_C_BankAccount_Processor { * @param C_Currency_ID Currency (ignored) * @param Amt Amount (ignored) * @param trxName transaction - * @return Array of BankAccount[0] and PaymentProcessor[1] or null + * @return Array of Bank Account Payment Processor or null */ public static MBankAccountProcessor[] find (Properties ctx, String tender, String CCType, @@ -131,6 +142,13 @@ public class MBankAccountProcessor extends X_C_BankAccount_Processor { return retValue; } // find + /** + * @param ctx + * @param C_BankAccount_ID + * @param C_PaymentProcessor_ID + * @param trxName + * @return MBankAccountProcessor + */ public static MBankAccountProcessor get(Properties ctx, int C_BankAccount_ID, int C_PaymentProcessor_ID, String trxName) { final String whereClause = MBankAccountProcessor.COLUMNNAME_C_BankAccount_ID + "=? AND " + MBankAccountProcessor.COLUMNNAME_C_PaymentProcessor_ID + "=?"; @@ -141,15 +159,20 @@ public class MBankAccountProcessor extends X_C_BankAccount_Processor { } /** - * UUID based Constructor - * @param ctx Context - * @param C_BankAccount_Processor_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_BankAccount_Processor_UU UUID key + * @param trxName Transaction + */ public MBankAccountProcessor(Properties ctx, String C_BankAccount_Processor_UU, String trxName) { super(ctx, C_BankAccount_Processor_UU, trxName); } - + + /** + * @param ctx + * @param ignored + * @param trxName + */ public MBankAccountProcessor (Properties ctx, int ignored, String trxName) { super(ctx, 0, trxName); @@ -157,11 +180,22 @@ public class MBankAccountProcessor extends X_C_BankAccount_Processor { throw new IllegalArgumentException("Multi-Key"); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MBankAccountProcessor (Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } + /** + * @param ctx + * @param C_BankAccount_ID + * @param C_PaymentProcessor_ID + * @param trxName + */ public MBankAccountProcessor (Properties ctx, int C_BankAccount_ID, int C_PaymentProcessor_ID, String trxName) { this (ctx, 0, trxName); @@ -186,7 +220,7 @@ public class MBankAccountProcessor extends X_C_BankAccount_Processor { * Does Payment Processor accepts tender / CC * @param TenderType tender type * @param CreditCardType credit card type - * @return true if acceptes + * @return true if accepted */ public boolean accepts (String TenderType, String CreditCardType) { @@ -226,6 +260,7 @@ public class MBankAccountProcessor extends X_C_BankAccount_Processor { } } // accepts + @Override public String toString() { StringBuilder sb = new StringBuilder("MBankAccountProcessor[") @@ -235,36 +270,54 @@ public class MBankAccountProcessor extends X_C_BankAccount_Processor { return sb.toString (); } + /** + * @return payment processor host address + */ public String getHostAddress() { MPaymentProcessor pp = new MPaymentProcessor(getCtx(), getC_PaymentProcessor_ID(), get_TrxName()); return pp.getHostAddress(); } + /** + * @return payment processor host port + */ public int getHostPort() { MPaymentProcessor pp = new MPaymentProcessor(getCtx(), getC_PaymentProcessor_ID(), get_TrxName()); return pp.getHostPort(); } + /** + * @return payment processor proxy address + */ public String getProxyAddress() { MPaymentProcessor pp = new MPaymentProcessor(getCtx(), getC_PaymentProcessor_ID(), get_TrxName()); return pp.getProxyAddress(); } + /** + * @return payment processor proxy port + */ public int getProxyPort() { MPaymentProcessor pp = new MPaymentProcessor(getCtx(), getC_PaymentProcessor_ID(), get_TrxName()); return pp.getProxyPort(); } + /** + * @return payment processor proxy login + */ public String getProxyLogon() { MPaymentProcessor pp = new MPaymentProcessor(getCtx(), getC_PaymentProcessor_ID(), get_TrxName()); return pp.getProxyLogon(); } + /** + * @return payment processor proxy password + */ public String getProxyPassword() { MPaymentProcessor pp = new MPaymentProcessor(getCtx(), getC_PaymentProcessor_ID(), get_TrxName()); diff --git a/org.adempiere.base/src/org/compiere/model/MBankStatement.java b/org.adempiere.base/src/org/compiere/model/MBankStatement.java index 04d4f61216..98edb6321e 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankStatement.java +++ b/org.adempiere.base/src/org/compiere/model/MBankStatement.java @@ -52,16 +52,16 @@ import org.compiere.util.Util; public class MBankStatement extends X_C_BankStatement implements DocAction { /** - * + * generated serial id */ private static final long serialVersionUID = 7420574960104461342L; /** - * UUID based Constructor - * @param ctx Context - * @param C_BankStatement_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_BankStatement_UU UUID key + * @param trxName Transaction + */ public MBankStatement(Properties ctx, String C_BankStatement_UU, String trxName) { super(ctx, C_BankStatement_UU, trxName); if (Util.isEmpty(C_BankStatement_UU)) @@ -139,8 +139,8 @@ public class MBankStatement extends X_C_BankStatement implements DocAction /** * Get Bank Statement Lines - * @param requery requery - * @return line array + * @param requery true to always re-query from DB + * @return statement line array */ public MBankStatementLine[] getLines (boolean requery) { @@ -163,7 +163,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction * Add to Description * @param description text */ - public void addDescription (String description) + public void addDescription (String description) { String desc = getDescription(); if (desc == null) @@ -176,9 +176,10 @@ public class MBankStatement extends X_C_BankStatement implements DocAction /** * Set Processed. - * Propergate to Lines/Taxes + * Propagate to Lines. * @param processed processed */ + @Override public void setProcessed (boolean processed) { super.setProcessed (processed); @@ -205,6 +206,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction * Get Document No * @return name */ + @Override public String getDocumentNo() { return getName(); @@ -214,6 +216,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction * Get Document Info * @return document info (untranslated) */ + @Override public String getDocumentInfo() { StringBuilder msgreturn = new StringBuilder().append(getBankAccount().getName()).append(" ").append(getDocumentNo()); @@ -222,8 +225,9 @@ public class MBankStatement extends X_C_BankStatement implements DocAction /** * Create PDF - * @return File or null + * @return PDF File or null */ + @Override public File createPDF () { try @@ -242,19 +246,19 @@ public class MBankStatement extends X_C_BankStatement implements DocAction /** * Create PDF file * @param file output file - * @return file if success + * @return not implemented, always return null */ public File createPDF (File file) { return null; } // createPDF - /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getC_DocType_ID() <= 0) { @@ -270,11 +274,12 @@ public class MBankStatement extends X_C_BankStatement implements DocAction return true; } // beforeSave - /************************************************************************** + /** * Process document * @param processAction document action - * @return true if performed + * @return true if success */ + @Override public boolean processIt (String processAction) { m_processMsg = null; @@ -291,6 +296,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction * Unlock Document. * @return true if success */ + @Override public boolean unlockIt() { if (log.isLoggable(Level.INFO)) log.info("unlockIt - " + toString()); @@ -302,6 +308,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction * Invalidate Document * @return true if success */ + @Override public boolean invalidateIt() { if (log.isLoggable(Level.INFO)) log.info("invalidateIt - " + toString()); @@ -313,6 +320,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction * Prepare Document * @return new status (In Progress or Invalid) */ + @Override public String prepareIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -361,6 +369,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction * Approve Document * @return true if success */ + @Override public boolean approveIt() { if (log.isLoggable(Level.INFO)) log.info("approveIt - " + toString()); @@ -372,6 +381,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction * Reject Approval * @return true if success */ + @Override public boolean rejectIt() { if (log.isLoggable(Level.INFO)) log.info("rejectIt - " + toString()); @@ -383,6 +393,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction * Complete Document * @return new status (Complete, In Progress, Invalid, Waiting ..) */ + @Override public String completeIt() { // Re-Check @@ -460,8 +471,9 @@ public class MBankStatement extends X_C_BankStatement implements DocAction /** * Void Document. - * @return false + * @return true if successfully voided */ + @Override public boolean voidIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -552,6 +564,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction * Close Document. * @return true if success */ + @Override public boolean closeIt() { if (log.isLoggable(Level.INFO)) log.info("closeIt - " + toString()); @@ -571,8 +584,9 @@ public class MBankStatement extends X_C_BankStatement implements DocAction /** * Reverse Correction - * @return false + * @return true if success */ + @Override public boolean reverseCorrectIt() { if (log.isLoggable(Level.INFO)) log.info("reverseCorrectIt - " + toString()); @@ -593,6 +607,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction * Reverse Accrual * @return false */ + @Override public boolean reverseAccrualIt() { if (log.isLoggable(Level.INFO)) log.info("reverseAccrualIt - " + toString()); @@ -627,12 +642,12 @@ public class MBankStatement extends X_C_BankStatement implements DocAction return false; return false; } // reActivateIt - - - /************************************************************************* + + /** * Get Summary * @return Summary of Document */ + @Override public String getSummary() { StringBuilder sb = new StringBuilder(); @@ -651,6 +666,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction * Get Process Message * @return clear text error message */ + @Override public String getProcessMsg() { return m_processMsg; @@ -660,6 +676,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction * Get Document Owner (Responsible) * @return AD_User_ID */ + @Override public int getDoc_User_ID() { return getUpdatedBy(); @@ -667,9 +684,9 @@ public class MBankStatement extends X_C_BankStatement implements DocAction /** * Get Document Approval Amount. - * Statement Difference - * @return amount + * @return Statement Difference */ + @Override public BigDecimal getApprovalAmt() { return getStatementDifference(); @@ -679,13 +696,14 @@ public class MBankStatement extends X_C_BankStatement implements DocAction * Get Document Currency * @return C_Currency_ID */ + @Override public int getC_Currency_ID() { return 0; } // getC_Currency_ID /** - * Document Status is Complete or Closed + * Document Status is Complete, Closed or Reversed * @return true if CO, CL or RE */ public boolean isComplete() @@ -696,6 +714,10 @@ public class MBankStatement extends X_C_BankStatement implements DocAction || DOCSTATUS_Reversed.equals(ds); } // isComplete + /** + * @param clientID + * @return true if bank statement posting should use accounting date from bank statement lines. + */ public static boolean isPostWithDateFromLine(int clientID) { return MSysConfig.getBooleanValue(MSysConfig.BANK_STATEMENT_POST_WITH_DATE_FROM_LINE, false, Env.getAD_Client_ID(Env.getCtx())); } diff --git a/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java b/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java index b8348d7622..6ba433ea67 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java +++ b/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java @@ -43,16 +43,16 @@ import org.compiere.util.Util; public class MBankStatementLine extends X_C_BankStatementLine { /** - * + * generated serial id */ private static final long serialVersionUID = -4479911757321927051L; /** - * UUID based Constructor - * @param ctx Context - * @param C_BankStatementLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_BankStatementLine_UU UUID key + * @param trxName Transaction + */ public MBankStatementLine(Properties ctx, String C_BankStatementLine_UU, String trxName) { super(ctx, C_BankStatementLine_UU, trxName); if (Util.isEmpty(C_BankStatementLine_UU)) @@ -117,6 +117,12 @@ import org.compiere.util.Util; setLine(lineNo); } // MBankStatementLine + /** + * @param ctx + * @param C_BankStatementLine_ID + * @param trxName + * @param virtualColumns + */ public MBankStatementLine(Properties ctx, int C_BankStatementLine_ID, String trxName, String... virtualColumns) { super(ctx, C_BankStatementLine_ID, trxName, virtualColumns); } @@ -125,6 +131,7 @@ import org.compiere.util.Util; * Set Statement Line Date and all other dates (Valuta, Acct) * @param StatementLineDate date */ + @Override public void setStatementLineDate(Timestamp StatementLineDate) { super.setStatementLineDate(StatementLineDate); @@ -168,13 +175,13 @@ import org.compiere.util.Util; setDescription(msgsd.toString()); } } // addDescription - /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (newRecord && getParent().isProcessed()) { @@ -253,6 +260,7 @@ import org.compiere.util.Util; * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -265,6 +273,7 @@ import org.compiere.util.Util; * @param success success * @return success */ + @Override protected boolean afterDelete (boolean success) { if (!success) @@ -273,7 +282,9 @@ import org.compiere.util.Util; } // afterSave /** - * Update Header + * Update Header (Bank Statement)
    + * - Statement difference
    + * - Ending balance */ protected boolean updateHeader() { @@ -297,9 +308,9 @@ import org.compiere.util.Util; return true; } // updateHeader - /** - * If the posting is based on the date of the line (ie SysConfig BANK_STATEMENT_POST_WITH_DATE_FROM_LINE = Y), make sure line and header dates are on the same period + * If the posting is based on the date of the line (ie SysConfig BANK_STATEMENT_POST_WITH_DATE_FROM_LINE = Y), make sure line and header dates are in the same financial period + * @return true if not using date from statement line or header and line is in the same financial period */ public boolean isDateConsistentIfUsedForPosting() { if (MBankStatement.isPostWithDateFromLine(getAD_Client_ID())) { diff --git a/org.adempiere.base/src/org/compiere/model/MBankStatementLoader.java b/org.adempiere.base/src/org/compiere/model/MBankStatementLoader.java index f03979021c..ba2eccdf60 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankStatementLoader.java +++ b/org.adempiere.base/src/org/compiere/model/MBankStatementLoader.java @@ -29,7 +29,8 @@ import org.compiere.util.Util; /** - * Bank Statement Loader Model + *
    + *  Bank Statement Loader Model.
      *  This class is responsible for creating an instance of the
      *  bank statement loader class to use.
      *  It also inserts the data into the I_BankStatement table.
    @@ -50,14 +51,14 @@ import org.compiere.util.Util;
      *  be used to construct the URL to connect to (combined with the other parameters).
      *  In this scenario the file name from the process parameter can be used to save
      *  the acquired statement data to disk.
    - *
    + *  
      *	author Maarten Klinker, Eldir Tomassen
      *	@version $Id: MBankStatementLoader.java,v 1.3 2006/07/30 00:51:04 jjanke Exp $
      */
      public class MBankStatementLoader extends X_C_BankStatementLoader
      {
      	/**
    -	 * 
    +	 * generated serial id
     	 */
     	private static final long serialVersionUID = 8482717913976119270L;
     
    @@ -86,11 +87,11 @@ import org.compiere.util.Util;
     	private X_I_BankStatement m_lastSavedLine;
     	
         /**
    -    * UUID based Constructor
    -    * @param ctx  Context
    -    * @param C_BankStatementLoader_UU  UUID key
    -    * @param trxName Transaction
    -    */
    +     * UUID based Constructor
    +     * @param ctx  Context
    +     * @param C_BankStatementLoader_UU  UUID key
    +     * @param trxName Transaction
    +     */
         public MBankStatementLoader(Properties ctx, String C_BankStatementLoader_UU, String trxName) {
             super(ctx, C_BankStatementLoader_UU, trxName);
     		init(null);
    @@ -135,6 +136,10 @@ import org.compiere.util.Util;
      		init(null);
      	}	//	MBankStatementLoader
      	
    + 	/**
    + 	 * Initialize loader
    + 	 * @param fileName
    + 	 */
      	private void init(String fileName)
     	{
     		localFileName = fileName;
    @@ -157,9 +162,10 @@ import org.compiere.util.Util;
     	}
     	
     	/**
    -	 *	Return Name
    -	 *	@return Name
    +	 *	Return id and name
    +	 *	@return id and name
     	 */
    + 	@Override
     	public String toString ()
     	{
     		StringBuilder sb = new StringBuilder ("MBankStatementLoader[")
    @@ -184,7 +190,7 @@ import org.compiere.util.Util;
     	public boolean loadLines()
     	{
     		boolean result = false;
    -		log.info( "MBankStatementLoader.loadLines");
    +		if (log.isLoggable(Level.INFO)) log.info( "MBankStatementLoader.loadLines");
     		if (m_loader == null)
     		{
     			errorMessage = "ClassNotLoaded";
    @@ -235,14 +241,14 @@ import org.compiere.util.Util;
     	}	//	loadLines
     	
     	/**
    -	 * 	Load a bank statement into the I_BankStatement table
    -	 *	@return Statement line was loaded successfully
    -	 *	This method is called by the BankStatementLoadere whenever a complete 
    +	 * 	Save last loaded line from loader into the I_BankStatement table.
    +	 *	This method is called by the BankStatementLoader after a complete 
     	 *	statement line has been read.
    +	 *  @return true if Statement line was loaded successfully.
     	 */
     	public boolean saveLine()
     	{
    -		log.info( "MBankStatementLoader.importLine");
    +		if (log.isLoggable(Level.INFO)) log.info( "MBankStatementLoader.importLine");
     		boolean result = false;
     		X_I_BankStatement imp = new X_I_BankStatement(getCtx(), 0, get_TrxName());
     		if (m_loader == null)
    @@ -339,7 +345,7 @@ import org.compiere.util.Util;
     
     	/**
     	 * Return the last saved line
    -	 * @return
    +	 * @return last saved X_I_BankStatement record
     	 */
     	public X_I_BankStatement getLastSavedLine() {
     		return m_lastSavedLine;
    diff --git a/org.adempiere.base/src/org/compiere/model/MBankStatementMatcher.java b/org.adempiere.base/src/org/compiere/model/MBankStatementMatcher.java
    index c22fa39f14..e8d23aafed 100644
    --- a/org.adempiere.base/src/org/compiere/model/MBankStatementMatcher.java
    +++ b/org.adempiere.base/src/org/compiere/model/MBankStatementMatcher.java
    @@ -29,7 +29,7 @@ import org.compiere.util.DB;
     import org.compiere.util.Env;
     
     /**
    - *	Bank Statement Matcher Algorithm
    + *	Bank Statement Matcher Configuration
      *	
      *  @author Jorg Janke
      *  @version $Id: MBankStatementMatcher.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $
    @@ -37,12 +37,12 @@ import org.compiere.util.Env;
     public class MBankStatementMatcher extends X_C_BankStatementMatcher
     {
     	/**
    -	 * 
    +	 * generated serial id
     	 */
     	private static final long serialVersionUID = -3756318777177414260L;
     
     	/**
    -	 * 	Get Bank Statement Matcher Algorithms
    +	 * 	Get Bank Statement Matcher Configuration
     	 * 	@param ctx context
     	 *	@param trxName transaction
     	 *	@return matchers
    @@ -84,16 +84,16 @@ public class MBankStatementMatcher extends X_C_BankStatementMatcher
     	private static CLogger 	s_log = CLogger.getCLogger(MBankStatementMatcher.class);
     
         /**
    -    * UUID based Constructor
    -    * @param ctx  Context
    -    * @param C_BankStatementMatcher_UU  UUID key
    -    * @param trxName Transaction
    -    */
    +     * UUID based Constructor
    +     * @param ctx  Context
    +     * @param C_BankStatementMatcher_UU  UUID key
    +     * @param trxName Transaction
    +     */
         public MBankStatementMatcher(Properties ctx, String C_BankStatementMatcher_UU, String trxName) {
             super(ctx, C_BankStatementMatcher_UU, trxName);
         }
     
    -	/**************************************************************************
    +	/**
     	 * 	Standard Constructor
     	 *	@param ctx context
     	 *	@param C_BankStatementMatcher_ID id
    @@ -130,7 +130,7 @@ public class MBankStatementMatcher extends X_C_BankStatementMatcher
     	}	//	isMatcherValid
     
     	/**
    -	 * 	Get Matcher 
    +	 * 	Get matcher instance 
     	 *	@return Matcher Instance
     	 */
     	public BankStatementMatcherInterface getMatcher()
    diff --git a/org.adempiere.base/src/org/compiere/model/MBankTransfer.java b/org.adempiere.base/src/org/compiere/model/MBankTransfer.java
    index fcafe58069..79b03241ca 100644
    --- a/org.adempiere.base/src/org/compiere/model/MBankTransfer.java
    +++ b/org.adempiere.base/src/org/compiere/model/MBankTransfer.java
    @@ -40,22 +40,22 @@ import org.compiere.util.Msg;
     import org.compiere.util.Util;
     
     /**
    - * 
    + * Bank transfer document
      * @author hengsin
      *
      */
     public class MBankTransfer extends X_C_BankTransfer implements DocAction {
     	/**
    -	 * 
    +	 * generated serial id
     	 */
     	private static final long serialVersionUID = -6091468617167291836L;
     
         /**
    -    * UUID based Constructor
    -    * @param ctx  Context
    -    * @param C_BankTransfer_UU  UUID key
    -    * @param trxName Transaction
    -    */
    +     * UUID based Constructor
    +     * @param ctx  Context
    +     * @param C_BankTransfer_UU  UUID key
    +     * @param trxName Transaction
    +     */
         public MBankTransfer(Properties ctx, String C_BankTransfer_UU, String trxName) {
             super(ctx, C_BankTransfer_UU, trxName);
     		if (Util.isEmpty(C_BankTransfer_UU))
    @@ -63,7 +63,6 @@ public class MBankTransfer extends X_C_BankTransfer implements DocAction {
         }
     
     	/**
    -	 * 
     	 * @param ctx
     	 * @param C_BankTransfer_ID
     	 * @param trxName
    @@ -85,7 +84,6 @@ public class MBankTransfer extends X_C_BankTransfer implements DocAction {
     	}
     
     	/**
    -	 * 
     	 * @param ctx
     	 * @param rs
     	 * @param trxName
    @@ -456,6 +454,7 @@ public class MBankTransfer extends X_C_BankTransfer implements DocAction {
     	 * 	String Representation
     	 *	@return info
     	 */
    +	@Override
     	public String toString() {
     		StringBuilder sb = new StringBuilder ("MBankTransfer[");
     		sb.append(get_ID()).append("-").append(getDocumentNo());
    diff --git a/org.adempiere.base/src/org/compiere/model/MBlackListCheque.java b/org.adempiere.base/src/org/compiere/model/MBlackListCheque.java
    index df2ad722ae..fe110894ea 100644
    --- a/org.adempiere.base/src/org/compiere/model/MBlackListCheque.java
    +++ b/org.adempiere.base/src/org/compiere/model/MBlackListCheque.java
    @@ -24,28 +24,39 @@ package org.compiere.model;
     import java.sql.ResultSet;
     import java.util.Properties;
     
    +@Deprecated(forRemoval = true, since = "11")
     public class MBlackListCheque extends X_U_BlackListCheque
     {
     	/**
    -	 * 
    +	 * generated serial id 
     	 */
     	private static final long serialVersionUID = 6958839594386806390L;
     
         /**
    -    * UUID based Constructor
    -    * @param ctx  Context
    -    * @param U_BlackListCheque_UU  UUID key
    -    * @param trxName Transaction
    -    */
    +     * UUID based Constructor
    +     * @param ctx  Context
    +     * @param U_BlackListCheque_UU  UUID key
    +     * @param trxName Transaction
    +     */
         public MBlackListCheque(Properties ctx, String U_BlackListCheque_UU, String trxName) {
             super(ctx, U_BlackListCheque_UU, trxName);
         }
     
    +    /**
    +     * @param ctx
    +     * @param U_BlackListCheque_ID
    +     * @param trxName
    +     */
     	public MBlackListCheque(Properties ctx, int U_BlackListCheque_ID, String trxName)
         {
             super(ctx, U_BlackListCheque_ID, trxName);
         }
     	
    +	/**
    +	 * @param ctx
    +	 * @param rs
    +	 * @param trxName
    +	 */
         public MBlackListCheque(Properties ctx, ResultSet rs, String trxName) 
         {
     		super(ctx, rs, trxName);
    diff --git a/org.adempiere.base/src/org/compiere/model/MCalendar.java b/org.adempiere.base/src/org/compiere/model/MCalendar.java
    index 1649d1189a..7c0e663200 100644
    --- a/org.adempiere.base/src/org/compiere/model/MCalendar.java
    +++ b/org.adempiere.base/src/org/compiere/model/MCalendar.java
    @@ -34,7 +34,7 @@ import org.idempiere.cache.ImmutablePOSupport;
     public class MCalendar extends X_C_Calendar implements ImmutablePOSupport
     {
     	/**
    -	 * 
    +	 * generated serial id
     	 */
     	private static final long serialVersionUID = 6036302512252100576L;
     
    @@ -109,19 +109,18 @@ public class MCalendar extends X_C_Calendar implements ImmutablePOSupport
     	/**	Cache						*/
     	private static ImmutableIntPOCache s_cache
     		= new ImmutableIntPOCache(Table_Name, 20);
    -	
    -	
    +		
         /**
    -    * UUID based Constructor
    -    * @param ctx  Context
    -    * @param C_Calendar_UU  UUID key
    -    * @param trxName Transaction
    -    */
    +     * UUID based Constructor
    +     * @param ctx  Context
    +     * @param C_Calendar_UU  UUID key
    +     * @param trxName Transaction
    +     */
         public MCalendar(Properties ctx, String C_Calendar_UU, String trxName) {
             super(ctx, C_Calendar_UU, trxName);
         }
     
    -	/*************************************************************************
    +	/**
     	 * 	Standard Constructor
     	 *	@param ctx context
     	 *	@param C_Calendar_ID id
    @@ -156,7 +155,7 @@ public class MCalendar extends X_C_Calendar implements ImmutablePOSupport
     	}	//	MCalendar
     	
     	/**
    -	 * 
    +	 * Copy constructor
     	 * @param copy
     	 */
     	public MCalendar(MCalendar copy) 
    @@ -165,7 +164,7 @@ public class MCalendar extends X_C_Calendar implements ImmutablePOSupport
     	}
     
     	/**
    -	 * 
    +	 * Copy constructor
     	 * @param ctx
     	 * @param copy
     	 */
    @@ -174,6 +173,12 @@ public class MCalendar extends X_C_Calendar implements ImmutablePOSupport
     		this(ctx, copy, (String) null);
     	}
     
    +	/**
    +	 * Copy constructor
    +	 * @param ctx
    +	 * @param copy
    +	 * @param trxName
    +	 */
     	public MCalendar(Properties ctx, MCalendar copy, String trxName) 
     	{
     		this(ctx, 0, trxName);
    @@ -181,9 +186,9 @@ public class MCalendar extends X_C_Calendar implements ImmutablePOSupport
     	}
     	
     	/**
    -	 * 	Create (current) Calendar Year
    +	 * 	Create and save (current) calendar year and periods
     	 * 	@param locale locale
    -	 *	@return The Year
    +	 *	@return new MYear instance
     	 */
     	public MYear createYear(Locale locale)
     	{
    diff --git a/org.adempiere.base/src/org/compiere/model/MCampaign.java b/org.adempiere.base/src/org/compiere/model/MCampaign.java
    index 32d83d515d..3f130378d1 100644
    --- a/org.adempiere.base/src/org/compiere/model/MCampaign.java
    +++ b/org.adempiere.base/src/org/compiere/model/MCampaign.java
    @@ -19,7 +19,6 @@ package org.compiere.model;
     import java.sql.ResultSet;
     import java.util.Properties;
     
    -
     /**
      *	Campaign model
      *	
    @@ -28,18 +27,17 @@ import java.util.Properties;
      */
     public class MCampaign extends X_C_Campaign
     {
    -
     	/**
    -	 * 
    +	 * generated serial id 
     	 */
     	private static final long serialVersionUID = -5881057827687596119L;
     
         /**
    -    * UUID based Constructor
    -    * @param ctx  Context
    -    * @param C_Campaign_UU  UUID key
    -    * @param trxName Transaction
    -    */
    +     * UUID based Constructor
    +     * @param ctx  Context
    +     * @param C_Campaign_UU  UUID key
    +     * @param trxName Transaction
    +     */
         public MCampaign(Properties ctx, String C_Campaign_UU, String trxName) {
             super(ctx, C_Campaign_UU, trxName);
         }
    @@ -67,13 +65,16 @@ public class MCampaign extends X_C_Campaign
     	}	//	MCampaign
     	
     	/**
    -	 * 	After Save.
    -	 * 	Insert
    -	 * 	- create tree
    +	 *  
    +	 *  After Save.
    +	 *  - Create or update tree.
    +	 *  - Update value description of combination
    +	 *  
    * @param newRecord insert * @param success save success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -94,6 +95,7 @@ public class MCampaign extends X_C_Campaign * @param success * @return deleted */ + @Override protected boolean afterDelete (boolean success) { if (success) diff --git a/org.adempiere.base/src/org/compiere/model/MCash.java b/org.adempiere.base/src/org/compiere/model/MCash.java index 19ee4bf5e8..66320ccac2 100644 --- a/org.adempiere.base/src/org/compiere/model/MCash.java +++ b/org.adempiere.base/src/org/compiere/model/MCash.java @@ -53,19 +53,18 @@ import org.compiere.util.Util; public class MCash extends X_C_Cash implements DocAction { /** - * + * generated serial id */ private static final long serialVersionUID = -7632011237765946083L; - /** - * Get Cash Journal for currency, org and date + * Get or create new Cash Journal for currency, org and date * @param ctx context * @param C_Currency_ID currency * @param AD_Org_ID org * @param dateAcct date * @param trxName transaction - * @return cash + * @return MCash */ public static MCash get (Properties ctx, int AD_Org_ID, Timestamp dateAcct, int C_Currency_ID, String trxName) @@ -100,7 +99,7 @@ public class MCash extends X_C_Cash implements DocAction } // get /** - * Get Cash Journal for CashBook and date + * Get or create new Cash Journal for CashBook and date * @param ctx context * @param C_CashBook_ID cashbook * @param dateAcct date @@ -138,21 +137,20 @@ public class MCash extends X_C_Cash implements DocAction /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MCash.class); - /** - * UUID based Constructor - * @param ctx Context - * @param C_Cash_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Cash_UU UUID key + * @param trxName Transaction + */ public MCash(Properties ctx, String C_Cash_UU, String trxName) { super(ctx, C_Cash_UU, trxName); if (Util.isEmpty(C_Cash_UU)) setInitialDefaults(ctx); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_Cash_ID id @@ -219,6 +217,12 @@ public class MCash extends X_C_Cash implements DocAction m_book = cb; } // MCash + /** + * @param ctx + * @param C_Cash_ID + * @param trxName + * @param virtualColumns + */ public MCash(Properties ctx, int C_Cash_ID, String trxName, String... virtualColumns) { super(ctx, C_Cash_ID, trxName, virtualColumns); } @@ -230,7 +234,7 @@ public class MCash extends X_C_Cash implements DocAction /** * Get Lines - * @param requery requery + * @param requery true to reload from DB * @return lines */ public MCashLine[] getLines (boolean requery) @@ -266,6 +270,7 @@ public class MCash extends X_C_Cash implements DocAction * Get Document No * @return name */ + @Override public String getDocumentNo() { return getName(); @@ -275,6 +280,7 @@ public class MCash extends X_C_Cash implements DocAction * Get Document Info * @return document info (untranslated) */ + @Override public String getDocumentInfo() { StringBuilder msgreturn = new StringBuilder().append(Msg.getElement(getCtx(), "C_Cash_ID")).append(" ").append(getDocumentNo()); @@ -283,8 +289,9 @@ public class MCash extends X_C_Cash implements DocAction /** * Create PDF - * @return File or null + * @return PDF File or null */ + @Override public File createPDF () { try @@ -303,7 +310,7 @@ public class MCash extends X_C_Cash implements DocAction /** * Create PDF file * @param file output file - * @return file if success + * @return not implemented, always return null */ public File createPDF (File file) { @@ -315,6 +322,7 @@ public class MCash extends X_C_Cash implements DocAction * @param newRecord * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { setAD_Org_ID(getCashBook().getAD_Org_ID()); @@ -327,13 +335,13 @@ public class MCash extends X_C_Cash implements DocAction setEndingBalance(getBeginningBalance().add(getStatementDifference())); return true; } // beforeSave - - - /************************************************************************** + + /** * Process document * @param processAction document action * @return true if performed */ + @Override public boolean processIt (String processAction) { m_processMsg = null; @@ -350,6 +358,7 @@ public class MCash extends X_C_Cash implements DocAction * Unlock Document. * @return true if success */ + @Override public boolean unlockIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -361,6 +370,7 @@ public class MCash extends X_C_Cash implements DocAction * Invalidate Document * @return true if success */ + @Override public boolean invalidateIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -371,7 +381,7 @@ public class MCash extends X_C_Cash implements DocAction /** * Prepare Document * @return new status (In Progress or Invalid) - */ + */@Override public String prepareIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -430,6 +440,7 @@ public class MCash extends X_C_Cash implements DocAction * Approve Document * @return true if success */ + @Override public boolean approveIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -441,6 +452,7 @@ public class MCash extends X_C_Cash implements DocAction * Reject Approval * @return true if success */ + @Override public boolean rejectIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -452,6 +464,7 @@ public class MCash extends X_C_Cash implements DocAction * Complete Document * @return new status (Complete, In Progress, Invalid, Waiting ..) */ + @Override public String completeIt() { // Re-Check @@ -580,8 +593,9 @@ public class MCash extends X_C_Cash implements DocAction /** * Void Document. * Same as Close. - * @return true if success + * @return true if successfully voided */ + @Override public boolean voidIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -604,8 +618,7 @@ public class MCash extends X_C_Cash implements DocAction return retValue; } // voidIt - //FR [ 1866214 ] - /************************************************************************** + /** * Reverse Cash * Period needs to be open * @return true if reversed @@ -693,6 +706,7 @@ public class MCash extends X_C_Cash implements DocAction * Cancel not delivered Quantities * @return true if success */ + @Override public boolean closeIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -714,6 +728,7 @@ public class MCash extends X_C_Cash implements DocAction * Reverse Correction * @return true if success */ + @Override public boolean reverseCorrectIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -739,6 +754,7 @@ public class MCash extends X_C_Cash implements DocAction * Reverse Accrual - none * @return true if success */ + @Override public boolean reverseAccrualIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -759,6 +775,7 @@ public class MCash extends X_C_Cash implements DocAction * Re-activate * @return true if success */ + @Override public boolean reActivateIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -782,6 +799,7 @@ public class MCash extends X_C_Cash implements DocAction * Set Processed * @param processed processed */ + @Override public void setProcessed (boolean processed) { super.setProcessed (processed); @@ -797,6 +815,7 @@ public class MCash extends X_C_Cash implements DocAction * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MCash["); @@ -812,6 +831,7 @@ public class MCash extends X_C_Cash implements DocAction * Get Summary * @return Summary of Document */ + @Override public String getSummary() { StringBuilder sb = new StringBuilder(); @@ -832,6 +852,7 @@ public class MCash extends X_C_Cash implements DocAction * Get Process Message * @return clear text error message */ + @Override public String getProcessMsg() { return m_processMsg; @@ -841,6 +862,7 @@ public class MCash extends X_C_Cash implements DocAction * Get Document Owner (Responsible) * @return AD_User_ID */ + @Override public int getDoc_User_ID() { return getCreatedBy(); @@ -850,6 +872,7 @@ public class MCash extends X_C_Cash implements DocAction * Get Document Approval Amount * @return amount difference */ + @Override public BigDecimal getApprovalAmt() { return getStatementDifference(); @@ -859,13 +882,14 @@ public class MCash extends X_C_Cash implements DocAction * Get Currency * @return Currency */ + @Override public int getC_Currency_ID () { return getCashBook().getC_Currency_ID(); } // getC_Currency_ID /** - * Document Status is Complete or Closed + * Document Status is Complete, Closed or Reversed * @return true if CO, CL or RE */ public boolean isComplete() diff --git a/org.adempiere.base/src/org/compiere/model/MCashBook.java b/org.adempiere.base/src/org/compiere/model/MCashBook.java index cdf9d32d20..9530890384 100644 --- a/org.adempiere.base/src/org/compiere/model/MCashBook.java +++ b/org.adempiere.base/src/org/compiere/model/MCashBook.java @@ -34,7 +34,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MCashBook extends X_C_CashBook implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -743516751730874877L; @@ -136,16 +136,16 @@ public class MCashBook extends X_C_CashBook implements ImmutablePOSupport private static CLogger s_log = CLogger.getCLogger (MCashBook.class); /** - * UUID based Constructor - * @param ctx Context - * @param C_CashBook_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_CashBook_UU UUID key + * @param trxName Transaction + */ public MCashBook(Properties ctx, String C_CashBook_UU, String trxName) { super(ctx, C_CashBook_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_CashBook_ID id @@ -168,7 +168,7 @@ public class MCashBook extends X_C_CashBook implements ImmutablePOSupport } // MCashBook /** - * + * Copy constructor * @param copy */ public MCashBook(MCashBook copy) @@ -177,7 +177,7 @@ public class MCashBook extends X_C_CashBook implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -187,7 +187,7 @@ public class MCashBook extends X_C_CashBook implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -204,6 +204,7 @@ public class MCashBook extends X_C_CashBook implements ImmutablePOSupport * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (newRecord && success) diff --git a/org.adempiere.base/src/org/compiere/model/MCashLine.java b/org.adempiere.base/src/org/compiere/model/MCashLine.java index 5869571bd8..10acac13fc 100644 --- a/org.adempiere.base/src/org/compiere/model/MCashLine.java +++ b/org.adempiere.base/src/org/compiere/model/MCashLine.java @@ -41,17 +41,16 @@ import org.compiere.util.Util; public class MCashLine extends X_C_CashLine { /** - * + * generated serial id */ private static final long serialVersionUID = 5023249596033465923L; - /** - * UUID based Constructor - * @param ctx Context - * @param C_CashLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_CashLine_UU UUID key + * @param trxName Transaction + */ public MCashLine(Properties ctx, String C_CashLine_UU, String trxName) { super(ctx, C_CashLine_UU, trxName); if (Util.isEmpty(C_CashLine_UU)) @@ -104,6 +103,12 @@ public class MCashLine extends X_C_CashLine m_parent = cash; } // MCashLine + /** + * @param ctx + * @param C_CashLine_ID + * @param trxName + * @param virtualColumns + */ public MCashLine(Properties ctx, int C_CashLine_ID, String trxName, String... virtualColumns) { super(ctx, C_CashLine_ID, trxName, virtualColumns); } @@ -115,7 +120,6 @@ public class MCashLine extends X_C_CashLine /** Invoice */ protected MInvoice m_invoice = null; - /** * Add to Description * @param description text @@ -199,8 +203,8 @@ public class MCashLine extends X_C_CashLine } // getStatementDate /** - * Create Line Reversal or inactivate this line if is not processed - * @return new reversed CashLine or this one if not processed + * Create Line Reversal or inactivate this line if it is not processed + * @return new reversed CashLine or this instance if not processed */ public MCashLine createReversal() { @@ -239,11 +243,10 @@ public class MCashLine extends X_C_CashLine reversal.addDescription("(" + getLine() + ")"); return reversal; } // reverse - - + /** - * Get Cash (parent) - * @return cash + * Get MCash (parent) + * @return MCash */ public MCash getParent() { @@ -283,10 +286,11 @@ public class MCashLine extends X_C_CashLine return m_invoice; } // getInvoice - /************************************************************************** + /** * Before Delete * @return true/false */ + @Override protected boolean beforeDelete () { // Cannot Delete generated Invoices @@ -307,6 +311,7 @@ public class MCashLine extends X_C_CashLine * @param success * @return true/false */ + @Override protected boolean afterDelete (boolean success) { if (!success) @@ -320,6 +325,7 @@ public class MCashLine extends X_C_CashLine * @param newRecord * @return true/false */ + @Override protected boolean beforeSave (boolean newRecord) { if (newRecord && getParent().isProcessed()) { @@ -375,12 +381,6 @@ public class MCashLine extends X_C_CashLine if (!CASHTYPE_BankAccountTransfer.equals(getCashType())) setC_BankAccount_ID(I_ZERO); - /** General fix of Currency - UPDATE C_CashLine cl SET C_Currency_ID = (SELECT C_Currency_ID FROM C_Invoice i WHERE i.C_Invoice_ID=cl.C_Invoice_ID) WHERE C_Currency_ID IS NULL AND C_Invoice_ID IS NOT NULL; - UPDATE C_CashLine cl SET C_Currency_ID = (SELECT C_Currency_ID FROM C_BankAccount b WHERE b.C_BankAccount_ID=cl.C_BankAccount_ID) WHERE C_Currency_ID IS NULL AND C_BankAccount_ID IS NOT NULL; - UPDATE C_CashLine cl SET C_Currency_ID = (SELECT b.C_Currency_ID FROM C_Cash c, C_CashBook b WHERE c.C_Cash_ID=cl.C_Cash_ID AND c.C_CashBook_ID=b.C_CashBook_ID) WHERE C_Currency_ID IS NULL; - **/ - // Get Line No if (getLine() == 0) { @@ -398,6 +398,7 @@ public class MCashLine extends X_C_CashLine * @param success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -406,8 +407,8 @@ public class MCashLine extends X_C_CashLine } // afterSave /** - * Update Cash Header. - * Statement Difference, Ending Balance + * Update Cash Header (C_Cash).
    + * - Statement Difference, Ending Balance. * @return true if success */ protected boolean updateHeader() diff --git a/org.adempiere.base/src/org/compiere/model/MCashPlan.java b/org.adempiere.base/src/org/compiere/model/MCashPlan.java index b134f8270b..c0ef852081 100644 --- a/org.adempiere.base/src/org/compiere/model/MCashPlan.java +++ b/org.adempiere.base/src/org/compiere/model/MCashPlan.java @@ -33,7 +33,7 @@ import org.compiere.util.DB; public class MCashPlan extends X_C_CashPlan { /** - * + * generated serial id */ private static final long serialVersionUID = -3068952163785661012L; @@ -42,16 +42,16 @@ public class MCashPlan extends X_C_CashPlan private static CLogger s_log = CLogger.getCLogger(MCashPlan.class); /** - * UUID based Constructor - * @param ctx Context - * @param C_CashPlan_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_CashPlan_UU UUID key + * @param trxName Transaction + */ public MCashPlan(Properties ctx, String C_CashPlan_UU, String trxName) { super(ctx, C_CashPlan_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_CashPlan_ID id @@ -77,6 +77,7 @@ public class MCashPlan extends X_C_CashPlan * Before Delete * @return true */ + @Override protected boolean beforeDelete () { // delete the lines using direct SQL (to avoid logging and updating of header on every step) - same as cascade foreign key diff --git a/org.adempiere.base/src/org/compiere/model/MCashPlanLine.java b/org.adempiere.base/src/org/compiere/model/MCashPlanLine.java index 6188a87ee7..d72a42ea63 100644 --- a/org.adempiere.base/src/org/compiere/model/MCashPlanLine.java +++ b/org.adempiere.base/src/org/compiere/model/MCashPlanLine.java @@ -23,14 +23,14 @@ import org.compiere.util.CLogger; import org.compiere.util.DB; /** - * Cash Plan model + * Cash Plan Line model * * @author Carlos Ruiz - GlobalQSS */ public class MCashPlanLine extends X_C_CashPlanLine { /** - * + * generated serial id */ private static final long serialVersionUID = -5535407146793681944L; @@ -39,16 +39,16 @@ public class MCashPlanLine extends X_C_CashPlanLine private static CLogger s_log = CLogger.getCLogger(MCashPlanLine.class); /** - * UUID based Constructor - * @param ctx Context - * @param C_CashPlanLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_CashPlanLine_UU UUID key + * @param trxName Transaction + */ public MCashPlanLine(Properties ctx, String C_CashPlanLine_UU, String trxName) { super(ctx, C_CashPlanLine_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_CashPlanLine_ID id @@ -70,11 +70,12 @@ public class MCashPlanLine extends X_C_CashPlanLine super(ctx, rs, trxName); } // MCashPlanLine - /************************************************************************** + /** * Before Save * @param newRecord * @return true if it can be sabed */ + @Override protected boolean beforeSave (boolean newRecord) { // Charge @@ -98,6 +99,7 @@ public class MCashPlanLine extends X_C_CashPlanLine * @param success success * @return saved */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -106,7 +108,7 @@ public class MCashPlanLine extends X_C_CashPlanLine } // afterSave /** - * Update Header + * Update Header (C_CashPlan) * @return true if header updated */ protected boolean updateHeader() diff --git a/org.adempiere.base/src/org/compiere/model/MChangeLog.java b/org.adempiere.base/src/org/compiere/model/MChangeLog.java index b1a7a2bd7e..b65fefc286 100644 --- a/org.adempiere.base/src/org/compiere/model/MChangeLog.java +++ b/org.adempiere.base/src/org/compiere/model/MChangeLog.java @@ -35,7 +35,7 @@ import org.compiere.util.Util; public class MChangeLog extends X_AD_ChangeLog { /** - * + * generated serial id */ private static final long serialVersionUID = 3082084206319959526L; @@ -53,6 +53,9 @@ public class MChangeLog extends X_AD_ChangeLog return index >= 0; } // trackChanges + /** + * Reset logged table list cache + */ public static synchronized void resetLoggedList() { s_changeLog = null; } @@ -75,9 +78,8 @@ public class MChangeLog extends X_AD_ChangeLog private static CLogger s_log = CLogger.getCLogger(MChangeLog.class); /** NULL Value */ public static String NULL = "NULL"; - - - /************************************************************************** + + /** * Load Constructor * @param ctx context * @param rs result set @@ -89,11 +91,11 @@ public class MChangeLog extends X_AD_ChangeLog } // MChangeLog /** - * UUID based Constructor - * @param ctx Context - * @param AD_ChangeLog_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_ChangeLog_UU UUID key + * @param trxName Transaction + */ public MChangeLog(Properties ctx, String AD_ChangeLog_UU, String trxName) { super(ctx, AD_ChangeLog_UU, trxName); } @@ -110,8 +112,8 @@ public class MChangeLog extends X_AD_ChangeLog } // MChangeLog /** - * Preserved for backward compatibility - *@deprecated + * Preserved for backward compatibility + * @deprecated */ public MChangeLog (Properties ctx, int AD_ChangeLog_ID, String TrxName, int AD_Session_ID, @@ -201,7 +203,6 @@ public class MChangeLog extends X_AD_ChangeLog setNewValue (NewValue); setEventChangeLog(event); } // MChangeLog - /** * Set Old Value @@ -217,7 +218,7 @@ public class MChangeLog extends X_AD_ChangeLog /** * Is Old Value Null - * @return true if null + * @return true if old value is null */ public boolean isOldNull() { @@ -239,7 +240,7 @@ public class MChangeLog extends X_AD_ChangeLog /** * Is New Value Null - * @return true if null + * @return true if new value is null */ public boolean isNewNull() { diff --git a/org.adempiere.base/src/org/compiere/model/MChangeNotice.java b/org.adempiere.base/src/org/compiere/model/MChangeNotice.java index 1e22475401..aadcfaba33 100644 --- a/org.adempiere.base/src/org/compiere/model/MChangeNotice.java +++ b/org.adempiere.base/src/org/compiere/model/MChangeNotice.java @@ -29,16 +29,16 @@ import org.compiere.util.Util; public class MChangeNotice extends X_M_ChangeNotice { /** - * + * generated serial id */ private static final long serialVersionUID = -1252425132317509377L; /** - * UUID based Constructor - * @param ctx Context - * @param M_ChangeNotice_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_ChangeNotice_UU UUID key + * @param trxName Transaction + */ public MChangeNotice(Properties ctx, String M_ChangeNotice_UU, String trxName) { super(ctx, M_ChangeNotice_UU, trxName); if (Util.isEmpty(M_ChangeNotice_UU)) diff --git a/org.adempiere.base/src/org/compiere/model/MChangeRequest.java b/org.adempiere.base/src/org/compiere/model/MChangeRequest.java index b69d57a8ac..481ace606b 100644 --- a/org.adempiere.base/src/org/compiere/model/MChangeRequest.java +++ b/org.adempiere.base/src/org/compiere/model/MChangeRequest.java @@ -31,17 +31,16 @@ import org.eevolution.model.MPPProductBOM; public class MChangeRequest extends X_M_ChangeRequest { /** - * + * generated serial id */ private static final long serialVersionUID = 8374119541472311165L; - /** - * UUID based Constructor - * @param ctx Context - * @param M_ChangeRequest_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_ChangeRequest_UU UUID key + * @param trxName Transaction + */ public MChangeRequest(Properties ctx, String M_ChangeRequest_UU, String trxName) { super(ctx, M_ChangeRequest_UU, trxName); if (Util.isEmpty(M_ChangeRequest_UU)) @@ -113,6 +112,7 @@ public class MChangeRequest extends X_M_ChangeRequest * @param newRecord new * @return true/false */ + @Override protected boolean beforeSave (boolean newRecord) { // Have at least one diff --git a/org.adempiere.base/src/org/compiere/model/MCharge.java b/org.adempiere.base/src/org/compiere/model/MCharge.java index 6ecbac57f8..383035119b 100644 --- a/org.adempiere.base/src/org/compiere/model/MCharge.java +++ b/org.adempiere.base/src/org/compiere/model/MCharge.java @@ -39,7 +39,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MCharge extends X_C_Charge implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 1978008783808254164L; @@ -51,6 +51,7 @@ public class MCharge extends X_C_Charge implements ImmutablePOSupport * @return Charge Account or null * @deprecated use getAccount(Charge, as) instead */ + @Deprecated(forRemoval = true, since = "11") public static MAccount getAccount (int C_Charge_ID, MAcctSchema as, BigDecimal amount) { return getAccount (C_Charge_ID, as); @@ -133,21 +134,20 @@ public class MCharge extends X_C_Charge implements ImmutablePOSupport /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MCharge.class); - - + /** - * UUID based Constructor - * @param ctx Context - * @param C_Charge_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Charge_UU UUID key + * @param trxName Transaction + */ public MCharge(Properties ctx, String C_Charge_UU, String trxName) { super(ctx, C_Charge_UU, trxName); if (Util.isEmpty(C_Charge_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_Charge_ID id @@ -182,7 +182,7 @@ public class MCharge extends X_C_Charge implements ImmutablePOSupport } // MCharge /** - * + * Copy constructor * @param copy */ public MCharge(MCharge copy) @@ -191,7 +191,7 @@ public class MCharge extends X_C_Charge implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -201,7 +201,7 @@ public class MCharge extends X_C_Charge implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -218,6 +218,7 @@ public class MCharge extends X_C_Charge implements ImmutablePOSupport * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (newRecord && success) diff --git a/org.adempiere.base/src/org/compiere/model/MChart.java b/org.adempiere.base/src/org/compiere/model/MChart.java index 424278fb7a..a3e6147a50 100644 --- a/org.adempiere.base/src/org/compiere/model/MChart.java +++ b/org.adempiere.base/src/org/compiere/model/MChart.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.sql.ResultSet; @@ -6,34 +27,45 @@ import java.util.Properties; import org.compiere.util.Env; - public class MChart extends X_AD_Chart { - /** - * + * generated serial id */ private static final long serialVersionUID = 5720760885280644477L; private int windowNo=0; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Chart_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Chart_UU UUID key + * @param trxName Transaction + */ public MChart(Properties ctx, String AD_Chart_UU, String trxName) { super(ctx, AD_Chart_UU, trxName); } + /** + * @param ctx + * @param AD_Chart_ID + * @param trxName + */ public MChart(Properties ctx, int AD_Chart_ID, String trxName) { super(ctx, AD_Chart_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MChart(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } + /** + * @return list of chart source + */ public List getDatasources() { return new Query(getCtx(), MChartDatasource.Table_Name, "AD_Chart_ID = ? AND AD_Client_ID IN (0, ?)", null) @@ -42,10 +74,16 @@ public class MChart extends X_AD_Chart { .list(); } + /** + * @param windowNo + */ public void setWindowNo(int windowNo) { this.windowNo = windowNo; } + /** + * @return window number + */ public int getWindowNo() { return windowNo; } diff --git a/org.adempiere.base/src/org/compiere/model/MChartDatasource.java b/org.adempiere.base/src/org/compiere/model/MChartDatasource.java index ab6cbf4c68..d859e0328a 100644 --- a/org.adempiere.base/src/org/compiere/model/MChartDatasource.java +++ b/org.adempiere.base/src/org/compiere/model/MChartDatasource.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.sql.PreparedStatement; @@ -13,35 +34,43 @@ import org.compiere.util.Env; import org.compiere.util.Util; public class MChartDatasource extends X_AD_ChartDatasource { - /** - * + * generated serial id */ private static final long serialVersionUID = 5108909995064477463L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_ChartDatasource_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_ChartDatasource_UU UUID key + * @param trxName Transaction + */ public MChartDatasource(Properties ctx, String AD_ChartDatasource_UU, String trxName) { super(ctx, AD_ChartDatasource_UU, trxName); } + /** + * @param ctx + * @param AD_ChartDatasource_ID + * @param trxName + */ public MChartDatasource(Properties ctx, int AD_ChartDatasource_ID, String trxName) { super(ctx, AD_ChartDatasource_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MChartDatasource(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } - /** * Convert date formatted as yyyy-MM to yyyy-QQ - * @param month - * @return + * @param month date string in the format of yyyy-MM (for e.g 2023-02) + * @return converted date string in the format of yyyy-QQ (for e.g 2023-Q1) */ private String convertToQuarter(String month) { if ( month.length() != 7 ) @@ -53,6 +82,13 @@ public class MChartDatasource extends X_AD_ChartDatasource { } + /** + * Get zoom query for key value + * @param parent + * @param value key value + * @param category2 ignore + * @return query model + */ public MQuery getZoomQuery(MChart parent, String value, String category2) { MQuery query = new MQuery(getAD_Table_ID()); @@ -93,7 +129,6 @@ public class MChartDatasource extends X_AD_ChartDatasource { sql += " WHERE " + where; } - sql += " GROUP BY " + series + ", " + category + "," + getKeyColumn() + " ORDER BY " + series + ", " + category + "," + getKeyColumn(); diff --git a/org.adempiere.base/src/org/compiere/model/MChat.java b/org.adempiere.base/src/org/compiere/model/MChat.java index 1f3fe0ecd3..fb388fe3a4 100644 --- a/org.adempiere.base/src/org/compiere/model/MChat.java +++ b/org.adempiere.base/src/org/compiere/model/MChat.java @@ -38,7 +38,7 @@ import org.compiere.util.Util; public class MChat extends X_CM_Chat { /** - * + * generated serial id */ private static final long serialVersionUID = -1188256932717048308L; @@ -62,18 +62,18 @@ public class MChat extends X_CM_Chat } // get /** - * UUID based Constructor - * @param ctx Context - * @param CM_Chat_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param CM_Chat_UU UUID key + * @param trxName Transaction + */ public MChat(Properties ctx, String CM_Chat_UU, String trxName) { super(ctx, CM_Chat_UU, trxName); if (Util.isEmpty(CM_Chat_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param CM_Chat_ID id @@ -145,12 +145,11 @@ public class MChat extends X_CM_Chat private MChatEntry[] m_entries = null; /** Date Format */ private SimpleDateFormat m_format = null; - - + /** * Get Entries * @param reload reload data - * @return array of lines + * @return array of chat entries */ public MChatEntry[] getEntries (boolean reload) { @@ -183,7 +182,7 @@ public class MChat extends X_CM_Chat } // setDescription /** - * Get History as htlp paragraph + * Get History as html paragraph * @param ConfidentialType confidentiality * @return html paragraph */ @@ -237,7 +236,7 @@ public class MChat extends X_CM_Chat } /** - * Get the chat ID based on table_id and record_id + * Get the chat ID based on table_id and record_uu * @param Table_ID * @param Record_UU * @return CM_Chat_ID diff --git a/org.adempiere.base/src/org/compiere/model/MChatEntry.java b/org.adempiere.base/src/org/compiere/model/MChatEntry.java index 8663de81f2..27304012ad 100644 --- a/org.adempiere.base/src/org/compiere/model/MChatEntry.java +++ b/org.adempiere.base/src/org/compiere/model/MChatEntry.java @@ -30,16 +30,16 @@ import org.compiere.util.Util; public class MChatEntry extends X_CM_ChatEntry { /** - * + * generated serial id */ private static final long serialVersionUID = -158924400098841023L; /** - * UUID based Constructor - * @param ctx Context - * @param CM_ChatEntry_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param CM_ChatEntry_UU UUID key + * @param trxName Transaction + */ public MChatEntry(Properties ctx, String CM_ChatEntry_UU, String trxName) { super(ctx, CM_ChatEntry_UU, trxName); if (Util.isEmpty(CM_ChatEntry_UU)) @@ -115,7 +115,7 @@ public class MChatEntry extends X_CM_ChatEntry /** * Can be published * @param ConfidentialType minimum confidential type - * @return true if withing confidentiality + * @return true if within confidentiality */ public boolean isConfidentialType(String ConfidentialType) { diff --git a/org.adempiere.base/src/org/compiere/model/MChatType.java b/org.adempiere.base/src/org/compiere/model/MChatType.java index 1eda660af5..f8040d8802 100644 --- a/org.adempiere.base/src/org/compiere/model/MChatType.java +++ b/org.adempiere.base/src/org/compiere/model/MChatType.java @@ -33,7 +33,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MChatType extends X_CM_ChatType implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 973259852970379643L; @@ -73,11 +73,11 @@ public class MChatType extends X_CM_ChatType implements ImmutablePOSupport = new ImmutableIntPOCache (Table_Name, 20); /** - * UUID based Constructor - * @param ctx Context - * @param CM_ChatType_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param CM_ChatType_UU UUID key + * @param trxName Transaction + */ public MChatType(Properties ctx, String CM_ChatType_UU, String trxName) { super(ctx, CM_ChatType_UU, trxName); if (Util.isEmpty(CM_ChatType_UU)) @@ -116,7 +116,7 @@ public class MChatType extends X_CM_ChatType implements ImmutablePOSupport } // MChatType /** - * + * Copy constructor * @param copy */ public MChatType(MChatType copy) @@ -125,7 +125,7 @@ public class MChatType extends X_CM_ChatType implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -135,7 +135,7 @@ public class MChatType extends X_CM_ChatType implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MCity.java b/org.adempiere.base/src/org/compiere/model/MCity.java index 85e5ba6822..b3fc838d30 100644 --- a/org.adempiere.base/src/org/compiere/model/MCity.java +++ b/org.adempiere.base/src/org/compiere/model/MCity.java @@ -36,7 +36,7 @@ public class MCity extends X_C_City implements Comparator, Serializable, ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -3716470269471334172L; @@ -77,19 +77,17 @@ public class MCity extends X_C_City @SuppressWarnings("unused") private static CLogger s_log = CLogger.getCLogger (MCity.class); - /** Region Cache */ - /** - * UUID based Constructor - * @param ctx Context - * @param C_City_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_City_UU UUID key + * @param trxName Transaction + */ public MCity(Properties ctx, String C_City_UU, String trxName) { super(ctx, C_City_UU, trxName); } - /************************************************************************** + /** * Create empty City * @param ctx context * @param C_City_ID id @@ -99,8 +97,7 @@ public class MCity extends X_C_City { super (ctx, C_City_ID, trxName); } // MCity - - + /** * Create City from current row in ResultSet * @param ctx context @@ -125,7 +122,7 @@ public class MCity extends X_C_City } // MCity /** - * + * Copy constructor * @param copy */ public MCity(MCity copy) @@ -134,7 +131,7 @@ public class MCity extends X_C_City } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -144,7 +141,7 @@ public class MCity extends X_C_City } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -158,6 +155,7 @@ public class MCity extends X_C_City * Return Name * @return Name */ + @Override public String toString() { return getName(); @@ -169,6 +167,7 @@ public class MCity extends X_C_City * @param o2 object 2 * @return -1,0, 1 */ + @Override public int compare(Object o1, Object o2) { String s1 = o1.toString(); diff --git a/org.adempiere.base/src/org/compiere/model/MClient.java b/org.adempiere.base/src/org/compiere/model/MClient.java index 017915181e..9b2206402f 100644 --- a/org.adempiere.base/src/org/compiere/model/MClient.java +++ b/org.adempiere.base/src/org/compiere/model/MClient.java @@ -55,7 +55,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MClient extends X_AD_Client implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 2479547777642328967L; @@ -161,8 +161,7 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport /** Cache */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 3, 120); - - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param AD_Client_ID id @@ -192,11 +191,11 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport } // MClient /** - * UUID based Constructor - * @param ctx Context - * @param AD_Client_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Client_UU UUID key + * @param trxName Transaction + */ public MClient(Properties ctx, String AD_Client_UU, String trxName) { super(ctx, AD_Client_UU, trxName); } @@ -224,7 +223,7 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport } // MClient /** - * Simplified Constructor + * Constructor using AD_Client_ID from context (ctx) * @param ctx context * @param trxName transaction */ @@ -234,7 +233,7 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport } // MClient /** - * + * Copy constructor * @param copy */ public MClient(MClient copy) @@ -243,7 +242,7 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -253,7 +252,7 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -296,6 +295,7 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder ("MClient[") @@ -305,7 +305,7 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport } // toString /** - * Get Default Accounting Currency + * Get Default Accounting Currency (from AD_ClientInfo) * @return currency or 0 */ public int getC_Currency_ID() @@ -336,6 +336,7 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport * Set AD_Language * @param AD_Language new language */ + @Override public void setAD_Language (String AD_Language) { m_language = null; @@ -346,6 +347,7 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport * Get AD_Language * @return Language */ + @Override public String getAD_Language () { String s = super.getAD_Language (); @@ -356,7 +358,7 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport /** * Get Locale - * @return locale + * @return client locale */ public Locale getLocale() { @@ -366,8 +368,7 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport return Locale.getDefault(); } // getLocale - - /************************************************************************** + /** * Create Trees and Setup Client Info * @param language language * @return true if created @@ -520,7 +521,7 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport } // isAutoArchive /** - * Get Primary Accounting Schema + * Get Primary Accounting Schema (from AD_ClientInfo) * @return Acct Schema or null */ public MAcctSchema getAcctSchema() @@ -540,6 +541,7 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport * Save * @return true if saved */ + @Override public boolean save () { if (get_ID() == 0 && !m_createNew) @@ -547,8 +549,7 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport return super.save (); } // save - - /************************************************************************** + /** * Test EMail * @return OK or error */ @@ -874,7 +875,7 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport } } // sendEmailNow - /************ + /** * Create EMail from Request User * @param to recipient * @param subject subject @@ -887,7 +888,7 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport return createEMail(to, subject, message, false); } - /************ + /** * Create EMail from Request User * @param to recipient * @param subject subject @@ -912,7 +913,7 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport return email; } // createEMail - /************ + /** * Create EMail with a specific from address * @param from recipient * @param to recipient @@ -1055,6 +1056,9 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport private static final String CLIENT_ACCOUNTING_QUEUE = "Q"; private static final String CLIENT_ACCOUNTING_IMMEDIATE = "I"; + /** + * @return true if posting is using {@link #CLIENT_ACCOUNTING_IMMEDIATE} or {@link #CLIENT_ACCOUNTING_QUEUE} + */ public static boolean isClientAccounting() { String ca = MSysConfig.getValue(MSysConfig.CLIENT_ACCOUNTING, CLIENT_ACCOUNTING_QUEUE, // default @@ -1062,6 +1066,9 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport return (ca.equalsIgnoreCase(CLIENT_ACCOUNTING_IMMEDIATE) || ca.equalsIgnoreCase(CLIENT_ACCOUNTING_QUEUE)); } + /** + * @return true if posting is using {@link #CLIENT_ACCOUNTING_QUEUE} + */ public static boolean isClientAccountingQueue() { String ca = MSysConfig.getValue(MSysConfig.CLIENT_ACCOUNTING, CLIENT_ACCOUNTING_QUEUE, // default @@ -1069,6 +1076,9 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport return ca.equalsIgnoreCase(CLIENT_ACCOUNTING_QUEUE); } + /** + * @return true if posting is using {@link #CLIENT_ACCOUNTING_IMMEDIATE} + */ public static boolean isClientAccountingImmediate() { String ca = MSysConfig.getValue(MSysConfig.CLIENT_ACCOUNTING, CLIENT_ACCOUNTING_QUEUE, // default @@ -1230,6 +1240,9 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport private static final String MAIL_SEND_CREDENTIALS_CLIENT = "C"; private static final String MAIL_SEND_CREDENTIALS_SYSTEM = "S"; + /** + * @return true if mail send credential is using {@link #MAIL_SEND_CREDENTIALS_CLIENT} + */ public static boolean isSendCredentialsClient() { String msc = MSysConfig.getValue(MSysConfig.MAIL_SEND_CREDENTIALS, MAIL_SEND_CREDENTIALS_USER, // default @@ -1237,6 +1250,9 @@ public class MClient extends X_AD_Client implements ImmutablePOSupport return (MAIL_SEND_CREDENTIALS_CLIENT.equalsIgnoreCase(msc)); } + /** + * @return true if mail send credential is using {@link #MAIL_SEND_CREDENTIALS_SYSTEM} + */ public static boolean isSendCredentialsSystem() { String msc = MSysConfig.getValue(MSysConfig.MAIL_SEND_CREDENTIALS, MAIL_SEND_CREDENTIALS_USER, // default diff --git a/org.adempiere.base/src/org/compiere/model/MClientInfo.java b/org.adempiere.base/src/org/compiere/model/MClientInfo.java index c8236cef27..5b655f11a3 100644 --- a/org.adempiere.base/src/org/compiere/model/MClientInfo.java +++ b/org.adempiere.base/src/org/compiere/model/MClientInfo.java @@ -37,7 +37,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MClientInfo extends X_AD_ClientInfo implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 4707948832203223893L; @@ -105,7 +105,7 @@ public class MClientInfo extends X_AD_ClientInfo implements ImmutablePOSupport } // get /** - * Get optionally cached client + * Get optionally cached client for current context * @return client */ public static MClientInfo get () @@ -114,7 +114,7 @@ public class MClientInfo extends X_AD_ClientInfo implements ImmutablePOSupport } /** - * Get optionally cached client + * Get optionally cached client for context (ctx) * @param ctx context * @return client */ @@ -142,19 +142,18 @@ public class MClientInfo extends X_AD_ClientInfo implements ImmutablePOSupport private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 2); /** Logger */ private static CLogger s_log = CLogger.getCLogger (MClientInfo.class); - /** - * UUID based Constructor - * @param ctx Context - * @param AD_ClientInfo_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_ClientInfo_UU UUID key + * @param trxName Transaction + */ public MClientInfo(Properties ctx, String AD_ClientInfo_UU, String trxName) { super(ctx, AD_ClientInfo_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param ignored ignored @@ -213,7 +212,7 @@ public class MClientInfo extends X_AD_ClientInfo implements ImmutablePOSupport } // MClientInfo /** - * + * Copy constructor * @param copy */ public MClientInfo(MClientInfo copy) @@ -222,7 +221,7 @@ public class MClientInfo extends X_AD_ClientInfo implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -232,7 +231,7 @@ public class MClientInfo extends X_AD_ClientInfo implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -283,6 +282,7 @@ public class MClientInfo extends X_AD_ClientInfo implements ImmutablePOSupport * @overwrite * @return true if saved */ + @Override public boolean save () { if (getAD_Org_ID() != 0) diff --git a/org.adempiere.base/src/org/compiere/model/MClientShare.java b/org.adempiere.base/src/org/compiere/model/MClientShare.java index 4b30f99e61..a598b45f5c 100644 --- a/org.adempiere.base/src/org/compiere/model/MClientShare.java +++ b/org.adempiere.base/src/org/compiere/model/MClientShare.java @@ -27,7 +27,7 @@ import org.compiere.util.DB; import org.compiere.util.Env; /** - * Client Share Info + * Model for sharing of client data * * @author Jorg Janke * @version $Id: MClientShare.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ @@ -35,15 +35,14 @@ import org.compiere.util.Env; public class MClientShare extends X_AD_ClientShare { /** - * + * generated serial id */ private static final long serialVersionUID = -8104352403537353753L; /** - * Is Table Client Level Only * @param AD_Client_ID client * @param AD_Table_ID table - * @return true if client level only (default false) + * @return true if table share at client level (i.e accessible by all org within the same tenant) */ public static boolean isClientLevelOnly (int AD_Client_ID, int AD_Table_ID) { @@ -54,10 +53,9 @@ public class MClientShare extends X_AD_ClientShare } // isClientLevel /** - * Is Table Org Level Only * @param AD_Client_ID client * @param AD_Table_ID table - * @return true if Org level only (default false) + * @return true if table is share at org level (i.e org A can't access data of org B) */ public static boolean isOrgLevelOnly (int AD_Client_ID, int AD_Table_ID) { @@ -71,7 +69,7 @@ public class MClientShare extends X_AD_ClientShare * Is Table Shared for Client * @param AD_Client_ID client * @param AD_Table_ID table - * @return info or null + * @return true if table is share at client level */ private static Boolean isShared (int AD_Client_ID, int AD_Table_ID) { @@ -122,16 +120,16 @@ public class MClientShare extends X_AD_ClientShare private static CLogger s_log = CLogger.getCLogger (MClientShare.class); /** - * UUID based Constructor - * @param ctx Context - * @param AD_ClientShare_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_ClientShare_UU UUID key + * @param trxName Transaction + */ public MClientShare(Properties ctx, String AD_ClientShare_UU, String trxName) { super(ctx, AD_ClientShare_UU, trxName); } - /************************************************************************** + /** * Default Constructor * @param ctx context * @param AD_ClientShare_ID id @@ -154,7 +152,7 @@ public class MClientShare extends X_AD_ClientShare } // MClientShare /** - * + * Copy constructor * @param copy */ public MClientShare(MClientShare copy) @@ -163,7 +161,7 @@ public class MClientShare extends X_AD_ClientShare } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -173,7 +171,7 @@ public class MClientShare extends X_AD_ClientShare } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -232,6 +230,7 @@ public class MClientShare extends X_AD_ClientShare * @param success success * @return true */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -245,7 +244,7 @@ public class MClientShare extends X_AD_ClientShare } // afterSave /** - * Set Data To Level + * Update AD_Org_ID of data to 0 if share type is client level only. * @return info */ public String setDataToLevel() @@ -273,7 +272,7 @@ public class MClientShare extends X_AD_ClientShare } // setDataToLevel /** - * List Child Tables + * List Child Tables with ACCESSLEVEL_ClientPlusOrganization * @return child tables */ public String listChildRecords() @@ -296,7 +295,6 @@ public class MClientShare extends X_AD_ClientShare rs = pstmt.executeQuery (); while (rs.next ()) { - //int AD_Table_ID = rs.getInt(1); String TableName = rs.getString(2); if (info.length() != 0) info.append(", "); @@ -322,6 +320,7 @@ public class MClientShare extends X_AD_ClientShare * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getAD_Org_ID() != 0) diff --git a/org.adempiere.base/src/org/compiere/model/MColor.java b/org.adempiere.base/src/org/compiere/model/MColor.java index 3567e71e4a..ea60d33b63 100644 --- a/org.adempiere.base/src/org/compiere/model/MColor.java +++ b/org.adempiere.base/src/org/compiere/model/MColor.java @@ -18,12 +18,10 @@ package org.compiere.model; import java.awt.Color; import java.sql.ResultSet; -import java.sql.SQLException; import java.util.Properties; -import java.util.logging.Level; /** - * Color Persistent Object Model + * Color Model * (DisplayType=27) * * @author Jorg Janke @@ -32,7 +30,7 @@ import java.util.logging.Level; public class MColor extends X_AD_Color { /** - * + * generated serial id */ private static final long serialVersionUID = -2721945803283036539L; @@ -49,6 +47,11 @@ public class MColor extends X_AD_Color setName("-/-"); } // MColor + /** + * @param ctx + * @param AD_Color_UU + * @param trxName + */ public MColor(Properties ctx, String AD_Color_UU, String trxName) { super (ctx, AD_Color_UU, trxName); @@ -56,6 +59,11 @@ public class MColor extends X_AD_Color setName("-/-"); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MColor(Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); @@ -65,49 +73,16 @@ public class MColor extends X_AD_Color * String Representation * @return string */ + @Override public String toString() { StringBuilder msgreturn = new StringBuilder("MColor[ID=").append(get_ID()).append(" - ").append(getName()).append("]"); return msgreturn.toString(); } // toString - /** - * Load Special data (images, ..). - * To be extended by sub-classes - * @param rs result set - * @param index zero based index - * @return value - * @throws SQLException - */ - protected Object loadSpecial (ResultSet rs, int index) throws SQLException - { - if (log.isLoggable(Level.CONFIG)) log.config(p_info.getColumnName(index)); - if (index == get_ColumnIndex("ColorType")) - return rs.getString(index+1); - return null; - } // loadSpecial - - - /** - * Save Special Data. - * AD_Image_ID (Background) - * @param value value - * @param index index - * @return SQL code for INSERT VALUES clause - */ - protected String saveNewSpecial (Object value, int index) - { - String colName = p_info.getColumnName(index); - String colValue = value == null ? "null" : value.getClass().toString(); - if (log.isLoggable(Level.FINE)) log.fine(colName + "=" + colValue); - if (value == null) - return "NULL"; - return value.toString(); - } // saveNewSpecial - /** * Get Color - * @param primary true if primary false if secondary + * @param primary true for primary color model (usually rgb), false for secondary color model (usually cmy) * @return Color */ public Color getColor (boolean primary) diff --git a/org.adempiere.base/src/org/compiere/model/MColorSchema.java b/org.adempiere.base/src/org/compiere/model/MColorSchema.java index 8360fae4ae..c0357b06e8 100644 --- a/org.adempiere.base/src/org/compiere/model/MColorSchema.java +++ b/org.adempiere.base/src/org/compiere/model/MColorSchema.java @@ -28,7 +28,7 @@ import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; /** - * Performance Color Schema + * Color Schema for Performance Measurement * * @author Jorg Janke * @version $Id: MColorSchema.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $ @@ -36,7 +36,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MColorSchema extends X_PA_ColorSchema implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -3730457542399382168L; @@ -76,7 +76,7 @@ public class MColorSchema extends X_PA_ColorSchema implements ImmutablePOSupport } // getColor /** - * Get MColorSchema from Cache + * Get MColorSchema from Cache (Immutable) * @param PA_ColorSchema_ID id * @return MColorSchema */ @@ -86,7 +86,7 @@ public class MColorSchema extends X_PA_ColorSchema implements ImmutablePOSupport } /** - * Get MColorSchema from Cache + * Get MColorSchema from Cache (Immutable) * @param ctx context * @param PA_ColorSchema_ID id * @return MColorSchema @@ -132,11 +132,11 @@ public class MColorSchema extends X_PA_ColorSchema implements ImmutablePOSupport = new ImmutableIntPOCache (Table_Name, 20); /** - * UUID based Constructor - * @param ctx Context - * @param PA_ColorSchema_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param PA_ColorSchema_UU UUID key + * @param trxName Transaction + */ public MColorSchema(Properties ctx, String PA_ColorSchema_UU, String trxName) { super(ctx, PA_ColorSchema_UU, trxName); } @@ -164,7 +164,7 @@ public class MColorSchema extends X_PA_ColorSchema implements ImmutablePOSupport } // MColorSchema /** - * + * Copy constructor * @param copy */ public MColorSchema(MColorSchema copy) @@ -173,7 +173,7 @@ public class MColorSchema extends X_PA_ColorSchema implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -183,7 +183,7 @@ public class MColorSchema extends X_PA_ColorSchema implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -196,7 +196,7 @@ public class MColorSchema extends X_PA_ColorSchema implements ImmutablePOSupport /** * Set Default. - * Red (50) - Yellow (100) - Green + * Red (50) - Yellow (100) - Green (101 - 9999) */ public void setDefault() { @@ -214,6 +214,7 @@ public class MColorSchema extends X_PA_ColorSchema implements ImmutablePOSupport * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getMark1Percent() > getMark2Percent()) @@ -227,8 +228,8 @@ public class MColorSchema extends X_PA_ColorSchema implements ImmutablePOSupport } // beforeSave /** - * Get Color - * @param percent percent + * Get color for percent + * @param percent percentage * @return color */ public Color getColor (int percent) @@ -264,6 +265,7 @@ public class MColorSchema extends X_PA_ColorSchema implements ImmutablePOSupport * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MColorSchema["); diff --git a/org.adempiere.base/src/org/compiere/model/MColumn.java b/org.adempiere.base/src/org/compiere/model/MColumn.java index 735d803795..44e3a0a93c 100644 --- a/org.adempiere.base/src/org/compiere/model/MColumn.java +++ b/org.adempiere.base/src/org/compiere/model/MColumn.java @@ -43,7 +43,7 @@ import org.idempiere.cache.ImmutablePOSupport; import org.idempiere.expression.logic.LogicEvaluator; /** - * Persistent Column Model + * Column Model * * @author Jorg Janke * @version $Id: MColumn.java,v 1.6 2006/08/09 05:23:49 jjanke Exp $ @@ -51,7 +51,7 @@ import org.idempiere.expression.logic.LogicEvaluator; public class MColumn extends X_AD_Column implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -971225879649586290L; @@ -141,6 +141,11 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport return table.getColumn(columnName); } // get + /** + * @param ctx + * @param AD_Column_ID + * @return Column name or null + */ public static String getColumnName (Properties ctx, int AD_Column_ID) { return getColumnName (ctx, AD_Column_ID, null); @@ -165,18 +170,18 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 20); /** - * UUID based Constructor - * @param ctx Context - * @param AD_Column_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Column_UU UUID key + * @param trxName Transaction + */ public MColumn(Properties ctx, String AD_Column_UU, String trxName) { super(ctx, AD_Column_UU, trxName); if (Util.isEmpty(AD_Column_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param AD_Column_ID @@ -229,7 +234,7 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport } // MColumn /** - * + * Copy constructor * @param copy */ public MColumn(MColumn copy) @@ -238,7 +243,7 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -248,7 +253,7 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -258,9 +263,11 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport this(ctx, 0, trxName); copyPO(copy); } + /** * Is Standard Column - * @return true for AD_Client_ID, etc. + * @return true if this column is one of the 8 standard column that should exists in every table.
    + * - AD_Client_ID, AD_Org_ID, IsActive, Created, Created By, Updated, Updated By or Processing */ public boolean isStandardColumn() { @@ -288,7 +295,7 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport /** * Is Virtual Column - * @return true if virtual column + * @return true if virtual column (using column SQL) */ public boolean isVirtualColumn() { @@ -298,7 +305,7 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport /** * Is Virtual DB Column - * @return true if virtual DB column + * @return true if virtual DB column (using column SQL and is not using @SQL= or @SQLFIND=) */ public boolean isVirtualDBColumn() { @@ -308,7 +315,7 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport /** * Is Virtual UI Column - * @return true if virtual UI column + * @return true if virtual UI column (using column SQL that starts with @SQL=) */ public boolean isVirtualUIColumn() { @@ -318,7 +325,7 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport /** * Is Virtual Search Column - * @return true if virtual search column + * @return true if virtual search column (using column SQL that starts with @SQLFIND=) */ public boolean isVirtualSearchColumn() { @@ -350,6 +357,7 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { String error = Database.isValidIdentifier(getColumnName()); @@ -581,6 +589,7 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -617,7 +626,7 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport /** * Get SQL Add command * @param table table - * @return sql + * @return SQL to add new column */ public String getSQLAdd (MTable table) { @@ -630,7 +639,7 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport /** * Get SQL DDL - * @return columnName datataype .. + * @return DDL for column */ public String getSQLDDL() { @@ -648,7 +657,7 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport * Get SQL Modify command * @param table table * @param setNullOption generate null / not null statement - * @return sql separated by ; + * @return SQL to modify existing column */ public String getSQLModify (MTable table, boolean setNullOption) { @@ -661,7 +670,7 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport /** * Get SQL Data Type - * @return e.g. NVARCHAR2(60) + * @return SQL data type (e.g. NVARCHAR2(60)) */ public String getSQLDataType() { @@ -673,7 +682,7 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport /** * Get Table Constraint * @param tableName table name - * @return table constraint + * @return table constraint clause */ public String getConstraint(String tableName) { @@ -717,6 +726,7 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder ("MColumn["); @@ -728,7 +738,7 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport * get Column ID * @param TableName * @param columnName - * @return int retValue + * @return AD_Column_ID */ public static int getColumn_ID(String TableName,String columnName) { MTable table = MTable.get(Env.getCtx(), TableName); @@ -741,19 +751,23 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport } /** - * Get Table Id for a column - * @param ctx context - * @param AD_Column_ID id - * @param trxName transaction - * @return MColumn - */ + * Get Table Id for a column + * @param ctx context + * @param AD_Column_ID id + * @param trxName transaction + * @return AD_Table_ID + */ public static int getTable_ID(Properties ctx, int AD_Column_ID, String trxName) { String sqlStmt = "SELECT AD_Table_ID FROM AD_Column WHERE AD_Column_ID=?"; return DB.getSQLValue(trxName, sqlStmt, AD_Column_ID); } - + /** + * @param columnName + * @param caseSensitive + * @return true if column should be included as selection column + */ public static boolean isSuggestSelectionColumn(String columnName, boolean caseSensitive) { if (Util.isEmpty(columnName, true)) @@ -794,9 +808,10 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport + " AND tb.IsActive = 'Y' " + " AND f.IsActive = 'Y'"; private String foreignTableMulti = null; + /** * Get the foreign table name that relates to this column when the column is multi selection - * @return + * @return foreign table name or null */ public String getMultiReferenceTableName() { if (foreignTableMulti != null) @@ -813,9 +828,10 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport } private String foreignTable = null; + /** * Get the foreign table name that relates to this column - * @return + * @return foreign table name or null */ public String getReferenceTableName() { if (foreignTable != null) @@ -862,6 +878,9 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport return foreignTable; } + /** + * Set default values for new column + */ public void setSmartDefaults() { // IDEMPIERE-1649 - dup code on Callout_AD_Column.columnName if (MColumn.isSuggestSelectionColumn(getColumnName(), true)) setIsSelectionColumn(true); @@ -965,6 +984,17 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport return table; } + /** + * @param md + * @param catalog + * @param schema + * @param tableName + * @param table + * @param column + * @param isNoTable + * @return SQL to add or replace foreign key constraint + * @throws Exception + */ public static String getForeignKeyConstraintSql(DatabaseMetaData md, String catalog, String schema, String tableName, MTable table, MColumn column, boolean isNoTable) throws Exception { StringBuilder fkConstraintSql = new StringBuilder(); @@ -1144,6 +1174,12 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport return fkConstraintSql.toString(); } + /** + * @param md + * @param primaryTableName + * @return primary key + * @throws Exception + */ public static DatabaseKey getPrimaryKey(DatabaseMetaData md, String primaryTableName) throws Exception { DatabaseKey primaryKey = null; @@ -1183,6 +1219,13 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport return primaryKey; } + /** + * @param md + * @param table + * @param column + * @return Foreign key constraint clause + * @throws Exception + */ public static String getForeignKeyConstraint(DatabaseMetaData md, MTable table, MColumn column) throws Exception { if (!column.isKey() && !column.getColumnName().equals(PO.getUUIDColumnName(table.getTableName()))) @@ -1291,10 +1334,19 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport return cnt > 0; } + /** + * @param nullForUI true to return the string "NULL" for @SQL= + * @return column SQL (without the @SQL= or @SQLFIND= prefix) or null + */ public String getColumnSQL(boolean nullForUI) { return getColumnSQL(nullForUI, true); } + /** + * @param nullForUI true to return the string "NULL" for @SQL= + * @param nullForSearch true to return the string "NULL" for @SQLFIND= + * @return column SQL (without the @SQL= or @SQLFIND= prefix) or null + */ public String getColumnSQL(boolean nullForUI, boolean nullForSearch) { String query = getColumnSQL(); if (query != null && query.length() > 0) { @@ -1308,6 +1360,10 @@ public class MColumn extends X_AD_Column implements ImmutablePOSupport return query; } + /** + * @param newColumnName + * @return new column name + " - " + SQL executed to rename column + */ public String renameDBColumn(String newColumnName) { int rvalue = -1; String sql; diff --git a/org.adempiere.base/src/org/compiere/model/MColumnAccess.java b/org.adempiere.base/src/org/compiere/model/MColumnAccess.java index c112fee7e7..23eb000e54 100644 --- a/org.adempiere.base/src/org/compiere/model/MColumnAccess.java +++ b/org.adempiere.base/src/org/compiere/model/MColumnAccess.java @@ -33,22 +33,21 @@ import org.compiere.util.Msg; public class MColumnAccess extends X_AD_Column_Access { /** - * + * generated serial id */ private static final long serialVersionUID = -2362624234744824977L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Column_Access_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Column_Access_UU UUID key + * @param trxName Transaction + */ public MColumnAccess(Properties ctx, String AD_Column_Access_UU, String trxName) { super(ctx, AD_Column_Access_UU, trxName); } /** - * Persistency Constructor * @param ctx context * @param ignored ignored * @param trxName transaction @@ -70,12 +69,12 @@ public class MColumnAccess extends X_AD_Column_Access { super(ctx, rs, trxName); } // MColumnAccess - /** * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder("MColumnAccess["); diff --git a/org.adempiere.base/src/org/compiere/model/MCommission.java b/org.adempiere.base/src/org/compiere/model/MCommission.java index 7be8b83170..42166f9780 100644 --- a/org.adempiere.base/src/org/compiere/model/MCommission.java +++ b/org.adempiere.base/src/org/compiere/model/MCommission.java @@ -37,16 +37,16 @@ import org.compiere.util.Util; public class MCommission extends X_C_Commission { /** - * + * generated serial id */ private static final long serialVersionUID = 2702487404398723180L; /** - * UUID based Constructor - * @param ctx Context - * @param C_Commission_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Commission_UU UUID key + * @param trxName Transaction + */ public MCommission(Properties ctx, String C_Commission_UU, String trxName) { super(ctx, C_Commission_UU, trxName); if (Util.isEmpty(C_Commission_UU)) @@ -86,6 +86,12 @@ public class MCommission extends X_C_Commission super(ctx, rs, trxName); } // MCommission + /** + * @param ctx + * @param C_Commission_ID + * @param trxName + * @param virtualColumns + */ public MCommission(Properties ctx, int C_Commission_ID, String trxName, String... virtualColumns) { super(ctx, C_Commission_ID, trxName, virtualColumns); } @@ -113,6 +119,7 @@ public class MCommission extends X_C_Commission * Set Date Last Run * @param DateLastRun date */ + @Override public void setDateLastRun (Timestamp DateLastRun) { if (DateLastRun != null) diff --git a/org.adempiere.base/src/org/compiere/model/MCommissionAmt.java b/org.adempiere.base/src/org/compiere/model/MCommissionAmt.java index b2722cab9b..f291702f74 100644 --- a/org.adempiere.base/src/org/compiere/model/MCommissionAmt.java +++ b/org.adempiere.base/src/org/compiere/model/MCommissionAmt.java @@ -33,16 +33,16 @@ import org.compiere.util.Util; public class MCommissionAmt extends X_C_CommissionAmt { /** - * + * generated serial id */ private static final long serialVersionUID = 1747802539808391638L; /** - * UUID based Constructor - * @param ctx Context - * @param C_CommissionAmt_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_CommissionAmt_UU UUID key + * @param trxName Transaction + */ public MCommissionAmt(Properties ctx, String C_CommissionAmt_UU, String trxName) { super(ctx, C_CommissionAmt_UU, trxName); if (Util.isEmpty(C_CommissionAmt_UU)) @@ -95,6 +95,12 @@ public class MCommissionAmt extends X_C_CommissionAmt super(ctx, rs, trxName); } // MCommissionAmt + /** + * @param ctx + * @param C_CommissionAmt_ID + * @param trxName + * @param virtualColumns + */ public MCommissionAmt(Properties ctx, int C_CommissionAmt_ID, String trxName, String... virtualColumns) { super(ctx, C_CommissionAmt_ID, trxName, virtualColumns); } @@ -149,14 +155,14 @@ public class MCommissionAmt extends X_C_CommissionAmt // setCommissionAmt(amt.add(qty)); } // calculateCommission - - + /** * After Save * @param newRecord new * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -171,6 +177,7 @@ public class MCommissionAmt extends X_C_CommissionAmt * @param success success * @return success */ + @Override protected boolean afterDelete (boolean success) { if (success) @@ -179,7 +186,7 @@ public class MCommissionAmt extends X_C_CommissionAmt } // afterDelete /** - * Update Amt Header + * Update Header (MCommissionRun) amount */ private void updateRunHeader() { diff --git a/org.adempiere.base/src/org/compiere/model/MCommissionDetail.java b/org.adempiere.base/src/org/compiere/model/MCommissionDetail.java index b5f9385a0f..01a13a5dae 100644 --- a/org.adempiere.base/src/org/compiere/model/MCommissionDetail.java +++ b/org.adempiere.base/src/org/compiere/model/MCommissionDetail.java @@ -32,22 +32,21 @@ import org.compiere.util.Env; public class MCommissionDetail extends X_C_CommissionDetail { /** - * + * generated serial id */ private static final long serialVersionUID = 1727857992121809494L; /** - * UUID based Constructor - * @param ctx Context - * @param C_CommissionDetail_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_CommissionDetail_UU UUID key + * @param trxName Transaction + */ public MCommissionDetail(Properties ctx, String C_CommissionDetail_UU, String trxName) { super(ctx, C_CommissionDetail_UU, trxName); } /** - * Persistency Constructor * @param ctx context * @param ignored ignored * @param trxName transaction @@ -89,6 +88,12 @@ public class MCommissionDetail extends X_C_CommissionDetail super(ctx, rs, trxName); } // MCommissionDetail + /** + * @param ctx + * @param C_CommissionDetail_ID + * @param trxName + * @param virtualColumns + */ public MCommissionDetail(Properties ctx, int C_CommissionDetail_ID, String trxName, String... virtualColumns) { super(ctx, C_CommissionDetail_ID, trxName, virtualColumns); } @@ -127,6 +132,7 @@ public class MCommissionDetail extends X_C_CommissionDetail * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -141,6 +147,7 @@ public class MCommissionDetail extends X_C_CommissionDetail * @param success success * @return success */ + @Override protected boolean afterDelete (boolean success) { if (success) @@ -149,7 +156,7 @@ public class MCommissionDetail extends X_C_CommissionDetail } // afterDelete /** - * Update Amt Header + * Update Header (MCommissionAmt) amount */ private void updateAmtHeader() { diff --git a/org.adempiere.base/src/org/compiere/model/MCommissionLine.java b/org.adempiere.base/src/org/compiere/model/MCommissionLine.java index a86778d8da..6dd0bf6118 100644 --- a/org.adempiere.base/src/org/compiere/model/MCommissionLine.java +++ b/org.adempiere.base/src/org/compiere/model/MCommissionLine.java @@ -32,16 +32,16 @@ import org.compiere.util.Util; public class MCommissionLine extends X_C_CommissionLine { /** - * + * generated serial id */ private static final long serialVersionUID = 2167566875518334780L; /** - * UUID based Constructor - * @param ctx Context - * @param C_CommissionLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_CommissionLine_UU UUID key + * @param trxName Transaction + */ public MCommissionLine(Properties ctx, String C_CommissionLine_UU, String trxName) { super(ctx, C_CommissionLine_UU, trxName); if (Util.isEmpty(C_CommissionLine_UU)) @@ -85,6 +85,12 @@ public class MCommissionLine extends X_C_CommissionLine super(ctx, rs, trxName); } // MCommissionLine + /** + * @param ctx + * @param C_CommissionLine_ID + * @param trxName + * @param virtualColumns + */ public MCommissionLine(Properties ctx, int C_CommissionLine_ID, String trxName, String... virtualColumns) { super(ctx, C_CommissionLine_ID, trxName, virtualColumns); } diff --git a/org.adempiere.base/src/org/compiere/model/MCommissionRun.java b/org.adempiere.base/src/org/compiere/model/MCommissionRun.java index 7a72591cad..3dab8a7646 100644 --- a/org.adempiere.base/src/org/compiere/model/MCommissionRun.java +++ b/org.adempiere.base/src/org/compiere/model/MCommissionRun.java @@ -32,19 +32,17 @@ import org.compiere.util.Util; */ public class MCommissionRun extends X_C_CommissionRun { - - /** - * + * generated serial id */ private static final long serialVersionUID = -3103035295526318283L; /** - * UUID based Constructor - * @param ctx Context - * @param C_CommissionRun_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_CommissionRun_UU UUID key + * @param trxName Transaction + */ public MCommissionRun(Properties ctx, String C_CommissionRun_UU, String trxName) { super(ctx, C_CommissionRun_UU, trxName); if (Util.isEmpty(C_CommissionRun_UU)) @@ -96,7 +94,7 @@ public class MCommissionRun extends X_C_CommissionRun /** * Get Amounts - * @return array of amounts + * @return array of amounts (MCommissionAmt) */ public MCommissionAmt[] getAmts() { @@ -110,12 +108,18 @@ public class MCommissionRun extends X_C_CommissionRun return retValue; } // getAmts + /** + * @param ctx + * @param C_CommissionRun_ID + * @param trxName + * @param virtualColumns + */ public MCommissionRun(Properties ctx, int C_CommissionRun_ID, String trxName, String... virtualColumns) { super(ctx, C_CommissionRun_ID, trxName, virtualColumns); } /** - * Update From Amt + * Update From Amt (MCommissionAmt) */ public void updateFromAmt() { diff --git a/org.adempiere.base/src/org/compiere/model/MContactInterest.java b/org.adempiere.base/src/org/compiere/model/MContactInterest.java index 5a4eb83ccd..5e111dfe96 100644 --- a/org.adempiere.base/src/org/compiere/model/MContactInterest.java +++ b/org.adempiere.base/src/org/compiere/model/MContactInterest.java @@ -25,12 +25,12 @@ import org.compiere.util.CLogger; import org.compiere.util.Env; /** - * Business Partner Contact Interest. - * Adempiere compies with spamming laws. - * If the opt out date is set (by the user), - * you should not subscribe the user again. + *
    + *  Business Partner Contact Interest (subscription).
    + *  Adempiere complies with spam laws.
    + *  If the opt out date is set (by the user), you should not subscribe the user again.
      *  Internally, the isActive flag is used.
    - *
    + *  
    * @author Jorg Janke * @version $Id: MContactInterest.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $ * @author red1 FR: [ 2214883 ] Remove SQL code and Replace for Query @@ -38,16 +38,16 @@ import org.compiere.util.Env; public class MContactInterest extends X_R_ContactInterest { /** - * + * generated serial id */ private static final long serialVersionUID = -4720845687902863428L; /** - * Get Contact Interest + * Get or create Contact Interest * @param ctx context * @param R_InterestArea_ID interest ares * @param AD_User_ID user - * @param isActive create as active + * @param isActive isActive value for create * @param trxName transaction * @return Contact Interest */ @@ -69,20 +69,18 @@ public class MContactInterest extends X_R_ContactInterest if (s_log.isLoggable(Level.FINE)) s_log.fine("Found - " + retValue); return retValue; } // get - /** - * UUID based Constructor - * @param ctx Context - * @param R_ContactInterest_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param R_ContactInterest_UU UUID key + * @param trxName Transaction + */ public MContactInterest(Properties ctx, String R_ContactInterest_UU, String trxName) { super(ctx, R_ContactInterest_UU, trxName); } - /************************************************************************** - * Persistency Constructor + /** * @param ctx context * @param ignored ignored * @param trxName transaction @@ -123,7 +121,7 @@ public class MContactInterest extends X_R_ContactInterest } // MContactInterest /** - * + * Copy constructor * @param copy */ public MContactInterest(MContactInterest copy) @@ -132,7 +130,7 @@ public class MContactInterest extends X_R_ContactInterest } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -142,7 +140,7 @@ public class MContactInterest extends X_R_ContactInterest } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -157,10 +155,11 @@ public class MContactInterest extends X_R_ContactInterest private static CLogger s_log = CLogger.getCLogger (MContactInterest.class); /** - * Set OptOut Date + * Set OptOut Date. * User action only. - * @param OptOutDate date + * @param OptOutDate opt out date, null to use current date */ + @Override public void setOptOutDate (Timestamp OptOutDate) { if (OptOutDate == null) @@ -189,9 +188,9 @@ public class MContactInterest extends X_R_ContactInterest } // isOptOut /** - * Set Subscribe Date + * Set Subscribe Date. * User action only. - * @param SubscribeDate date + * @param SubscribeDate subscribe date, null to use current date */ public void setSubscribeDate (Timestamp SubscribeDate) { @@ -204,7 +203,7 @@ public class MContactInterest extends X_R_ContactInterest } // setSubscribeDate /** - * Subscribe + * Subscribe. * User action only. */ public void subscribe() @@ -217,7 +216,7 @@ public class MContactInterest extends X_R_ContactInterest /** * Subscribe. * User action only. - * @param subscribe subscribe + * @param subscribe true to subscribe, false to opt out */ public void subscribe (boolean subscribe) { @@ -244,6 +243,7 @@ public class MContactInterest extends X_R_ContactInterest * String representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MContactInterest[") @@ -254,20 +254,4 @@ public class MContactInterest extends X_R_ContactInterest return sb.toString (); } // toString - /************************************************************************** - * @param args ignored - */ - public static void main (String[] args) - { - org.compiere.Adempiere.startup(true); - int R_InterestArea_ID = 1000002; - int AD_User_ID = 1000002; - MContactInterest ci = MContactInterest.get(Env.getCtx(), R_InterestArea_ID, AD_User_ID, false, null); - ci.subscribe(); - ci.saveEx(); - // - ci = MContactInterest.get(Env.getCtx(), R_InterestArea_ID, AD_User_ID, false, null); - } // main - - } // MContactInterest diff --git a/org.adempiere.base/src/org/compiere/model/MConversionRate.java b/org.adempiere.base/src/org/compiere/model/MConversionRate.java index 0066cc6c58..834b1bbf88 100644 --- a/org.adempiere.base/src/org/compiere/model/MConversionRate.java +++ b/org.adempiere.base/src/org/compiere/model/MConversionRate.java @@ -46,7 +46,7 @@ import org.compiere.util.Util; public class MConversionRate extends X_C_Conversion_Rate { /** - * + * generated serial id */ private static final long serialVersionUID = -3866898973541150020L; @@ -72,7 +72,6 @@ public class MConversionRate extends X_C_Conversion_Rate return convert (ctx, Amt, CurFrom_ID, MClient.get(ctx).getC_Currency_ID(), ConvDate, C_ConversionType_ID, AD_Client_ID, AD_Org_ID); } // convertBase - /** * Convert an amount with today's default rate @@ -149,7 +148,6 @@ public class MConversionRate extends X_C_Conversion_Rate return retValue; } // convert - /** * Sets system spot conversion rate for a single day. @@ -287,21 +285,20 @@ public class MConversionRate extends X_C_Conversion_Rate + ", Org=" + AD_Org_ID); return retValue; } // getRate - /** - * UUID based Constructor - * @param ctx Context - * @param C_Conversion_Rate_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Conversion_Rate_UU UUID key + * @param trxName Transaction + */ public MConversionRate(Properties ctx, String C_Conversion_Rate_UU, String trxName) { super(ctx, C_Conversion_Rate_UU, trxName); if (Util.isEmpty(C_Conversion_Rate_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_Conversion_Rate_ID id @@ -358,13 +355,19 @@ public class MConversionRate extends X_C_Conversion_Rate setValidFrom(ValidFrom); } // MConversionRate + /** + * @param ctx + * @param C_Conversion_Rate_ID + * @param trxName + * @param virtualColumns + */ public MConversionRate(Properties ctx, int C_Conversion_Rate_ID, String trxName, String... virtualColumns) { super(ctx, C_Conversion_Rate_ID, trxName, virtualColumns); } /** - * Set Multiply Rate - * Sets also Divide Rate + * Set Multiply Rate. + * Sets also Divide Rate (calculate from multiply rate). * @param MultiplyRate multiply rate */ public void setMultiplyRate (BigDecimal MultiplyRate) @@ -386,7 +389,7 @@ public class MConversionRate extends X_C_Conversion_Rate /** * Set Divide Rate. - * Sets also Multiply Rate + * Sets also Multiply Rate (calculate from divide rate) * @param DivideRate divide rate */ public void setDivideRate (BigDecimal DivideRate) @@ -410,6 +413,7 @@ public class MConversionRate extends X_C_Conversion_Rate * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder("MConversionRate["); @@ -432,6 +436,7 @@ public class MConversionRate extends X_C_Conversion_Rate * @param newRecord new * @return true if OK to save */ + @Override protected boolean beforeSave (boolean newRecord) { // From - To is the same @@ -487,6 +492,7 @@ public class MConversionRate extends X_C_Conversion_Rate } // beforeSave private volatile static boolean recursiveCall = false; + @Override protected boolean afterSave(boolean newRecord, boolean success) { if (success && !recursiveCall) { diff --git a/org.adempiere.base/src/org/compiere/model/MConversionRateUtil.java b/org.adempiere.base/src/org/compiere/model/MConversionRateUtil.java index 77be19d8d8..f0c8b5621e 100644 --- a/org.adempiere.base/src/org/compiere/model/MConversionRateUtil.java +++ b/org.adempiere.base/src/org/compiere/model/MConversionRateUtil.java @@ -102,7 +102,16 @@ public final class MConversionRateUtil return amt; } // convert - /** Return the message to show when no exchange rate is found */ + /** + * @param ctx + * @param adMessage + * @param currencyFromID + * @param currencyToID + * @param convertionTypeID + * @param date + * @param trxName + * @return the message to show when no exchange rate is found + */ public static String getErrorMessage(Properties ctx, String adMessage, int currencyFromID, int currencyToID, int convertionTypeID, Timestamp date, String trxName) { if (convertionTypeID == 0) diff --git a/org.adempiere.base/src/org/compiere/model/MConversionType.java b/org.adempiere.base/src/org/compiere/model/MConversionType.java index 57d3ba0fc2..a07cd0c0cc 100644 --- a/org.adempiere.base/src/org/compiere/model/MConversionType.java +++ b/org.adempiere.base/src/org/compiere/model/MConversionType.java @@ -32,7 +32,7 @@ import org.compiere.util.Env; public class MConversionType extends X_C_ConversionType { /** - * + * generated serial id */ private static final long serialVersionUID = 7198388106444590667L; @@ -75,16 +75,16 @@ public class MConversionType extends X_C_ConversionType private static CCache s_cache = new CCache(Table_Name, 4); /** - * UUID based Constructor - * @param ctx Context - * @param C_ConversionType_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_ConversionType_UU UUID key + * @param trxName Transaction + */ public MConversionType(Properties ctx, String C_ConversionType_UU, String trxName) { super(ctx, C_ConversionType_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_ConversionType_ID id @@ -107,7 +107,7 @@ public class MConversionType extends X_C_ConversionType } // MConversionType /** - * + * Copy constructor * @param copy */ public MConversionType(MConversionType copy) @@ -116,7 +116,7 @@ public class MConversionType extends X_C_ConversionType } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -126,7 +126,7 @@ public class MConversionType extends X_C_ConversionType } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -137,6 +137,12 @@ public class MConversionType extends X_C_ConversionType copyPO(copy); } + /** + * @param ctx + * @param C_ConversionType_ID + * @param trxName + * @param virtualColumns + */ public MConversionType(Properties ctx, int C_ConversionType_ID, String trxName, String... virtualColumns) { super(ctx, C_ConversionType_ID, trxName, virtualColumns); } diff --git a/org.adempiere.base/src/org/compiere/model/MCost.java b/org.adempiere.base/src/org/compiere/model/MCost.java index 8c91a80334..e474718143 100644 --- a/org.adempiere.base/src/org/compiere/model/MCost.java +++ b/org.adempiere.base/src/org/compiere/model/MCost.java @@ -32,7 +32,6 @@ import java.util.logging.Level; import org.adempiere.exceptions.AverageCostingNegativeQtyException; import org.adempiere.exceptions.AverageCostingZeroQtyException; import org.adempiere.exceptions.DBException; -import org.compiere.Adempiere; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; @@ -59,12 +58,11 @@ import org.compiere.util.Util; public class MCost extends X_M_Cost { /** - * + * generated serial id */ private static final long serialVersionUID = -9054858267574839079L; /** - * * @param product * @param M_AttributeSetInstance_ID * @param trxName @@ -81,9 +79,9 @@ public class MCost extends X_M_Cost /** * Retrieve/Calculate Current Cost Price * @param product product - * @param M_AttributeSetInstance_ID real asi + * @param M_AttributeSetInstance_ID asi for batchlot costing level * @param as accounting schema - * @param AD_Org_ID real org + * @param AD_Org_ID org for organization costing level * @param costingMethod AcctSchema.COSTINGMETHOD_* * @param qty qty * @param C_OrderLine_ID optional order line @@ -127,10 +125,10 @@ public class MCost extends X_M_Cost } // getCurrentCost /** - * Get Current Cost Price for Costing Level + * Calculate and Get Current Cost Price for Costing Level * @param product product - * @param M_ASI_ID costing level asi - * @param Org_ID costing level org + * @param M_ASI_ID M_AttributeSetInstance_ID for batchlot costing level + * @param Org_ID AD_Org_ID for organization costing level * @param M_CostType_ID cost type * @param as AcctSchema * @param costingMethod method @@ -275,12 +273,12 @@ public class MCost extends X_M_Cost /** * Get Seed Costs * @param product product - * @param M_ASI_ID costing level asi + * @param M_ASI_ID costing M_AttributeSetInstance_ID for batchlot costing level * @param as accounting schema - * @param Org_ID costing level org + * @param Org_ID AD_Org_ID for organization costing level * @param costingMethod costing method * @param C_OrderLine_ID optional order line - * @return price or null + * @return seed cost or null */ public static BigDecimal getSeedCosts (MProduct product, int M_ASI_ID, MAcctSchema as, int Org_ID, String costingMethod, int C_OrderLine_ID) @@ -435,7 +433,13 @@ public class MCost extends X_M_Cost return retValue; } // getSeedCosts - + /** + * Get seed cost from purchase price list + * @param product + * @param as + * @param orgID + * @return seed cost or null + */ protected static BigDecimal getSeedCostFromPriceList(MProduct product, MAcctSchema as, int orgID) { String sql = "SELECT pp.PriceList, pp.PriceStd FROM M_ProductPrice pp" + @@ -468,7 +472,7 @@ public class MCost extends X_M_Cost } /** - * Get Last Invoice Price in currency + * Get Last Vendor Invoice Price in currency * @param product product * @param M_ASI_ID attribute set instance * @param AD_Org_ID org @@ -480,7 +484,6 @@ public class MCost extends X_M_Cost { BigDecimal retValue = null; StringBuilder sql = new StringBuilder("SELECT currencyConvertInvoice(i.C_Invoice_ID, ?, il.PriceActual, i.DateAcct) ") - // ,il.PriceActual, il.QtyInvoiced, i.DateInvoiced, il.Line .append("FROM C_InvoiceLine il ") .append(" INNER JOIN C_Invoice i ON (il.C_Invoice_ID=i.C_Invoice_ID) ") .append("WHERE il.M_Product_ID=?") @@ -538,7 +541,6 @@ public class MCost extends X_M_Cost BigDecimal retValue = null; StringBuilder sql = new StringBuilder("SELECT currencyConvert(ol.PriceCost, o.C_Currency_ID, ?, o.DateAcct, o.C_ConversionType_ID, ol.AD_Client_ID, ol.AD_Org_ID),") .append(" currencyConvert(ol.PriceActual, o.C_Currency_ID, ?, o.DateAcct, o.C_ConversionType_ID, ol.AD_Client_ID, ol.AD_Org_ID) ") - // ,ol.PriceCost,ol.PriceActual, ol.QtyOrdered, o.DateOrdered, ol.Line .append("FROM C_OrderLine ol") .append(" INNER JOIN C_Order o ON (ol.C_Order_ID=o.C_Order_ID) ") .append("WHERE ol.M_Product_ID=?") @@ -592,14 +594,13 @@ public class MCost extends X_M_Cost * @param product product * @param C_OrderLine_ID order line * @param C_Currency_ID accounting currency - * @return last PO price in currency or null + * @return PO price for order line in currency or null */ public static BigDecimal getPOPrice (MProduct product, int C_OrderLine_ID, int C_Currency_ID) { BigDecimal retValue = null; String sql = "SELECT currencyConvert(ol.PriceCost, o.C_Currency_ID, ?, o.DateAcct, o.C_ConversionType_ID, ol.AD_Client_ID, ol.AD_Org_ID)," + " currencyConvert(ol.PriceActual, o.C_Currency_ID, ?, o.DateAcct, o.C_ConversionType_ID, ol.AD_Client_ID, ol.AD_Org_ID) " - // ,ol.PriceCost,ol.PriceActual, ol.QtyOrdered, o.DateOrdered, ol.Line + "FROM C_OrderLine ol" + " INNER JOIN C_Order o ON (ol.C_Order_ID=o.C_Order_ID) " + "WHERE ol.C_OrderLine_ID=?" @@ -639,9 +640,9 @@ public class MCost extends X_M_Cost return null; } // getPOPrice - /************************************************************************** - * Create costing for client. - * Handles Transaction if not in a transaction + /** + * Calculate costing for client. + * Handles Transaction if not in a transaction. * @param client client */ public static void create (MClient client) @@ -776,7 +777,15 @@ public class MCost extends X_M_Cost } } // create - + /** + * Organization costing level - create costing records for child organization + * @param root + * @param product + * @param as + * @param M_ASI_ID + * @param ce + * @param found + */ private static void createForChildOrg(MTreeNode root, MProduct product, MAcctSchema as, int M_ASI_ID, MCostElement ce, boolean found) { int parentId = root.getNode_ID(); @@ -801,6 +810,14 @@ public class MCost extends X_M_Cost } } + /** + * Create costing record (MCost). + * @param product + * @param M_ASI_ID + * @param as + * @param AD_Org_ID + * @param M_CostElement_ID + */ private static void createCostingRecord(MProduct product,int M_ASI_ID, MAcctSchema as, int AD_Org_ID, int M_CostElement_ID) { MCost cost = MCost.get (product, M_ASI_ID, as, AD_Org_ID, M_CostElement_ID, product.get_TrxName()); @@ -817,64 +834,64 @@ public class MCost extends X_M_Cost } /** - * Delete standard Costing records for Product + * Delete costing records for Product (for client and organization costing level) * @param product product **/ protected static void delete (MProduct product) { - s_log.config(product.getName()); + if (s_log.isLoggable(Level.CONFIG)) s_log.config(product.getName()); // Cost Elements List ces = MCostElement.getCostElementsWithCostingMethods(product); - MAcctSchema[] mass = MAcctSchema.getClientAcctSchema(product.getCtx(), - product.getAD_Client_ID(), product.get_TrxName()); - MOrg[] orgs = null; + MAcctSchema[] mass = MAcctSchema.getClientAcctSchema(product.getCtx(), + product.getAD_Client_ID(), product.get_TrxName()); + MOrg[] orgs = null; - int M_ASI_ID = 0; // No Attribute - for (MAcctSchema as : mass) + int M_ASI_ID = 0; // No Attribute + for (MAcctSchema as : mass) + { + String cl = product.getCostingLevel(as); + // Create Std Costing + if (MAcctSchema.COSTINGLEVEL_Client.equals(cl)) { - String cl = product.getCostingLevel(as); - // Create Std Costing - if (MAcctSchema.COSTINGLEVEL_Client.equals(cl)) + for(MCostElement ce : ces) + { + MCost cost = MCost.get (product, M_ASI_ID, + as, 0, ce.getM_CostElement_ID(), product.get_TrxName()); + if(cost != null) + cost.deleteEx(true); + } + } + else if (MAcctSchema.COSTINGLEVEL_Organization.equals(cl)) + { + if (orgs == null) + orgs = MOrg.getOfClient(product); + for (MOrg o : orgs) { for(MCostElement ce : ces) { MCost cost = MCost.get (product, M_ASI_ID, - as, 0, ce.getM_CostElement_ID(), product.get_TrxName()); + as, o.getAD_Org_ID(), ce.getM_CostElement_ID(), product.get_TrxName()); if(cost != null) - cost.deleteEx(true); + cost.deleteEx(true); } - } - else if (MAcctSchema.COSTINGLEVEL_Organization.equals(cl)) - { - if (orgs == null) - orgs = MOrg.getOfClient(product); - for (MOrg o : orgs) - { - for(MCostElement ce : ces) - { - MCost cost = MCost.get (product, M_ASI_ID, - as, o.getAD_Org_ID(), ce.getM_CostElement_ID(), product.get_TrxName()); - if(cost != null) - cost.deleteEx(true); - } - } // for all orgs - } - else - { - s_log.warning("Not created: Std.Cost for " + product.getName() - + " - Costing Level on Batch/Lot"); - } - } // accounting schema loop + } // for all orgs + } + else + { + s_log.warning("Not created: Cost for " + product.getName() + + " - Costing Level on Batch/Lot"); + } + } // accounting schema loop } // create - /************************************************************************** - * Calculate Average Invoice from Trx + /** + * Calculate Average Invoice Cost from M_Transaction * @param product product * @param M_AttributeSetInstance_ID optional asi * @param as acct schema * @param AD_Org_ID optonal org - * @return average costs or null + * @return average invoice costs or null */ public static BigDecimal calculateAverageInv (MProduct product, int M_AttributeSetInstance_ID, MAcctSchema as, int AD_Org_ID) @@ -962,12 +979,12 @@ public class MCost extends X_M_Cost } // calculateAverageInv /** - * Calculate Average PO + * Calculate Average PO from M_Transaction * @param product product * @param M_AttributeSetInstance_ID asi * @param as acct schema * @param AD_Org_ID org - * @return costs or null + * @return average PO cost or null */ public static BigDecimal calculateAveragePO (MProduct product, int M_AttributeSetInstance_ID, MAcctSchema as, int AD_Org_ID) @@ -1058,12 +1075,12 @@ public class MCost extends X_M_Cost } // calculateAveragePO /** - * Calculate FiFo Cost + * Calculate FiFo Cost from M_Transaction * @param product product * @param M_AttributeSetInstance_ID asi * @param as acct schema * @param AD_Org_ID org - * @return costs or null + * @return FIFO costs or null */ public static BigDecimal calculateFiFo (MProduct product, int M_AttributeSetInstance_ID, MAcctSchema as, int AD_Org_ID) @@ -1195,12 +1212,12 @@ public class MCost extends X_M_Cost } // calculateFiFo /** - * Calculate LiFo costs + * Calculate LiFo costs from M_Transaction * @param product product * @param M_AttributeSetInstance_ID asi * @param as acct schema * @param AD_Org_ID org - * @return costs or null + * @return LIFO costs or null */ public static BigDecimal calculateLiFo (MProduct product, int M_AttributeSetInstance_ID, MAcctSchema as, int AD_Org_ID) @@ -1313,8 +1330,7 @@ public class MCost extends X_M_Cost return pp.Cost; } // calculateLiFo - - /************************************************************************** + /** * MCost Qty-Cost Pair */ public static class QtyCost @@ -1349,7 +1365,7 @@ public class MCost extends X_M_Cost /** * Get/Create Cost Record. - * CostingLevel is not validated + * CostingLevel is not validated. * @param product product * @param M_AttributeSetInstance_ID costing level asi * @param as accounting schema @@ -1405,7 +1421,7 @@ public class MCost extends X_M_Cost * @param M_CostElement_ID cost element * @param M_AttributeSetInstance_ID asi * @param trxName transaction name - * @return cost or null + * @return MCost or null */ public static MCost get (Properties ctx, int AD_Client_ID, int AD_Org_ID, int M_Product_ID, int M_CostType_ID, int C_AcctSchema_ID, int M_CostElement_ID, @@ -1441,20 +1457,19 @@ public class MCost extends X_M_Cost /** Logger */ private static CLogger s_log = CLogger.getCLogger (MCost.class); - /** - * UUID based Constructor - * @param ctx Context - * @param M_Cost_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_Cost_UU UUID key + * @param trxName Transaction + */ public MCost(Properties ctx, String M_Cost_UU, String trxName) { super(ctx, M_Cost_UU, trxName); if (Util.isEmpty(M_Cost_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param ignored multi-key @@ -1520,7 +1535,7 @@ public class MCost extends X_M_Cost protected boolean m_manual = true; /** - * Add Cumulative Amt/Qty and Current Qty + * Add to Cumulative Amt/Qty and Current Qty * @param amt amt * @param qty qty */ @@ -1541,8 +1556,8 @@ public class MCost extends X_M_Cost } // add /** - * Add Amt/Qty and calculate weighted average. - * ((OldAvg*OldQty)+(Price*Qty)) / (OldQty+Qty) + * Add to cumulative Amt/Qty, current qty and calculate new weighted average cost.
    + * ((OldAvg*OldQty)+(Price*Qty)) / (OldQty+Qty). * @param amt total amt (price * qty) * @param qty qty */ @@ -1641,6 +1656,7 @@ public class MCost extends X_M_Cost * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MCost["); @@ -1676,6 +1692,7 @@ public class MCost extends X_M_Cost * @param newRecord new * @return true if can be saved */ + @Override protected boolean beforeSave (boolean newRecord) { //The method getCostElement() not should be cached because is a transaction @@ -1746,17 +1763,20 @@ public class MCost extends X_M_Cost return true; } // beforeSave - /** * Before Delete * @return true */ + @Override protected boolean beforeDelete () { return true; } // beforeDelete - + /** + * Throw {@link AverageCostingNegativeQtyException} if cost element is average po or average invoice and currentQty < 0. + * @param CurrentQty + */ @Override public void setCurrentQty(BigDecimal CurrentQty) { MCostElement ce = (MCostElement)getM_CostElement(); @@ -1770,17 +1790,4 @@ public class MCost extends X_M_Cost } super.setCurrentQty(CurrentQty); } - - /** - * Test - * @param args ignored - */ - public static void main (String[] args) - { - Adempiere.startup(true); - MClient client = MClient.get(Env.getCtx(), 11); // GardenWorld - create(client); - - } // main - } // MCost diff --git a/org.adempiere.base/src/org/compiere/model/MCostDetail.java b/org.adempiere.base/src/org/compiere/model/MCostDetail.java index 29056234f1..afdc0d51fb 100644 --- a/org.adempiere.base/src/org/compiere/model/MCostDetail.java +++ b/org.adempiere.base/src/org/compiere/model/MCostDetail.java @@ -49,7 +49,7 @@ import org.compiere.util.Util; public class MCostDetail extends X_M_CostDetail { /** - * + * generated serial id */ private static final long serialVersionUID = -3896161579785627935L; @@ -60,8 +60,8 @@ public class MCostDetail extends X_M_CostDetail "WHERE iol.M_InOutLine_ID=?"; /** - * Create New Order Cost Detail for Purchase Orders. - * Called from Doc_MatchPO + * Create New Cost Detail record for Purchase Orders. + * Called from Doc_MatchPO. * @param as accounting schema * @param AD_Org_ID org * @param M_Product_ID product @@ -95,7 +95,6 @@ public class MCostDetail extends X_M_CostDetail { if (cd.isProcessed()) { - // MZ Goodwill // set deltaAmt=Amt, deltaQty=qty, and set Cost Detail for Amt and Qty cd.setDeltaAmt(Amt.subtract(cd.getAmt())); cd.setDeltaQty(Qty.subtract(cd.getQty())); @@ -113,7 +112,6 @@ public class MCostDetail extends X_M_CostDetail cd.setAmt(Amt); cd.setQty(Qty); } - // end MZ else if (cd.isProcessed()) return true; // nothing to do } @@ -125,11 +123,10 @@ public class MCostDetail extends X_M_CostDetail if (s_log.isLoggable(Level.CONFIG)) s_log.config("(" + ok + ") " + cd); return ok; } // createOrder - /** - * Create New Invoice Cost Detail for AP Invoices. - * Called from Doc_Invoice - for Invoice Adjustments + * Create New Cost Detail record for AP Invoices. + * Called from Doc_Invoice - for Invoice Adjustments. * @param as accounting schema * @param AD_Org_ID org * @param M_Product_ID product @@ -163,7 +160,6 @@ public class MCostDetail extends X_M_CostDetail { if (cd.isProcessed()) { - // MZ Goodwill // set deltaAmt=Amt, deltaQty=qty, and set Cost Detail for Amt and Qty cd.setDeltaAmt(Amt.subtract(cd.getAmt())); cd.setDeltaQty(Qty.subtract(cd.getQty())); @@ -181,7 +177,6 @@ public class MCostDetail extends X_M_CostDetail cd.setAmt(Amt); cd.setQty(Qty); } - // end MZ else if (cd.isProcessed()) return true; // nothing to do } @@ -195,8 +190,8 @@ public class MCostDetail extends X_M_CostDetail } // createInvoice /** - * Create New Shipment Cost Detail for SO Shipments. - * Called from Doc_MInOut - for SO Shipments + * Create New Cost Detail record for SO Shipments. + * Called from Doc_MInOut - for SO Shipments. * @param as accounting schema * @param AD_Org_ID org * @param M_Product_ID product @@ -232,7 +227,6 @@ public class MCostDetail extends X_M_CostDetail { if (cd.isProcessed()) { - // MZ Goodwill // set deltaAmt=Amt, deltaQty=qty, and set Cost Detail for Amt and Qty cd.setDeltaAmt(Amt.subtract(cd.getAmt())); cd.setDeltaQty(Qty.subtract(cd.getQty())); @@ -250,7 +244,6 @@ public class MCostDetail extends X_M_CostDetail cd.setAmt(Amt); cd.setQty(Qty); } - // end MZ else if (cd.isProcessed()) return true; // nothing to do } @@ -264,8 +257,8 @@ public class MCostDetail extends X_M_CostDetail } // createShipment /** - * Create New Order Cost Detail for Physical Inventory. - * Called from Doc_Inventory + * Create New Cost Detail record for Physical Inventory. + * Called from Doc_Inventory. * @param as accounting schema * @param AD_Org_ID org * @param M_Product_ID product @@ -299,7 +292,6 @@ public class MCostDetail extends X_M_CostDetail { if (cd.isProcessed()) { - // MZ Goodwill // set deltaAmt=Amt, deltaQty=qty, and set Cost Detail for Amt and Qty cd.setDeltaAmt(Amt.subtract(cd.getAmt())); cd.setDeltaQty(Qty.subtract(cd.getQty())); @@ -317,7 +309,6 @@ public class MCostDetail extends X_M_CostDetail cd.setAmt(Amt); cd.setQty(Qty); } - // end MZ else if (cd.isProcessed()) return true; // nothing to do } @@ -331,8 +322,8 @@ public class MCostDetail extends X_M_CostDetail } // createInventory /** - * Create New Order Cost Detail for Movements. - * Called from Doc_Movement + * Create New Cost Detail record for Inventory Movements. + * Called from Doc_Movement. * @param as accounting schema * @param AD_Org_ID org * @param M_Product_ID product @@ -370,7 +361,6 @@ public class MCostDetail extends X_M_CostDetail { if (cd.isProcessed()) { - // MZ Goodwill // set deltaAmt=Amt, deltaQty=qty, and set Cost Detail for Amt and Qty cd.setDeltaAmt(Amt.subtract(cd.getAmt())); cd.setDeltaQty(Qty.subtract(cd.getQty())); @@ -388,7 +378,6 @@ public class MCostDetail extends X_M_CostDetail cd.setAmt(Amt); cd.setQty(Qty); } - // end MZ else if (cd.isProcessed()) return true; // nothing to do } @@ -402,8 +391,8 @@ public class MCostDetail extends X_M_CostDetail } // createMovement /** - * Create New Order Cost Detail for Production. - * Called from Doc_Production + * Create New Cost Detail record for Production. + * Called from Doc_Production. * @param as accounting schema * @param AD_Org_ID org * @param M_Product_ID product @@ -437,7 +426,6 @@ public class MCostDetail extends X_M_CostDetail { if (cd.isProcessed()) { - // MZ Goodwill // set deltaAmt=Amt, deltaQty=qty, and set Cost Detail for Amt and Qty cd.setDeltaAmt(Amt.subtract(cd.getAmt())); cd.setDeltaQty(Qty.subtract(cd.getQty())); @@ -455,7 +443,6 @@ public class MCostDetail extends X_M_CostDetail cd.setAmt(Amt); cd.setQty(Qty); } - // end MZ else if (cd.isProcessed()) return true; // nothing to do } @@ -469,6 +456,7 @@ public class MCostDetail extends X_M_CostDetail } // createProduction /** + * Create cost detail record for Match Invoice (M_MatchInv). * @param as * @param AD_Org_ID * @param M_Product_ID @@ -531,7 +519,7 @@ public class MCostDetail extends X_M_CostDetail } // createMatchInvoice /** - * Create Cost Detail for Project Issue. + * Create Cost Detail for Project Issue (C_ProjectIssue). * Called from Doc_ProjectIssue * @param as accounting schema * @param AD_Org_ID org @@ -594,7 +582,7 @@ public class MCostDetail extends X_M_CostDetail return ok; } // createProjectIssue - /************************************************************************** + /** * Get Cost Detail * @param ctx context * @param whereClause where clause @@ -604,6 +592,7 @@ public class MCostDetail extends X_M_CostDetail * @return cost detail * @deprecated */ + @Deprecated public static MCostDetail get (Properties ctx, String whereClause, int ID, int M_AttributeSetInstance_ID, String trxName) { @@ -643,12 +632,13 @@ public class MCostDetail extends X_M_CostDetail return retValue; } - /************************************************************************** + /** * Get Cost Detail * @param ctx context - * @param whereClause where clause - * @param ID 1st parameter - * @param M_AttributeSetInstance_ID ASI + * @param whereClause where clause for record id (1st parameter) + * @param ID record id (1st parameter) + * @param M_AttributeSetInstance_ID ASI (2nd parameter) + * @param C_AcctSchema_ID accounting schema (3rd parameter) * @param trxName trx * @return cost detail */ @@ -664,12 +654,13 @@ public class MCostDetail extends X_M_CostDetail return retValue; } // get - /************************************************************************** + /** * Get Cost Detail Records * @param ctx context - * @param whereClause where clause - * @param ID 1st parameter - * @param M_AttributeSetInstance_ID ASI + * @param whereClause where clause for record id (1st parameter) + * @param ID record id (1st parameter) + * @param M_AttributeSetInstance_ID ASI (2nd parameter) + * @param C_AcctSchema_ID accounting schema (3rd parameter) * @param trxName trx * @return list of cost detail record */ @@ -713,21 +704,20 @@ public class MCostDetail extends X_M_CostDetail /** Logger */ private static CLogger s_log = CLogger.getCLogger (MCostDetail.class); - - + /** - * UUID based Constructor - * @param ctx Context - * @param M_CostDetail_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_CostDetail_UU UUID key + * @param trxName Transaction + */ public MCostDetail(Properties ctx, String M_CostDetail_UU, String trxName) { super(ctx, M_CostDetail_UU, trxName); if (Util.isEmpty(M_CostDetail_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param M_CostDetail_ID id @@ -797,6 +787,7 @@ public class MCostDetail extends X_M_CostDetail * Set Amt * @param Amt amt */ + @Override public void setAmt (BigDecimal Amt) { if (isProcessed()) @@ -811,6 +802,7 @@ public class MCostDetail extends X_M_CostDetail * Set Qty * @param Qty qty */ + @Override public void setQty (BigDecimal Qty) { if (isProcessed()) @@ -823,7 +815,7 @@ public class MCostDetail extends X_M_CostDetail /** * Is Order - * @return true if order line + * @return true if has order line */ public boolean isOrder() { @@ -832,7 +824,7 @@ public class MCostDetail extends X_M_CostDetail /** * Is Invoice - * @return true if invoice line + * @return true if has invoice line */ public boolean isInvoice() { @@ -841,7 +833,7 @@ public class MCostDetail extends X_M_CostDetail /** * Is Shipment - * @return true if sales order shipment + * @return true if has sales order shipment line */ public boolean isShipment() { @@ -849,7 +841,7 @@ public class MCostDetail extends X_M_CostDetail } // isShipment /** - * @return true if return to vendor + * @return true if shipment line belongs to return to vendor (vendor RMA) */ public boolean isVendorRMA() { @@ -876,6 +868,7 @@ public class MCostDetail extends X_M_CostDetail * Before Delete * @return false if processed */ + @Override protected boolean beforeDelete () { return !isProcessed(); @@ -886,6 +879,7 @@ public class MCostDetail extends X_M_CostDetail * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MCostDetail["); @@ -912,9 +906,8 @@ public class MCostDetail extends X_M_CostDetail sb.append ("]"); return sb.toString (); } // toString - - - /************************************************************************** + + /** * Process Cost Detail Record. * The record is saved if processed. * @return true if processed @@ -1007,7 +1000,7 @@ public class MCostDetail extends X_M_CostDetail } // process /** - * Process cost detail for cost record + * Process cost detail record * @param as accounting schema * @param product product * @param ce cost element diff --git a/org.adempiere.base/src/org/compiere/model/MCostElement.java b/org.adempiere.base/src/org/compiere/model/MCostElement.java index 95c65e2fe9..b08c0601f6 100644 --- a/org.adempiere.base/src/org/compiere/model/MCostElement.java +++ b/org.adempiere.base/src/org/compiere/model/MCostElement.java @@ -43,14 +43,14 @@ import org.idempiere.cache.ImmutablePOSupport; public class MCostElement extends X_M_CostElement implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 4914952212171251715L; /** * Get Material Cost Element or create it * @param po parent - * @param CostingMethod method + * @param CostingMethod costing method * @return cost element */ public static MCostElement getMaterialCostElement (PO po, String CostingMethod) @@ -85,7 +85,7 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport } // getMaterialCostElement /** - * Get first Material Cost Element + * Get first Material Cost Element for a costing method. * @param ctx context * @param CostingMethod costing method * @return Cost Element or null @@ -106,7 +106,7 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport } // getMaterialCostElement /** - * Get first Material Cost Element + * Get first Material Cost Element for a costing method * @param ctx context * @param CostingMethod costing method * @return Cost Element or null @@ -127,9 +127,9 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport } // getMaterialCostElement /** - * Get active Material Cost Element for client + * Get active Material Cost Element (associated with costing method) for client * @param po parent - * @return cost element array + * @return cost element list */ public static List getCostElementsWithCostingMethods (PO po) { @@ -141,7 +141,7 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport } // getCostElementCostingMethod /** - * Get active Material Cost Element for client + * Get active Material Cost Element (associated with costing method) for client * @param po parent * @return cost element array */ @@ -158,9 +158,8 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport return retValue; } // getMaterialCostElement - // MZ Goodwill /** - * Get active non Material Cost Element for client + * Get active non Material Cost Element (i.e costing method is null) for client * @param po parent * @return cost element array */ @@ -244,14 +243,11 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport } /** - * Get All Cost Elements for current AD_Client_ID + * Get All active Cost Elements for current AD_Client_ID * @param ctx context * @param CostingMethod - * @return array cost elements + * @return cost element list **/ - /** - * @return - */ public static List getByCostingMethod (Properties ctx, String CostingMethod) { final String whereClause = "AD_Client_ID = ? AND CostingMethod=?"; @@ -266,21 +262,20 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport /** Logger */ private static CLogger s_log = CLogger.getCLogger (MCostElement.class); - - + /** - * UUID based Constructor - * @param ctx Context - * @param M_CostElement_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_CostElement_UU UUID key + * @param trxName Transaction + */ public MCostElement(Properties ctx, String M_CostElement_UU, String trxName) { super(ctx, M_CostElement_UU, trxName); if (Util.isEmpty(M_CostElement_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param M_CostElement_ID id @@ -313,7 +308,7 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport } // MCostElement /** - * + * Copy constructor * @param copy */ public MCostElement(MCostElement copy) @@ -322,7 +317,7 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -332,7 +327,7 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -348,6 +343,7 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { // Check Unique Costing Method @@ -376,6 +372,7 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport * Before Delete * @return true if can be deleted */ + @Override protected boolean beforeDelete () { String cm = getCostingMethod(); @@ -414,7 +411,7 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport /** * Is this a Costing Method - * @return true if not Material cost or no costing method. + * @return true if cost element is of type material and costing method is not null */ public boolean isCostingMethod() { @@ -424,7 +421,7 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport /** * Is Avg Invoice Costing Method - * @return true if AverageInvoice + * @return true if costing method is AverageInvoice */ public boolean isAverageInvoice() { @@ -436,7 +433,7 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport /** * Is Avg PO Costing Method - * @return true if AveragePO + * @return true if costing method is AveragePO */ public boolean isAveragePO() { @@ -445,9 +442,10 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport && cm.equals(COSTINGMETHOD_AveragePO) && COSTELEMENTTYPE_Material.equals(getCostElementType()); } // isAveragePO + /** * Is FiFo Costing Method - * @return true if Fifo + * @return true if costing method is Fifo */ public boolean isFifo() { @@ -456,9 +454,10 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport && cm.equals(COSTINGMETHOD_Fifo) && COSTELEMENTTYPE_Material.equals(getCostElementType()); } // isFifo + /** * Is Last Invoice Costing Method - * @return true if LastInvoice + * @return true if costing method is LastInvoice */ public boolean isLastInvoice() { @@ -467,9 +466,10 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport && cm.equals(COSTINGMETHOD_LastInvoice) && COSTELEMENTTYPE_Material.equals(getCostElementType()); } // isLastInvoice + /** * Is Last PO Costing Method - * @return true if LastPOPrice + * @return true if costing method is LastPOPrice */ public boolean isLastPOPrice() { @@ -478,9 +478,10 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport && cm.equals(COSTINGMETHOD_LastPOPrice) && COSTELEMENTTYPE_Material.equals(getCostElementType()); } // isLastPOPrice + /** * Is LiFo Costing Method - * @return true if Lifo + * @return true if costing method is Lifo */ public boolean isLifo() { @@ -489,9 +490,10 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport && cm.equals(COSTINGMETHOD_Lifo) && COSTELEMENTTYPE_Material.equals(getCostElementType()); } // isLiFo + /** * Is Std Costing Method - * @return true if StandardCosting + * @return true if costing method is StandardCosting */ public boolean isStandardCosting() { @@ -500,9 +502,10 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport && cm.equals(COSTINGMETHOD_StandardCosting) && COSTELEMENTTYPE_Material.equals(getCostElementType()); } // isStandardCosting + /** * Is User Costing Method - * @return true if User Defined + * @return true if costing method is User Defined */ public boolean isUserDefined() { @@ -516,6 +519,7 @@ public class MCostElement extends X_M_CostElement implements ImmutablePOSupport * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MCostElement["); diff --git a/org.adempiere.base/src/org/compiere/model/MCostQueue.java b/org.adempiere.base/src/org/compiere/model/MCostQueue.java index 0899b8ba84..47e7bf8afb 100644 --- a/org.adempiere.base/src/org/compiere/model/MCostQueue.java +++ b/org.adempiere.base/src/org/compiere/model/MCostQueue.java @@ -38,19 +38,18 @@ import org.compiere.util.Util; public class MCostQueue extends X_M_CostQueue { /** - * + * generated serial id */ private static final long serialVersionUID = -1782836708418500130L; - /** * Get/Create Cost Queue Record. - * CostingLevel is not validated + * CostingLevel is not validated. * @param product product - * @param M_AttributeSetInstance_ID real asi + * @param M_AttributeSetInstance_ID asi * @param as accounting schema - * @param AD_Org_ID real org - * @param M_CostElement_ID element + * @param AD_Org_ID org + * @param M_CostElement_ID cost element * @param trxName transaction * @return cost queue or null */ @@ -153,7 +152,6 @@ public class MCostQueue extends X_M_CostQueue list.toArray(costQ); return costQ; } // getQueue - /** * Adjust Qty based on in Lifo/Fifo order @@ -164,7 +162,7 @@ public class MCostQueue extends X_M_CostQueue * @param ce Cost Element * @param Qty quantity to be reduced * @param trxName transaction - * @return cost price reduced or null of error + * @return cost price reduced or null if error */ public static BigDecimal adjustQty (MProduct product, int M_ASI_ID, MAcctSchema as, int Org_ID, MCostElement ce, BigDecimal Qty, @@ -226,7 +224,7 @@ public class MCostQueue extends X_M_CostQueue } // adjustQty /** - * Calculate Cost based on Qty based on in Lifo/Fifo order + * Calculate Cost based on Qty and in Lifo/Fifo order * @param product product * @param M_ASI_ID costing level ASI * @param as accounting schema @@ -311,21 +309,20 @@ public class MCostQueue extends X_M_CostQueue /** Logger */ private static CLogger s_log = CLogger.getCLogger (MCostQueue.class); - - + /** - * UUID based Constructor - * @param ctx Context - * @param M_CostQueue_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_CostQueue_UU UUID key + * @param trxName Transaction + */ public MCostQueue(Properties ctx, String M_CostQueue_UU, String trxName) { super(ctx, M_CostQueue_UU, trxName); if (Util.isEmpty(M_CostQueue_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param ignored multi-key @@ -381,9 +378,9 @@ public class MCostQueue extends X_M_CostQueue } // MCostQueue /** - * Update Record. + * Update current cost price and qty. * ((OldAvg*OldQty)+(Price*Qty)) / (OldQty+Qty) - * @param amt total Amount + * @param amt total Amount (price * qty) * @param qty quantity * @param precision costing precision */ diff --git a/org.adempiere.base/src/org/compiere/model/MCostType.java b/org.adempiere.base/src/org/compiere/model/MCostType.java index 1b548fd59e..52e88a71b3 100644 --- a/org.adempiere.base/src/org/compiere/model/MCostType.java +++ b/org.adempiere.base/src/org/compiere/model/MCostType.java @@ -29,16 +29,16 @@ import org.compiere.util.Msg; public class MCostType extends X_M_CostType { /** - * + * generated serial id */ private static final long serialVersionUID = -2060640115481013228L; /** - * UUID based Constructor - * @param ctx Context - * @param M_CostType_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_CostType_UU UUID key + * @param trxName Transaction + */ public MCostType(Properties ctx, String M_CostType_UU, String trxName) { super(ctx, M_CostType_UU, trxName); } @@ -69,6 +69,7 @@ public class MCostType extends X_M_CostType * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MCostType["); @@ -81,6 +82,7 @@ public class MCostType extends X_M_CostType * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getAD_Org_ID() != 0) @@ -92,6 +94,7 @@ public class MCostType extends X_M_CostType * Before Delete * @return true if it can be deleted */ + @Override protected boolean beforeDelete () { MAcctSchema[] ass = MAcctSchema.getClientAcctSchema(getCtx(), getAD_Client_ID()); diff --git a/org.adempiere.base/src/org/compiere/model/MCountry.java b/org.adempiere.base/src/org/compiere/model/MCountry.java index b859b236e5..5a4e2a1acc 100644 --- a/org.adempiere.base/src/org/compiere/model/MCountry.java +++ b/org.adempiere.base/src/org/compiere/model/MCountry.java @@ -38,7 +38,7 @@ import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; /** - * Location Country Model (Value Object) + * Location Country Model * * @author Jorg Janke * @version $Id: MCountry.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $ @@ -50,7 +50,7 @@ public class MCountry extends X_C_Country implements Comparator, Serializable, ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 6102749517340832365L; @@ -93,6 +93,7 @@ public class MCountry extends X_C_Country * @return Country * @deprecated */ + @Deprecated public static MCountry getDefault (Properties ctx) { return getDefault(); @@ -120,6 +121,7 @@ public class MCountry extends X_C_Country * @return MCountry Array * @deprecated */ + @Deprecated public static MCountry[] getCountries(Properties ctx) { return getCountries(); @@ -145,7 +147,7 @@ public class MCountry extends X_C_Country /** * Load Countries. - * Set Default Language to Client Language + * Set Default Country via country code of Client Language (AD_Language.CountryCode). */ private static synchronized void loadAllCountries () { @@ -168,7 +170,7 @@ public class MCountry extends X_C_Country } // loadAllCountries /** - * Load Default Country for actual client on context + * Load Default Country for login client */ private static void loadDefaultCountry() { loadAllCountriesIfNeeded(); @@ -205,6 +207,7 @@ public class MCountry extends X_C_Country * @param AD_Language language or null * @deprecated - not used at all, you can delete references to this method */ + @Deprecated(forRemoval = true, since = "11") public static void setDisplayLanguage (String AD_Language) { s_AD_Language = AD_Language; @@ -224,22 +227,20 @@ public class MCountry extends X_C_Country private static CLogger s_log = CLogger.getCLogger (MCountry.class); // Default DisplaySequence */ private static String DISPLAYSEQUENCE = "@C@, @P@"; - /** - * UUID based Constructor - * @param ctx Context - * @param C_Country_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Country_UU UUID key + * @param trxName Transaction + */ public MCountry(Properties ctx, String C_Country_UU, String trxName) { super(ctx, C_Country_UU, trxName); if (Util.isEmpty(C_Country_UU)) setInitialDefaults(); } - /************************************************************************* - * Create empty Country + /** * @param ctx context * @param C_Country_ID ID * @param trxName transaction @@ -263,7 +264,7 @@ public class MCountry extends X_C_Country } /** - * Create Country from current row in ResultSet + * Load Country from current row in ResultSet * @param ctx context * @param rs ResultSet * @param trxName transaction @@ -274,7 +275,7 @@ public class MCountry extends X_C_Country } // MCountry /** - * + * Copy constructor * @param copy */ public MCountry(MCountry copy) @@ -283,7 +284,7 @@ public class MCountry extends X_C_Country } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -293,7 +294,7 @@ public class MCountry extends X_C_Country } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -308,6 +309,7 @@ public class MCountry extends X_C_Country * Return Name - translated if DisplayLanguage is set. * @return Name */ + @Override public String toString() { return getTrlName(); @@ -331,12 +333,12 @@ public class MCountry extends X_C_Country { return get_Translation(COLUMNNAME_Name, language); } // getTrlName - - + /** - * Get Display Sequence + * Get Display Sequence for city (C), region (R), postal code (P) and additional postal code (A). * @return display sequence */ + @Override public String getDisplaySequence () { String ds = super.getDisplaySequence (); @@ -346,10 +348,11 @@ public class MCountry extends X_C_Country } // getDisplaySequence /** - * Get Local Display Sequence. - * If not defined get Display Sequence - * @return local display sequence + * Get Local Display Sequence for city (C), region (R), postal code (P) and additional postal code (A). + * If not defined get Display Sequence. + * @return display sequence */ + @Override public String getDisplaySequenceLocal () { String ds = super.getDisplaySequenceLocal(); @@ -364,6 +367,7 @@ public class MCountry extends X_C_Country * @param o2 object 2 * @return -1,0, 1 */ + @Override public int compare(Object o1, Object o2) { String s1 = o1.toString(); @@ -377,7 +381,7 @@ public class MCountry extends X_C_Country } // compare /** - * Is the region valid in the country + * Is the region valid in this country * @param C_Region_ID region * @return true if valid */ diff --git a/org.adempiere.base/src/org/compiere/model/MCountryGroup.java b/org.adempiere.base/src/org/compiere/model/MCountryGroup.java index 8dcd580c20..09713b59ab 100644 --- a/org.adempiere.base/src/org/compiere/model/MCountryGroup.java +++ b/org.adempiere.base/src/org/compiere/model/MCountryGroup.java @@ -39,7 +39,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MCountryGroup extends X_C_CountryGroup implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 8489673276196368210L; @@ -80,17 +80,16 @@ public class MCountryGroup extends X_C_CountryGroup implements ImmutablePOSuppor private static CLogger s_log = CLogger.getCLogger (MCountryGroup.class); /** - * UUID based Constructor - * @param ctx Context - * @param C_CountryGroup_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_CountryGroup_UU UUID key + * @param trxName Transaction + */ public MCountryGroup(Properties ctx, String C_CountryGroup_UU, String trxName) { super(ctx, C_CountryGroup_UU, trxName); } - /************************************************************************* - * Create empty Country + /** * @param ctx context * @param C_CountryGroup_ID ID * @param trxName transaction @@ -101,7 +100,7 @@ public class MCountryGroup extends X_C_CountryGroup implements ImmutablePOSuppor } // MCountryGroup /** - * Create Country Group from current row in ResultSet + * Load Country Group from current row in ResultSet * @param ctx context * @param rs ResultSet * @param trxName transaction @@ -112,7 +111,7 @@ public class MCountryGroup extends X_C_CountryGroup implements ImmutablePOSuppor } // MCountryGroup /** - * + * Copy constructor * @param copy */ public MCountryGroup(MCountryGroup copy) @@ -121,7 +120,7 @@ public class MCountryGroup extends X_C_CountryGroup implements ImmutablePOSuppor } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -131,7 +130,7 @@ public class MCountryGroup extends X_C_CountryGroup implements ImmutablePOSuppor } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -151,6 +150,11 @@ public class MCountryGroup extends X_C_CountryGroup implements ImmutablePOSuppor return this; } + /** + * @param c_CountryGroup_ID + * @param c_Country_ID + * @return true if country (C_Country_ID) is part of country group (C_CountryGroup_ID) + */ public static boolean countryGroupContains(int c_CountryGroup_ID, int c_Country_ID) { if (c_CountryGroup_ID == 0 || c_Country_ID == 0) diff --git a/org.adempiere.base/src/org/compiere/model/MCountryGroupCountry.java b/org.adempiere.base/src/org/compiere/model/MCountryGroupCountry.java index 90e6802cb5..61d843f483 100644 --- a/org.adempiere.base/src/org/compiere/model/MCountryGroupCountry.java +++ b/org.adempiere.base/src/org/compiere/model/MCountryGroupCountry.java @@ -30,12 +30,12 @@ import java.util.Properties; import org.compiere.util.CLogger; /** - * Country Group Country Model + * Countries in a Country Group */ public class MCountryGroupCountry extends X_C_CountryGroupCountry { /** - * + * generated serial id */ private static final long serialVersionUID = -6075271124746909433L; @@ -44,17 +44,16 @@ public class MCountryGroupCountry extends X_C_CountryGroupCountry private static CLogger s_log = CLogger.getCLogger (MCountryGroupCountry.class); /** - * UUID based Constructor - * @param ctx Context - * @param C_CountryGroupCountry_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_CountryGroupCountry_UU UUID key + * @param trxName Transaction + */ public MCountryGroupCountry(Properties ctx, String C_CountryGroupCountry_UU, String trxName) { super(ctx, C_CountryGroupCountry_UU, trxName); } - /************************************************************************* - * Create empty Country Group Country + /** * @param ctx context * @param C_CountryGroupCountry_ID ID * @param trxName transaction @@ -65,7 +64,6 @@ public class MCountryGroupCountry extends X_C_CountryGroupCountry } // MCountryGroupCountry /** - * Create Country Group from current row in ResultSet * @param ctx context * @param rs ResultSet * @param trxName transaction diff --git a/org.adempiere.base/src/org/compiere/model/MCtxHelp.java b/org.adempiere.base/src/org/compiere/model/MCtxHelp.java index 7023d669b1..ce05dfca73 100644 --- a/org.adempiere.base/src/org/compiere/model/MCtxHelp.java +++ b/org.adempiere.base/src/org/compiere/model/MCtxHelp.java @@ -35,16 +35,16 @@ import java.util.Properties; */ public class MCtxHelp extends X_AD_CtxHelp { /** - * + * generated serial id */ private static final long serialVersionUID = 6004459503884638672L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_CtxHelp_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_CtxHelp_UU UUID key + * @param trxName Transaction + */ public MCtxHelp(Properties ctx, String AD_CtxHelp_UU, String trxName) { super(ctx, AD_CtxHelp_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MCtxHelpMsg.java b/org.adempiere.base/src/org/compiere/model/MCtxHelpMsg.java index 71f6adaf05..4e9ca19305 100644 --- a/org.adempiere.base/src/org/compiere/model/MCtxHelpMsg.java +++ b/org.adempiere.base/src/org/compiere/model/MCtxHelpMsg.java @@ -42,7 +42,7 @@ import org.idempiere.cache.ImmutablePOCache; */ public class MCtxHelpMsg extends X_AD_CtxHelpMsg implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 3148838750037103261L; /** Logging */ @@ -51,11 +51,11 @@ public class MCtxHelpMsg extends X_AD_CtxHelpMsg implements ImmutablePOSupport { private static ImmutablePOCache s_cache = new ImmutablePOCache(Table_Name, 10); /** - * UUID based Constructor - * @param ctx Context - * @param AD_CtxHelpMsg_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_CtxHelpMsg_UU UUID key + * @param trxName Transaction + */ public MCtxHelpMsg(Properties ctx, String AD_CtxHelpMsg_UU, String trxName) { super(ctx, AD_CtxHelpMsg_UU, trxName); } @@ -81,7 +81,7 @@ public class MCtxHelpMsg extends X_AD_CtxHelpMsg implements ImmutablePOSupport { } // MCtxHelpMsg /** - * + * Copy constructor * @param copy */ public MCtxHelpMsg(MCtxHelpMsg copy) { @@ -89,7 +89,7 @@ public class MCtxHelpMsg extends X_AD_CtxHelpMsg implements ImmutablePOSupport { } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -98,7 +98,7 @@ public class MCtxHelpMsg extends X_AD_CtxHelpMsg implements ImmutablePOSupport { } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -149,6 +149,11 @@ public class MCtxHelpMsg extends X_AD_CtxHelpMsg implements ImmutablePOSupport { return retValue; } + /** + * @param ctxType CTXTYPE_* + * @param recordId + * @return AD_CtxHelp_ID + */ private static int getCtxHelpID(String ctxType, int recordId) { Properties ctx = Env.getCtx(); String column; diff --git a/org.adempiere.base/src/org/compiere/model/MCtxHelpSuggestion.java b/org.adempiere.base/src/org/compiere/model/MCtxHelpSuggestion.java index 66d5eaa458..8e3dee168f 100644 --- a/org.adempiere.base/src/org/compiere/model/MCtxHelpSuggestion.java +++ b/org.adempiere.base/src/org/compiere/model/MCtxHelpSuggestion.java @@ -1,14 +1,35 @@ -/** - * - */ +/*********************************************************************** + * 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: * + * - hengsin * + **********************************************************************/ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; /** + * Suggestion for context help message * @author hengsin - * */ public class MCtxHelpSuggestion extends X_AD_CtxHelpSuggestion { @@ -18,11 +39,11 @@ public class MCtxHelpSuggestion extends X_AD_CtxHelpSuggestion { private static final long serialVersionUID = 1940407803562658708L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_CtxHelpSuggestion_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_CtxHelpSuggestion_UU UUID key + * @param trxName Transaction + */ public MCtxHelpSuggestion(Properties ctx, String AD_CtxHelpSuggestion_UU, String trxName) { super(ctx, AD_CtxHelpSuggestion_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MCurrency.java b/org.adempiere.base/src/org/compiere/model/MCurrency.java index e15113ff0d..0563d7f3a5 100644 --- a/org.adempiere.base/src/org/compiere/model/MCurrency.java +++ b/org.adempiere.base/src/org/compiere/model/MCurrency.java @@ -33,16 +33,16 @@ import org.idempiere.cache.ImmutablePOSupport; public class MCurrency extends X_C_Currency implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 4325153934518648373L; /** - * UUID based Constructor - * @param ctx Context - * @param C_Currency_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Currency_UU UUID key + * @param trxName Transaction + */ public MCurrency(Properties ctx, String C_Currency_UU, String trxName) { super(ctx, C_Currency_UU, trxName); if (Util.isEmpty(C_Currency_UU)) @@ -107,7 +107,7 @@ public class MCurrency extends X_C_Currency implements ImmutablePOSupport } // MCurrency /** - * + * Copy constructor * @param copy */ public MCurrency(MCurrency copy) @@ -116,7 +116,7 @@ public class MCurrency extends X_C_Currency implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -126,7 +126,7 @@ public class MCurrency extends X_C_Currency implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -137,7 +137,7 @@ public class MCurrency extends X_C_Currency implements ImmutablePOSupport copyPO(copy); } - /** Store System Currencies **/ + /** Currencies cache **/ private static ImmutableIntPOCache s_currencies = new ImmutableIntPOCache(Table_Name, 50); /** Cache System Currencies by using ISO code as key **/ private static ImmutablePOCache s_currenciesISO = new ImmutablePOCache(Table_Name, "C_CurrencyISO", 50); @@ -249,6 +249,7 @@ public class MCurrency extends X_C_Currency implements ImmutablePOSupport * String Representation * @return info */ + @Override public String toString() { StringBuilder msgreturn = new StringBuilder("MCurrency[").append(getC_Currency_ID()) diff --git a/org.adempiere.base/src/org/compiere/model/MCurrencyAcct.java b/org.adempiere.base/src/org/compiere/model/MCurrencyAcct.java index 4d872ea58e..5d718cf50a 100644 --- a/org.adempiere.base/src/org/compiere/model/MCurrencyAcct.java +++ b/org.adempiere.base/src/org/compiere/model/MCurrencyAcct.java @@ -30,7 +30,7 @@ import org.compiere.util.CLogger; public class MCurrencyAcct extends X_C_Currency_Acct { /** - * + * generated serial id */ private static final long serialVersionUID = 2256532431388781618L; /** Static Logger */ @@ -51,19 +51,18 @@ public class MCurrencyAcct extends X_C_Currency_Acct .first(); return retValue; } // get - - + /** - * UUID based Constructor - * @param ctx Context - * @param C_Currency_Acct_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Currency_Acct_UU UUID key + * @param trxName Transaction + */ public MCurrencyAcct(Properties ctx, String C_Currency_Acct_UU, String trxName) { super(ctx, C_Currency_Acct_UU, trxName); } - /************************************************************************** + /** * Load Constructor * @param ctx context * @param rs result set diff --git a/org.adempiere.base/src/org/compiere/model/MDashboardContent.java b/org.adempiere.base/src/org/compiere/model/MDashboardContent.java index 188f789cad..e55a3568d7 100644 --- a/org.adempiere.base/src/org/compiere/model/MDashboardContent.java +++ b/org.adempiere.base/src/org/compiere/model/MDashboardContent.java @@ -1,6 +1,24 @@ -/** - * - */ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.sql.ResultSet; @@ -24,22 +42,40 @@ import org.compiere.util.Util; public class MDashboardContent extends X_PA_DashboardContent { /** - * + * generated serial id */ private static final long serialVersionUID = -1360395253302002667L; + /** + * @param isShowInDashboard true for main dashboard, false for side panel + * @param AD_User_ID + * @param AD_Role_ID + * @return number of columns + */ public static int getForSessionColumnCount(boolean isShowInDashboard, int AD_User_ID, int AD_Role_ID) { int noOfCols = getForSessionQuery(isShowInDashboard, AD_User_ID, AD_Role_ID).aggregate("DISTINCT "+COLUMNNAME_ColumnNo, Query.AGGREGATE_COUNT, Integer.class); return noOfCols; } + /** + * @param isShowInDashboard true for main dashboard, false for side panel + * @param AD_User_ID + * @param AD_Role_ID + * @return array of MDashboardContent + */ public static MDashboardContent[] getForSession(boolean isShowInDashboard, int AD_User_ID, int AD_Role_ID) { List list = getForSessionQuery(isShowInDashboard, AD_User_ID, AD_Role_ID).list(); return list.toArray(new MDashboardContent[list.size()]); } + /** + * @param isShowInDashboard + * @param AD_User_ID + * @param AD_Role_ID + * @return Query + */ public static Query getForSessionQuery(boolean isShowInDashboard, int AD_User_ID, int AD_Role_ID) { Properties ctx = Env.getCtx(); @@ -68,20 +104,30 @@ public class MDashboardContent extends X_PA_DashboardContent .setOrderBy(COLUMNNAME_ColumnNo+","+COLUMNNAME_AD_Client_ID+","+COLUMNNAME_Line); } + /** + * @param AD_User_ID + * @param AD_Role_ID + * @return array of MDashboardContent + */ public static MDashboardContent[] getForUserList( int AD_User_ID, int AD_Role_ID) { List list = getForUser( AD_User_ID, AD_Role_ID).list(); return list.toArray(new MDashboardContent[list.size()]); } - public static Query getForUser( int AD_User_ID, int AD_Role_ID) + /** + * @param AD_User_ID + * @param AD_Role_ID + * @return Query + */ + public static Query getForUser( int AD_User_ID, int AD_Role_ID) { - Properties ctx = Env.getCtx(); + Properties ctx = Env.getCtx(); - int AD_Client_ID = Env.getAD_Client_ID(ctx); - List parameters = new ArrayList(); + int AD_Client_ID = Env.getAD_Client_ID(ctx); + List parameters = new ArrayList(); - StringBuilder whereClause = new StringBuilder(); + StringBuilder whereClause = new StringBuilder(); if (AD_Role_ID >= 0){ whereClause.append(COLUMNNAME_AD_Role_ID).append("= ?"); @@ -89,8 +135,6 @@ public class MDashboardContent extends X_PA_DashboardContent parameters.add(AD_Role_ID); } - - if(AD_User_ID >= 0){ whereClause.append(" AND ").append(COLUMNNAME_AD_User_ID).append("= ?"); whereClause.append(" OR ").append( COLUMNNAME_AD_User_ID).append(" IS NULL "); @@ -114,12 +158,22 @@ public class MDashboardContent extends X_PA_DashboardContent return query; } + /** + * @param AD_User_ID + * @param AD_Role_ID + * @return array of MDashboardContent + */ public static MDashboardContent[] getForSession(int AD_User_ID, int AD_Role_ID) { List list = getForSessionQuery(AD_User_ID, AD_Role_ID).list(); return list.toArray(new MDashboardContent[list.size()]); } + /** + * @param AD_User_ID + * @param AD_Role_ID + * @return Query + */ public static Query getForSessionQuery(int AD_User_ID, int AD_Role_ID) { Properties ctx = Env.getCtx(); @@ -148,25 +202,38 @@ public class MDashboardContent extends X_PA_DashboardContent } /** - * UUID based Constructor - * @param ctx Context - * @param PA_DashboardContent_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param PA_DashboardContent_UU UUID key + * @param trxName Transaction + */ public MDashboardContent(Properties ctx, String PA_DashboardContent_UU, String trxName) { super(ctx, PA_DashboardContent_UU, trxName); } - + + /** + * @param ctx + * @param PA_DashboardContent_ID + * @param trxName + */ public MDashboardContent (Properties ctx, int PA_DashboardContent_ID, String trxName) { super (ctx, PA_DashboardContent_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MDashboardContent (Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } + /** + * @return AD_Menu_ID or -1 + */ public int getAD_Menu_ID() { if (m_AD_Menu_ID != null) @@ -183,8 +250,12 @@ public class MDashboardContent extends X_PA_DashboardContent .firstId(); return m_AD_Menu_ID; } + private Integer m_AD_Menu_ID = null; + /** + * @return I_AD_Menu + */ public I_AD_Menu getAD_Menu() { return (I_AD_Menu)MTable.get(getCtx(), I_AD_Menu.Table_Name) @@ -260,8 +331,9 @@ public class MDashboardContent extends X_PA_DashboardContent /* * Before Save * @param newRecord new - * @return + * @return true if no error */ + @Override protected boolean beforeSave (boolean newRecord) { // all mandatory process parameters need to be set if (getAD_Process_ID() > 0 && isEmbedReportContent()) { diff --git a/org.adempiere.base/src/org/compiere/model/MDashboardContentAccess.java b/org.adempiere.base/src/org/compiere/model/MDashboardContentAccess.java index bf521f451e..c99ee8b569 100644 --- a/org.adempiere.base/src/org/compiere/model/MDashboardContentAccess.java +++ b/org.adempiere.base/src/org/compiere/model/MDashboardContentAccess.java @@ -1,6 +1,24 @@ -/** - * - */ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.sql.PreparedStatement; @@ -15,21 +33,20 @@ import org.compiere.util.Env; /** * @author juliana - * */ public class MDashboardContentAccess extends X_PA_DashboardContent_Access { /** - * + * generated serial id */ private static final long serialVersionUID = -4460812046437256244L; /** - * UUID based Constructor - * @param ctx Context - * @param PA_DashboardContent_Access_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param PA_DashboardContent_Access_UU UUID key + * @param trxName Transaction + */ public MDashboardContentAccess(Properties ctx, String PA_DashboardContent_Access_UU, String trxName) { super(ctx, PA_DashboardContent_Access_UU, trxName); } @@ -52,6 +69,13 @@ public class MDashboardContentAccess extends X_PA_DashboardContent_Access { super(ctx, rs, trxName); } + /** + * @param ctx + * @param AD_Role + * @param AD_User + * @param trxname + * @return array of MDashboardContent + */ public static MDashboardContent[] get (Properties ctx,int AD_Role, int AD_User, String trxname) { @@ -110,7 +134,6 @@ public class MDashboardContentAccess extends X_PA_DashboardContent_Access { sql.append(" AND cta.AD_Client_ID in (0,?)"); parameters.add(AD_Client_ID); - sql.append(" ORDER BY ColumnNo"); PreparedStatement pstmt=null; diff --git a/org.adempiere.base/src/org/compiere/model/MDashboardPreference.java b/org.adempiere.base/src/org/compiere/model/MDashboardPreference.java index a612f146b7..963ff2a890 100644 --- a/org.adempiere.base/src/org/compiere/model/MDashboardPreference.java +++ b/org.adempiere.base/src/org/compiere/model/MDashboardPreference.java @@ -29,12 +29,11 @@ import org.compiere.util.Env; public class MDashboardPreference extends X_PA_DashboardPreference { /** - * + * generated serial id */ private static final long serialVersionUID = -8779298936108629638L; /** - * * @param isShowInDashboard * @param AD_User_ID * @param AD_Role_ID @@ -49,7 +48,6 @@ public class MDashboardPreference extends X_PA_DashboardPreference } /** - * * @param isShowInDashboard * @param AD_User_ID * @param AD_Role_ID @@ -64,7 +62,6 @@ public class MDashboardPreference extends X_PA_DashboardPreference } /** - * * @param isShowInDashboard * @param AD_User_ID * @param AD_Role_ID @@ -75,12 +72,25 @@ public class MDashboardPreference extends X_PA_DashboardPreference List list = getForSessionQuery(isShowInDashboard, AD_User_ID, AD_Role_ID).list(); return list.toArray(new MDashboardPreference[list.size()]); } - + + /** + * @param isShowInDashboard + * @param AD_User_ID + * @param AD_Role_ID + * @return Query + */ private static Query getForSessionQuery(boolean isShowInDashboard, int AD_User_ID, int AD_Role_ID) { return getForSessionQuery(isShowInDashboard, AD_User_ID, AD_Role_ID, -1); } - + + /** + * @param isShowInDashboard + * @param AD_User_ID + * @param AD_Role_ID + * @param lineNo + * @return Query + */ private static Query getForSessionQuery(boolean isShowInDashboard, int AD_User_ID, int AD_Role_ID, int lineNo) { Properties ctx = Env.getCtx(); @@ -112,7 +122,6 @@ public class MDashboardPreference extends X_PA_DashboardPreference } /** - * * @param AD_User_ID * @param AD_Role_ID * @param isCol @@ -123,7 +132,13 @@ public class MDashboardPreference extends X_PA_DashboardPreference List list = getForSessionQuery(AD_User_ID, AD_Role_ID, isCol).list(); return list.toArray(new MDashboardPreference[list.size()]); } - + + /** + * @param AD_User_ID + * @param AD_Role_ID + * @param isCol + * @return Query + */ private static Query getForSessionQuery(int AD_User_ID, int AD_Role_ID, boolean isCol) { Properties ctx = Env.getCtx(); @@ -152,17 +167,16 @@ public class MDashboardPreference extends X_PA_DashboardPreference } /** - * UUID based Constructor - * @param ctx Context - * @param PA_DashboardPreference_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param PA_DashboardPreference_UU UUID key + * @param trxName Transaction + */ public MDashboardPreference(Properties ctx, String PA_DashboardPreference_UU, String trxName) { super(ctx, PA_DashboardPreference_UU, trxName); } /** - * * @param ctx * @param PA_DashboardPreference_ID * @param trxName @@ -173,7 +187,6 @@ public class MDashboardPreference extends X_PA_DashboardPreference } /** - * * @param ctx * @param rs * @param trxName @@ -182,5 +195,4 @@ public class MDashboardPreference extends X_PA_DashboardPreference { super (ctx, rs, trxName); } - } diff --git a/org.adempiere.base/src/org/compiere/model/MDepositBatch.java b/org.adempiere.base/src/org/compiere/model/MDepositBatch.java index 111cad5301..f60e12ea0b 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepositBatch.java +++ b/org.adempiere.base/src/org/compiere/model/MDepositBatch.java @@ -53,16 +53,16 @@ import org.compiere.util.Util; public class MDepositBatch extends X_C_DepositBatch { /** - * + * generated serial id */ private static final long serialVersionUID = 7691820074981291939L; /** - * UUID based Constructor - * @param ctx Context - * @param C_DepositBatch_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_DepositBatch_UU UUID key + * @param trxName Transaction + */ public MDepositBatch(Properties ctx, String C_DepositBatch_UU, String trxName) { super(ctx, C_DepositBatch_UU, trxName); if (Util.isEmpty(C_DepositBatch_UU)) @@ -104,8 +104,8 @@ public class MDepositBatch extends X_C_DepositBatch } // MDepositBatch /** - * Copy Constructor. - * Dos not copy: Dates/Period + * Create new deposit batch from original.
    + * Copy over ad_client_id, ad_org_id, c_depositbatch_id, description, c_doctype_id, datedoc, datedeposit and depositamt. * @param original original */ public MDepositBatch (MDepositBatch original) @@ -127,14 +127,14 @@ public class MDepositBatch extends X_C_DepositBatch * @param AD_Client_ID client * @param AD_Org_ID org */ + @Override public void setClientOrg (int AD_Client_ID, int AD_Org_ID) { super.setClientOrg(AD_Client_ID, AD_Org_ID); } // setClientOrg /** - * Set Accounting Date. - * Set also Period if not set earlier + * Set Date Deposit * @param DateAcct date */ public void setDateAcct (Timestamp DateAcct) @@ -144,14 +144,15 @@ public class MDepositBatch extends X_C_DepositBatch return; } // setDateAcct - /** Process Message */ private String m_processMsg = null; /** * Unlock Document. - * @return true if success + * @return true if success + * @deprecated incomplete/abandon implementation of DocAction interface */ + @Deprecated public boolean unlockIt() { if (log.isLoggable(Level.INFO)) log.info("unlockIt - " + toString()); @@ -162,19 +163,21 @@ public class MDepositBatch extends X_C_DepositBatch /** * Invalidate Document * @return true if success + * @deprecated incomplete/abandon implementation of DocAction interface */ + @Deprecated public boolean invalidateIt() { if (log.isLoggable(Level.INFO)) log.info("invalidateIt - " + toString()); return true; } // invalidateIt - - /** * Void Document. - * @return false + * @return false + * @deprecated incomplete/abandon implementation of DocAction interface */ + @Deprecated public boolean voidIt() { if (log.isLoggable(Level.INFO)) log.info("voidIt - " + toString()); @@ -190,11 +193,11 @@ public class MDepositBatch extends X_C_DepositBatch return false; } // voidIt - /** * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MDepositBatch["); @@ -207,7 +210,9 @@ public class MDepositBatch extends X_C_DepositBatch /** * Get Document Info * @return document info (untranslated) + * @deprecated incomplete/abandon implementation of DocAction interface */ + @Deprecated public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); @@ -217,7 +222,9 @@ public class MDepositBatch extends X_C_DepositBatch /** * Create PDF * @return File or null + * @deprecated incomplete/abandon implementation of DocAction interface */ + @Deprecated public File createPDF () { try @@ -236,7 +243,9 @@ public class MDepositBatch extends X_C_DepositBatch * Create PDF file * @param file output file * @return file if success + * @deprecated incomplete/abandon implementation of DocAction interface */ + @Deprecated public File createPDF (File file) { return null; @@ -246,7 +255,9 @@ public class MDepositBatch extends X_C_DepositBatch /** * Get Process Message * @return clear text error message + * @deprecated incomplete/abandon implementation of DocAction interface */ + @Deprecated public String getProcessMsg() { return m_processMsg; @@ -255,7 +266,9 @@ public class MDepositBatch extends X_C_DepositBatch /** * Get Document Owner (Responsible) * @return AD_User_ID (Created By) + * @deprecated incomplete/abandon implementation of DocAction interface */ + @Deprecated public int getDoc_User_ID() { return getCreatedBy(); @@ -264,19 +277,20 @@ public class MDepositBatch extends X_C_DepositBatch /** * Get Document Approval Amount * @return DR amount + * @deprecated incomplete/abandon implementation of DocAction interface */ + @Deprecated public BigDecimal getApprovalAmt() { return getDepositAmt(); } // getApprovalAmt - - - + /** * After Delete * @param success success * @return success */ + @Override protected boolean afterDelete (boolean success) { if (getC_DepositBatch_ID() != 0 ) @@ -287,11 +301,10 @@ public class MDepositBatch extends X_C_DepositBatch return success; } // afterDelete - - - /************************************************************************** + + /** * Get Deposit Batch Lines - * @return Array of lines + * @return Array of lines (MDepositBatchLine) */ public MDepositBatchLine[] getLines() { @@ -325,7 +338,9 @@ public class MDepositBatch extends X_C_DepositBatch /** * Document Status is Complete or Closed * @return true if CO, CL or RE + * @deprecated incomplete/abandon implementation of DocAction interface */ + @Deprecated public boolean isComplete() { String ds = getDocStatus(); diff --git a/org.adempiere.base/src/org/compiere/model/MDepositBatchLine.java b/org.adempiere.base/src/org/compiere/model/MDepositBatchLine.java index 95d52c8554..2b06473bf0 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepositBatchLine.java +++ b/org.adempiere.base/src/org/compiere/model/MDepositBatchLine.java @@ -40,7 +40,7 @@ import org.compiere.util.Msg; import org.compiere.util.Util; /** - * Bank Statement Line Model + * Lines of deposit batch * * @author Alejandro Falcone * @version $Id: MDepositBatchLine.java,v 1.3 2007/07/02 00:51:02 afalcone Exp $ @@ -49,18 +49,16 @@ import org.compiere.util.Util; public class MDepositBatchLine extends X_C_DepositBatchLine { /** - * + * generated serial id */ private static final long serialVersionUID = -4461960512392850996L; - - /** - * UUID based Constructor - * @param ctx Context - * @param C_DepositBatchLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_DepositBatchLine_UU UUID key + * @param trxName Transaction + */ public MDepositBatchLine(Properties ctx, String C_DepositBatchLine_UU, String trxName) { super(ctx, C_DepositBatchLine_UU, trxName); if (Util.isEmpty(C_DepositBatchLine_UU)) @@ -120,7 +118,6 @@ import org.compiere.util.Util; setLine(lineNo); } // MDepositBatchLine - /** * Set Payment * @param payment payment @@ -139,6 +136,7 @@ import org.compiere.util.Util; * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { MDepositBatch parent = new MDepositBatch(getCtx(), getC_DepositBatch_ID(), get_TrxName()); @@ -166,14 +164,14 @@ import org.compiere.util.Util; return true; } // beforeSave - - + /** * After Save * @param newRecord new * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -187,6 +185,7 @@ import org.compiere.util.Util; * @param success success * @return success */ + @Override protected boolean afterDelete (boolean success) { if (!success) @@ -200,11 +199,9 @@ import org.compiere.util.Util; return success; } // afterDelete - - - + /** - * Update Header + * Update DepositAmt of Header (C_DepositBatch) */ private void updateHeader() { diff --git a/org.adempiere.base/src/org/compiere/model/MDepreciation.java b/org.adempiere.base/src/org/compiere/model/MDepreciation.java index ef00abe93e..c323524f65 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepreciation.java +++ b/org.adempiere.base/src/org/compiere/model/MDepreciation.java @@ -18,29 +18,33 @@ import org.idempiere.fa.exceptions.AssetNotSupportedException; import org.idempiere.fa.service.api.DepreciationDTO; import org.idempiere.fa.service.api.IDepreciationMethod; - /** - * Depreciation Engine (eg. SL, ARH_VAR ...) + * Depreciation Method (eg. SL, ARH_VAR ...). + * Note that only SL (straight line) method have been implemented. * @author Teo Sarca, SC ARHIPAC SERVICE SRL */ public class MDepreciation extends X_A_Depreciation implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -4366354698409595086L; /** - * UUID based Constructor - * @param ctx Context - * @param A_Depreciation_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Depreciation_UU UUID key + * @param trxName Transaction + */ public MDepreciation(Properties ctx, String A_Depreciation_UU, String trxName) { super(ctx, A_Depreciation_UU, trxName); } - /** Standard Constructor */ + /** + * @param ctx + * @param A_Depreciation_ID + * @param trxName + */ public MDepreciation (Properties ctx, int A_Depreciation_ID, String trxName) { super (ctx, A_Depreciation_ID, trxName); @@ -57,7 +61,7 @@ public class MDepreciation extends X_A_Depreciation implements ImmutablePOSuppor } // MDepreciation /** - * + * Copy constructor * @param copy */ public MDepreciation(MDepreciation copy) @@ -66,7 +70,7 @@ public class MDepreciation extends X_A_Depreciation implements ImmutablePOSuppor } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -76,7 +80,7 @@ public class MDepreciation extends X_A_Depreciation implements ImmutablePOSuppor } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -98,9 +102,12 @@ public class MDepreciation extends X_A_Depreciation implements ImmutablePOSuppor /** The accuracy of calculation on depreciation */ private final static int m_precision = 2; - /* Constrants */ + /* 12 month */ private static final BigDecimal BD_12 = BigDecimal.valueOf(12); + /** + * @param depr + */ private static void addToCache(MDepreciation depr) { if (depr == null) @@ -184,7 +191,7 @@ public class MDepreciation extends X_A_Depreciation implements ImmutablePOSuppor } /** - * Needs to be adjusted in last month's amortization + * @return true if needs to be adjusted in last month's amortization */ public boolean requireLastPeriodAdjustment() { @@ -193,10 +200,11 @@ public class MDepreciation extends X_A_Depreciation implements ImmutablePOSuppor /** * Calculate the value of depreciation over time - * @param assetwk - Fixed Assets worksheet + * @param assetwk - Depreciation work sheet * @param assetAcct - FA default accounting elements * @param A_Current_Period - current period * @param Accum_Dep accumulated depreciation until present period + * @param depreciationMethod * @return amortized value */ public BigDecimal invoke(MDepreciationWorkfile assetwk, MAssetAcct assetAcct, @@ -235,7 +243,8 @@ public class MDepreciation extends X_A_Depreciation implements ImmutablePOSuppor depreciationDTO.scale = getPrecision(); // calculate expense use implement of IDepreciationMethod retValue = depreciationMethod.caclulateDepreciation(depreciationDTO); - }else if (depreciationType.equalsIgnoreCase("SL")) + } + else if (depreciationType.equalsIgnoreCase("SL")) { retValue = apply_SL(assetwk, assetAcct, A_Current_Period, Accum_Dep); } @@ -271,16 +280,17 @@ public class MDepreciation extends X_A_Depreciation implements ImmutablePOSuppor } // invoke /** - * Check if the method can be invoked to give parameters + * Check if the method can be invoked to give parameters.
    + * Not fully implemented - always return true now. * @param assetwk * @param assetAcct * @param A_Current_Period between 0 to UseLifeMonths - 1 * @param Accum_Dep + * @return true if can invoke depreciation */ public boolean canInvoke(MDepreciationWorkfile assetwk, MAssetAcct assetAcct, int A_Current_Period, BigDecimal Accum_Dep) { - //~ MDepreciationWorkfile wk = MDepreciationWorkfile.get(getCtx(), A_Asset_ID, PostingType); if (assetwk == null) { log.warning("@NotFound@ @A_Depreciation_Workfile_ID@"); @@ -296,13 +306,11 @@ public class MDepreciation extends X_A_Depreciation implements ImmutablePOSuppor } // canInvoke /** - * Without depreciation - * @param A_Asset_ID Assets IDs (ignored) - * @param A_Current_Period current period (in months, between 0 and UseLifeMonths - 1) (ignored) - * @param PostingType posting type (eg. A - Actual, S - Statistics ...) (ignored) - * @param A_Asset_Acct_ID FA accounting IDs (see table A_Asset_Acct) (ignored) - * @param Accum_Dep Accumulated depreciation from this method (ignored) - * @return Env.ZERO + * @param wk + * @param assetAcct + * @param A_Current_Period + * @param Accum_Dep + * @return always return 0 */ private BigDecimal apply_ARH_ZERO (MDepreciationWorkfile wk, MAssetAcct assetAcct, int A_Current_Period, BigDecimal Accum_Dep) @@ -310,13 +318,13 @@ public class MDepreciation extends X_A_Depreciation implements ImmutablePOSuppor return Env.ZERO; } - /** Linear depreciation regime - * @param A_Asset_ID Assets IDs - * @param A_Current_Period current period (in months, between 0 and UseLifeMonths - 1) - * @param PostingType posting type (eg. A - Actual, S - Statistics ...) - * @param A_Asset_Acct_ID FA accounting IDs (see table A_Asset_Acct) - * @param Accum_Dep Accumulated depreciation from this method - * @return depreciation for the current month + /** + * Linear depreciation regime + * @param wk Depreciation work sheet + * @param assetAcct Asset account + * @param A_Current_Period current period + * @param Accum_Dep Accumulated depreciation + * @return depreciation for current period */ private BigDecimal apply_SL (MDepreciationWorkfile wk, MAssetAcct assetAcct, int A_Current_Period, BigDecimal Accum_Dep) @@ -336,18 +344,17 @@ public class MDepreciation extends X_A_Depreciation implements ImmutablePOSuppor /** * Accelerated depreciation regime - * @param A_Current_Period current period (in months, between 0 and UseLifeMonths - 1) - * @param PostingType posting type (eg. A - Actual, S - Statistics ...) - * @param A_Asset_Acct_ID FA accounting IDs (see table A_Asset_Acct) - * @param Accum_Dep Accumulated depreciation from this method - * @return depreciation for the current month + * @param wk + * @param acct + * @param A_Current_Period + * @param Accum_Dep + * @return depreciation for current period */ private BigDecimal apply_ARH_VAR (MDepreciationWorkfile wk, MAssetAcct acct, int A_Current_Period, BigDecimal Accum_Dep) { BigDecimal amt = wk.getActualCost(); BigDecimal varPercent = acct.getA_Depreciation_Variable_Perc(wk.isFiscal()).setScale(getPrecision(), RoundingMode.HALF_UP); - //~ int lifePeriods = wk.getUseLifeMonths(wk.isFiscal()); BigDecimal assetExp = BigDecimal.ZERO; // First time in first year @@ -374,13 +381,14 @@ public class MDepreciation extends X_A_Depreciation implements ImmutablePOSuppor } - /** Digressive depreciation regime (AD1) - * @param A_Current_Period current period (in months, between 0 and UseLifeMonths - 1) - * @param PostingType posting type (eg. A - Actual, S - Statistics ...) - * @param A_Asset_Acct_ID FA accounting IDs (see table A_Asset_Acct) - * @param Accum_Dep Accumulated depreciation from this method - * @return depreciation for the current month - * TODO RE TEST IT! + /** + * Digressive depreciation regime (AD1) + * @param wk + * @param assetAcct + * @param A_Current_Period + * @param Accum_Dep Accumulated depreciation + * @return depreciation for current period + * TODO RE TEST IT! */ private BigDecimal apply_ARH_AD1(MDepreciationWorkfile wk, MAssetAcct assetAcct, int A_Current_Period,BigDecimal Accum_Dep) { @@ -462,7 +470,8 @@ public class MDepreciation extends X_A_Depreciation implements ImmutablePOSuppor throw new AssetNotImplementedException("AD2"); } - /** Calculate the value of depreciation over a month (period). In the last month of the year we add errors from the adjustment calculation + /** + * Calculate the value of depreciation over a month (period). In the last month of the year we add errors from the adjustment calculation. * @param A_Current_Period current month's index * @param amtPerYear value of depreciation per year * @return rounded value to the nearest month/decimal getPrecision () @@ -488,6 +497,9 @@ public class MDepreciation extends X_A_Depreciation implements ImmutablePOSuppor return assetExp; } + /** + * @return always return 0 + */ public int getFixMonthOffset() { // IDEMPIERE-197 Stabilize Fixed Assets // MDepreciationWorkfile is requiring this missing column diff --git a/org.adempiere.base/src/org/compiere/model/MDepreciationBuild.java b/org.adempiere.base/src/org/compiere/model/MDepreciationBuild.java index 91991bbeb2..a60eb74043 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepreciationBuild.java +++ b/org.adempiere.base/src/org/compiere/model/MDepreciationBuild.java @@ -1,35 +1,66 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; - -/** Depreciation Build +/** + * Depreciation Build * @author Teo Sarca, SC ARHIPAC SRL * @version $Id$ -- Release 2.5.3a - 2006-06-22 18:03:22.896 */ public class MDepreciationBuild extends X_A_Depreciation_Build { /** - * + * generated serial id */ private static final long serialVersionUID = 2075917470265913988L; + /** - * UUID based Constructor - * @param ctx Context - * @param A_Depreciation_Build_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Depreciation_Build_UU UUID key + * @param trxName Transaction + */ public MDepreciationBuild(Properties ctx, String A_Depreciation_Build_UU, String trxName) { super(ctx, A_Depreciation_Build_UU, trxName); } - /** Standard Constructor */ + /** + * @param ctx + * @param A_Depreciation_Build_ID + * @param trxName + */ public MDepreciationBuild (Properties ctx, int A_Depreciation_Build_ID, String trxName) { super (ctx, A_Depreciation_Build_ID, trxName); } - /** Load Constructor */ + + /** + * @param ctx + * @param rs + * @param trxName + */ public MDepreciationBuild (Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); diff --git a/org.adempiere.base/src/org/compiere/model/MDepreciationConvention.java b/org.adempiere.base/src/org/compiere/model/MDepreciationConvention.java index 9c6e214820..8d1640a8ee 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepreciationConvention.java +++ b/org.adempiere.base/src/org/compiere/model/MDepreciationConvention.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.math.BigDecimal; import java.sql.CallableStatement; @@ -10,23 +31,25 @@ import org.compiere.util.Env; import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; -/** Convention for the first year of depreciation (ex. FMCON, FYCON ...) +/** + * Convention for the first year of depreciation (ex. FMCON, FYCON ...). + * Not fully implemented. * @author Teo Sarca, SC Arhipac SRL * @version $Id$ */ public class MDepreciationConvention extends X_A_Depreciation_Convention implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -3735111030292424391L; /** - * UUID based Constructor - * @param ctx Context - * @param A_Depreciation_Convention_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Depreciation_Convention_UU UUID key + * @param trxName Transaction + */ public MDepreciationConvention(Properties ctx, String A_Depreciation_Convention_UU, String trxName) { super(ctx, A_Depreciation_Convention_UU, trxName); } @@ -53,7 +76,7 @@ public class MDepreciationConvention extends X_A_Depreciation_Convention impleme } // MDepreciationConvention /** - * + * Copy constructor * @param copy */ public MDepreciationConvention(MDepreciationConvention copy) @@ -62,7 +85,7 @@ public class MDepreciationConvention extends X_A_Depreciation_Convention impleme } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -72,7 +95,7 @@ public class MDepreciationConvention extends X_A_Depreciation_Convention impleme } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -115,12 +138,25 @@ public class MDepreciationConvention extends X_A_Depreciation_Convention impleme return null; } // get - /** */ + /** + * @param assetwk + * @param assetAcct + * @param Flag + * @param Period + * @return + */ public BigDecimal invoke (MDepreciationWorkfile assetwk, MAssetAcct assetAcct, int Flag, int Period) { return invoke(assetwk.getA_Asset_ID(), assetAcct.getPostingType(), assetAcct.get_ID(), Flag, Period); } - /** */ + /** + * @param A_Asset_ID + * @param PostingType + * @param A_Asset_Acct_ID + * @param Flag + * @param Period + * @return calculated value + */ public BigDecimal invoke (int A_Asset_ID, String PostingType, int A_Asset_Acct_ID, int Flag, int Period) { String conventionType = getConventionType(); BigDecimal retValue = null; @@ -163,6 +199,14 @@ public class MDepreciationConvention extends X_A_Depreciation_Convention impleme return retValue; } + /** + * @param A_Asset_ID + * @param PostingType + * @param A_Asset_Acct_ID + * @param Flag + * @param Period + * @return always return 1 + */ public BigDecimal apply_FMCON(int A_Asset_ID, String PostingType, int A_Asset_Acct_ID, int Flag, int Period) { return BigDecimal.ONE; } diff --git a/org.adempiere.base/src/org/compiere/model/MDepreciationEntry.java b/org.adempiere.base/src/org/compiere/model/MDepreciationEntry.java index d54810e8c1..e9a2aa1fa2 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepreciationEntry.java +++ b/org.adempiere.base/src/org/compiere/model/MDepreciationEntry.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.io.File; @@ -21,7 +42,6 @@ import org.compiere.util.Util; import org.idempiere.fa.exceptions.AssetArrayException; import org.idempiere.fa.exceptions.AssetException; - /** * Depreciation Entry * @author Teo Sarca, SC ARHIPAC SERVICE SRL @@ -29,26 +49,28 @@ import org.idempiere.fa.exceptions.AssetException; public class MDepreciationEntry extends X_A_Depreciation_Entry implements DocAction { - /** - * + * generated serial id */ private static final long serialVersionUID = 6631244784741228058L; - /** - * UUID based Constructor - * @param ctx Context - * @param A_Depreciation_Entry_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Depreciation_Entry_UU UUID key + * @param trxName Transaction + */ public MDepreciationEntry(Properties ctx, String A_Depreciation_Entry_UU, String trxName) { super(ctx, A_Depreciation_Entry_UU, trxName); if (Util.isEmpty(A_Depreciation_Entry_UU)) setInitialDefaults(); } - /** Standard Constructor */ + /** + * @param ctx + * @param A_Depreciation_Entry_ID + * @param trxName + */ public MDepreciationEntry(Properties ctx, int A_Depreciation_Entry_ID, String trxName) { super (ctx, A_Depreciation_Entry_ID, trxName); @@ -70,20 +92,24 @@ implements DocAction setPosted(false); } - /** Load Constructor */ + /** + * @param ctx + * @param rs + * @param trxName + */ public MDepreciationEntry (Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } - + @Override protected boolean beforeSave(boolean newRecord) { setC_Period_ID(); return true; } - + @Override protected boolean afterSave(boolean newRecord, boolean success) { if (!success) @@ -97,7 +123,7 @@ implements DocAction return true; } - + @Override protected boolean afterDelete(boolean success) { if (!success) @@ -109,6 +135,9 @@ implements DocAction return true; } + /** + * Set period from DateAcct + */ public void setC_Period_ID() { MPeriod period = MPeriod.get(getCtx(), getDateAcct(), getAD_Org_ID(), get_TrxName()); @@ -119,6 +148,9 @@ implements DocAction setC_Period_ID(period.get_ID()); } + /** + * Disconnect lines (MDepreciationExp) by setting A_Depreciation_Entry_ID to null + */ private void unselectLines() { String sql = "UPDATE " + MDepreciationExp.Table_Name + " SET " @@ -134,6 +166,9 @@ implements DocAction if (log.isLoggable(Level.FINE)) log.fine("Updated #" + no); } + /** + * Select/connect lines (MDepreciationExp) by setting A_Depreciation_Entry_ID to the id of this record. + */ private void selectLines() { // Reset selected lines: @@ -154,6 +189,8 @@ implements DocAction /** * Get Lines + * @param onlyNotProcessed + * @return lines (MDepreciationExp) iterator */ public Iterator getLinesIterator(boolean onlyNotProcessed) { @@ -182,7 +219,7 @@ implements DocAction return it; } - + @Override public boolean processIt (String processAction) { m_processMsg = null; @@ -195,20 +232,20 @@ implements DocAction /** Just Prepared Flag */ private boolean m_justPrepared = false; - + @Override public boolean unlockIt() { if (log.isLoggable(Level.INFO)) log.info("unlockIt - " + toString()); return true; } // unlockIt - + @Override public boolean invalidateIt() { return false; } - + @Override public String prepareIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -232,7 +269,7 @@ implements DocAction return DocAction.STATUS_InProgress; } - + @Override public boolean approveIt() { if (log.isLoggable(Level.INFO)) log.info("approveIt - " + toString()); @@ -240,7 +277,7 @@ implements DocAction return true; } - + @Override public boolean rejectIt() { if (log.isLoggable(Level.INFO)) log.info("rejectIt - " + toString()); @@ -248,7 +285,7 @@ implements DocAction return true; } // rejectIt - + @Override public String completeIt() { // Re-Check @@ -313,74 +350,77 @@ implements DocAction return DocAction.STATUS_Completed; } // completeIt - + @Override public boolean voidIt() { return false; } - + @Override public boolean closeIt() { setDocAction(DOCACTION_None); return true; } - + @Override public boolean reverseCorrectIt() { return false; } - + @Override public boolean reverseAccrualIt() { return false; } - + @Override public boolean reActivateIt() { return false; } // reActivateIt - - - + + @Override public String getSummary() { return toString(); } - + @Override public String getProcessMsg() { return m_processMsg; } - + @Override public int getDoc_User_ID() { return getCreatedBy(); } - + @Override public BigDecimal getApprovalAmt() { return null; } - + @Override public File createPDF () { return null; } - + @Override public String getDocumentInfo() { return getDocumentNo(); } + /** + * Delect Fact_Acct entries for this record + * @param depexp + */ public static void deleteFacts(MDepreciationExp depexp) { final String sql = "DELETE FROM Fact_Acct WHERE AD_Table_ID=? AND Record_ID=? AND Line_ID=?"; diff --git a/org.adempiere.base/src/org/compiere/model/MDepreciationExp.java b/org.adempiere.base/src/org/compiere/model/MDepreciationExp.java index a0a39089e5..82982ff144 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepreciationExp.java +++ b/org.adempiere.base/src/org/compiere/model/MDepreciationExp.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.math.BigDecimal; @@ -16,40 +37,50 @@ import org.compiere.util.TimeUtil; import org.idempiere.fa.exceptions.AssetException; import org.idempiere.fa.exceptions.AssetNotActiveException; - +/** + * Depreciation expenses + */ public class MDepreciationExp extends X_A_Depreciation_Exp -{ - +{ /** - * + * generated serial id */ private static final long serialVersionUID = 6731366890875525147L; private static CLogger s_log = CLogger.getCLogger(MDepreciationExp.class); private CLogger log = CLogger.getCLogger(this.getClass()); /** - * UUID based Constructor - * @param ctx Context - * @param A_Depreciation_Exp_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Depreciation_Exp_UU UUID key + * @param trxName Transaction + */ public MDepreciationExp(Properties ctx, String A_Depreciation_Exp_UU, String trxName) { super(ctx, A_Depreciation_Exp_UU, trxName); } - /** Standard Constructor */ + /** + * @param ctx + * @param A_Depreciation_Exp_ID + * @param trxName + */ public MDepreciationExp(Properties ctx, int A_Depreciation_Exp_ID, String trxName) { super (ctx, A_Depreciation_Exp_ID, trxName); } - /** Load Constructor */ + /** + * @param ctx + * @param rs + * @param trxName + */ public MDepreciationExp (Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } - /** Gets depreciation expense + /** + * Gets depreciation expense from DB * @param ctx context * @param A_Depreciation_Exp_ID depreciation expense id * @return depreciation expense or null if A_Depreciation_Exp_ID=0 or not found @@ -65,7 +96,20 @@ public class MDepreciationExp extends X_A_Depreciation_Exp return depexp; } - /** Create entry + /** + * Create new MDepreciationExp (not save to DB) + * @param ctx + * @param entryType + * @param A_Asset_ID + * @param A_Period + * @param DateAcct + * @param postingType + * @param drAcct + * @param crAcct + * @param expense + * @param description + * @param assetwk + * @return MDepreciationExp */ public static MDepreciationExp createEntry (Properties ctx, String entryType, int A_Asset_ID , int A_Period, Timestamp DateAcct, String postingType @@ -94,8 +138,8 @@ public class MDepreciationExp extends X_A_Depreciation_Exp } /** - * Update fields from asset workfile - * @param wk asset workfile + * Update fields from asset work file + * @param wk asset work file */ public void updateFrom(MDepreciationWorkfile wk) { @@ -108,11 +152,18 @@ public class MDepreciationExp extends X_A_Depreciation_Exp setA_Asset_Remaining_F(wk.getA_Asset_Remaining_F()); } - /** Create Depreciation Entries - * Produce record: - *
    -	 *		68.. = 28..   depreciation value
    -	 *	
    + /** + * Create Depreciation Entries + * @param assetwk + * @param PeriodNo + * @param dateAcct + * @param amt + * @param amt_F + * @param accumAmt + * @param accumAmt_F + * @param help + * @param trxName + * @return collection of MDepreciationExp records */ public static Collection createDepreciation ( MDepreciationWorkfile assetwk, @@ -192,12 +243,9 @@ public class MDepreciationExp extends X_A_Depreciation_Exp setProcessed(true); updateFrom(assetwk); saveEx(); - - // - } - + @Override protected boolean beforeDelete() { if (isProcessed()) @@ -218,7 +266,7 @@ public class MDepreciationExp extends X_A_Depreciation_Exp return true; } - + @Override protected boolean afterDelete(boolean success) { if (!success) @@ -239,11 +287,22 @@ public class MDepreciationExp extends X_A_Depreciation_Exp return true; } + /** + * @return true if posted + */ protected boolean isPosted() { return isProcessed() && getA_Depreciation_Entry_ID() > 0; } + /** + * @param ctx + * @param A_Asset_ID + * @param dateAcct + * @param postingType + * @param trxName + * @throws AssetException if there are unprocessed records + */ public static void checkExistsNotProcessedEntries(Properties ctx, int A_Asset_ID, Timestamp dateAcct, String postingType, String trxName) @@ -261,6 +320,13 @@ public class MDepreciationExp extends X_A_Depreciation_Exp } } + /** + * @param ctx + * @param A_Asset_ID + * @param postingType + * @param trxName + * @return list of not process MDepreciationExp records + */ public static List getNotProcessedEntries(Properties ctx, int A_Asset_ID, String postingType, String trxName) @@ -272,21 +338,22 @@ public class MDepreciationExp extends X_A_Depreciation_Exp .setParameters(new Object[]{A_Asset_ID, postingType, false}) .list(); return list; -} + } - + @Override public void setProcessed(boolean Processed) { super.setProcessed(Processed); // if (get_ID() > 0) { + //lock record final String sql = "UPDATE "+Table_Name+" SET Processed=? WHERE "+COLUMNNAME_A_Depreciation_Exp_ID+"=?"; DB.executeUpdateEx(sql, new Object[]{Processed, get_ID()}, get_TrxName()); } } - + @Override public String toString() { return getClass().getSimpleName()+"["+get_ID() diff --git a/org.adempiere.base/src/org/compiere/model/MDepreciationMethod.java b/org.adempiere.base/src/org/compiere/model/MDepreciationMethod.java index 26ec5fd4fa..2b6e49fd0c 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepreciationMethod.java +++ b/org.adempiere.base/src/org/compiere/model/MDepreciationMethod.java @@ -23,21 +23,25 @@ import org.idempiere.cache.ImmutablePOCache; public class MDepreciationMethod extends X_A_Depreciation_Method implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -7477974832683140825L; /** - * UUID based Constructor - * @param ctx Context - * @param A_Depreciation_Method_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Depreciation_Method_UU UUID key + * @param trxName Transaction + */ public MDepreciationMethod(Properties ctx, String A_Depreciation_Method_UU, String trxName) { super(ctx, A_Depreciation_Method_UU, trxName); } - /** Standard Constructor */ + /** + * @param ctx + * @param A_Depreciation_Method_ID + * @param trxName + */ public MDepreciationMethod (Properties ctx, int A_Depreciation_Method_ID, String trxName) { super (ctx, A_Depreciation_Method_ID, trxName); @@ -47,6 +51,7 @@ public class MDepreciationMethod extends X_A_Depreciation_Method implements Immu * Load Constructor * @param ctx context * @param rs result set record + * @param trxName */ public MDepreciationMethod (Properties ctx, ResultSet rs, String trxName) { @@ -54,7 +59,7 @@ public class MDepreciationMethod extends X_A_Depreciation_Method implements Immu } // MDepreciationMethod /** - * + * Copy constructor * @param copy */ public MDepreciationMethod(MDepreciationMethod copy) @@ -63,7 +68,7 @@ public class MDepreciationMethod extends X_A_Depreciation_Method implements Immu } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -73,7 +78,7 @@ public class MDepreciationMethod extends X_A_Depreciation_Method implements Immu } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -92,7 +97,8 @@ public class MDepreciationMethod extends X_A_Depreciation_Method implements Immu s_cache_forType = new ImmutablePOCache(Table_Name, Table_Name+"_DepreciationType", 5); /** - * + * add to cache + * @param depr */ private static void addToCache(MDepreciationMethod depr) { @@ -105,7 +111,7 @@ public class MDepreciationMethod extends X_A_Depreciation_Method implements Immu } /** - * + * @return precision */ private static int getPrecision() { @@ -172,10 +178,17 @@ public class MDepreciationMethod extends X_A_Depreciation_Method implements Immu addToCache(depr); return (MDepreciationMethod) depr.markImmutable(); } - /** - * + * Invoke depreciation calculation for this method + * @param ctx + * @param depreciationType + * @param A_Asset_ID + * @param A_Asset_Adjustment + * @param A_PeriodNo + * @param PostingType + * @param A_Asset_Acct_ID + * @return depreciation for current period */ public static BigDecimal invoke (Properties ctx, String depreciationType, int A_Asset_ID, BigDecimal A_Asset_Adjustment, @@ -191,6 +204,10 @@ public class MDepreciationMethod extends X_A_Depreciation_Method implements Immu /** * Calculate adjustment + * @param assetwk + * @param assetAcct + * @param A_Asset_Adjustment + * @param A_PeriodNo * @return adjustment to be applied in the specified period */ public BigDecimal invoke (MDepreciationWorkfile assetwk, @@ -202,6 +219,11 @@ public class MDepreciationMethod extends X_A_Depreciation_Method implements Immu /** * Calculate adjustment + * @param A_Asset_ID + * @param A_Asset_Adjustment + * @param A_PeriodNo + * @param PostingType + * @param A_Asset_Acct_ID * @return adjustment to be applied in the specified period */ public BigDecimal invoke (int A_Asset_ID, BigDecimal A_Asset_Adjustment, @@ -264,16 +286,28 @@ public class MDepreciationMethod extends X_A_Depreciation_Method implements Immu return retValue; } - /** MDI - adjustment is made ​​in the current month - * + /** + * MDI - adjustment is made ​​in the current month + * @param A_Asset_ID + * @param A_Asset_Adjustment + * @param A_PeriodNo + * @param PostingType + * @param A_Asset_Acct_ID + * @return adjustment value */ public BigDecimal apply_MDI (int A_Asset_ID, BigDecimal A_Asset_Adjustment, int A_PeriodNo, String PostingType, int A_Asset_Acct_ID) { return A_Asset_Adjustment; } - /** YDI -adjustment is made ​​for periods of the year remains - * + /** + * YDI - adjustment is made ​​for periods of the year remains + * @param A_Asset_ID + * @param A_Asset_Adjustment + * @param A_PeriodNo + * @param PostingType + * @param A_Asset_Acct_ID + * @return adjustment value */ public BigDecimal apply_YDI (int A_Asset_ID, BigDecimal A_Asset_Adjustment, int A_PeriodNo, String PostingType, int A_Asset_Acct_ID) { @@ -289,8 +323,14 @@ public class MDepreciationMethod extends X_A_Depreciation_Method implements Immu return periodAdjustment; } - /** LDI - adjustment is made ​​on the remaining life - * + /** + * LDI - adjustment is made ​​on the remaining life + * @param A_Asset_ID + * @param A_Asset_Adjustment + * @param A_PeriodNo + * @param PostingType + * @param A_Asset_Acct_ID + * @return adjustment value */ public BigDecimal apply_LDI (int A_Asset_ID, BigDecimal A_Asset_Adjustment, int A_PeriodNo, String PostingType, int A_Asset_Acct_ID) { diff --git a/org.adempiere.base/src/org/compiere/model/MDepreciationWorkfile.java b/org.adempiere.base/src/org/compiere/model/MDepreciationWorkfile.java index 61af78636c..4552c2344c 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepreciationWorkfile.java +++ b/org.adempiere.base/src/org/compiere/model/MDepreciationWorkfile.java @@ -30,16 +30,16 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile implements UseLife { /** - * + * generated serial id */ private static final long serialVersionUID = -3814417671427820714L; /** - * UUID based Constructor - * @param ctx Context - * @param A_Depreciation_Workfile_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param A_Depreciation_Workfile_UU UUID key + * @param trxName Transaction + */ public MDepreciationWorkfile(Properties ctx, String A_Depreciation_Workfile_UU, String trxName) { super(ctx, A_Depreciation_Workfile_UU, trxName); if (Util.isEmpty(A_Depreciation_Workfile_UU)) @@ -89,8 +89,9 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile return getAsset(false); } - /** Get asset using this trxName - * @param requery requery asset + /** + * Get asset using this trxName + * @param requery true to re-query from DB * @return parent asset */ public MAsset getAsset(boolean requery) @@ -104,8 +105,9 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile return m_asset; } - /** Set asset - * @param asset + /** + * Set asset + * @param asset */ public void setAsset(MAsset asset) { @@ -113,10 +115,10 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile m_asset = asset; } - /** Gets asset's service date (commissioning) + /** + * Gets asset's service date (commissioning) * @return asset service date - */ - + */ public Timestamp getAssetServiceDate() { MAsset asset = getAsset(); @@ -126,11 +128,14 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile return asset.getAssetServiceDate(); } - /** After save + /** + * After save * @param newRecord + * @param success * @return true on success */ - protected boolean afterSave (boolean newRecord) + @Override + protected boolean afterSave (boolean newRecord, boolean success) { if(m_buildDepreciation) { @@ -139,7 +144,7 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile return true; } - + @Override protected boolean beforeSave (boolean newRecord) { if (log.isLoggable(Level.INFO)) log.info ("Entering: trxName=" + get_TrxName()); @@ -237,7 +242,9 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile } /** - * + * @param asset + * @param postingType + * @param assetgrpacct */ public MDepreciationWorkfile(MAsset asset, String postingType, MAssetGroupAcct assetgrpacct) { @@ -279,7 +286,7 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile } /** - * + * Copy constructor * @param copy */ public MDepreciationWorkfile(MDepreciationWorkfile copy) @@ -288,7 +295,7 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -298,7 +305,7 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -313,6 +320,12 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile /** Logger */ private CLogger log = CLogger.getCLogger(getClass()); + /** + * @param ctx + * @param asset_id + * @param trxName + * @return collection of MDepreciationWorkfile + */ public static Collection forA_Asset_ID(Properties ctx, int asset_id, String trxName) { return new Query(ctx, Table_Name, MDepreciationWorkfile.COLUMNNAME_A_Asset_ID+"=?", trxName) @@ -321,7 +334,6 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile } /** - * * @param ctx * @param A_Asset_ID * @param postingType @@ -334,7 +346,6 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile } /** - * * @param ctx * @param A_Asset_ID * @param postingType @@ -374,14 +385,16 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile return get(ctx, A_Asset_ID, postingType, trxName, 0); } - /** Returns the date of the last action + /** + * @return last day of previous month of DateAcct */ public Timestamp getLastActionDate() { return TimeUtil.getMonthLastDay(TimeUtil.addMonths(getDateAcct(), -1)); } - /** Check if the asset is depreciated at the specified date + /** + * Check if the asset is depreciated at the specified date * @param date * @return true if you amortized until the specified date, otherwise false */ @@ -396,6 +409,8 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile /** * Get Asset Accounting for this workfile + * @param dateAcct + * @param trxName * @return asset accounting model */ public MAssetAcct getA_AssetAcct(Timestamp dateAcct, String trxName) @@ -403,7 +418,8 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile return MAssetAcct.forA_Asset_ID(getCtx(), getC_AcctSchema_ID(), getA_Asset_ID(), getPostingType(), dateAcct, trxName); } - /** Returns the current cost of FAs. It is calculated as the difference between acquisition value and the value that you (A_Salvage_Value) + /** + * Returns the current cost of FAs. It is calculated as the difference between acquisition value and salvage value (A_Salvage_Value). * @return the current cost of FAs */ public BigDecimal getActualCost() @@ -411,17 +427,20 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile return getActualCost(getA_Asset_Cost()); } - /** */ + /** + * @param assetCost + * @return assetCost - A_Salvage_Value + */ public BigDecimal getActualCost(BigDecimal assetCost) { return assetCost.subtract(getA_Salvage_Value()); } /** - * + * Adjust asset cost and qty with deltaAmt and deltaQty * @param deltaAmt * @param deltaQty - * @param reset + * @param reset true to use deltaAmt and deltaQty as current asset cost and qty */ public void adjustCost(BigDecimal deltaAmt, BigDecimal deltaQty, boolean reset) { @@ -445,8 +464,8 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile * Adjust Accumulated depreciation * @param amt * @param amt_F - * @param reset - * @return + * @param reset true to use amt and amt_F as new value + * @return true */ public boolean adjustAccumulatedDepr(BigDecimal amt, BigDecimal amt_F, boolean reset) { @@ -465,6 +484,9 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile /** * Adjust use life years + * @param deltaUseLifeYears + * @param deltaUseLifeYears_F + * @param reset true to use deltaUseLifeYears and deltaUseLifeYears_F as new value */ public void adjustUseLife(int deltaUseLifeYears, int deltaUseLifeYears_F, boolean reset) { @@ -476,32 +498,44 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile if (log.isLoggable(Level.FINE)) log.fine("Leaving"); } - /** */ + /** + * @param fiscal true for UseLifeMonths_F, false for getUseLifeMonths + * @return use life in months + */ public int getUseLifeMonths(boolean fiscal) { return fiscal ? getUseLifeMonths_F() : getUseLifeMonths(); } - /** */ + /** + * @param fiscal true for A_Accumulated_Depr_F, false for A_Accumulated_Depr + * @return accumulated depreciation + */ public BigDecimal getA_Accumulated_Depr(boolean fiscal) { return fiscal ? getA_Accumulated_Depr_F() : getA_Accumulated_Depr(); } - /** */ + /** + * @return accumulated cost + */ public BigDecimal getAccumulatedCost() { return getA_Accumulated_Depr(isFiscal()); } - /** */ + /** + * @return re-evaluation cost + */ public BigDecimal getReevaluationCost() { return Env.ZERO; } /** - * Returns the residual (remaining) value + * @param accumAmt null to use current A_Accumulated_Depr/A_Accumulated_Depr_F value + * @param fiscal true for A_Accumulated_Depr_F, false for A_Accumulated_Depr + * @return residual (remaining) value (actual cost - accumulated depreciation) */ public BigDecimal getRemainingCost(BigDecimal accumAmt, boolean fiscal) { @@ -513,14 +547,19 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile } /** - * Returns the residual (remaining) value + * @param accumAmt + * @return residual (remaining) value (actual cost - accumulated depreciation) */ public BigDecimal getRemainingCost(BigDecimal accumAmt) { return getRemainingCost(accumAmt, isFiscal()); } - /** */ + /** + * @param A_Current_Period + * @param method + * @return remaining periods + */ public int getRemainingPeriods(int A_Current_Period, MDepreciation method) { int useLifePeriods = getUseLifeMonths(isFiscal()); @@ -530,7 +569,11 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile int currentPeriod = (A_Current_Period >= 0 ? A_Current_Period : getA_Current_Period()); return useLifePeriods - currentPeriod; } - /** */ + + /** + * @param A_Current_Period + * @return remaining periods + */ public int getRemainingPeriods(int A_Current_Period) { return getRemainingPeriods(A_Current_Period, null); @@ -538,13 +581,17 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile /** */ private boolean m_isFiscal = false; - /** */ + + /** + * @return true for fiscal, false otherwise + */ public boolean isFiscal() { return m_isFiscal; } + /** - * Set fiscal flag (temporary - is not modifing the workfile) + * Set fiscal flag (in memory only - this is not modifying the work file) * @param fiscal */ public void setFiscal(boolean fiscal) @@ -552,7 +599,9 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile m_isFiscal = fiscal; } - /** Increment the current period (A_Current_Period) 1, and a month DateAcct */ + /** + * Increment the current period (A_Current_Period) 1, and a month DateAcct. + */ public void incA_Current_Period() { int old_period = getA_Current_Period(); @@ -566,8 +615,8 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile } /** - * Set A Current Period (and Data Act) processed just after the last expense. - * Do not save. + * Set A Current Period (and Data Act) to period after the latest expense (MDepreciationExp) record. + * This method do not save to DB. */ public void setA_Current_Period() { @@ -590,7 +639,7 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile } else { - log.info("There are no records from which to infer its"); + log.info("There are no MDepreciationExp records from which to set current period and accounting date"); } } @@ -599,11 +648,10 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile private boolean m_buildDepreciation = false; /** - * Build depreciation (A_Depreciation_Exp) entries. More exactly, is deleting not Processed entries. + * Build depreciation (A_Depreciation_Exp) entries. More exactly, is deleting not Processed entries * and create new ones again. - * WARNING: IS NOT modifying workfile (this) + * WARNING: IS NOT modifying workfile (this). */ - public void buildDepreciation() { if (!isDepreciated()) @@ -764,7 +812,7 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile } // truncDepreciation /** - * Update Founding Mode related fields + * Update Funding Mode related fields * @param m model * @param changedColumnName column name that has been changed */ @@ -824,18 +872,23 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile } } + @Override public boolean set_AttrValue(String ColumnName, Object value) { int index = get_ColumnIndex(ColumnName); if (index < 0) return false; return set_ValueNoCheck(ColumnName, value); } + + @Override public Object get_AttrValue(String ColumnName) { int index = get_ColumnIndex(ColumnName); if (index < 0) return null; return get_Value(index); } + + @Override public boolean is_AttrValueChanged(String ColumnName) { int index = get_ColumnIndex(ColumnName); if (index < 0) diff --git a/org.adempiere.base/src/org/compiere/model/MDiscountSchema.java b/org.adempiere.base/src/org/compiere/model/MDiscountSchema.java index 9c5a174f3a..435297e727 100644 --- a/org.adempiere.base/src/org/compiere/model/MDiscountSchema.java +++ b/org.adempiere.base/src/org/compiere/model/MDiscountSchema.java @@ -41,7 +41,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MDiscountSchema extends X_M_DiscountSchema implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 4916780751688051566L; @@ -79,21 +79,20 @@ public class MDiscountSchema extends X_M_DiscountSchema implements ImmutablePOSu /** Cache */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 20); - /** - * UUID based Constructor - * @param ctx Context - * @param M_DiscountSchema_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_DiscountSchema_UU UUID key + * @param trxName Transaction + */ public MDiscountSchema(Properties ctx, String M_DiscountSchema_UU, String trxName) { super(ctx, M_DiscountSchema_UU, trxName); if (Util.isEmpty(M_DiscountSchema_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param M_DiscountSchema_ID id @@ -129,7 +128,7 @@ public class MDiscountSchema extends X_M_DiscountSchema implements ImmutablePOSu } // MDiscountSchema /** - * + * Copy constructor * @param copy */ public MDiscountSchema(MDiscountSchema copy) @@ -138,7 +137,7 @@ public class MDiscountSchema extends X_M_DiscountSchema implements ImmutablePOSu } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -148,7 +147,7 @@ public class MDiscountSchema extends X_M_DiscountSchema implements ImmutablePOSu } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -168,7 +167,7 @@ public class MDiscountSchema extends X_M_DiscountSchema implements ImmutablePOSu /** * Get Breaks - * @param reload reload + * @param reload true to reload from DB * @return breaks */ public MDiscountSchemaBreak[] getBreaks(boolean reload) @@ -259,7 +258,7 @@ public class MDiscountSchema extends X_M_DiscountSchema implements ImmutablePOSu * @param M_Product_ID product * @param M_Product_Category_ID category * @param BPartnerFlatDiscount flat discount - * @return discount or zero + * @return Discounted Price */ public BigDecimal calculatePrice (BigDecimal Qty, BigDecimal Price, int M_Product_ID, int M_Product_Category_ID, @@ -287,7 +286,7 @@ public class MDiscountSchema extends X_M_DiscountSchema implements ImmutablePOSu } // calculatePrice /** - * + * Calculate discounted price * @param price input price * @param discount discount percentage, for e.g 5.00 for 5% * @return discounted price @@ -383,7 +382,7 @@ public class MDiscountSchema extends X_M_DiscountSchema implements ImmutablePOSu * @param Price price * @param M_Product_ID product * @param M_Product_Category_ID category - * @return fix discounted price or zero + * @return fix discounted price or null */ private BigDecimal calculateFixedPrice (BigDecimal Qty, BigDecimal Price, int M_Product_ID, int M_Product_Category_ID) @@ -433,6 +432,7 @@ public class MDiscountSchema extends X_M_DiscountSchema implements ImmutablePOSu * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getValidFrom() == null) @@ -442,7 +442,7 @@ public class MDiscountSchema extends X_M_DiscountSchema implements ImmutablePOSu } // beforeSave /** - * Renumber + * Renumber SeqNo * @return lines updated */ public int reSeq() diff --git a/org.adempiere.base/src/org/compiere/model/MDiscountSchemaBreak.java b/org.adempiere.base/src/org/compiere/model/MDiscountSchemaBreak.java index 6843ca4dc1..21f1f2c5a0 100644 --- a/org.adempiere.base/src/org/compiere/model/MDiscountSchemaBreak.java +++ b/org.adempiere.base/src/org/compiere/model/MDiscountSchemaBreak.java @@ -23,9 +23,8 @@ import java.util.Properties; import org.compiere.util.Env; import org.idempiere.cache.ImmutablePOSupport; - /** - * Discount Break Schema (Model) + * Discount Schema Break Model * * @author Jorg Janke * @version $Id: MDiscountSchemaBreak.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $ @@ -35,18 +34,17 @@ import org.idempiere.cache.ImmutablePOSupport; */ public class MDiscountSchemaBreak extends X_M_DiscountSchemaBreak implements ImmutablePOSupport { - /** - * + * generated serial id */ private static final long serialVersionUID = -5405425697628869517L; /** - * UUID based Constructor - * @param ctx Context - * @param M_DiscountSchemaBreak_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_DiscountSchemaBreak_UU UUID key + * @param trxName Transaction + */ public MDiscountSchemaBreak(Properties ctx, String M_DiscountSchemaBreak_UU, String trxName) { super(ctx, M_DiscountSchemaBreak_UU, trxName); } @@ -74,7 +72,7 @@ public class MDiscountSchemaBreak extends X_M_DiscountSchemaBreak implements Imm } // MDiscountSchemaBreak /** - * + * Copy constructor * @param copy */ public MDiscountSchemaBreak(MDiscountSchemaBreak copy) @@ -83,7 +81,7 @@ public class MDiscountSchemaBreak extends X_M_DiscountSchemaBreak implements Imm } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -93,7 +91,7 @@ public class MDiscountSchemaBreak extends X_M_DiscountSchemaBreak implements Imm } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -105,11 +103,11 @@ public class MDiscountSchemaBreak extends X_M_DiscountSchemaBreak implements Imm } /** - * Criteria apply + * Check if criteria apply * @param Value amt or qty * @param M_Product_ID product * @param M_Product_Category_ID category - * @return true if criteria met + * @return true if criteria is applicable for this break record */ public boolean applies (BigDecimal Value, int M_Product_ID, int M_Product_Category_ID) { @@ -150,6 +148,7 @@ public class MDiscountSchemaBreak extends X_M_DiscountSchemaBreak implements Imm * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MDiscountSchemaBreak["); diff --git a/org.adempiere.base/src/org/compiere/model/MDiscountSchemaLine.java b/org.adempiere.base/src/org/compiere/model/MDiscountSchemaLine.java index 1af612c26c..8933e53fc7 100644 --- a/org.adempiere.base/src/org/compiere/model/MDiscountSchemaLine.java +++ b/org.adempiere.base/src/org/compiere/model/MDiscountSchemaLine.java @@ -22,7 +22,6 @@ import java.util.Properties; import org.compiere.util.Env; import org.idempiere.cache.ImmutablePOSupport; - /** * Discount Schema Line (Price List) Model * @@ -32,16 +31,16 @@ import org.idempiere.cache.ImmutablePOSupport; public class MDiscountSchemaLine extends X_M_DiscountSchemaLine implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 5145958821951855437L; /** - * UUID based Constructor - * @param ctx Context - * @param M_DiscountSchemaLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_DiscountSchemaLine_UU UUID key + * @param trxName Transaction + */ public MDiscountSchemaLine(Properties ctx, String M_DiscountSchemaLine_UU, String trxName) { super(ctx, M_DiscountSchemaLine_UU, trxName); } @@ -69,7 +68,7 @@ public class MDiscountSchemaLine extends X_M_DiscountSchemaLine implements Immut } // MDiscountSchemaLine /** - * + * Copy constructor * @param copy */ public MDiscountSchemaLine(MDiscountSchemaLine copy) @@ -78,7 +77,7 @@ public class MDiscountSchemaLine extends X_M_DiscountSchemaLine implements Immut } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -88,7 +87,7 @@ public class MDiscountSchemaLine extends X_M_DiscountSchemaLine implements Immut } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -108,11 +107,12 @@ public class MDiscountSchemaLine extends X_M_DiscountSchemaLine implements Immut return this; } - /** + /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getC_BPartner_ID() == 0) diff --git a/org.adempiere.base/src/org/compiere/model/MDistribution.java b/org.adempiere.base/src/org/compiere/model/MDistribution.java index d6c706633e..9d811c2061 100644 --- a/org.adempiere.base/src/org/compiere/model/MDistribution.java +++ b/org.adempiere.base/src/org/compiere/model/MDistribution.java @@ -41,7 +41,7 @@ import org.compiere.util.Util; public class MDistribution extends X_GL_Distribution { /** - * + * generated serial id */ private static final long serialVersionUID = -5964912910470166735L; @@ -191,7 +191,9 @@ public class MDistribution extends X_GL_Distribution * @param ctx ignore * @param Account_ID id * @return array of distributions + * @deprecated */ + @Deprecated public static MDistribution[] get (Properties ctx, int Account_ID) { return get(Account_ID); @@ -204,6 +206,7 @@ public class MDistribution extends X_GL_Distribution * @deprecated - using the method to get a specific account ID doesn't make sense because of the flag IsAnyAcct * use method getAll() instead */ + @Deprecated public static MDistribution[] get (int Account_ID) { Properties ctx = Env.getCtx(); @@ -255,21 +258,20 @@ public class MDistribution extends X_GL_Distribution /** Distributions by Account */ private static CCache s_accounts = new CCache(Table_Name, 100); - - + /** - * UUID based Constructor - * @param ctx Context - * @param GL_Distribution_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param GL_Distribution_UU UUID key + * @param trxName Transaction + */ public MDistribution(Properties ctx, String GL_Distribution_UU, String trxName) { super(ctx, GL_Distribution_UU, trxName); if (Util.isEmpty(GL_Distribution_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param GL_Distribution_ID id @@ -316,7 +318,7 @@ public class MDistribution extends X_GL_Distribution } // MDistribution /** - * + * Copy constructor * @param copy */ public MDistribution(MDistribution copy) @@ -325,7 +327,7 @@ public class MDistribution extends X_GL_Distribution } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -335,7 +337,7 @@ public class MDistribution extends X_GL_Distribution } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -352,7 +354,7 @@ public class MDistribution extends X_GL_Distribution /** * Get Lines and calculate total - * @param reload reload data + * @param reload true to reload data * @return array of lines */ public MDistributionLine[] getLines (boolean reload) @@ -432,7 +434,7 @@ public class MDistribution extends X_GL_Distribution * Distribute Amount to Lines * @param acct account * @param Amt amount - * @param Qty + * @param Qty * @param C_Currency_ID currency */ public void distribute (MAccount acct, BigDecimal Amt, BigDecimal Qty, int C_Currency_ID) @@ -508,13 +510,13 @@ public class MDistribution extends X_GL_Distribution } } } // distribute - - + /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { // Reset not selected Any diff --git a/org.adempiere.base/src/org/compiere/model/MDistributionLine.java b/org.adempiere.base/src/org/compiere/model/MDistributionLine.java index a4c694b2f9..bb9b75ef5f 100644 --- a/org.adempiere.base/src/org/compiere/model/MDistributionLine.java +++ b/org.adempiere.base/src/org/compiere/model/MDistributionLine.java @@ -35,16 +35,16 @@ import org.compiere.util.Util; public class MDistributionLine extends X_GL_DistributionLine { /** - * + * generated serial id */ private static final long serialVersionUID = 6148743556518054326L; /** - * UUID based Constructor - * @param ctx Context - * @param GL_DistributionLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param GL_DistributionLine_UU UUID key + * @param trxName Transaction + */ public MDistributionLine(Properties ctx, String GL_DistributionLine_UU, String trxName) { super(ctx, GL_DistributionLine_UU, trxName); if (Util.isEmpty(GL_DistributionLine_UU)) @@ -97,7 +97,7 @@ public class MDistributionLine extends X_GL_DistributionLine } // MDistributionLine /** - * + * Copy constructor * @param copy */ public MDistributionLine(MDistributionLine copy) @@ -106,7 +106,7 @@ public class MDistributionLine extends X_GL_DistributionLine } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -116,7 +116,7 @@ public class MDistributionLine extends X_GL_DistributionLine } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -198,9 +198,8 @@ public class MDistributionLine extends X_GL_DistributionLine get_TrxName()); return acct; } // setAccount - - /************************************************************************** + /** * Get Distribution Amount * @return Returns the amt. */ @@ -218,7 +217,7 @@ public class MDistributionLine extends X_GL_DistributionLine m_amt = amt; } // setAmt - /************************************************************************** + /** * Get Distribution Quantity * @return Returns the qty. */ @@ -237,8 +236,8 @@ public class MDistributionLine extends X_GL_DistributionLine } // setQty /** - * Set Distribution Amount - * @param amt The amt to set to be multiplied by percent. + * Calculate Distribution Amount + * @param amt The amt to be multiplied by percent. * @param precision precision */ public void calculateAmt (BigDecimal amt, int precision) @@ -248,7 +247,7 @@ public class MDistributionLine extends X_GL_DistributionLine } // setAmt /** - * Set Distribution Quantity + * Calculate Distribution Quantity * @param qty The qty to set to be multiplied by percent. */ public void calculateQty (BigDecimal qty) @@ -256,13 +255,13 @@ public class MDistributionLine extends X_GL_DistributionLine m_qty = qty.multiply(getPercent()); m_qty = m_qty.divide(Env.ONEHUNDRED, RoundingMode.HALF_UP); } // setAmt - - /************************************************************************** + /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getLine() == 0) @@ -320,6 +319,7 @@ public class MDistributionLine extends X_GL_DistributionLine * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) diff --git a/org.adempiere.base/src/org/compiere/model/MDistributionList.java b/org.adempiere.base/src/org/compiere/model/MDistributionList.java index a6f0d48b2b..faf91c68b2 100644 --- a/org.adempiere.base/src/org/compiere/model/MDistributionList.java +++ b/org.adempiere.base/src/org/compiere/model/MDistributionList.java @@ -27,7 +27,8 @@ import org.compiere.util.DB; import org.compiere.util.Env; /** - * Material Distribution List + * Material Distribution List.
    + * Note: feature not fully implemented and have been marked as inactive in application dictionary. * * @author Jorg Janke * @version $Id: MDistributionList.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $ @@ -35,16 +36,16 @@ import org.compiere.util.Env; public class MDistributionList extends X_M_DistributionList { /** - * + * generated serial id */ private static final long serialVersionUID = -1570304450929416071L; /** - * UUID based Constructor - * @param ctx Context - * @param M_DistributionList_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_DistributionList_UU UUID key + * @param trxName Transaction + */ public MDistributionList(Properties ctx, String M_DistributionList_UU, String trxName) { super(ctx, M_DistributionList_UU, trxName); } @@ -72,8 +73,8 @@ public class MDistributionList extends X_M_DistributionList } // MDistributionList /** - * Get Distibution Lines. - * Add/Correct also Total Ratio + * Get Distribution Lines. + * Add/Correct also Total Ratio. * @return array of lines */ public MDistributionListLine[] getLines() @@ -119,8 +120,5 @@ public class MDistributionList extends X_M_DistributionList MDistributionListLine[] retValue = new MDistributionListLine[list.size ()]; list.toArray (retValue); return retValue; - } // getLines - - - + } // getLines } // MDistributionList diff --git a/org.adempiere.base/src/org/compiere/model/MDistributionListLine.java b/org.adempiere.base/src/org/compiere/model/MDistributionListLine.java index 889276ab61..9bd3922883 100644 --- a/org.adempiere.base/src/org/compiere/model/MDistributionListLine.java +++ b/org.adempiere.base/src/org/compiere/model/MDistributionListLine.java @@ -22,9 +22,9 @@ import java.util.Properties; import org.compiere.util.Env; - /** - * Distribution List Line + * Material Distribution List Line.
    + * Note: feature not fully implemented and have been marked as inactive in application dictionary. * * @author Jorg Janke * @version $Id: MDistributionListLine.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $ @@ -32,17 +32,17 @@ import org.compiere.util.Env; public class MDistributionListLine extends X_M_DistributionListLine { /** - * + * generated serial id */ private static final long serialVersionUID = -8227610572847013425L; /** - * UUID based Constructor - * @param ctx Context - * @param M_DistributionListLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_DistributionListLine_UU UUID key + * @param trxName Transaction + */ public MDistributionListLine(Properties ctx, String M_DistributionListLine_UU, String trxName) { super(ctx, M_DistributionListLine_UU, trxName); } @@ -68,12 +68,12 @@ public class MDistributionListLine extends X_M_DistributionListLine { super(ctx, rs, trxName); } // MDistributionListLine - - + /** - * Get Min Qty - * @return min Qty or 0 + * Get Minimum Qty + * @return minimum Qty or 0 */ + @Override public BigDecimal getMinQty () { BigDecimal minQty = super.getMinQty (); @@ -81,12 +81,12 @@ public class MDistributionListLine extends X_M_DistributionListLine return Env.ZERO; return minQty; } // getMinQty - - + /** * Get Ratio * @return ratio or 0 */ + @Override public BigDecimal getRatio () { BigDecimal ratio = super.getRatio(); diff --git a/org.adempiere.base/src/org/compiere/model/MDistributionRun.java b/org.adempiere.base/src/org/compiere/model/MDistributionRun.java index 1c20ecbae3..ebc9a923e6 100644 --- a/org.adempiere.base/src/org/compiere/model/MDistributionRun.java +++ b/org.adempiere.base/src/org/compiere/model/MDistributionRun.java @@ -25,25 +25,25 @@ import java.util.logging.Level; import org.compiere.util.DB; /** - * Distribution Run Model + * Material Distribution Run Model.
    + * Note: feature not fully implemented and have been marked as inactive in application dictionary. * * @author Jorg Janke * @version $Id: MDistributionRun.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $ */ public class MDistributionRun extends X_M_DistributionRun { - /** - * + * generated serial id */ private static final long serialVersionUID = -4355723603388382287L; /** - * UUID based Constructor - * @param ctx Context - * @param M_DistributionRun_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_DistributionRun_UU UUID key + * @param trxName Transaction + */ public MDistributionRun(Properties ctx, String M_DistributionRun_UU, String trxName) { super(ctx, M_DistributionRun_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MDistributionRunDetail.java b/org.adempiere.base/src/org/compiere/model/MDistributionRunDetail.java index 5352938aeb..3a5644b92b 100644 --- a/org.adempiere.base/src/org/compiere/model/MDistributionRunDetail.java +++ b/org.adempiere.base/src/org/compiere/model/MDistributionRunDetail.java @@ -29,7 +29,8 @@ import org.compiere.util.DB; import org.compiere.util.Env; /** - * Distribution Run Detail + * Material Distribution Run Detail.
    + * Note: feature not fully implemented and have been marked as inactive in application dictionary. * * @author Jorg Janke * @version $Id: MDistributionRunDetail.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $ @@ -37,7 +38,7 @@ import org.compiere.util.Env; public class MDistributionRunDetail extends X_T_DistributionRunDetail { /** - * + * generated serial id */ private static final long serialVersionUID = -8679063565056887913L; @@ -87,11 +88,11 @@ public class MDistributionRunDetail extends X_T_DistributionRunDetail private static CLogger s_log = CLogger.getCLogger (MDistributionRunDetail.class); /** - * UUID based Constructor - * @param ctx Context - * @param T_DistributionRunDetail_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param T_DistributionRunDetail_UU UUID key + * @param trxName Transaction + */ public MDistributionRunDetail(Properties ctx, String T_DistributionRunDetail_UU, String trxName) { super(ctx, T_DistributionRunDetail_UU, trxName); } @@ -122,8 +123,8 @@ public class MDistributionRunDetail extends X_T_DistributionRunDetail private int m_precision = 0; /** - * Round MinQty and Qty - * @param precision precision (saved) + * Round MinQty and Qty (RoundingMode.HALF_UP) and save to DB + * @param precision rounding precision */ public void round (int precision) { @@ -146,7 +147,7 @@ public class MDistributionRunDetail extends X_T_DistributionRunDetail } // round /** - * We can adjust Allocation Qty + * can adjust Allocation Qty ? * @return true if qty > min */ public boolean isCanAdjust() @@ -156,7 +157,7 @@ public class MDistributionRunDetail extends X_T_DistributionRunDetail /** * Get Actual Allocation Qty - * @return the greater of the min/qty + * @return the greater of min and qty */ public BigDecimal getActualAllocation() { @@ -194,6 +195,7 @@ public class MDistributionRunDetail extends X_T_DistributionRunDetail * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MDistributionRunDetail[") diff --git a/org.adempiere.base/src/org/compiere/model/MDistributionRunLine.java b/org.adempiere.base/src/org/compiere/model/MDistributionRunLine.java index b5f9f0527f..ea6568f1bd 100644 --- a/org.adempiere.base/src/org/compiere/model/MDistributionRunLine.java +++ b/org.adempiere.base/src/org/compiere/model/MDistributionRunLine.java @@ -23,26 +23,26 @@ import java.util.Properties; import org.compiere.util.Env; /** - * Distribution Run List Line Model + * Material Distribution Run List Line Model.
    + * Note: feature not fully implemented and have been marked as inactive in application dictionary. * * @author Jorg Janke * @version $Id: MDistributionRunLine.java,v 1.4 2006/07/30 00:51:02 jjanke Exp $ */ public class MDistributionRunLine extends X_M_DistributionRunLine { - /** - * + * generated serial id */ private static final long serialVersionUID = 4106664830581774843L; /** - * UUID based Constructor - * @param ctx Context - * @param M_DistributionRunLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_DistributionRunLine_UU UUID key + * @param trxName Transaction + */ public MDistributionRunLine(Properties ctx, String M_DistributionRunLine_UU, String trxName) { super(ctx, M_DistributionRunLine_UU, trxName); } @@ -81,7 +81,6 @@ public class MDistributionRunLine extends X_M_DistributionRunLine private BigDecimal m_lastDifference = Env.ZERO; /** Max Allocation */ private BigDecimal m_maxAllocation = Env.ZERO; - /** * Get Actual Qty @@ -94,7 +93,7 @@ public class MDistributionRunLine extends X_M_DistributionRunLine /** * Add to Actual Qty - * @param add number to add + * @param add qty to add */ public void addActualQty(BigDecimal add) { @@ -112,7 +111,7 @@ public class MDistributionRunLine extends X_M_DistributionRunLine /** * Add to Actual Min Qty - * @param add number to add + * @param add qty to add */ public void addActualMin(BigDecimal add) { @@ -120,15 +119,14 @@ public class MDistributionRunLine extends X_M_DistributionRunLine } // addActualMin /** - * Is Actual Min Greater than Total - * @return true if act min > total + * Is Actual Min Greater than Total Qty + * @return true if actual min > total qty */ public boolean isActualMinGtTotal() { return m_actualMin.compareTo(getTotalQty()) > 0; } // isActualMinGtTotal - /** * Get Actual Allocation Qty * @return actual Allocation Qty @@ -139,8 +137,8 @@ public class MDistributionRunLine extends X_M_DistributionRunLine } // getActualAllocation /** - * Add to Actual Min Qty - * @param add number to add + * Add to Actual Allocation Qty + * @param add qty to add */ public void addActualAllocation(BigDecimal add) { @@ -148,8 +146,8 @@ public class MDistributionRunLine extends X_M_DistributionRunLine } // addActualAllocation /** - * Is Actual Allocation equals Total - * @return true if act allocation = total + * Is Actual Allocation equals Total Qty + * @return true if actual allocation = total qty */ public boolean isActualAllocationEqTotal() { @@ -158,7 +156,7 @@ public class MDistributionRunLine extends X_M_DistributionRunLine /** * Get Allocation Difference - * @return Total - Allocation Qty + * @return Total Qty - Allocation Qty */ public BigDecimal getActualAllocationDiff() { @@ -195,8 +193,8 @@ public class MDistributionRunLine extends X_M_DistributionRunLine /** * Set Max Allocation if greater - * @param max allocation - * @param set set to max + * @param max max allocation to set + * @param set true to always set to max (regardless of max is less than current max allocation) */ public void setMaxAllocation (BigDecimal max, boolean set) { @@ -205,7 +203,7 @@ public class MDistributionRunLine extends X_M_DistributionRunLine } // setMaxAllocation /** - * Reset Calculations + * Reset all calculation variables (actual qty, actual min, actual allocation and max allocation) to zero */ public void resetCalculations() { @@ -215,9 +213,8 @@ public class MDistributionRunLine extends X_M_DistributionRunLine m_maxAllocation = Env.ZERO; } // resetCalculations - - - /************************************************************************** + + /** * Get Product * @return product */ @@ -229,19 +226,19 @@ public class MDistributionRunLine extends X_M_DistributionRunLine } // getProduct /** - * Get Product Standard Precision - * @return standard precision + * Get Product UOM Precision + * @return UOM precision */ public int getUOMPrecision() { return getProduct().getUOMPrecision(); } // getUOMPrecision - - - /************************************************************************** + + /** * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MDistributionRunLine[") diff --git a/org.adempiere.base/src/org/compiere/model/MDocBaseGroup.java b/org.adempiere.base/src/org/compiere/model/MDocBaseGroup.java index 4a7c2dd649..473cbe8e63 100644 --- a/org.adempiere.base/src/org/compiere/model/MDocBaseGroup.java +++ b/org.adempiere.base/src/org/compiere/model/MDocBaseGroup.java @@ -35,31 +35,57 @@ import java.util.Properties; * */ public class MDocBaseGroup extends X_C_DocBaseGroup { - /** - * + * generated serial id */ private static final long serialVersionUID = -4619625345276666731L; /** Document Base Type Group Lines */ private MDocBaseGroupLine[] m_lines; + /** + * @param ctx + * @param C_DocBaseGroup_ID + * @param trxName + */ public MDocBaseGroup(Properties ctx, int C_DocBaseGroup_ID, String trxName) { super(ctx, C_DocBaseGroup_ID, trxName); } + /** + * @param ctx + * @param C_DocBaseGroup_ID + * @param trxName + * @param virtualColumns + */ public MDocBaseGroup(Properties ctx, int C_DocBaseGroup_ID, String trxName, String[] virtualColumns) { super(ctx, C_DocBaseGroup_ID, trxName, virtualColumns); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MDocBaseGroup(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } + /** + * @param ctx + * @param C_DocBaseGroup_UU + * @param trxName + */ public MDocBaseGroup(Properties ctx, String C_DocBaseGroup_UU, String trxName) { super(ctx, C_DocBaseGroup_UU, trxName); } + /** + * @param ctx + * @param C_DocBaseGroup_UU + * @param trxName + * @param virtualColumns + */ public MDocBaseGroup(Properties ctx, String C_DocBaseGroup_UU, String trxName, String[] virtualColumns) { super(ctx, C_DocBaseGroup_UU, trxName, virtualColumns); diff --git a/org.adempiere.base/src/org/compiere/model/MDocBaseGroupLine.java b/org.adempiere.base/src/org/compiere/model/MDocBaseGroupLine.java index d5490e8c48..8837c3a41a 100644 --- a/org.adempiere.base/src/org/compiere/model/MDocBaseGroupLine.java +++ b/org.adempiere.base/src/org/compiere/model/MDocBaseGroupLine.java @@ -34,31 +34,57 @@ import java.util.Properties; * */ public class MDocBaseGroupLine extends X_C_DocBaseGroupLine { - /** - * + * generated serial id */ private static final long serialVersionUID = -8604315901539608261L; /** Parent */ protected MDocBaseGroup m_parent = null; + /** + * @param ctx + * @param C_DocBaseGroupLine_ID + * @param trxName + */ public MDocBaseGroupLine(Properties ctx, int C_DocBaseGroupLine_ID, String trxName) { super(ctx, C_DocBaseGroupLine_ID, trxName); } + /** + * @param ctx + * @param C_DocBaseGroupLine_ID + * @param trxName + * @param virtualColumns + */ public MDocBaseGroupLine(Properties ctx, int C_DocBaseGroupLine_ID, String trxName, String[] virtualColumns) { super(ctx, C_DocBaseGroupLine_ID, trxName, virtualColumns); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MDocBaseGroupLine(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } + /** + * @param ctx + * @param C_DocBaseGroupLine_UU + * @param trxName + */ public MDocBaseGroupLine(Properties ctx, String C_DocBaseGroupLine_UU, String trxName) { super(ctx, C_DocBaseGroupLine_UU, trxName); } + /** + * @param ctx + * @param C_DocBaseGroupLine_UU + * @param trxName + * @param virtualColumns + */ public MDocBaseGroupLine(Properties ctx, String C_DocBaseGroupLine_UU, String trxName, String[] virtualColumns) { super(ctx, C_DocBaseGroupLine_UU, trxName, virtualColumns); diff --git a/org.adempiere.base/src/org/compiere/model/MDocType.java b/org.adempiere.base/src/org/compiere/model/MDocType.java index 0739b09a80..dfdd6a66ea 100644 --- a/org.adempiere.base/src/org/compiere/model/MDocType.java +++ b/org.adempiere.base/src/org/compiere/model/MDocType.java @@ -42,14 +42,14 @@ import org.idempiere.cache.ImmutablePOSupport; public class MDocType extends X_C_DocType implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 1830844263371227816L; /** * Return the first Doc Type for this BaseType * @param DocBaseType - * @return + * @return C_DocType_ID */ static public int getDocType(String DocBaseType) { @@ -123,18 +123,18 @@ public class MDocType extends X_C_DocType implements ImmutablePOSupport static private ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 20); /** - * UUID based Constructor - * @param ctx Context - * @param C_DocType_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_DocType_UU UUID key + * @param trxName Transaction + */ public MDocType(Properties ctx, String C_DocType_UU, String trxName) { super(ctx, C_DocType_UU, trxName); if (Util.isEmpty(C_DocType_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_DocType_ID id @@ -176,7 +176,7 @@ public class MDocType extends X_C_DocType implements ImmutablePOSupport } // MDocType /** - * New Constructor + * New MDocType Constructor * @param ctx context * @param DocBaseType document base type * @param Name name @@ -193,7 +193,7 @@ public class MDocType extends X_C_DocType implements ImmutablePOSupport } // MDocType /** - * + * Copy constructor * @param copy */ public MDocType(MDocType copy) @@ -202,7 +202,7 @@ public class MDocType extends X_C_DocType implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -212,7 +212,7 @@ public class MDocType extends X_C_DocType implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -237,7 +237,7 @@ public class MDocType extends X_C_DocType implements ImmutablePOSupport /** - * Set SOTrx based on document base type + * Set IsSOTrx based on document base type */ public void setIsSOTrx () { @@ -251,6 +251,7 @@ public class MDocType extends X_C_DocType implements ImmutablePOSupport * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder("MDocType["); @@ -290,12 +291,11 @@ public class MDocType extends X_C_DocType implements ImmutablePOSupport || DOCSUBTYPESO_Quotation.equals(getDocSubTypeSO())) && DOCBASETYPE_SalesOrder.equals(getDocBaseType()); } // isOffer - /** * Get Print Name * @param AD_Language language - * @return print Name if available translated + * @return print name if available translated */ public String getPrintName (String AD_Language) { @@ -309,6 +309,7 @@ public class MDocType extends X_C_DocType implements ImmutablePOSupport * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { return true; @@ -320,6 +321,7 @@ public class MDocType extends X_C_DocType implements ImmutablePOSupport * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (newRecord && success) @@ -358,6 +360,7 @@ public class MDocType extends X_C_DocType implements ImmutablePOSupport * * @return true if delete is a success */ + @Override protected boolean beforeDelete () { // delete access records @@ -368,9 +371,9 @@ public class MDocType extends X_C_DocType implements ImmutablePOSupport } // beforeDelete /** - * Returns Document type for the shipment/receipt based - * on Document type provided for order/rma - * @param docTypeId + * Get shipment/receipt document type based + * on document type (docTypeId) provided + * @param docTypeId order/rma/vendor return/return material * @return shipment/receipt doctype id */ public static int getShipmentReceiptDocType(int docTypeId) diff --git a/org.adempiere.base/src/org/compiere/model/MDocTypeCounter.java b/org.adempiere.base/src/org/compiere/model/MDocTypeCounter.java index b7b96b0db6..6b90ad1a4d 100644 --- a/org.adempiere.base/src/org/compiere/model/MDocTypeCounter.java +++ b/org.adempiere.base/src/org/compiere/model/MDocTypeCounter.java @@ -28,7 +28,6 @@ import org.compiere.util.Util; import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; - /** * Counter Document Type Model * @@ -38,14 +37,14 @@ import org.idempiere.cache.ImmutablePOSupport; public class MDocTypeCounter extends X_C_DocTypeCounter implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 3999273279386464393L; /** - * Get Counter document for document type + * Get counter document for a document type * @param ctx context - * @param C_DocType_ID base document + * @param C_DocType_ID document type to get counter document * @return counter document C_DocType_ID or 0 or -1 if no counter doc */ public static int getCounterDocType_ID (Properties ctx, int C_DocType_ID) @@ -88,7 +87,7 @@ public class MDocTypeCounter extends X_C_DocTypeCounter implements ImmutablePOSu * Get (first) valid Counter document for document type * @param ctx ignore * @param C_DocType_ID base document - * @return counter document (may be invalid) or null + * @return counter document type (may be invalid) or null */ public static MDocTypeCounter getCounterDocType (Properties ctx, int C_DocType_ID) { @@ -98,7 +97,7 @@ public class MDocTypeCounter extends X_C_DocTypeCounter implements ImmutablePOSu /** * Get (first) valid Counter document for document type * @param C_DocType_ID base document - * @return counter document (may be invalid) or null + * @return counter document type (may be invalid) or null */ public static MDocTypeCounter getCounterDocType (int C_DocType_ID) { @@ -149,7 +148,7 @@ public class MDocTypeCounter extends X_C_DocTypeCounter implements ImmutablePOSu } // getCounterDocType /** - * Get MDocTypeCounter from Cache + * Get MDocTypeCounter from Cache (Immutable) * @param C_DocTypeCounter_ID id * @return MDocTypeCounter */ @@ -159,7 +158,7 @@ public class MDocTypeCounter extends X_C_DocTypeCounter implements ImmutablePOSu } /** - * Get MDocTypeCounter from Cache + * Get MDocTypeCounter from Cache (Immutable) * @param C_DocTypeCounter_ID id * @param trxName transaction * @return MDocTypeCounter @@ -170,7 +169,7 @@ public class MDocTypeCounter extends X_C_DocTypeCounter implements ImmutablePOSu } /** - * Get MDocTypeCounter from Cache + * Get MDocTypeCounter from Cache (Immutable) * @param ctx context * @param C_DocTypeCounter_ID id * @param trxName @@ -194,7 +193,7 @@ public class MDocTypeCounter extends X_C_DocTypeCounter implements ImmutablePOSu /** * Get Counter Document BaseType - * @param DocBaseType Document Base Type (e.g. SOO) + * @param DocBaseType Document Base Type (e.g. SOO) to get counter document base type * @return Counter Document BaseType (e.g. POO) or null if there is none */ public static String getCounterDocBaseType (String DocBaseType) @@ -232,29 +231,27 @@ public class MDocTypeCounter extends X_C_DocTypeCounter implements ImmutablePOSu s_log.log(Level.SEVERE, "getCounterDocBaseType for " + DocBaseType + ": None found"); return retValue; } // getCounterDocBaseType - - - /** Object Cache */ + + /** MDocTypeCounter Cache */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 20); /** Counter Relationship Cache */ private static ImmutableIntPOCache s_counter = new ImmutableIntPOCache(Table_Name, "C_DocTypeCounter_Relation", 20); /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MDocTypeCounter.class); - - + /** - * UUID based Constructor - * @param ctx Context - * @param C_DocTypeCounter_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_DocTypeCounter_UU UUID key + * @param trxName Transaction + */ public MDocTypeCounter(Properties ctx, String C_DocTypeCounter_UU, String trxName) { super(ctx, C_DocTypeCounter_UU, trxName); if (Util.isEmpty(C_DocTypeCounter_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_DocTypeCounter_ID id @@ -287,7 +284,7 @@ public class MDocTypeCounter extends X_C_DocTypeCounter implements ImmutablePOSu } // MDocTypeCounter /** - * + * Copy constructor * @param copy */ public MDocTypeCounter(MDocTypeCounter copy) @@ -306,7 +303,7 @@ public class MDocTypeCounter extends X_C_DocTypeCounter implements ImmutablePOSu } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -318,21 +315,22 @@ public class MDocTypeCounter extends X_C_DocTypeCounter implements ImmutablePOSu } /** - * Set C_DocType_ID + * Set C_DocType_ID. Reset IsValid to false. * @param C_DocType_ID id */ + @Override public void setC_DocType_ID (int C_DocType_ID) { super.setC_DocType_ID (C_DocType_ID); if (isValid()) setIsValid(false); } // setC_DocType_ID - /** - * Set Counter C_DocType_ID + * Set Counter C_DocType_ID. Reset IsValid to false. * @param Counter_C_DocType_ID id */ + @Override public void setCounter_C_DocType_ID (int Counter_C_DocType_ID) { super.setCounter_C_DocType_ID (Counter_C_DocType_ID); @@ -371,10 +369,9 @@ public class MDocTypeCounter extends X_C_DocTypeCounter implements ImmutablePOSu } return dt; } // getCounterDocType - - /************************************************************************** - * Validate Document Type compatability + /** + * Validate Document Type compatibility and update IsValid flag accordingly. * @return Error message or null if valid */ public String validate() @@ -434,6 +431,7 @@ public class MDocTypeCounter extends X_C_DocTypeCounter implements ImmutablePOSu * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MDocTypeCounter["); @@ -444,13 +442,13 @@ public class MDocTypeCounter extends X_C_DocTypeCounter implements ImmutablePOSu .append ("]"); return sb.toString (); } // toString - - + /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getAD_Org_ID() != 0) diff --git a/org.adempiere.base/src/org/compiere/model/MDocumentActionAccess.java b/org.adempiere.base/src/org/compiere/model/MDocumentActionAccess.java index 29946c1d80..66b17a34cf 100644 --- a/org.adempiere.base/src/org/compiere/model/MDocumentActionAccess.java +++ b/org.adempiere.base/src/org/compiere/model/MDocumentActionAccess.java @@ -30,16 +30,16 @@ import java.util.Properties; public class MDocumentActionAccess extends X_AD_Document_Action_Access { /** - * + * generated serial id */ private static final long serialVersionUID = -2036011342206732816L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Document_Action_Access_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Document_Action_Access_UU UUID key + * @param trxName Transaction + */ public MDocumentActionAccess(Properties ctx, String AD_Document_Action_Access_UU, String trxName) { super(ctx, AD_Document_Action_Access_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MDocumentStatus.java b/org.adempiere.base/src/org/compiere/model/MDocumentStatus.java index 4834fb8ae8..b382374627 100644 --- a/org.adempiere.base/src/org/compiere/model/MDocumentStatus.java +++ b/org.adempiere.base/src/org/compiere/model/MDocumentStatus.java @@ -26,7 +26,6 @@ * - Murilo Ht * * - Carlos Ruiz * **********************************************************************/ - package org.compiere.model; import java.sql.ResultSet; @@ -39,32 +38,45 @@ import org.compiere.util.Env; import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; +/** + * Named status of records in a table via SQL criteria + */ public class MDocumentStatus extends X_PA_DocumentStatus implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 4028519324986534673L; /** - * UUID based Constructor - * @param ctx Context - * @param PA_DocumentStatus_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param PA_DocumentStatus_UU UUID key + * @param trxName Transaction + */ public MDocumentStatus(Properties ctx, String PA_DocumentStatus_UU, String trxName) { super(ctx, PA_DocumentStatus_UU, trxName); } + /** + * @param ctx + * @param PA_DocumentStatus_ID + * @param trxName + */ public MDocumentStatus(Properties ctx, int PA_DocumentStatus_ID, String trxName) { super(ctx, PA_DocumentStatus_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MDocumentStatus(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } /** - * + * Copy constructor * @param copy */ public MDocumentStatus(MDocumentStatus copy) @@ -73,7 +85,7 @@ public class MDocumentStatus extends X_PA_DocumentStatus implements ImmutablePOS } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -83,7 +95,7 @@ public class MDocumentStatus extends X_PA_DocumentStatus implements ImmutablePOS } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -94,7 +106,7 @@ public class MDocumentStatus extends X_PA_DocumentStatus implements ImmutablePOS copyPO(copy); } - /** Categopry Cache */ + /** MDocumentStatus Cache */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 20); /** @@ -172,6 +184,10 @@ public class MDocumentStatus extends X_PA_DocumentStatus implements ImmutablePOS return retValue; } // getDocumentStatusIndicators + /** + * @param documentStatus + * @return number of matching records + */ public static int evaluate(MDocumentStatus documentStatus) { StringBuilder sql = new StringBuilder("SELECT COUNT(*) FROM "); String tableName = MTable.getTableName(Env.getCtx(), documentStatus.getAD_Table_ID()); @@ -183,6 +199,10 @@ public class MDocumentStatus extends X_PA_DocumentStatus implements ImmutablePOS return DB.getSQLValue(null, sqlS); } + /** + * @param documentStatus + * @return where clause to find matching records + */ public static String getWhereClause(MDocumentStatus documentStatus) { String tableName = MTable.getTableName(Env.getCtx(), documentStatus.getAD_Table_ID()); StringBuilder where = new StringBuilder(" ").append(tableName).append(".AD_Client_ID=" + Env.getAD_Client_ID(Env.getCtx()) ); diff --git a/org.adempiere.base/src/org/compiere/model/MDocumentStatusAccess.java b/org.adempiere.base/src/org/compiere/model/MDocumentStatusAccess.java index c413f48d13..0135a11765 100644 --- a/org.adempiere.base/src/org/compiere/model/MDocumentStatusAccess.java +++ b/org.adempiere.base/src/org/compiere/model/MDocumentStatusAccess.java @@ -30,24 +30,34 @@ import java.util.Properties; public class MDocumentStatusAccess extends X_PA_DocumentStatusAccess { /** - * + * generated serial id */ private static final long serialVersionUID = -6018040839563733491L; /** - * UUID based Constructor - * @param ctx Context - * @param PA_DocumentStatusAccess_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param PA_DocumentStatusAccess_UU UUID key + * @param trxName Transaction + */ public MDocumentStatusAccess(Properties ctx, String PA_DocumentStatusAccess_UU, String trxName) { super(ctx, PA_DocumentStatusAccess_UU, trxName); } + /** + * @param ctx + * @param PA_DocumentStatusAccess_ID + * @param trxName + */ public MDocumentStatusAccess(Properties ctx, int PA_DocumentStatusAccess_ID, String trxName) { super(ctx, PA_DocumentStatusAccess_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MDocumentStatusAccess(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MDunning.java b/org.adempiere.base/src/org/compiere/model/MDunning.java index 417302f5da..ed57fd28d8 100644 --- a/org.adempiere.base/src/org/compiere/model/MDunning.java +++ b/org.adempiere.base/src/org/compiere/model/MDunning.java @@ -19,7 +19,6 @@ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; - /** * Dunning Model * @@ -29,16 +28,16 @@ import java.util.Properties; public class MDunning extends X_C_Dunning { /** - * + * generated serial id */ private static final long serialVersionUID = -3844081441218291895L; /** - * UUID based Constructor - * @param ctx Context - * @param C_Dunning_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Dunning_UU UUID key + * @param trxName Transaction + */ public MDunning(Properties ctx, String C_Dunning_UU, String trxName) { super(ctx, C_Dunning_UU, trxName); } @@ -65,6 +64,12 @@ public class MDunning extends X_C_Dunning super(ctx, rs, trxName); } // MDunning + /** + * @param ctx + * @param C_Dunning_ID + * @param trxName + * @param virtualColumns + */ public MDunning(Properties ctx, int C_Dunning_ID, String trxName, String... virtualColumns) { super(ctx, C_Dunning_ID, trxName, virtualColumns); } diff --git a/org.adempiere.base/src/org/compiere/model/MDunningLevel.java b/org.adempiere.base/src/org/compiere/model/MDunningLevel.java index c07570f0a9..893d06fdcb 100644 --- a/org.adempiere.base/src/org/compiere/model/MDunningLevel.java +++ b/org.adempiere.base/src/org/compiere/model/MDunningLevel.java @@ -25,7 +25,6 @@ import java.util.logging.Level; import org.compiere.util.CLogger; import org.compiere.util.DB; - /** * Dunning Level Model * @@ -35,18 +34,18 @@ import org.compiere.util.DB; public class MDunningLevel extends X_C_DunningLevel { /** - * + * generated serial id */ private static final long serialVersionUID = 4869909989789113387L; /** Logger */ private static CLogger s_log = CLogger.getCLogger (MDunningLevel.class); /** - * UUID based Constructor - * @param ctx Context - * @param C_DunningLevel_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_DunningLevel_UU UUID key + * @param trxName Transaction + */ public MDunningLevel(Properties ctx, String C_DunningLevel_UU, String trxName) { super(ctx, C_DunningLevel_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MDunningRun.java b/org.adempiere.base/src/org/compiere/model/MDunningRun.java index ebf5839118..0c0fb0750b 100644 --- a/org.adempiere.base/src/org/compiere/model/MDunningRun.java +++ b/org.adempiere.base/src/org/compiere/model/MDunningRun.java @@ -38,16 +38,16 @@ import org.compiere.util.Util; public class MDunningRun extends X_C_DunningRun { /** - * + * generated serial id */ private static final long serialVersionUID = 6858939271415643483L; /** - * UUID based Constructor - * @param ctx Context - * @param C_DunningRun_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_DunningRun_UU UUID key + * @param trxName Transaction + */ public MDunningRun(Properties ctx, String C_DunningRun_UU, String trxName) { super(ctx, C_DunningRun_UU, trxName); if (Util.isEmpty(C_DunningRun_UU)) @@ -128,7 +128,7 @@ public class MDunningRun extends X_C_DunningRun /** * Get Entries - * @param requery requery + * @param requery true to requery * @return entries */ public MDunningRunEntry[] getEntries (boolean requery) @@ -138,8 +138,8 @@ public class MDunningRun extends X_C_DunningRun /** * Get Entries - * @param requery requery requery - * @param onlyInvoices only invoices + * @param requery true to requery + * @param onlyInvoices true for entries with invoice only * @return entries */ public MDunningRunEntry[] getEntries (boolean requery, boolean onlyInvoices) @@ -180,7 +180,7 @@ public class MDunningRun extends X_C_DunningRun /** * Delete all Entries - * @param force delete also processed records + * @param force true to delete also processed records * @return true if deleted */ public boolean deleteEntries(boolean force) diff --git a/org.adempiere.base/src/org/compiere/model/MDunningRunEntry.java b/org.adempiere.base/src/org/compiere/model/MDunningRunEntry.java index 678d21c58e..be0a450230 100644 --- a/org.adempiere.base/src/org/compiere/model/MDunningRunEntry.java +++ b/org.adempiere.base/src/org/compiere/model/MDunningRunEntry.java @@ -41,7 +41,7 @@ import org.compiere.util.Util; public class MDunningRunEntry extends X_C_DunningRunEntry { /** - * + * generated serial id */ private static final long serialVersionUID = -3838792682143065656L; @@ -49,11 +49,11 @@ public class MDunningRunEntry extends X_C_DunningRunEntry private static CLogger s_log = CLogger.getCLogger (MPayment.class); /** - * UUID based Constructor - * @param ctx Context - * @param C_DunningRunEntry_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_DunningRunEntry_UU UUID key + * @param trxName Transaction + */ public MDunningRunEntry(Properties ctx, String C_DunningRunEntry_UU, String trxName) { super(ctx, C_DunningRunEntry_UU, trxName); if (Util.isEmpty(C_DunningRunEntry_UU)) @@ -112,7 +112,7 @@ public class MDunningRunEntry extends X_C_DunningRunEntry /** * Set BPartner * @param bp partner - * @param isSOTrx SO + * @param isSOTrx */ public void setBPartner (MBPartner bp, boolean isSOTrx) { @@ -206,7 +206,7 @@ public class MDunningRunEntry extends X_C_DunningRunEntry /** * Get Lines - * @param onlyInvoices only with invoices + * @param onlyInvoices true for entries with invoice only * @return Array of all lines for this Run */ public MDunningRunLine[] getLines (boolean onlyInvoices) @@ -244,7 +244,7 @@ public class MDunningRunEntry extends X_C_DunningRunEntry /** * Check whether has Invoices - * @return true if it has Invoices + * @return true if C_Invoice_ID > 0 */ public boolean hasInvoices() { diff --git a/org.adempiere.base/src/org/compiere/model/MDunningRunLine.java b/org.adempiere.base/src/org/compiere/model/MDunningRunLine.java index 54836e0f8e..b7ae9d9b45 100644 --- a/org.adempiere.base/src/org/compiere/model/MDunningRunLine.java +++ b/org.adempiere.base/src/org/compiere/model/MDunningRunLine.java @@ -33,16 +33,16 @@ import org.compiere.util.Util; public class MDunningRunLine extends X_C_DunningRunLine { /** - * + * generated serial id */ private static final long serialVersionUID = -6329441027195611155L; /** - * UUID based Constructor - * @param ctx Context - * @param C_DunningRunLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_DunningRunLine_UU UUID key + * @param trxName Transaction + */ public MDunningRunLine(Properties ctx, String C_DunningRunLine_UU, String trxName) { super(ctx, C_DunningRunLine_UU, trxName); if (Util.isEmpty(C_DunningRunLine_UU)) @@ -122,7 +122,7 @@ public class MDunningRunLine extends X_C_DunningRunLine /** * Get Invoice - * @return Returns the invoice. + * @return invoice or null */ public MInvoice getInvoice () { @@ -206,7 +206,7 @@ public class MDunningRunLine extends X_C_DunningRunLine /** * Get Payment - * @return Returns the payment. + * @return payment or null */ public MPayment getPayment () { @@ -238,7 +238,7 @@ public class MDunningRunLine extends X_C_DunningRunLine /** * Get Currency From (Invoice/Payment) - * @return Returns the Currency From + * @return C_Currency_ID of invoice or payment */ public int getC_CurrencyFrom_ID () { @@ -254,7 +254,7 @@ public class MDunningRunLine extends X_C_DunningRunLine /** * Get Currency To from Parent - * @return Returns the Currency To + * @return C_Currency_ID of parent (MDunningRunEntry) */ public int getC_CurrencyTo_ID () { @@ -312,6 +312,7 @@ public class MDunningRunLine extends X_C_DunningRunLine * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -325,6 +326,7 @@ public class MDunningRunLine extends X_C_DunningRunLine * @param success success * @return success */ + @Override protected boolean afterDelete (boolean success) { if (!success) @@ -334,8 +336,8 @@ public class MDunningRunLine extends X_C_DunningRunLine } // afterDelete /** - * Update Entry. - * Calculate/update Amt/Qty + * Update Entry (C_DunningRunEntry). + * Calculate/update Amt/Qty. */ private void updateEntry() { diff --git a/org.adempiere.base/src/org/compiere/model/MEXPFormat.java b/org.adempiere.base/src/org/compiere/model/MEXPFormat.java index 541d6e07c1..95e0eca3ed 100644 --- a/org.adempiere.base/src/org/compiere/model/MEXPFormat.java +++ b/org.adempiere.base/src/org/compiere/model/MEXPFormat.java @@ -57,7 +57,7 @@ import org.idempiere.cache.POCopyCache; public class MEXPFormat extends X_EXP_Format implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -2749091471654364602L; @@ -72,26 +72,36 @@ public class MEXPFormat extends X_EXP_Format implements ImmutablePOSupport { private List m_lines_unique = null; /** - * UUID based Constructor - * @param ctx Context - * @param EXP_Format_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param EXP_Format_UU UUID key + * @param trxName Transaction + */ public MEXPFormat(Properties ctx, String EXP_Format_UU, String trxName) { super(ctx, EXP_Format_UU, trxName); } - + + /** + * @param ctx + * @param EXP_Format_ID + * @param trxName + */ public MEXPFormat(Properties ctx, int EXP_Format_ID, String trxName) { super(ctx, EXP_Format_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MEXPFormat(Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } /** - * + * Copy constructor * @param copy */ public MEXPFormat(MEXPFormat copy) { @@ -99,7 +109,7 @@ public class MEXPFormat extends X_EXP_Format implements ImmutablePOSupport { } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -108,7 +118,7 @@ public class MEXPFormat extends X_EXP_Format implements ImmutablePOSupport { } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -120,10 +130,17 @@ public class MEXPFormat extends X_EXP_Format implements ImmutablePOSupport { this.m_lines_unique = copy.m_lines_unique != null ? copy.m_lines_unique.stream().map(e -> {return new MEXPFormatLine(ctx, e, trxName);}).collect(Collectors.toCollection(ArrayList::new)) : null; } + /** + * @return list of format lines (MEXPFormatLine) + */ public List getFormatLines() { return getFormatLinesOrderedBy(X_EXP_FormatLine.COLUMNNAME_Position); } + /** + * @param orderBy + * @return list of format lines (MEXPFormatLine) + */ public List getFormatLinesOrderedBy(String orderBy) { if(m_lines != null) @@ -142,6 +159,10 @@ public class MEXPFormat extends X_EXP_Format implements ImmutablePOSupport { return m_lines; } + /** + * @return collection of format line (MEXPFormatLine) with IsPartUniqueIndex=Y + * @throws SQLException + */ public Collection getUniqueColumns() throws SQLException { if (m_lines_unique != null) @@ -203,6 +224,16 @@ public class MEXPFormat extends X_EXP_Format implements ImmutablePOSupport { return null; } + /** + * Get export format via value, client and version + * @param ctx + * @param value + * @param AD_Client_ID + * @param version + * @param trxName + * @return MEXPFormat + * @throws SQLException + */ public static MEXPFormat getFormatByValueAD_Client_IDAndVersion(Properties ctx, String value, int AD_Client_ID, String version, String trxName) throws SQLException { @@ -229,6 +260,16 @@ public class MEXPFormat extends X_EXP_Format implements ImmutablePOSupport { return null; } + /** + * Get export format via client, table and version + * @param ctx + * @param AD_Client_ID + * @param AD_Table_ID + * @param version + * @param trxName + * @return MEXPFormat + * @throws SQLException + */ public static MEXPFormat getFormatByAD_Client_IDAD_Table_IDAndVersion(Properties ctx, int AD_Client_ID, int AD_Table_ID, String version, String trxName) throws SQLException { String key = new String(MTable.getTableName(ctx, AD_Table_ID)+version); @@ -265,6 +306,7 @@ public class MEXPFormat extends X_EXP_Format implements ImmutablePOSupport { * Before Delete * @return true of it can be deleted */ + @Override protected boolean beforeDelete () { int[] ids =MEXPFormatLine.getAllIDs(MEXPFormatLine.Table_Name, "EXP_Format_ID="+getEXP_Format_ID(), get_TrxName()); diff --git a/org.adempiere.base/src/org/compiere/model/MEXPFormatLine.java b/org.adempiere.base/src/org/compiere/model/MEXPFormatLine.java index 2af7e72e5c..286b723ea8 100644 --- a/org.adempiere.base/src/org/compiere/model/MEXPFormatLine.java +++ b/org.adempiere.base/src/org/compiere/model/MEXPFormatLine.java @@ -45,34 +45,42 @@ import org.idempiere.cache.ImmutablePOSupport; */ public class MEXPFormatLine extends X_EXP_FormatLine implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 2125885766063286714L; /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (X_EXP_FormatLine.class); - - /** - * UUID based Constructor - * @param ctx Context - * @param EXP_FormatLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param EXP_FormatLine_UU UUID key + * @param trxName Transaction + */ public MEXPFormatLine(Properties ctx, String EXP_FormatLine_UU, String trxName) { super(ctx, EXP_FormatLine_UU, trxName); } - + + /** + * @param ctx + * @param EXP_FormatLine_ID + * @param trxName + */ public MEXPFormatLine(Properties ctx, int EXP_FormatLine_ID, String trxName) { super(ctx, EXP_FormatLine_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MEXPFormatLine (Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } /** - * + * Copy constructor * @param copy */ public MEXPFormatLine(MEXPFormatLine copy) { @@ -80,7 +88,7 @@ public class MEXPFormatLine extends X_EXP_FormatLine implements ImmutablePOSuppo } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -89,7 +97,7 @@ public class MEXPFormatLine extends X_EXP_FormatLine implements ImmutablePOSuppo } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -105,36 +113,44 @@ public class MEXPFormatLine extends X_EXP_FormatLine implements ImmutablePOSuppo return sb.toString(); } + /** + * @param ctx + * @param value + * @param EXP_Format_ID + * @param trxName + * @return MEXPFormatLine + * @throws SQLException + */ public static MEXPFormatLine getFormatLineByValue(Properties ctx, String value, int EXP_Format_ID, String trxName) throws SQLException { - MEXPFormatLine result = null; - - StringBuilder sql = new StringBuilder("SELECT * ") - .append(" FROM ").append(X_EXP_FormatLine.Table_Name) - .append(" WHERE ").append(X_EXP_Format.COLUMNNAME_Value).append("=?") - .append(" AND ").append(X_EXP_Format.COLUMNNAME_EXP_Format_ID).append(" = ?") - ; - PreparedStatement pstmt = null; - ResultSet rs = null; - try { - pstmt = DB.prepareStatement (sql.toString(), trxName); - pstmt.setString(1, value); - pstmt.setInt(2, EXP_Format_ID); - rs = pstmt.executeQuery (); - if ( rs.next() ) { - result = new MEXPFormatLine (ctx, rs, trxName); + MEXPFormatLine result = null; + + StringBuilder sql = new StringBuilder("SELECT * ") + .append(" FROM ").append(X_EXP_FormatLine.Table_Name) + .append(" WHERE ").append(X_EXP_FormatLine.COLUMNNAME_Value).append("=?") + .append(" AND ").append(X_EXP_FormatLine.COLUMNNAME_EXP_Format_ID).append(" = ?") + ; + PreparedStatement pstmt = null; + ResultSet rs = null; + try { + pstmt = DB.prepareStatement (sql.toString(), trxName); + pstmt.setString(1, value); + pstmt.setInt(2, EXP_Format_ID); + rs = pstmt.executeQuery (); + if ( rs.next() ) { + result = new MEXPFormatLine (ctx, rs, trxName); + } + } catch (SQLException e) { + s_log.log(Level.SEVERE, sql.toString(), e); + throw e; + } finally{ + DB.close(rs, pstmt); + rs = null; + pstmt = null; } - } catch (SQLException e) { - s_log.log(Level.SEVERE, sql.toString(), e); - throw e; - } finally{ - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - - return result; + + return result; } @Override diff --git a/org.adempiere.base/src/org/compiere/model/MEXPProcessor.java b/org.adempiere.base/src/org/compiere/model/MEXPProcessor.java index 84de3243a7..8cc77fb98f 100644 --- a/org.adempiere.base/src/org/compiere/model/MEXPProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MEXPProcessor.java @@ -45,7 +45,7 @@ import org.compiere.util.DB; */ public class MEXPProcessor extends X_EXP_Processor { /** - * + * generated serial id */ private static final long serialVersionUID = -2925330684523283775L; /** Static Logger */ @@ -54,37 +54,58 @@ public class MEXPProcessor extends X_EXP_Processor { private volatile static MEXPProcessor processor= null; private X_EXP_ProcessorParameter[] parameters = null; + /** + * Get MEXPProcessor via id + * @param ctx + * @param EXP_Processor_ID + * @param trxName + * @return MEXPProcessor + */ public static MEXPProcessor get(Properties ctx, int EXP_Processor_ID, String trxName) { if(processor == null) { - processor = new MEXPProcessor(ctx, EXP_Processor_ID, trxName); + processor = new MEXPProcessor(ctx, EXP_Processor_ID, trxName); } return processor; } /** - * UUID based Constructor - * @param ctx Context - * @param EXP_Processor_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param EXP_Processor_UU UUID key + * @param trxName Transaction + */ public MEXPProcessor(Properties ctx, String EXP_Processor_UU, String trxName) { super(ctx, EXP_Processor_UU, trxName); } - + + /** + * @param ctx + * @param EXP_Processor_ID + * @param trxName + */ public MEXPProcessor(Properties ctx, int EXP_Processor_ID, String trxName) { super(ctx, EXP_Processor_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MEXPProcessor(Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } - public X_EXP_ProcessorParameter[] getEXP_ProcessorParameters(String trxName) { - + /** + * Get parameters + * @param trxName + * @return array of X_EXP_ProcessorParameter + */ + public X_EXP_ProcessorParameter[] getEXP_ProcessorParameters(String trxName) { if(parameters != null) - return parameters; + return parameters; List resultList = new ArrayList(); @@ -116,7 +137,5 @@ public class MEXPProcessor extends X_EXP_Processor { X_EXP_ProcessorParameter[] result = (X_EXP_ProcessorParameter[])resultList.toArray( new X_EXP_ProcessorParameter[0]); parameters = result; return result; - } - - + } } diff --git a/org.adempiere.base/src/org/compiere/model/MEXPProcessorParameter.java b/org.adempiere.base/src/org/compiere/model/MEXPProcessorParameter.java index d88dfcfa1b..271163d6a3 100644 --- a/org.adempiere.base/src/org/compiere/model/MEXPProcessorParameter.java +++ b/org.adempiere.base/src/org/compiere/model/MEXPProcessorParameter.java @@ -39,7 +39,7 @@ import org.compiere.util.CLogger; */ public class MEXPProcessorParameter extends X_EXP_ProcessorParameter { /** - * + * generated serial id */ private static final long serialVersionUID = 2633307385854436092L; /** Static Logger */ @@ -48,19 +48,29 @@ public class MEXPProcessorParameter extends X_EXP_ProcessorParameter { /** - * UUID based Constructor - * @param ctx Context - * @param EXP_ProcessorParameter_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param EXP_ProcessorParameter_UU UUID key + * @param trxName Transaction + */ public MEXPProcessorParameter(Properties ctx, String EXP_ProcessorParameter_UU, String trxName) { super(ctx, EXP_ProcessorParameter_UU, trxName); } - + + /** + * @param ctx + * @param EXP_ProcessorParameter_ID + * @param trxName + */ public MEXPProcessorParameter(Properties ctx, int EXP_ProcessorParameter_ID, String trxName) { super(ctx, EXP_ProcessorParameter_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MEXPProcessorParameter(Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MEXPProcessorType.java b/org.adempiere.base/src/org/compiere/model/MEXPProcessorType.java index 61f08b71b0..062890acca 100644 --- a/org.adempiere.base/src/org/compiere/model/MEXPProcessorType.java +++ b/org.adempiere.base/src/org/compiere/model/MEXPProcessorType.java @@ -39,28 +39,37 @@ import org.compiere.util.CLogger; */ public class MEXPProcessorType extends X_EXP_Processor_Type { /** - * + * generated serial id */ private static final long serialVersionUID = -4987531346397814095L; /** Static Logger */ @SuppressWarnings("unused") private static CLogger s_log = CLogger.getCLogger (MEXPProcessorType.class); - - + /** - * UUID based Constructor - * @param ctx Context - * @param EXP_Processor_Type_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param EXP_Processor_Type_UU UUID key + * @param trxName Transaction + */ public MEXPProcessorType(Properties ctx, String EXP_Processor_Type_UU, String trxName) { super(ctx, EXP_Processor_Type_UU, trxName); } - + + /** + * @param ctx + * @param EXP_Processor_Type_ID + * @param trxName + */ public MEXPProcessorType(Properties ctx, int EXP_Processor_Type_ID, String trxName) { super(ctx, EXP_Processor_Type_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MEXPProcessorType(Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MElement.java b/org.adempiere.base/src/org/compiere/model/MElement.java index dc9cbfe7ec..339e5e1e2c 100644 --- a/org.adempiere.base/src/org/compiere/model/MElement.java +++ b/org.adempiere.base/src/org/compiere/model/MElement.java @@ -31,16 +31,16 @@ import org.compiere.util.Util; public class MElement extends X_C_Element { /** - * + * generated serial id */ private static final long serialVersionUID = 7656092284157893366L; /** - * UUID based Constructor - * @param ctx Context - * @param C_Element_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Element_UU UUID key + * @param trxName Transaction + */ public MElement(Properties ctx, String C_Element_UU, String trxName) { super(ctx, C_Element_UU, trxName); if (Util.isEmpty(C_Element_UU)) @@ -80,7 +80,6 @@ public class MElement extends X_C_Element } // MElement /** - * Full Constructor * @param client client * @param Name name * @param ElementType type @@ -116,6 +115,7 @@ public class MElement extends X_C_Element * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getAD_Org_ID() != 0) diff --git a/org.adempiere.base/src/org/compiere/model/MElementValue.java b/org.adempiere.base/src/org/compiere/model/MElementValue.java index 92f3914069..a4e086b5d1 100644 --- a/org.adempiere.base/src/org/compiere/model/MElementValue.java +++ b/org.adempiere.base/src/org/compiere/model/MElementValue.java @@ -38,16 +38,16 @@ import org.idempiere.cache.ImmutablePOSupport; public class MElementValue extends X_C_ElementValue implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 6352667759697380460L; /** - * UUID based Constructor - * @param ctx Context - * @param C_ElementValue_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_ElementValue_UU UUID key + * @param trxName Transaction + */ public MElementValue(Properties ctx, String C_ElementValue_UU, String trxName) { super(ctx, C_ElementValue_UU, trxName); if (Util.isEmpty(C_ElementValue_UU)) @@ -96,7 +96,6 @@ public class MElementValue extends X_C_ElementValue implements ImmutablePOSuppor } // MElementValue /** - * Full Constructor * @param ctx context * @param Value value * @param Name name @@ -133,7 +132,7 @@ public class MElementValue extends X_C_ElementValue implements ImmutablePOSuppor } // MElementValue /** - * + * Copy constructor * @param copy */ public MElementValue(MElementValue copy) @@ -142,7 +141,7 @@ public class MElementValue extends X_C_ElementValue implements ImmutablePOSuppor } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -152,7 +151,7 @@ public class MElementValue extends X_C_ElementValue implements ImmutablePOSuppor } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -164,7 +163,7 @@ public class MElementValue extends X_C_ElementValue implements ImmutablePOSuppor } /** - * Set/Update Settings from import + * Set/Update values from import * @param imp import */ public void set (X_I_ElementValue imp) @@ -188,7 +187,7 @@ public class MElementValue extends X_C_ElementValue implements ImmutablePOSuppor /** * Is this a Balance Sheet Account - * @return boolean + * @return true if this is a balance sheet account (i.e asset, liability or owner equity) */ public boolean isBalanceSheet() { @@ -199,8 +198,8 @@ public class MElementValue extends X_C_ElementValue implements ImmutablePOSuppor } // isBalanceSheet /** - * Is this an Activa Account - * @return boolean + * Is this an asset Account + * @return true if this is an asset account */ public boolean isActiva() { @@ -208,8 +207,8 @@ public class MElementValue extends X_C_ElementValue implements ImmutablePOSuppor } // isActive /** - * Is this a Passiva Account - * @return boolean + * Is this a Liability Account + * @return true this is liability or owners equity account */ public boolean isPassiva() { @@ -222,6 +221,7 @@ public class MElementValue extends X_C_ElementValue implements ImmutablePOSuppor * User String Representation * @return info value - name */ + @Override public String toString () { StringBuilder sb = new StringBuilder(); @@ -240,9 +240,7 @@ public class MElementValue extends X_C_ElementValue implements ImmutablePOSuppor .append ("]"); return sb.toString (); } // toStringX - - - + @Override protected boolean beforeSave (boolean newRecord) { diff --git a/org.adempiere.base/src/org/compiere/model/MEntityType.java b/org.adempiere.base/src/org/compiere/model/MEntityType.java index 95d78184e6..eec1a7b3da 100644 --- a/org.adempiere.base/src/org/compiere/model/MEntityType.java +++ b/org.adempiere.base/src/org/compiere/model/MEntityType.java @@ -44,7 +44,7 @@ import org.idempiere.cache.ImmutablePOCache; public class MEntityType extends X_AD_EntityType implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -7160389442572466581L; @@ -87,16 +87,16 @@ public class MEntityType extends X_AD_EntityType implements ImmutablePOSupport private static CLogger s_log = CLogger.getCLogger (MEntityType.class); /** - * UUID based Constructor - * @param ctx Context - * @param AD_EntityType_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_EntityType_UU UUID key + * @param trxName Transaction + */ public MEntityType(Properties ctx, String AD_EntityType_UU, String trxName) { super(ctx, AD_EntityType_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param AD_EntityType_ID id @@ -119,7 +119,7 @@ public class MEntityType extends X_AD_EntityType implements ImmutablePOSupport } // MEntityType /** - * + * Copy constructor * @param copy */ public MEntityType(MEntityType copy) @@ -128,7 +128,7 @@ public class MEntityType extends X_AD_EntityType implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -138,7 +138,7 @@ public class MEntityType extends X_AD_EntityType implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -171,6 +171,7 @@ public class MEntityType extends X_AD_EntityType implements ImmutablePOSupport * @param newRecord new * @return true if it can be saved */ + @Override protected boolean beforeSave (boolean newRecord) { if (!newRecord) @@ -205,6 +206,7 @@ public class MEntityType extends X_AD_EntityType implements ImmutablePOSupport * Before Delete * @return true if it can be deleted */ + @Override protected boolean beforeDelete () { if (isSystemMaintained()) // all pre-defined diff --git a/org.adempiere.base/src/org/compiere/model/MExpenseType.java b/org.adempiere.base/src/org/compiere/model/MExpenseType.java index c488d324a0..f4bda1566c 100644 --- a/org.adempiere.base/src/org/compiere/model/MExpenseType.java +++ b/org.adempiere.base/src/org/compiere/model/MExpenseType.java @@ -19,7 +19,6 @@ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; - /** * Expense Type Model * @@ -28,18 +27,17 @@ import java.util.Properties; */ public class MExpenseType extends X_S_ExpenseType { - /** - * + * generated serial id */ private static final long serialVersionUID = -5721855125106737886L; /** - * UUID based Constructor - * @param ctx Context - * @param S_ExpenseType_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param S_ExpenseType_UU UUID key + * @param trxName Transaction + */ public MExpenseType(Properties ctx, String S_ExpenseType_UU, String trxName) { super(ctx, S_ExpenseType_UU, trxName); } @@ -71,7 +69,7 @@ public class MExpenseType extends X_S_ExpenseType /** * Get Product - * @return product + * @return first product that uses this expense type */ public MProduct getProduct() { @@ -84,14 +82,14 @@ public class MExpenseType extends X_S_ExpenseType } return m_product; } // getProduct - - + /** * beforeSave * @see org.compiere.model.PO#beforeSave(boolean) * @param newRecord * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (newRecord) @@ -110,6 +108,7 @@ public class MExpenseType extends X_S_ExpenseType * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -121,6 +120,5 @@ public class MExpenseType extends X_S_ExpenseType return success; } // afterSave - - + } // MExpenseType diff --git a/org.adempiere.base/src/org/compiere/model/MFactAcct.java b/org.adempiere.base/src/org/compiere/model/MFactAcct.java index 061fd5eb21..bc18bf5be4 100644 --- a/org.adempiere.base/src/org/compiere/model/MFactAcct.java +++ b/org.adempiere.base/src/org/compiere/model/MFactAcct.java @@ -24,7 +24,6 @@ import org.adempiere.exceptions.DBException; import org.compiere.util.CLogger; import org.compiere.util.DB; - /** * Accounting Fact Model * @@ -37,7 +36,7 @@ import org.compiere.util.DB; public class MFactAcct extends X_Fact_Acct { /** - * + * generated serial id */ private static final long serialVersionUID = 5251847162314796574L; @@ -46,9 +45,10 @@ public class MFactAcct extends X_Fact_Acct * @param AD_Table_ID table * @param Record_ID record * @param trxName transaction - * @return number of rows or -1 for error + * @return number of rows deleted or -1 for error * @deprecated Since ADempiere 3.5.2a; please use {@link #deleteEx(int, int, String)} instead. */ + @Deprecated public static int delete (int AD_Table_ID, int Record_ID, String trxName) { int no = -1; @@ -63,7 +63,7 @@ public class MFactAcct extends X_Fact_Acct } // delete /** - * Delete Accounting + * Delete Fact_Acct records via table and record id * @param AD_Table_ID table * @param Record_ID record * @param trxName transaction @@ -83,16 +83,16 @@ public class MFactAcct extends X_Fact_Acct private static CLogger s_log = CLogger.getCLogger (MFactAcct.class); /** - * UUID based Constructor - * @param ctx Context - * @param Fact_Acct_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param Fact_Acct_UU UUID key + * @param trxName Transaction + */ public MFactAcct(Properties ctx, String Fact_Acct_UU, String trxName) { super(ctx, Fact_Acct_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param Fact_Acct_ID id @@ -118,6 +118,7 @@ public class MFactAcct extends X_Fact_Acct * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MFactAcct["); @@ -129,7 +130,7 @@ public class MFactAcct extends X_Fact_Acct } // toString /** - * Derive MAccount from record + * Get MAccount from record * @return Valid Account Combination */ public MAccount getMAccount() diff --git a/org.adempiere.base/src/org/compiere/model/MFactReconciliation.java b/org.adempiere.base/src/org/compiere/model/MFactReconciliation.java index faa87c56fb..a6723d4d4a 100644 --- a/org.adempiere.base/src/org/compiere/model/MFactReconciliation.java +++ b/org.adempiere.base/src/org/compiere/model/MFactReconciliation.java @@ -3,26 +3,39 @@ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; +/** + * Fact_Acct reconciliation model + */ public class MFactReconciliation extends X_Fact_Reconciliation { /** - * + * generated serial id */ private static final long serialVersionUID = 7569838866747051210L; /** - * UUID based Constructor - * @param ctx Context - * @param Fact_Reconciliation_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param Fact_Reconciliation_UU UUID key + * @param trxName Transaction + */ public MFactReconciliation(Properties ctx, String Fact_Reconciliation_UU, String trxName) { super(ctx, Fact_Reconciliation_UU, trxName); } + /** + * @param ctx + * @param Fact_Reconciliation_ID + * @param trxName + */ public MFactReconciliation(Properties ctx, int Fact_Reconciliation_ID, String trxName) { super(ctx, Fact_Reconciliation_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MFactReconciliation(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MField.java b/org.adempiere.base/src/org/compiere/model/MField.java index 1ec9e61219..4c21f3cacb 100644 --- a/org.adempiere.base/src/org/compiere/model/MField.java +++ b/org.adempiere.base/src/org/compiere/model/MField.java @@ -25,7 +25,6 @@ import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; import org.idempiere.expression.logic.LogicEvaluator; - /** * Field Model * @@ -35,7 +34,7 @@ import org.idempiere.expression.logic.LogicEvaluator; public class MField extends X_AD_Field implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -7382459987895129752L; @@ -43,7 +42,7 @@ public class MField extends X_AD_Field implements ImmutablePOSupport private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 20); /** - * + * Get MField from cache * @param AD_Field_ID * @return MField (immutable) */ @@ -73,11 +72,11 @@ public class MField extends X_AD_Field implements ImmutablePOSupport } /** - * UUID based Constructor - * @param ctx Context - * @param AD_Field_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Field_UU UUID key + * @param trxName Transaction + */ public MField(Properties ctx, String AD_Field_UU, String trxName) { super(ctx, AD_Field_UU, trxName); if (Util.isEmpty(AD_Field_UU)) @@ -149,7 +148,7 @@ public class MField extends X_AD_Field implements ImmutablePOSupport } // M_Field /** - * + * Copy Constructor * @param copy */ public MField(MField copy) @@ -158,7 +157,7 @@ public class MField extends X_AD_Field implements ImmutablePOSupport } /** - * + * Copy Constructor * @param ctx * @param copy */ @@ -168,7 +167,7 @@ public class MField extends X_AD_Field implements ImmutablePOSupport } /** - * + * Copy Constructor * @param ctx * @param copy * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MFieldSuggestion.java b/org.adempiere.base/src/org/compiere/model/MFieldSuggestion.java index 20e7c0ac57..523406c3d3 100644 --- a/org.adempiere.base/src/org/compiere/model/MFieldSuggestion.java +++ b/org.adempiere.base/src/org/compiere/model/MFieldSuggestion.java @@ -7,8 +7,8 @@ import java.sql.ResultSet; import java.util.Properties; /** + * Help and description suggestion for Field * @author hengsin - * */ public class MFieldSuggestion extends X_AD_FieldSuggestion { @@ -18,11 +18,11 @@ public class MFieldSuggestion extends X_AD_FieldSuggestion { private static final long serialVersionUID = 3304495084929321451L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_FieldSuggestion_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_FieldSuggestion_UU UUID key + * @param trxName Transaction + */ public MFieldSuggestion(Properties ctx, String AD_FieldSuggestion_UU, String trxName) { super(ctx, AD_FieldSuggestion_UU, trxName); } @@ -52,6 +52,5 @@ public class MFieldSuggestion extends X_AD_FieldSuggestion { public void setClientOrg(int AD_Client_ID, int AD_Org_ID) { super.setClientOrg(AD_Client_ID, AD_Org_ID); } - } diff --git a/org.adempiere.base/src/org/compiere/model/MForecast.java b/org.adempiere.base/src/org/compiere/model/MForecast.java index 48bc2f398a..6a50c5b84e 100644 --- a/org.adempiere.base/src/org/compiere/model/MForecast.java +++ b/org.adempiere.base/src/org/compiere/model/MForecast.java @@ -18,27 +18,25 @@ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; - /** - * Forecast Model + * Material Forecast Model.
    + * Note: not fully develop and have been marked as inactive in Application Dictionary. * * @author victor.perez@e-evolution.com, www.e-evolution.com */ public class MForecast extends X_M_Forecast { - - /** - * + * generated serial id */ private static final long serialVersionUID = 66771328316032322L; /** - * UUID based Constructor - * @param ctx Context - * @param M_Forecast_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_Forecast_UU UUID key + * @param trxName Transaction + */ public MForecast(Properties ctx, String M_Forecast_UU, String trxName) { super(ctx, M_Forecast_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MForecastLine.java b/org.adempiere.base/src/org/compiere/model/MForecastLine.java index 84bc16442b..755225e6ee 100644 --- a/org.adempiere.base/src/org/compiere/model/MForecastLine.java +++ b/org.adempiere.base/src/org/compiere/model/MForecastLine.java @@ -19,30 +19,28 @@ import java.sql.ResultSet; import java.util.Properties; import org.adempiere.exceptions.WarehouseInvalidForOrgException; - /** - * Forecast Line Model + * Material Forecast Line Model.
    + * Note: not fully develop and have been marked as inactive in Application Dictionary. * * @author Victor Perez www.e-evolution.com * @version $Id: MForecastLine.java,v 1.11 2005/05/17 05:29:52 vpj-cd Exp $ */ public class MForecastLine extends X_M_ForecastLine -{ - - +{ /** - * + * generated serial id */ private static final long serialVersionUID = -3420900505079279058L; /** Parent */ private MForecast m_parent = null; /** - * UUID based Constructor - * @param ctx Context - * @param M_ForecastLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_ForecastLine_UU UUID key + * @param trxName Transaction + */ public MForecastLine(Properties ctx, String M_ForecastLine_UU, String trxName) { super(ctx, M_ForecastLine_UU, trxName); } @@ -67,15 +65,22 @@ public class MForecastLine extends X_M_ForecastLine super(ctx, rs, trxName); } // MForecastLine + /** + * @param ctx + * @param M_ForecastLine_ID + * @param trxName + * @param virtualColumns + */ public MForecastLine(Properties ctx, int M_ForecastLine_ID, String trxName, String... virtualColumns) { super(ctx, M_ForecastLine_ID, trxName, virtualColumns); } - /************************************************************************** + /** * Before Save * @param newRecord * @return true if it can be saved */ + @Override protected boolean beforeSave (boolean newRecord) { if (newRecord diff --git a/org.adempiere.base/src/org/compiere/model/MForm.java b/org.adempiere.base/src/org/compiere/model/MForm.java index d294a8f8e2..e30844d21a 100644 --- a/org.adempiere.base/src/org/compiere/model/MForm.java +++ b/org.adempiere.base/src/org/compiere/model/MForm.java @@ -23,7 +23,6 @@ import org.compiere.util.Env; import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; - /** * Form Model * @@ -33,7 +32,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MForm extends X_AD_Form implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -3617225890452735325L; @@ -72,11 +71,11 @@ public class MForm extends X_AD_Form implements ImmutablePOSupport } // get /** - * UUID based Constructor - * @param ctx Context - * @param AD_Form_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Form_UU UUID key + * @param trxName Transaction + */ public MForm(Properties ctx, String AD_Form_UU, String trxName) { super(ctx, AD_Form_UU, trxName); } @@ -104,7 +103,7 @@ public class MForm extends X_AD_Form implements ImmutablePOSupport } // MForm /** - * + * Copy constructor * @param ctx * @param copy */ @@ -113,7 +112,7 @@ public class MForm extends X_AD_Form implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -130,6 +129,7 @@ public class MForm extends X_AD_Form implements ImmutablePOSupport * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) diff --git a/org.adempiere.base/src/org/compiere/model/MFormAccess.java b/org.adempiere.base/src/org/compiere/model/MFormAccess.java index 63c693deef..dc8aff130d 100644 --- a/org.adempiere.base/src/org/compiere/model/MFormAccess.java +++ b/org.adempiere.base/src/org/compiere/model/MFormAccess.java @@ -21,7 +21,6 @@ import java.util.Properties; import org.compiere.util.Util; - /** * Form Access Model * @@ -31,16 +30,16 @@ import org.compiere.util.Util; public class MFormAccess extends X_AD_Form_Access { /** - * + * generated serial id */ private static final long serialVersionUID = 7818255846843514899L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Form_Access_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Form_Access_UU UUID key + * @param trxName Transaction + */ public MFormAccess(Properties ctx, String AD_Form_Access_UU, String trxName) { super(ctx, AD_Form_Access_UU, trxName); if (Util.isEmpty(AD_Form_Access_UU)) diff --git a/org.adempiere.base/src/org/compiere/model/MFreight.java b/org.adempiere.base/src/org/compiere/model/MFreight.java index 989bcc4583..dbcd0dad78 100644 --- a/org.adempiere.base/src/org/compiere/model/MFreight.java +++ b/org.adempiere.base/src/org/compiere/model/MFreight.java @@ -30,18 +30,21 @@ import java.sql.ResultSet; import java.sql.Timestamp; import java.util.Properties; +/** + * Freight amount model + */ public class MFreight extends X_M_Freight { /** - * + * generated serial id */ private static final long serialVersionUID = -1280041173155194185L; /** - * UUID based Constructor - * @param ctx Context - * @param M_Freight_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_Freight_UU UUID key + * @param trxName Transaction + */ public MFreight(Properties ctx, String M_Freight_UU, String trxName) { super(ctx, M_Freight_UU, trxName); } @@ -69,12 +72,13 @@ public class MFreight extends X_M_Freight { } /** - * Get a freight record based on the parameters - * Shipper, Freight Category are used as filters - * DateOrdered is used to get the most recent record that is valid for that date - * MaxDimension is used to get records that are valid for such dimensions - * Country/Region From/To are used to get the records, first valid is the more detailed defined - * + *
    +	 * Get a freight record based on the parameters.
    +	 * Shipper, Freight Category are used as filters.
    +	 * DateOrdered is used to get the most recent record that is valid for that date.
    +	 * MaxDimension is used to get records that are valid for such dimensions.
    +	 * Country/Region From/To are used as filters.
    +	 * 
    * @param ctx Context * @param shipperId Shipper * @param freightCategoryId Freight Category diff --git a/org.adempiere.base/src/org/compiere/model/MFreightCategory.java b/org.adempiere.base/src/org/compiere/model/MFreightCategory.java index ffbff18e94..26a1a2218b 100644 --- a/org.adempiere.base/src/org/compiere/model/MFreightCategory.java +++ b/org.adempiere.base/src/org/compiere/model/MFreightCategory.java @@ -32,24 +32,23 @@ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; + /** - * + * Freight category model * @author Daniel Tamm */ public class MFreightCategory extends X_M_FreightCategory { - /** - * + * generated serial id */ private static final long serialVersionUID = -4790439008800915010L; - /** - * UUID based Constructor - * @param ctx Context - * @param M_FreightCategory_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_FreightCategory_UU UUID key + * @param trxName Transaction + */ public MFreightCategory(Properties ctx, String M_FreightCategory_UU, String trxName) { super(ctx, M_FreightCategory_UU, trxName); } @@ -75,8 +74,7 @@ public class MFreightCategory extends X_M_FreightCategory { public MFreightCategory(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } - - + /** * Reads a freight category from database based on the value (key) of the category. * No cache is used. diff --git a/org.adempiere.base/src/org/compiere/model/MGLCategory.java b/org.adempiere.base/src/org/compiere/model/MGLCategory.java index f877ad8679..0c8c0374d8 100644 --- a/org.adempiere.base/src/org/compiere/model/MGLCategory.java +++ b/org.adempiere.base/src/org/compiere/model/MGLCategory.java @@ -37,7 +37,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MGLCategory extends X_GL_Category implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 7294511214194057235L; @@ -73,7 +73,7 @@ public class MGLCategory extends X_GL_Category implements ImmutablePOSupport } // get /** - * Get Default Category + * Get Default GL Category * @param ctx context * @param CategoryType optional CategoryType (ignored, if not exists) * @return GL Category or null @@ -116,7 +116,7 @@ public class MGLCategory extends X_GL_Category implements ImmutablePOSupport } // getDefault /** - * Get Default System Category + * Get Default System Generated GL Category (CATEGORYTYPE_SystemGenerated) * @param ctx context * @return GL Category */ @@ -135,7 +135,6 @@ public class MGLCategory extends X_GL_Category implements ImmutablePOSupport } return retValue; } // getDefaultSystem - /** Logger */ private static CLogger s_log = CLogger.getCLogger (MGLCategory.class); @@ -143,20 +142,19 @@ public class MGLCategory extends X_GL_Category implements ImmutablePOSupport private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache (Table_Name, 5); - /** - * UUID based Constructor - * @param ctx Context - * @param GL_Category_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param GL_Category_UU UUID key + * @param trxName Transaction + */ public MGLCategory(Properties ctx, String GL_Category_UU, String trxName) { super(ctx, GL_Category_UU, trxName); if (Util.isEmpty(GL_Category_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param GL_Category_ID id @@ -189,7 +187,7 @@ public class MGLCategory extends X_GL_Category implements ImmutablePOSupport } // MGLCategory /** - * + * Copy constructor * @param copy */ public MGLCategory(MGLCategory copy) @@ -198,7 +196,7 @@ public class MGLCategory extends X_GL_Category implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -208,7 +206,7 @@ public class MGLCategory extends X_GL_Category implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MGoal.java b/org.adempiere.base/src/org/compiere/model/MGoal.java index e899958893..cd13d77e96 100644 --- a/org.adempiere.base/src/org/compiere/model/MGoal.java +++ b/org.adempiere.base/src/org/compiere/model/MGoal.java @@ -47,12 +47,12 @@ import org.compiere.util.Util; public class MGoal extends X_PA_Goal { /** - * + * generated serial id */ private static final long serialVersionUID = -4612113288233473730L; /** - * Get User Goals + * Get User Goals (will call updateGoal for each record) * @param ctx context * @param AD_User_ID user * @return array of goals @@ -103,7 +103,7 @@ public class MGoal extends X_PA_Goal } // getUserGoals /** - * Get Accessible Goals + * Get Accessible Goals ((will call updateGoal for each record) * @param ctx context * @return array of goals */ @@ -121,10 +121,9 @@ public class MGoal extends X_PA_Goal list.toArray (retValue); return retValue; } // getGoals - /** - * Create Test Goals + * Create Dummy Test Goals * @param ctx context * @return array of goals */ @@ -143,9 +142,9 @@ public class MGoal extends X_PA_Goal } // getTestGoals /** - * Get Goals with Measure + * Get Goals for a performance measurement * @param ctx context - * @param PA_Measure_ID measure + * @param PA_Measure_ID performance measurement * @return goals */ public static MGoal[] getMeasureGoals (Properties ctx, int PA_Measure_ID) @@ -178,9 +177,9 @@ public class MGoal extends X_PA_Goal } // getMeasureGoals /** - * Get Multiplier from Scope to Display + * Get Multiplier for the goal's combination of Measurement Scope and Measurement Display * @param goal goal - * @return null if error or multiplier + * @return multiplier value or 1 (measure display is null) or null (for MEASURESCOPE_Total and MEASUREDISPLAY_Total) */ public static BigDecimal getMultiplier (MGoal goal) { @@ -257,18 +256,18 @@ public class MGoal extends X_PA_Goal private static CLogger s_log = CLogger.getCLogger (MGoal.class); /** - * UUID based Constructor - * @param ctx Context - * @param PA_Goal_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param PA_Goal_UU UUID key + * @param trxName Transaction + */ public MGoal(Properties ctx, String PA_Goal_UU, String trxName) { super(ctx, PA_Goal_UU, trxName); if (Util.isEmpty(PA_Goal_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param PA_Goal_ID id @@ -306,7 +305,6 @@ public class MGoal extends X_PA_Goal } // MGoal /** - * Base Constructor * @param ctx context * @param Name Name * @param Description Decsription @@ -321,7 +319,6 @@ public class MGoal extends X_PA_Goal setDescription(Description); setMeasureTarget(MeasureTarget); } // MGoal - /** Restrictions */ private MGoalRestriction[] m_restrictions = null; @@ -330,7 +327,7 @@ public class MGoal extends X_PA_Goal /** * Get Restriction Lines - * @param reload reload data + * @param reload true to reload data * @return array of lines */ public MGoalRestriction[] getRestrictions (boolean reload) @@ -377,11 +374,10 @@ public class MGoal extends X_PA_Goal return MMeasure.get(getPA_Measure_ID()); return null; } // getMeasure - - - /************************************************************************** - * Update/save Goals for the same measure - * @param force force to update goal (default once per day) + + /** + * Update/save measurement for Goals + * @param force force to update goal even if it has not reach the next update interval (default is 30 minutes interval) * @return true if updated */ public boolean updateGoal(boolean force) @@ -411,9 +407,10 @@ public class MGoal extends X_PA_Goal } // updateGoal /** - * Set Measure Actual + * Set Actual Measurement value * @param MeasureActual actual */ + @Override public void setMeasureActual (BigDecimal MeasureActual) { if (MeasureActual == null) @@ -424,7 +421,7 @@ public class MGoal extends X_PA_Goal } // setMeasureActual /** - * Calculate Performance Goal as multiplier + * Calculate Performance Goal */ public void setGoalPerformance () { @@ -438,8 +435,8 @@ public class MGoal extends X_PA_Goal } // setGoalPerformance /** - * Get Goal Performance as Double - * @return performance as multipier + * Get Goal Performance value as Double + * @return goal performance value */ public double getGoalPerformanceDouble() { @@ -448,8 +445,8 @@ public class MGoal extends X_PA_Goal } // getGoalPerformanceDouble /** - * Get Goal Performance in Percent - * @return performance in percent + * Get Goal Performance value in Percent + * @return goal performance value in percent (i.e 5 percent if value is 0.05) */ public int getPercent() { @@ -484,7 +481,7 @@ public class MGoal extends X_PA_Goal /** * Get Measure Display - * @return Measure Display + * @return Measure Display (MEASUREDISPLAY_*) */ public String getMeasureDisplay () { @@ -503,7 +500,7 @@ public class MGoal extends X_PA_Goal /** * Get Measure Display Text - * @return Measure Display Text + * @return Measure Display Text for X axis */ public String getXAxisText () { @@ -523,7 +520,7 @@ public class MGoal extends X_PA_Goal /** * Goal has Target - * @return true if target + * @return true if has measurement target value */ public boolean isTarget() { @@ -534,6 +531,7 @@ public class MGoal extends X_PA_Goal * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MGoal["); @@ -549,6 +547,7 @@ public class MGoal extends X_PA_Goal * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { // Measure required if nor Summary @@ -601,6 +600,7 @@ public class MGoal extends X_PA_Goal * @param success success * @return true */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -614,6 +614,5 @@ public class MGoal extends X_PA_Goal return success; } - - + } // MGoal diff --git a/org.adempiere.base/src/org/compiere/model/MGoalRestriction.java b/org.adempiere.base/src/org/compiere/model/MGoalRestriction.java index 8e9e0078bc..52aa573fb0 100644 --- a/org.adempiere.base/src/org/compiere/model/MGoalRestriction.java +++ b/org.adempiere.base/src/org/compiere/model/MGoalRestriction.java @@ -28,17 +28,16 @@ import java.util.Properties; public class MGoalRestriction extends X_PA_GoalRestriction { /** - * + * generated serial id */ private static final long serialVersionUID = 4027980875091517732L; - /** - * UUID based Constructor - * @param ctx Context - * @param PA_GoalRestriction_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param PA_GoalRestriction_UU UUID key + * @param trxName Transaction + */ public MGoalRestriction(Properties ctx, String PA_GoalRestriction_UU, String trxName) { super(ctx, PA_GoalRestriction_UU, trxName); } @@ -64,12 +63,12 @@ public class MGoalRestriction extends X_PA_GoalRestriction { super (ctx, rs, trxName); } // MGoalRestriction - - + /** * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MGoalRestriction["); diff --git a/org.adempiere.base/src/org/compiere/model/MGroup.java b/org.adempiere.base/src/org/compiere/model/MGroup.java index 6de8b7ad3c..94767e1e20 100644 --- a/org.adempiere.base/src/org/compiere/model/MGroup.java +++ b/org.adempiere.base/src/org/compiere/model/MGroup.java @@ -31,7 +31,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MGroup extends X_R_Group implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 9013217403211341916L; @@ -83,19 +83,18 @@ public class MGroup extends X_R_Group implements ImmutablePOSupport /** Cache */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 20); - - + /** - * UUID based Constructor - * @param ctx Context - * @param R_Group_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param R_Group_UU UUID key + * @param trxName Transaction + */ public MGroup(Properties ctx, String R_Group_UU, String trxName) { super(ctx, R_Group_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param R_Group_ID group @@ -118,7 +117,7 @@ public class MGroup extends X_R_Group implements ImmutablePOSupport } // MGroup /** - * + * Copy constructor * @param copy */ public MGroup(MGroup copy) @@ -127,7 +126,7 @@ public class MGroup extends X_R_Group implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -137,7 +136,7 @@ public class MGroup extends X_R_Group implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MHierarchy.java b/org.adempiere.base/src/org/compiere/model/MHierarchy.java index a1288eac8a..3df8ce1dfd 100644 --- a/org.adempiere.base/src/org/compiere/model/MHierarchy.java +++ b/org.adempiere.base/src/org/compiere/model/MHierarchy.java @@ -32,7 +32,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MHierarchy extends X_PA_Hierarchy implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 7862096742442159952L; @@ -72,11 +72,11 @@ public class MHierarchy extends X_PA_Hierarchy implements ImmutablePOSupport = new ImmutableIntPOCache (Table_Name, 20); /** - * UUID based Constructor - * @param ctx Context - * @param PA_Hierarchy_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param PA_Hierarchy_UU UUID key + * @param trxName Transaction + */ public MHierarchy(Properties ctx, String PA_Hierarchy_UU, String trxName) { super(ctx, PA_Hierarchy_UU, trxName); } @@ -104,7 +104,7 @@ public class MHierarchy extends X_PA_Hierarchy implements ImmutablePOSupport } // MHierarchy /** - * + * Copy constructor * @param copy */ public MHierarchy(MHierarchy copy) @@ -113,7 +113,7 @@ public class MHierarchy extends X_PA_Hierarchy implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -123,7 +123,7 @@ public class MHierarchy extends X_PA_Hierarchy implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -135,8 +135,8 @@ public class MHierarchy extends X_PA_Hierarchy implements ImmutablePOSupport } /** - * Get AD_Tree_ID based on tree type - * @param TreeType Tree Type + * Get AD_Tree_ID based on tree type + * @param TreeType Tree Type (MTree.TREETYPE_*) * @return id or 0 */ public int getAD_Tree_ID (String TreeType) diff --git a/org.adempiere.base/src/org/compiere/model/MHouseKeeping.java b/org.adempiere.base/src/org/compiere/model/MHouseKeeping.java index d8a6c4a417..1bfa61ec06 100644 --- a/org.adempiere.base/src/org/compiere/model/MHouseKeeping.java +++ b/org.adempiere.base/src/org/compiere/model/MHouseKeeping.java @@ -30,26 +30,39 @@ import java.util.Properties; import org.compiere.util.Msg; +/** + * House keeping model + */ public class MHouseKeeping extends X_AD_HouseKeeping { /** - * + * generated serial id */ private static final long serialVersionUID = 6481567026614278994L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_HouseKeeping_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_HouseKeeping_UU UUID key + * @param trxName Transaction + */ public MHouseKeeping(Properties ctx, String AD_HouseKeeping_UU, String trxName) { super(ctx, AD_HouseKeeping_UU, trxName); } + /** + * @param ctx + * @param AD_HouseKeeping_ID + * @param trxName + */ public MHouseKeeping(Properties ctx, int AD_HouseKeeping_ID, String trxName) { super(ctx, AD_HouseKeeping_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MHouseKeeping(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MIFixedAsset.java b/org.adempiere.base/src/org/compiere/model/MIFixedAsset.java index 310af73175..f1e9e3a2ab 100644 --- a/org.adempiere.base/src/org/compiere/model/MIFixedAsset.java +++ b/org.adempiere.base/src/org/compiere/model/MIFixedAsset.java @@ -19,26 +19,29 @@ import org.compiere.util.Util; * @version $Id */ public class MIFixedAsset extends X_I_FixedAsset -{ - +{ /** - * + * generated serial id */ private static final long serialVersionUID = -6394518107160329652L; /** Default depreciation method */ private static final String s_defaultDepreciationType = "SL"; /** - * UUID based Constructor - * @param ctx Context - * @param I_FixedAsset_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param I_FixedAsset_UU UUID key + * @param trxName Transaction + */ public MIFixedAsset(Properties ctx, String I_FixedAsset_UU, String trxName) { super(ctx, I_FixedAsset_UU, trxName); } - /** Standard Constructor */ + /** + * @param ctx + * @param I_FixedAsset_ID + * @param trxName + */ public MIFixedAsset (Properties ctx, int I_FixedAsset_ID, String trxName) { super (ctx, I_FixedAsset_ID, trxName); @@ -54,7 +57,8 @@ public class MIFixedAsset extends X_I_FixedAsset super (ctx, rs, trxName); } // MIFixedAsset - /** Create / Load product + /** + * Create / Load product * @return product */ public MProduct getCreateProduct() @@ -120,6 +124,8 @@ public class MIFixedAsset extends X_I_FixedAsset } // getCreateProduct /** + * Round value of a column to standard precision. + * @param idx column index */ private void fixAmount(int idx) { BigDecimal amt = (BigDecimal)get_Value(idx); @@ -133,6 +139,8 @@ public class MIFixedAsset extends X_I_FixedAsset } /** + * Trim and compress duplicate space character in the value of a column + * @param idx column index */ private void fixKeyValue(int idx) { String name = (String)get_Value(idx); @@ -144,8 +152,9 @@ public class MIFixedAsset extends X_I_FixedAsset } /** - * + * @deprecated */ + @Deprecated public void process() { if (isProcessed()) { @@ -229,7 +238,7 @@ public class MIFixedAsset extends X_I_FixedAsset } /** - * @return Este MF-ul depreciat integral + * @return true if fully depreciated */ public boolean isFullyDepreciated() { @@ -265,18 +274,32 @@ public class MIFixedAsset extends X_I_FixedAsset /** */ private int m_M_Product_Category_ID = 0; + + /** + * SEt default product category id + * @param M_Product_Category_ID + */ public void setDefault_Product_Category_ID(int M_Product_Category_ID) { m_M_Product_Category_ID = M_Product_Category_ID; } /** */ private int m_A_Asset_Group_ID = 0; + + /** + * set defauly asset group id + * @param A_Asset_Group_ID + */ public void setDefault_Asset_Group_ID(int A_Asset_Group_ID) { m_A_Asset_Group_ID = A_Asset_Group_ID; } /** Product */ private MProduct m_product = null; + + /** + * @param product + */ public void setProduct(MProduct product) { m_product = product; setM_Product_ID(product.get_ID()); @@ -284,6 +307,10 @@ public class MIFixedAsset extends X_I_FixedAsset if (Util.isEmpty(getName())) setName(product.getName()); } + + /** + * @return product or null + */ public MProduct getProduct() { if (m_product == null && getM_Product_ID() > 0) { m_product = new MProduct(getCtx(), getM_Product_ID(), get_TrxName()); @@ -291,27 +318,38 @@ public class MIFixedAsset extends X_I_FixedAsset return m_product; } - /** Depreciation Method */ + /** + * @return A_Depreciation_ID + */ public int getA_Depreciation_ID() { MDepreciation depr = MDepreciation.get(getCtx(), s_defaultDepreciationType); return depr != null ? depr.get_ID() : 0; } + + /** + * @return A_Depreciation_ID + */ public int getA_Depreciation_F_ID() { return getA_Depreciation_ID(); } - /** Currency */ + /** + * @return standard precision of primary accounting schema + */ public int getStdPrecision() { return MClient.get(getCtx()).getAcctSchema().getStdPrecision(); } - /** String representation */ + /** + * @return summary text + */ public String getSummary() { return getInventoryNo() + " - " + getName(); } - /** Sets custom error - * + /** + * Sets custom error (I_ErrorMsg) + * @param msg */ public void setError(String msg) { String msg_trl = Msg.parseTranslation(getCtx(), msg); diff --git a/org.adempiere.base/src/org/compiere/model/MIMPProcessor.java b/org.adempiere.base/src/org/compiere/model/MIMPProcessor.java index b066f04a01..1d29963563 100644 --- a/org.adempiere.base/src/org/compiere/model/MIMPProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MIMPProcessor.java @@ -42,23 +42,24 @@ import org.compiere.util.DB; import org.compiere.util.Util; /** + * Import processor model for replication * @author Trifon Trifonov */ public class MIMPProcessor extends X_IMP_Processor implements AdempiereProcessor { /** - * + * generated serial id */ private static final long serialVersionUID = 4477942100661801354L; private static CLogger s_log = CLogger.getCLogger (MIMPProcessor.class); /** - * UUID based Constructor - * @param ctx Context - * @param IMP_Processor_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param IMP_Processor_UU UUID key + * @param trxName Transaction + */ public MIMPProcessor(Properties ctx, String IMP_Processor_UU, String trxName) { super(ctx, IMP_Processor_UU, trxName); if (Util.isEmpty(IMP_Processor_UU)) @@ -82,13 +83,19 @@ public class MIMPProcessor extends X_IMP_Processor implements AdempiereProcessor setKeepLogDays (7); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MIMPProcessor(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } /** - * + * @param requery + * @return next run time stamp */ public Timestamp getDateNextRun (boolean requery) { @@ -97,7 +104,6 @@ public class MIMPProcessor extends X_IMP_Processor implements AdempiereProcessor return getDateNextRun(); } - /** * Get Logs * @return logs @@ -135,8 +141,8 @@ public class MIMPProcessor extends X_IMP_Processor implements AdempiereProcessor } // getLogs /** - * Delete old Request Log - * @return number of records + * Delete old processor logs + * @return number of records deleted */ public int deleteLog() { @@ -149,11 +155,16 @@ public class MIMPProcessor extends X_IMP_Processor implements AdempiereProcessor return no; } + @Override public String getServerID() { StringBuilder msgreturn = new StringBuilder("ReplicationProcessor").append(get_ID()); return msgreturn.toString(); } + /** + * @param trxName + * @return processor parameters + */ public X_IMP_ProcessorParameter[] getIMP_ProcessorParameters(String trxName) { List resultList = new ArrayList(); @@ -185,6 +196,10 @@ public class MIMPProcessor extends X_IMP_Processor implements AdempiereProcessor return result; } + /** + * @param ctx + * @return active import processors + */ public static MIMPProcessor[] getActive(Properties ctx) { ArrayList list = new ArrayList(); diff --git a/org.adempiere.base/src/org/compiere/model/MIMPProcessorLog.java b/org.adempiere.base/src/org/compiere/model/MIMPProcessorLog.java index 25e08bd4e9..bb001154f3 100644 --- a/org.adempiere.base/src/org/compiere/model/MIMPProcessorLog.java +++ b/org.adempiere.base/src/org/compiere/model/MIMPProcessorLog.java @@ -31,29 +31,27 @@ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; - /** * @author Trifon Trifonov */ public class MIMPProcessorLog extends X_IMP_ProcessorLog implements AdempiereProcessorLog { /** - * + * generated serial id */ private static final long serialVersionUID = 2314394818152867856L; /** - * UUID based Constructor - * @param ctx Context - * @param IMP_ProcessorLog_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param IMP_ProcessorLog_UU UUID key + * @param trxName Transaction + */ public MIMPProcessorLog(Properties ctx, String IMP_ProcessorLog_UU, String trxName) { super(ctx, IMP_ProcessorLog_UU, trxName); } /** - * * @param ctx * @param IMP_ProcessorLog_ID * @param trxName @@ -63,7 +61,6 @@ public class MIMPProcessorLog extends X_IMP_ProcessorLog implements AdempierePro } /** - * * @param ctx * @param rs * @param trxName @@ -74,7 +71,6 @@ public class MIMPProcessorLog extends X_IMP_ProcessorLog implements AdempierePro } /** - * * @param parent * @param summary */ diff --git a/org.adempiere.base/src/org/compiere/model/MImage.java b/org.adempiere.base/src/org/compiere/model/MImage.java index 29efc9d0cc..f27809ac01 100644 --- a/org.adempiere.base/src/org/compiere/model/MImage.java +++ b/org.adempiere.base/src/org/compiere/model/MImage.java @@ -48,7 +48,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MImage extends X_AD_Image implements ImmutablePOSupport { /** - * + * generated serual id */ private static final long serialVersionUID = 1850627989276185947L; @@ -111,11 +111,11 @@ public class MImage extends X_AD_Image implements ImmutablePOSupport private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 20, 10); /** - * UUID based Constructor - * @param ctx Context - * @param AD_Image_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Image_UU UUID key + * @param trxName Transaction + */ public MImage(Properties ctx, String AD_Image_UU, String trxName) { super(ctx, AD_Image_UU, trxName); if (Util.isEmpty(AD_Image_UU)) @@ -150,7 +150,7 @@ public class MImage extends X_AD_Image implements ImmutablePOSupport } // MImage /** - * + * Copy constructor * @param copy */ public MImage(MImage copy) @@ -159,7 +159,7 @@ public class MImage extends X_AD_Image implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -169,7 +169,7 @@ public class MImage extends X_AD_Image implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -273,7 +273,7 @@ public class MImage extends X_AD_Image implements ImmutablePOSupport /** * Get URL - * @return url or null + * @return image url or null */ private URL getURL() { @@ -313,7 +313,7 @@ public class MImage extends X_AD_Image implements ImmutablePOSupport /** * Set Binary Data - * @param BinaryData data + * @param BinaryData binary data of an image */ @Override public void setBinaryData (byte[] BinaryData) @@ -325,6 +325,9 @@ public class MImage extends X_AD_Image implements ImmutablePOSupport prov.save(this,provider,BinaryData); } // setBinaryData + /** + * Load binary data through storage provider + */ @Override public byte[] getBinaryData() { IImageStore prov = provider.getImageStore(); @@ -335,7 +338,7 @@ public class MImage extends X_AD_Image implements ImmutablePOSupport /** * Get Data - * @return data + * @return binary data of an image */ public byte[] getData() { @@ -386,6 +389,7 @@ public class MImage extends X_AD_Image implements ImmutablePOSupport * String Representation * @return String */ + @Override public String toString() { StringBuilder msgreturn = new StringBuilder("MImage[ID=").append(get_ID()).append(",Name=").append(getName()).append("]"); @@ -398,6 +402,7 @@ public class MImage extends X_AD_Image implements ImmutablePOSupport * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getAD_Org_ID() != 0) @@ -405,6 +410,9 @@ public class MImage extends X_AD_Image implements ImmutablePOSupport return true; } // beforeSave + /** + * @return relative image storage path (without the image id/name) + */ public String getImageStoragePath() { StringBuilder path = new StringBuilder("AD_Image").append(File.separator) .append(this.getAD_Client_ID()).append(File.separator); @@ -425,8 +433,8 @@ public class MImage extends X_AD_Image implements ImmutablePOSupport } /** - * Set Storage Provider - * Used temporarily for the process to migrate storage provider + * Set Storage Provider.
    + * Used by storage provider migration process to migrate storage provider. * @param p Storage provider */ public void setStorageProvider(MStorageProvider p) { @@ -434,10 +442,17 @@ public class MImage extends X_AD_Image implements ImmutablePOSupport setAD_StorageProvider_ID(p.getAD_StorageProvider_ID()); } + /** + * @return binary data of image + */ public byte[] getByteData(){ return super.getBinaryData(); } + /** + * Set binary data of image + * @param BinaryData + */ public void setByteData(byte[] BinaryData){ super.setBinaryData(BinaryData); } diff --git a/org.adempiere.base/src/org/compiere/model/MImportTemplate.java b/org.adempiere.base/src/org/compiere/model/MImportTemplate.java index 8aa2af380d..6e6e4f7e8f 100644 --- a/org.adempiere.base/src/org/compiere/model/MImportTemplate.java +++ b/org.adempiere.base/src/org/compiere/model/MImportTemplate.java @@ -42,7 +42,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MImportTemplate extends X_AD_ImportTemplate implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -4681075469110529774L; @@ -51,16 +51,16 @@ public class MImportTemplate extends X_AD_ImportTemplate implements ImmutablePOS private static CLogger s_log = CLogger.getCLogger(MImportTemplate.class); /** - * UUID based Constructor - * @param ctx Context - * @param AD_ImportTemplate_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_ImportTemplate_UU UUID key + * @param trxName Transaction + */ public MImportTemplate(Properties ctx, String AD_ImportTemplate_UU, String trxName) { super(ctx, AD_ImportTemplate_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param AD_ImportTemplate_ID id @@ -83,7 +83,7 @@ public class MImportTemplate extends X_AD_ImportTemplate implements ImmutablePOS } // MImportTemplate /** - * + * Copy constructor * @param copy */ public MImportTemplate(MImportTemplate copy) @@ -92,7 +92,7 @@ public class MImportTemplate extends X_AD_ImportTemplate implements ImmutablePOS } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -102,7 +102,7 @@ public class MImportTemplate extends X_AD_ImportTemplate implements ImmutablePOS } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -129,6 +129,12 @@ public class MImportTemplate extends X_AD_ImportTemplate implements ImmutablePOS /** Cache of Role */ private static CCache> s_cacheRoleTab = new CCache>(Table_Name, Table_Name+"_Of_Role", 5); + /** + * Get accessible import templates + * @param roleid AD_Role_ID + * @param tabid AD_Tab_ID + * @return list of MImportTemplate + */ public static List getTemplates(int roleid, int tabid) { String key = roleid + "_" + tabid; List retValue = s_cacheRoleTab.get(key); @@ -160,6 +166,11 @@ public class MImportTemplate extends X_AD_ImportTemplate implements ImmutablePOS return retValue; } + /** + * @param importMode I (Insert), U (Update) or M (Merge) + * @param roleID AD_Role_ID + * @return true if role can perform importMode with this template + */ public boolean isAllowed(String importMode, int roleID) { StringBuilder sql= new StringBuilder("" + "SELECT COUNT(*) " @@ -187,9 +198,9 @@ public class MImportTemplate extends X_AD_ImportTemplate implements ImmutablePOS } /** - * Validate that InputStream header is CSVHeader or AliasCSVHeader + * Validate that InputStream header is CSVHeader or AliasCSVHeader.
    * If the header is AliasCSVHeader it replaces it with the CSVHeader so it can be - * processed + * processed. * @param in input file * @return InputStream with the CSVHeader that can be processed by CsvMapReader */ diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index 619a9e7a32..fc9bd1b4ef 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -57,7 +57,7 @@ import org.compiere.wf.MWFActivity; import org.compiere.wf.MWorkflow; /** - * Shipment Model + * Shipment/Receipt Model * * @author Jorg Janke * @version $Id: MInOut.java,v 1.4 2006/07/30 00:51:03 jjanke Exp $ @@ -83,6 +83,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess */ private static final long serialVersionUID = -8699990804131725782L; + /** Matching SQL Template for M_InOut */ private static final String BASE_MATCHING_SQL = """ SELECT hdr.M_InOut_ID, hdr.DocumentNo, hdr.MovementDate, bp.Name, hdr.C_BPartner_ID, @@ -99,6 +100,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess WHERE hdr.DocStatus IN ('CO','CL') """; + /** Matching SQL template for GROUP BY */ private static final String BASE_MATCHING_GROUP_BY_SQL = """ GROUP BY hdr.M_InOut_ID,hdr.DocumentNo,hdr.MovementDate,bp.Name,hdr.C_BPartner_ID, @@ -519,7 +521,6 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess } // copyFrom /** - * @deprecated * Create new Shipment by copying * @param from shipment * @param dateDoc date of the document date @@ -529,7 +530,9 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * @param trxName trx * @param setOrder set the order link * @return Shipment + * @deprecated */ + @Deprecated public static MInOut copyFrom (MInOut from, Timestamp dateDoc, int C_DocType_ID, boolean isSOTrx, boolean counter, String trxName, boolean setOrder) { @@ -541,18 +544,18 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess } /** - * UUID based Constructor - * @param ctx Context - * @param M_InOut_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_InOut_UU UUID key + * @param trxName Transaction + */ public MInOut(Properties ctx, String M_InOut_UU, String trxName) { super(ctx, M_InOut_UU, trxName); if (Util.isEmpty(M_InOut_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param M_InOut_ID @@ -563,6 +566,12 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess this (ctx, M_InOut_ID, trxName, (String[]) null); } // MInOut + /** + * @param ctx + * @param M_InOut_ID + * @param trxName + * @param virtualColumns + */ public MInOut(Properties ctx, int M_InOut_ID, String trxName, String... virtualColumns) { super(ctx, M_InOut_ID, trxName, virtualColumns); if (M_InOut_ID == 0) @@ -793,7 +802,6 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess } // MInOut - /** Lines */ protected MInOutLine[] m_lines = null; /** Confirmations */ @@ -801,10 +809,9 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess /** BPartner */ protected MBPartner m_partner = null; - /** - * Get Document Status - * @return Document Status Clear Text + * Get Document Status Name + * @return Document Status Name */ public String getDocStatusName() { @@ -830,6 +837,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * String representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MInOut[") @@ -841,8 +849,9 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess /** * Get Document Info - * @return document info (untranslated) + * @return document info (not translated) */ + @Override public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); @@ -854,6 +863,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * Create PDF * @return File or null */ + @Override public File createPDF () { try @@ -930,7 +940,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess /** * Get Confirmations - * @param requery requery + * @param requery true to requery from DB * @return array of Confirmations */ public MInOutConfirm[] getConfirmations(boolean requery) @@ -948,7 +958,6 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess return m_confirms; } // getConfirmations - /** * Copy Lines From other Shipment * @param otherShipment shipment @@ -1036,16 +1045,17 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess protected boolean m_reversal = false; /** - * Set Reversal + * Set reversal state (instance variable) * @param reversal reversal */ protected void setReversal(boolean reversal) { m_reversal = reversal; } // setReversal + /** * Is Reversal - * @return reversal + * @return true reversal state is set to true */ public boolean isReversal() { @@ -1057,6 +1067,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * Propagate to Lines/Taxes * @param processed processed */ + @Override public void setProcessed (boolean processed) { super.setProcessed (processed); @@ -1072,7 +1083,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess /** * Get BPartner - * @return partner + * @return business partner */ public MBPartner getBPartner() { @@ -1083,7 +1094,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess /** * Set Document Type - * @param DocBaseType doc type MDocType.DOCBASETYPE_ + * @param DocBaseType MDocType.DOCBASETYPE_* */ public void setC_DocType_ID (String DocBaseType) { @@ -1107,7 +1118,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess /** * Set Default C_DocType_ID. - * Based on SO flag + * Based on IsSOTrx flag. */ public void setC_DocType_ID() { @@ -1207,6 +1218,9 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess MInOutConfirm.create (this, MInOutConfirm.CONFIRMTYPE_ShipReceiptConfirm, true); } // createConfirmation + /** + * Void confirmations + */ protected void voidConfirmations() { for(MInOutConfirm confirm : getConfirmations(true)) @@ -1220,7 +1234,6 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess } } - /** * Set Warehouse and check/set Organization * @param M_Warehouse_ID id @@ -1244,12 +1257,12 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess } // setM_Warehouse_ID /** - * Gets Movement Type based on Document Type's DocBaseType and isSOTrx + * Get Movement Type based on Document Type's DocBaseType and isSOTrx * @param ctx * @param C_DocType_ID Document Type ID * @param issotrx is sales transaction * @param trxName transaction name - * @return Movement Type + * @return Movement Type (MOVEMENTTYPE_*) */ public static String getMovementType(Properties ctx, int C_DocType_ID, boolean issotrx, String trxName) { String movementType = null; @@ -1284,6 +1297,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * @param newRecord new * @return true or false */ + @Override protected boolean beforeSave (boolean newRecord) { if(newRecord || is_ValueChanged("C_DocType_ID")) { @@ -1357,6 +1371,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success || newRecord) @@ -1375,12 +1390,12 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess return true; } // afterSave - - /************************************************************************** + /** * Process document * @param processAction document action * @return true if performed */ + @Override public boolean processIt (String processAction) { m_processMsg = null; @@ -1397,6 +1412,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * Unlock Document. * @return true if success */ + @Override public boolean unlockIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -1408,6 +1424,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * Invalidate Document * @return true if success */ + @Override public boolean invalidateIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -1419,6 +1436,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * Prepare Document * @return new status (In Progress or Invalid) */ + @Override public String prepareIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -1555,6 +1573,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * Approve Document * @return true if success */ + @Override public boolean approveIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -1566,6 +1585,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * Reject Approval * @return true if success */ + @Override public boolean rejectIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -1577,6 +1597,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * Complete Document * @return new status (Complete, In Progress, Invalid, Waiting ..) */ + @Override public String completeIt() { // Re-Check @@ -2129,7 +2150,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess /** * Outstanding (not processed) Customer Confirmations ? - * @return true if there are pending Customer Confirmations + * @return true if there are pending Customer Confirmations (MInOutConfirm.CONFIRMTYPE_CustomerConfirmation) */ public boolean pendingCustomerConfirmations() { MInOutConfirm[] confirmations = getConfirmations(true); @@ -2161,8 +2182,12 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess } /* Save array of documents to process AFTER completing this one */ - ArrayList docsPostProcess = new ArrayList(); + protected ArrayList docsPostProcess = new ArrayList(); + /** + * Add doc for post processing (after processing of document action) + * @param doc + */ protected void addDocsPostProcess(PO doc) { docsPostProcess.add(doc); } @@ -2174,8 +2199,8 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess /** * Automatically creates a customer shipment for any - * drop shipment material receipt - * Based on createCounterDoc() by JJ + * drop shipment material receipt. + * Based on createCounterDoc() by JJ. * @return shipment if created else null */ protected MInOut createDropShipment() { @@ -2272,8 +2297,10 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess } /** - * Check Material Policy - * Sets line ASI + * Check Material Policy. + * Create MInOutLineMA and set line ASI (if needed). + * @param line + * @param qty */ protected void checkMaterialPolicy(MInOutLine line,BigDecimal qty) { @@ -2422,8 +2449,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess return qtyToReceive; } - - /************************************************************************** + /** * Create Counter Document * @return InOut */ @@ -2526,6 +2552,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * Void Document. * @return true if success */ + @Override public boolean voidIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2602,6 +2629,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * Close Document. * @return true if success */ + @Override public boolean closeIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2624,6 +2652,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * Reverse Correction - same date * @return true if success */ + @Override public boolean reverseCorrectIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2648,6 +2677,11 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess return true; } // reverseCorrectionIt + /** + * Reverse this document + * @param accrual true to create reversal document using current date, false to use the accounting date of this document + * @return reversal MInOut + */ protected MInOut reverse(boolean accrual) { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); Timestamp reversalDate = accrual ? Env.getContextAsDate(getCtx(), Env.DATE) : getDateAcct(); @@ -2749,7 +2783,6 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess reversal.setM_RMA_ID(getM_RMA_ID()); StringBuilder msgadd = new StringBuilder("{->").append(getDocumentNo()).append(")"); reversal.addDescription(msgadd.toString()); - //FR1948157 reversal.setReversal_ID(getM_InOut_ID()); reversal.saveEx(get_TrxName()); // @@ -2775,12 +2808,16 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess // Void Confirmations setDocStatus(DOCSTATUS_Reversed); // need to set & save docstatus to be able to check it in MInOutConfirm.voidIt() saveEx(); - //FR1948157 this.setReversal_ID(reversal.getM_InOut_ID()); voidConfirmations(); return reversal; } + /** + * Reverse match invoice and match PO. + * @param reversalDate + * @return false if there errors, true otherwise + */ protected boolean reverseMatching(Timestamp reversalDate) { MMatchInv[] mInv = MMatchInv.getInOut(getCtx(), getM_InOut_ID(), get_TrxName()); for (MMatchInv mMatchInv : mInv) @@ -2820,9 +2857,10 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess } /** - * Reverse Accrual - none + * Reverse Accrual - current date * @return false */ + @Override public boolean reverseAccrualIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2851,6 +2889,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * Re-activate * @return false */ + @Override public boolean reActivateIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2867,11 +2906,11 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess return false; } // reActivateIt - - /************************************************************************* + /** * Get Summary * @return Summary of Document */ + @Override public String getSummary() { StringBuilder sb = new StringBuilder(); @@ -2889,6 +2928,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * Get Process Message * @return clear text error message */ + @Override public String getProcessMsg() { return m_processMsg; @@ -2898,6 +2938,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * Get Document Owner (Responsible) * @return AD_User_ID */ + @Override public int getDoc_User_ID() { return getSalesRep_ID(); @@ -2905,8 +2946,9 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess /** * Get Document Approval Amount - * @return amount + * @return 0 */ + @Override public BigDecimal getApprovalAmt() { return Env.ZERO; @@ -2916,6 +2958,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * Get C_Currency_ID * @return Accounting Currency */ + @Override public int getC_Currency_ID () { return Env.getContextAsInt(getCtx(),Env.C_CURRENCY_ID); @@ -2943,7 +2986,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess * @param M_InOutLine_ID * @param reversal * @param trxName - * @return error doc status if there are any errors + * @return error doc status if there are any errors, null otherwise */ protected String moveOnHandToShipmentASI(MProduct product, int M_Locator_ID, int M_AttributeSetInstance_ID, BigDecimal qty, Timestamp dateMaterialPolicy, int M_InOutLine_ID, boolean reversal, String trxName) { @@ -3004,6 +3047,18 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess return null; } + /** + * Move non ASI on hand (M_AttributeSetInstance_ID==0) to ASI storage record + * @param product + * @param M_Locator_ID + * @param M_AttributeSetInstance_ID + * @param dateMaterialPolicy + * @param qty + * @param M_InOutLine_ID + * @param reversal + * @param trxName + * @return null or error doc status + */ private String doMove(MProduct product, int M_Locator_ID, int M_AttributeSetInstance_ID, Timestamp dateMaterialPolicy, BigDecimal qty, int M_InOutLine_ID, boolean reversal, String trxName) { MStorageOnHand[] storages; @@ -3167,8 +3222,10 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess /** * Update from order/invoice/rma - * - if linked to another order/invoice/rma - remove link - * - if no link set it + *
      + *
    • if linked to another order/invoice/rma - remove link
    • + *
    • if no link set it
    • + *
    * @param order * @param invoice * @param rma diff --git a/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java b/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java index e773f4187e..ab7be1b04e 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java +++ b/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java @@ -50,7 +50,7 @@ import org.compiere.util.Util; public class MInOutConfirm extends X_M_InOutConfirm implements DocAction { /** - * + * generated serial id */ private static final long serialVersionUID = -1998947558580855224L; @@ -95,18 +95,18 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction private static CLogger s_log = CLogger.getCLogger (MInOutConfirm.class); /** - * UUID based Constructor - * @param ctx Context - * @param M_InOutConfirm_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_InOutConfirm_UU UUID key + * @param trxName Transaction + */ public MInOutConfirm(Properties ctx, String M_InOutConfirm_UU, String trxName) { super(ctx, M_InOutConfirm_UU, trxName); if (Util.isEmpty(M_InOutConfirm_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param M_InOutConfirm_ID id @@ -164,7 +164,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction /** * Get Lines - * @param requery requery + * @param requery true to requery from DB * @return array of lines */ public MInOutLineConfirm[] getLines (boolean requery) @@ -210,6 +210,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MInOutConfirm["); @@ -222,6 +223,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction * Get Document Info * @return document info (untranslated) */ + @Override public String getDocumentInfo() { StringBuilder msgreturn = new StringBuilder().append(Msg.getElement(getCtx(), "M_InOutConfirm_ID")).append(" ").append(getDocumentNo()); @@ -232,6 +234,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction * Create PDF * @return File or null */ + @Override public File createPDF () { try @@ -250,17 +253,18 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction /** * Create PDF file * @param file output file - * @return file if success + * @return not implemented, always return null */ public File createPDF (File file) { - return null; + return null; } // createPDF /** - * Set Approved + * Set Approved and update description (if IsApproved=true) * @param IsApproved approval */ + @Override public void setIsApproved (boolean IsApproved) { if (IsApproved && !isApproved()) @@ -275,13 +279,13 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction } super.setIsApproved (IsApproved); } // setIsApproved - - - /************************************************************************** + + /** * Process document * @param processAction document action * @return true if performed */ + @Override public boolean processIt (String processAction) { m_processMsg = null; @@ -298,6 +302,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction * Unlock Document. * @return true if success */ + @Override public boolean unlockIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -309,6 +314,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction * Invalidate Document * @return true if success */ + @Override public boolean invalidateIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -320,6 +326,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction * Prepare Document * @return new status (In Progress or Invalid) */ + @Override public String prepareIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -359,6 +366,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction * Approve Document * @return true if success */ + @Override public boolean approveIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -370,6 +378,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction * Reject Approval * @return true if success */ + @Override public boolean rejectIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -381,6 +390,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction * Complete Document * @return new status (Complete, In Progress, Invalid, Waiting ..) */ + @Override public String completeIt() { // Re-Check @@ -470,7 +480,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction } // completeIt /** - * Split Shipment into confirmed and dispute + * Split Shipment into confirmed and dispute (if there are quantity difference recorded in confirmation line) * @param original original shipment * @param C_DocType_ID target DocType * @param confirmLines confirm lines @@ -580,10 +590,13 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction m_processMsg += "??"; } // splitInOut - /** - * Create Difference Document + * Create Difference Document. + *
      + *
    • Physical inventory for scrap
    • + *
    • Credit memo for difference
    • + *
        * @param inout shipment/receipt * @param confirm confirm line * @return true if created @@ -655,8 +668,8 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction return true; } // createDifferenceDoc - /** + * Set physical inventory doc type * @param inventory */ private void setInventoryDocType(MInventory inventory) { @@ -670,12 +683,12 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction } } } - - + /** * Void Document. * @return false */ + @Override public boolean voidIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -736,6 +749,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction * Close Document. * @return true if success */ + @Override public boolean closeIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -758,6 +772,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction * Reverse Correction * @return false */ + @Override public boolean reverseCorrectIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -778,6 +793,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction * Reverse Accrual - none * @return false */ + @Override public boolean reverseAccrualIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -798,6 +814,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction * Re-activate * @return false */ + @Override public boolean reActivateIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -813,12 +830,12 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction return false; } // reActivateIt - - - /************************************************************************* + + /** * Get Summary * @return Summary of Document */ + @Override public String getSummary() { StringBuilder sb = new StringBuilder(); @@ -837,6 +854,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction * Get Process Message * @return clear text error message */ + @Override public String getProcessMsg() { return m_processMsg; @@ -846,6 +864,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction * Get Document Owner (Responsible) * @return AD_User_ID */ + @Override public int getDoc_User_ID() { return getUpdatedBy(); @@ -855,6 +874,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction * Get Document Currency * @return C_Currency_ID */ + @Override public int getC_Currency_ID() { return 0; diff --git a/org.adempiere.base/src/org/compiere/model/MInOutLine.java b/org.adempiere.base/src/org/compiere/model/MInOutLine.java index df8118cc59..98a13d5f1b 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOutLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInOutLine.java @@ -21,6 +21,7 @@ import java.math.RoundingMode; import java.sql.ResultSet; import java.util.List; import java.util.Properties; +import java.util.logging.Level; import org.adempiere.base.Core; import org.adempiere.exceptions.AdempiereException; @@ -49,17 +50,17 @@ import org.compiere.util.ValueNamePair; public class MInOutLine extends X_M_InOutLine { /** - * + * generated serial id */ private static final long serialVersionUID = 8630611882798722864L; /** - * Get Ship lines Of Product - * * @param ctx context + * Get Shipment/Receipt lines Of Product + * @param ctx context * @param M_Product_ID product * @param where optional addition where clause * @param trxName transaction - * @return array of receipt lines + * @return array of shipment/receipt lines */ public static MInOutLine[] getOfProduct (Properties ctx, int M_Product_ID, String where, String trxName) @@ -72,12 +73,12 @@ public class MInOutLine extends X_M_InOutLine } /** - * Get Ship lines Of Order Line + * Get Shipment/Receipt lines Of Order Line * @param ctx context * @param C_OrderLine_ID line * @param where optional addition where clause * @param trxName transaction - * @return array of receipt lines + * @return array of shipment/receipt lines */ public static MInOutLine[] getOfOrderLine (Properties ctx, int C_OrderLine_ID, String where, String trxName) @@ -90,12 +91,12 @@ public class MInOutLine extends X_M_InOutLine } // getOfOrderLine /** - * Get Ship lines Of RMA Line + * Get shipment/receipt lines Of RMA Line * @param ctx context * @param M_RMALine_ID line * @param where optional addition where clause * @param trxName transaction - * @return array of receipt lines + * @return array of shipment/receipt lines */ public static MInOutLine[] getOfRMALine (Properties ctx, int M_RMALine_ID, String where, String trxName) @@ -108,31 +109,30 @@ public class MInOutLine extends X_M_InOutLine } // getOfRMALine /** - * Get Ship lines Of Order Line + * Get shipment/receipt lines Of Order Line * @param ctx context * @param C_OrderLine_ID line * @param trxName transaction - * @return array of receipt lines2 + * @return array of shipment/receipt lines */ public static MInOutLine[] get (Properties ctx, int C_OrderLine_ID, String trxName) { return getOfOrderLine(ctx, C_OrderLine_ID, null, trxName); } // get - /** - * UUID based Constructor - * @param ctx Context - * @param M_InOutLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_InOutLine_UU UUID key + * @param trxName Transaction + */ public MInOutLine(Properties ctx, String M_InOutLine_UU, String trxName) { super(ctx, M_InOutLine_UU, trxName); if (Util.isEmpty(M_InOutLine_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param M_InOutLine_ID id @@ -143,6 +143,12 @@ public class MInOutLine extends X_M_InOutLine this (ctx, M_InOutLine_ID, trxName, (String[]) null); } // MInOutLine + /** + * @param ctx + * @param M_InOutLine_ID + * @param trxName + * @param virtualColumns + */ public MInOutLine(Properties ctx, int M_InOutLine_ID, String trxName, String... virtualColumns) { super(ctx, M_InOutLine_ID, trxName, virtualColumns); if (M_InOutLine_ID == 0) @@ -209,8 +215,8 @@ public class MInOutLine extends X_M_InOutLine * Set Order Line. * Does not set Quantity! * @param oLine order line - * @param M_Locator_ID locator - * @param Qty used only to find suitable locator + * @param M_Locator_ID optional locator id + * @param Qty used to find locator if M_Locator_ID parameter is 0 */ public void setOrderLine (MOrderLine oLine, int M_Locator_ID, BigDecimal Qty) { @@ -257,8 +263,8 @@ public class MInOutLine extends X_M_InOutLine * Set Invoice Line. * Does not set Quantity! * @param iLine invoice line - * @param M_Locator_ID locator - * @param Qty qty only fo find suitable locator + * @param M_Locator_ID optional locator id + * @param Qty used to find locator if M_Locator_ID parameter is 0 */ public void setInvoiceLine (MInvoiceLine iLine, int M_Locator_ID, BigDecimal Qty) { @@ -316,7 +322,8 @@ public class MInOutLine extends X_M_InOutLine } // setM_Warehouse_ID /** - * Set M_Locator_ID + * Set M_Locator_ID. + * Throw IllegalArgumentException if M_Locator_ID < 0. * @param M_Locator_ID id */ @Override @@ -330,8 +337,8 @@ public class MInOutLine extends X_M_InOutLine /** * Set (default) Locator based on qty. + * Assumes Warehouse is set. * @param Qty quantity - * Assumes Warehouse is set */ public void setM_Locator_ID(BigDecimal Qty) { @@ -359,7 +366,7 @@ public class MInOutLine extends X_M_InOutLine } // setM_Locator_ID /** - * Set Movement/Movement Qty + * Set Entered and Movement Qty * @param Qty Entered/Movement Qty */ public void setQty (BigDecimal Qty) @@ -369,9 +376,10 @@ public class MInOutLine extends X_M_InOutLine } // setQtyInvoiced /** - * Set Qty Entered - enforce entered UOM + * Set Qty Entered - enforce UOM precision * @param QtyEntered */ + @Override public void setQtyEntered (BigDecimal QtyEntered) { if (QtyEntered != null && getC_UOM_ID() != 0) @@ -383,9 +391,10 @@ public class MInOutLine extends X_M_InOutLine } // setQtyEntered /** - * Set Movement Qty - enforce Product UOM + * Set Movement Qty - enforce Product UOM precision * @param MovementQty */ + @Override public void setMovementQty (BigDecimal MovementQty) { MProduct product = getProduct(); @@ -431,7 +440,7 @@ public class MInOutLine extends X_M_InOutLine /** * Set M_Product_ID * @param M_Product_ID product - * @param setUOM also set UOM from product + * @param setUOM true to also set UOM from product */ public void setM_Product_ID (int M_Product_ID, boolean setUOM) { @@ -473,7 +482,7 @@ public class MInOutLine extends X_M_InOutLine /** * Get C_Project_ID - * @return project + * @return C_Project_ID */ public int getC_Project_ID() { @@ -485,7 +494,7 @@ public class MInOutLine extends X_M_InOutLine /** * Get C_Activity_ID - * @return Activity + * @return C_Activity_ID */ public int getC_Activity_ID() { @@ -497,7 +506,7 @@ public class MInOutLine extends X_M_InOutLine /** * Get C_Campaign_ID - * @return Campaign + * @return C_Campaign_ID */ public int getC_Campaign_ID() { @@ -508,8 +517,8 @@ public class MInOutLine extends X_M_InOutLine } // getC_Campaign_ID /** - * Get User2_ID - * @return User2 + * Get User1_ID + * @return User1_ID */ public int getUser1_ID () { @@ -521,7 +530,7 @@ public class MInOutLine extends X_M_InOutLine /** * Get User2_ID - * @return User2 + * @return User2_ID */ public int getUser2_ID () { @@ -533,7 +542,7 @@ public class MInOutLine extends X_M_InOutLine /** * Get AD_OrgTrx_ID - * @return trx org + * @return AD_OrgTrx_ID */ public int getAD_OrgTrx_ID() { @@ -543,14 +552,15 @@ public class MInOutLine extends X_M_InOutLine return ii; } // getAD_OrgTrx_ID - /************************************************************************** + /** * Before Save * @param newRecord new * @return save */ + @Override protected boolean beforeSave (boolean newRecord) { - log.fine(""); + if (log.isLoggable(Level.FINE)) log.fine(""); if (newRecord && getParent().isProcessed()) { log.saveError("ParentComplete", Msg.translate(getCtx(), "M_InOut_ID")); return false; @@ -591,7 +601,6 @@ public class MInOutLine extends X_M_InOutLine if (getM_Locator_ID() <= 0 && getC_Charge_ID() <= 0) { // Try to load Default Locator - MWarehouse warehouse = MWarehouse.get(getM_Warehouse_ID()); if(warehouse != null) { @@ -711,6 +720,7 @@ public class MInOutLine extends X_M_InOutLine * Before Delete * @return true if drafted */ + @Override protected boolean beforeDelete () { if (! getParent().getDocStatus().equals(MInOut.DOCSTATUS_Drafted)) { @@ -737,6 +747,7 @@ public class MInOutLine extends X_M_InOutLine * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MInOutLine[").append (get_ID()) @@ -750,7 +761,7 @@ public class MInOutLine extends X_M_InOutLine /** * Get Base value for Cost Distribution - * @param CostDistribution cost Distribution + * @param CostDistribution cost Distribution (MLandedCost.LANDEDCOSTDISTRIBUTION_*) * @return base number */ public BigDecimal getBase (String CostDistribution) @@ -798,6 +809,9 @@ public class MInOutLine extends X_M_InOutLine return Env.ZERO; } // getBase + /** + * @return true if has same UOM with order line + */ public boolean sameOrderLineUOM() { if (getC_OrderLine_ID() <= 0) diff --git a/org.adempiere.base/src/org/compiere/model/MInOutLineConfirm.java b/org.adempiere.base/src/org/compiere/model/MInOutLineConfirm.java index a8b1ca0ec5..49657364a3 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOutLineConfirm.java +++ b/org.adempiere.base/src/org/compiere/model/MInOutLineConfirm.java @@ -25,7 +25,7 @@ import org.compiere.util.Msg; import org.compiere.util.Util; /** - * Ship Confirmation Line Model + * Shipment Confirmation Line Model * * @author Jorg Janke * @version $Id: MInOutLineConfirm.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $ @@ -33,16 +33,16 @@ import org.compiere.util.Util; public class MInOutLineConfirm extends X_M_InOutLineConfirm { /** - * + * generated serial id */ private static final long serialVersionUID = -2753405320678781177L; /** - * UUID based Constructor - * @param ctx Context - * @param M_InOutLineConfirm_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_InOutLineConfirm_UU UUID key + * @param trxName Transaction + */ public MInOutLineConfirm(Properties ctx, String M_InOutLineConfirm_UU, String trxName) { super(ctx, M_InOutLineConfirm_UU, trxName); if (Util.isEmpty(M_InOutLineConfirm_UU)) @@ -121,10 +121,10 @@ public class MInOutLineConfirm extends X_M_InOutLineConfirm /** - * Process Confirmation Line. + * Process Confirmation Line.
        * - Update InOut Line - * @param isSOTrx sales order - * @param confirmType type + * @param isSOTrx true for sales trx, false otherwise + * @param confirmType type (MInOutConfirm.CONFIRMTYPE_*) * @return success */ public boolean processLine (boolean isSOTrx, String confirmType) @@ -184,9 +184,10 @@ public class MInOutLineConfirm extends X_M_InOutLineConfirm /** - * Before Delete - do not delete + * Before Delete - do not allow delete * @return false */ + @Override protected boolean beforeDelete () { log.saveError("Error", Msg.getMsg(getCtx(), "CannotDelete")); @@ -198,6 +199,7 @@ public class MInOutLineConfirm extends X_M_InOutLineConfirm * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { MInOutConfirm parent = new MInOutConfirm(getCtx(), getM_InOutConfirm_ID(), get_TrxName()); diff --git a/org.adempiere.base/src/org/compiere/model/MInOutLineMA.java b/org.adempiere.base/src/org/compiere/model/MInOutLineMA.java index fa638caf2c..1baceb1b61 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOutLineMA.java +++ b/org.adempiere.base/src/org/compiere/model/MInOutLineMA.java @@ -34,7 +34,7 @@ import org.compiere.util.Msg; import org.compiere.util.Util; /** - * Shipment Material Allocation + * Shipment/Receipt Material Allocation * * @author Jorg Janke * @version $Id: MInOutLineMA.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $ @@ -42,7 +42,7 @@ import org.compiere.util.Util; public class MInOutLineMA extends X_M_InOutLineMA { /** - * + * generated serial id */ private static final long serialVersionUID = -2610075295914545809L; @@ -94,16 +94,16 @@ public class MInOutLineMA extends X_M_InOutLineMA } // deleteInOutLineMA /** - * UUID based Constructor - * @param ctx Context - * @param M_InOutLineMA_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_InOutLineMA_UU UUID key + * @param trxName Transaction + */ public MInOutLineMA(Properties ctx, String M_InOutLineMA_UU, String trxName) { super(ctx, M_InOutLineMA_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param M_InOutLineMA_ID ignored @@ -144,7 +144,7 @@ public class MInOutLineMA extends X_M_InOutLineMA * @param M_AttributeSetInstance_ID * @param MovementQty * @param DateMaterialPolicy - * @param isAutoGenerated + * @param isAutoGenerated true if auto created by application instead of by user */ public MInOutLineMA (MInOutLine parent, int M_AttributeSetInstance_ID, BigDecimal MovementQty,Timestamp DateMaterialPolicy,boolean isAutoGenerated) { @@ -178,6 +178,7 @@ public class MInOutLineMA extends X_M_InOutLineMA * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MInOutLineMA["); @@ -188,10 +189,27 @@ public class MInOutLineMA extends X_M_InOutLineMA return sb.toString (); } // toString + /** + * Create new MInOutLineMA or add MovementQty to existing MInOutLineMA + * @param line + * @param M_AttributeSetInstance_ID + * @param MovementQty + * @param DateMaterialPolicy + * @return MInOutLineMA + */ public static MInOutLineMA addOrCreate(MInOutLine line, int M_AttributeSetInstance_ID, BigDecimal MovementQty, Timestamp DateMaterialPolicy){ return addOrCreate(line,M_AttributeSetInstance_ID,MovementQty,DateMaterialPolicy,true); } + /** + * Create new MInOutLineMA or add MovementQty to existing MInOutLineMA + * @param line + * @param M_AttributeSetInstance_ID + * @param MovementQty + * @param DateMaterialPolicy + * @param isAutoGenerated + * @return MInOutLineMA + */ public static MInOutLineMA addOrCreate(MInOutLine line, int M_AttributeSetInstance_ID, BigDecimal MovementQty, Timestamp DateMaterialPolicy,boolean isAutoGenerated) { Query query = new Query(Env.getCtx(), I_M_InOutLineMA.Table_Name, "M_InOutLine_ID=? AND M_AttributeSetInstance_ID=? AND DateMaterialPolicy=trunc(cast(? as date))", @@ -205,10 +223,10 @@ public class MInOutLineMA extends X_M_InOutLineMA } /** - * Total qty on LineMA for M_InoutLine + * Get total movement qty for LineMA created manually by user * @param M_InOutLine_ID * @param trxName - * @return + * @return total movement qty from M_InOutLineMA created by user */ public static BigDecimal getManualQty (int M_InOutLine_ID, String trxName) { @@ -218,7 +236,7 @@ public class MInOutLineMA extends X_M_InOutLineMA } //totalLineQty /** - * Get Material Allocations from shipment which is not returned + * Get Material Allocations from shipment which is not returned (returnedQty) * @param ctx context * @param M_InOutLine_ID line * @param trxName trx @@ -263,11 +281,12 @@ public class MInOutLineMA extends X_M_InOutLineMA return new MInOutLine(getCtx(), getM_InOutLine_ID(), get_TrxName()); } - /************************************************************************** + /** * Before Save * @param newRecord new * @return save */ + @Override protected boolean beforeSave (boolean newRecord) { MInOutLine parentline = getM_InOutLine(); diff --git a/org.adempiere.base/src/org/compiere/model/MIndexColumn.java b/org.adempiere.base/src/org/compiere/model/MIndexColumn.java index b7affb800b..9f31772811 100644 --- a/org.adempiere.base/src/org/compiere/model/MIndexColumn.java +++ b/org.adempiere.base/src/org/compiere/model/MIndexColumn.java @@ -19,20 +19,21 @@ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; - +/** + * Column of index + */ public class MIndexColumn extends X_AD_IndexColumn { - /** - * + * generated serial id */ private static final long serialVersionUID = -7588207529142215755L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_IndexColumn_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_IndexColumn_UU UUID key + * @param trxName Transaction + */ public MIndexColumn(Properties ctx, String AD_IndexColumn_UU, String trxName) { super(ctx, AD_IndexColumn_UU, trxName); } @@ -77,7 +78,7 @@ public class MIndexColumn extends X_AD_IndexColumn { /** * Get column name - * @return column name + * @return column SQL expression or name */ public String getColumnName() { diff --git a/org.adempiere.base/src/org/compiere/model/MInfoColumn.java b/org.adempiere.base/src/org/compiere/model/MInfoColumn.java index 3bcdd63344..d51f59861c 100644 --- a/org.adempiere.base/src/org/compiere/model/MInfoColumn.java +++ b/org.adempiere.base/src/org/compiere/model/MInfoColumn.java @@ -40,16 +40,16 @@ import org.idempiere.cache.ImmutablePOSupport; public class MInfoColumn extends X_AD_InfoColumn implements IInfoColumn, ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 3909164419255524834L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_InfoColumn_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_InfoColumn_UU UUID key + * @param trxName Transaction + */ public MInfoColumn(Properties ctx, String AD_InfoColumn_UU, String trxName) { super(ctx, AD_InfoColumn_UU, trxName); } @@ -76,6 +76,9 @@ public class MInfoColumn extends X_AD_InfoColumn implements IInfoColumn, Immutab super (ctx, rs, trxName); } // MInfoColumn + /** + * @param targetInfoWindow + */ public MInfoColumn(MInfoWindow targetInfoWindow) { this(targetInfoWindow.getCtx(), 0, targetInfoWindow.get_TrxName()); m_parent = targetInfoWindow; @@ -110,7 +113,7 @@ public class MInfoColumn extends X_AD_InfoColumn implements IInfoColumn, Immutab /** * check column read access * @param tableInfos - * @return false if current role don't have read access to the column, false otherwise + * @return false if current role don't have read access to the column, true otherwise */ public boolean isColumnAccess(TableInfo[] tableInfos) { @@ -155,7 +158,7 @@ public class MInfoColumn extends X_AD_InfoColumn implements IInfoColumn, Immutab /** * @param ctx * @param windowNo - * @return boolean + * @return true if visible, false otherwise */ public boolean isDisplayed(final Properties ctx, final int windowNo) { if (!isDisplayed()) @@ -229,9 +232,11 @@ public class MInfoColumn extends X_AD_InfoColumn implements IInfoColumn, Immutab } /** + *
         	 * when delete record, call valid from parent to set state
         	 * when delete all, valid state is false
         	 * when delete a wrong column can make valid state to true
        +	 * 
        */ @Override protected boolean afterDelete(boolean success) { diff --git a/org.adempiere.base/src/org/compiere/model/MInfoWindow.java b/org.adempiere.base/src/org/compiere/model/MInfoWindow.java index 105b84798a..6ee761fda4 100644 --- a/org.adempiere.base/src/org/compiere/model/MInfoWindow.java +++ b/org.adempiere.base/src/org/compiere/model/MInfoWindow.java @@ -46,7 +46,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MInfoWindow extends X_AD_InfoWindow implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -6793583766286122866L; @@ -54,11 +54,11 @@ public class MInfoWindow extends X_AD_InfoWindow implements ImmutablePOSupport private static ImmutablePOCache s_cache = new ImmutablePOCache(Table_Name, 20); /** - * UUID based Constructor - * @param ctx Context - * @param AD_InfoWindow_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_InfoWindow_UU UUID key + * @param trxName Transaction + */ public MInfoWindow(Properties ctx, String AD_InfoWindow_UU, String trxName) { super(ctx, AD_InfoWindow_UU, trxName); } @@ -108,6 +108,12 @@ public class MInfoWindow extends X_AD_InfoWindow implements ImmutablePOSupport this.m_infoRelated = copy.m_infoRelated != null ? Arrays.stream(copy.m_infoRelated).map(MInfoRelated::new).toArray(MInfoRelated[]::new) : null; } + /** + * Get first accessible info window for a table + * @param tableName + * @param trxName + * @return MInfoWindow + */ public static MInfoWindow get(String tableName, String trxName) { Query query = new Query(Env.getCtx(), MTable.get(Env.getCtx(), MInfoWindow.Table_ID), MInfoWindow.COLUMNNAME_AD_Table_ID+"=? AND IsValid='Y' ", null); MTable table = MTable.get(Env.getCtx(), tableName); @@ -130,7 +136,7 @@ public class MInfoWindow extends X_AD_InfoWindow implements ImmutablePOSupport /** * author xolali * @param AD_InfoWindow_ID - * @return {@link MInfoWindow} + * @return {@link MInfoWindow} or null */ public static MInfoWindow getInfoWindow(int AD_InfoWindow_ID) { if (AD_InfoWindow_ID > 0) { @@ -163,7 +169,7 @@ public class MInfoWindow extends X_AD_InfoWindow implements ImmutablePOSupport /** * author xolali * @param requery - * @return + * @return related info windows */ public MInfoRelated[] getInfoRelated(boolean requery) { if ((this.m_infoRelated != null) && (!requery)) { @@ -184,9 +190,9 @@ public class MInfoWindow extends X_AD_InfoWindow implements ImmutablePOSupport /** * IDEMPIERE-1334 - * Get list {@link MInfoProcess} of this infoWindow - * @param requery true get from db, false try get from cache - * @return empty array when not exists Info Process + * Get {@link MInfoProcess} list of this infoWindow + * @param requery true to always get from DB, false to try to get from cache + * @return empty array array of Info Process */ public MInfoProcess [] getInfoProcess(boolean requery) { // try from cache @@ -208,10 +214,9 @@ public class MInfoWindow extends X_AD_InfoWindow implements ImmutablePOSupport return m_infoProcess; } - /** - * if user haven't right to run a process, set infoProcess to null - * @param lsInfoProcess + * if user haven't got right to run a process, remove infoProcess from list + * @param lsInfoProcess info process list */ protected void checkProcessRight (List lsInfoProcess) { Iterator iterator = lsInfoProcess.iterator(); @@ -228,7 +233,7 @@ public class MInfoWindow extends X_AD_InfoWindow implements ImmutablePOSupport /** * @param infoWindowID * @param trxName - * return MInfoWindow if the current role can access to the specified info window ; otherwise return null + * @return MInfoWindow if the current role can access to the specified info window ; otherwise return null * */ public static MInfoWindow get(int infoWindowID, String trxName) { MInfoWindow iw = getInfoWindow(infoWindowID); @@ -245,6 +250,10 @@ public class MInfoWindow extends X_AD_InfoWindow implements ImmutablePOSupport return null; } + /** + * @param tableInfos + * @return array of accessible info column + */ public synchronized MInfoColumn[] getInfoColumns(TableInfo[] tableInfos) { getInfoColumns(); List list = new ArrayList(); @@ -255,6 +264,9 @@ public class MInfoWindow extends X_AD_InfoWindow implements ImmutablePOSupport return list.toArray(new MInfoColumn[0]); } + /** + * @return array of info columns (doesn't check access right) + */ public synchronized MInfoColumn[] getInfoColumns() { if (m_infocolumns == null) { Query query = new Query(getCtx(), MTable.get(getCtx(), I_AD_InfoColumn.Table_ID), I_AD_InfoColumn.COLUMNNAME_AD_InfoWindow_ID+"=?", get_TrxName()); @@ -275,6 +287,11 @@ public class MInfoWindow extends X_AD_InfoWindow implements ImmutablePOSupport */ private MInfoColumn[] m_infocolumns = null; + /** + * @param requery + * @param checkDisplay true to exclude not visible column + * @return array of info column + */ public synchronized MInfoColumn[] getInfoColumns(boolean requery, boolean checkDisplay) { if (m_infocolumns == null || requery) { m_infocolumns = null; @@ -295,7 +312,7 @@ public class MInfoWindow extends X_AD_InfoWindow implements ImmutablePOSupport /** * author xolali - * @return + * @return SELECT SQL clause */ public String getSql(){ @@ -317,11 +334,14 @@ public class MInfoWindow extends X_AD_InfoWindow implements ImmutablePOSupport sql.append(" FROM ").append(fromsql) .append(oclause); - log.info("Generated SQL -- getSql: "+ sql.toString()); + if (log.isLoggable(Level.INFO)) log.info("Generated SQL -- getSql: "+ sql.toString()); return sql.toString(); } + /** + * @return true if generated SELECT SQL is valid + */ public boolean validateSql(){ PreparedStatement pstmt = null; ResultSet rs = null; @@ -427,7 +447,9 @@ public class MInfoWindow extends X_AD_InfoWindow implements ImmutablePOSupport return super.afterSave(newRecord, success); } - + /** + * Validate info window and update IsValid flag + */ public void validate () { // default, before complete check is invalid @@ -506,10 +528,16 @@ public class MInfoWindow extends X_AD_InfoWindow implements ImmutablePOSupport **/ private boolean m_validateEachColumn = true; + /** + * @param validateEachColumn + */ public void setIsValidateEachColumn (boolean validateEachColumn) { m_validateEachColumn= validateEachColumn; } + /** + * @return true if info window should be re-validate after saving changes of any info column + */ boolean isValidateEachColumn() { return m_validateEachColumn; } diff --git a/org.adempiere.base/src/org/compiere/model/MInfoWindowAccess.java b/org.adempiere.base/src/org/compiere/model/MInfoWindowAccess.java index 5ffb664b6a..8895b06c05 100644 --- a/org.adempiere.base/src/org/compiere/model/MInfoWindowAccess.java +++ b/org.adempiere.base/src/org/compiere/model/MInfoWindowAccess.java @@ -1,6 +1,24 @@ -/** - * - */ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.sql.ResultSet; @@ -18,11 +36,11 @@ public class MInfoWindowAccess extends X_AD_InfoWindow_Access { private static final long serialVersionUID = -5134731157350014858L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_InfoWindow_Access_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_InfoWindow_Access_UU UUID key + * @param trxName Transaction + */ public MInfoWindowAccess(Properties ctx, String AD_InfoWindow_Access_UU, String trxName) { super(ctx, AD_InfoWindow_Access_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MInterestArea.java b/org.adempiere.base/src/org/compiere/model/MInterestArea.java index 0d1eec8c94..ed6456984e 100644 --- a/org.adempiere.base/src/org/compiere/model/MInterestArea.java +++ b/org.adempiere.base/src/org/compiere/model/MInterestArea.java @@ -32,9 +32,6 @@ import org.idempiere.cache.ImmutablePOSupport; /** * Interest Area. - * Note: if model is changed, update - * org.compiere.wstore.Info.getInterests() - * manually * * @author Jorg Janke * @version $Id: MInterestArea.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $ @@ -42,7 +39,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MInterestArea extends X_R_InterestArea implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -8171678779149295978L; @@ -118,14 +115,13 @@ public class MInterestArea extends X_R_InterestArea implements ImmutablePOSuppor new ImmutableIntPOCache(Table_Name, 5); /** Logger */ private static CLogger s_log = CLogger.getCLogger (MInterestArea.class); - - + /** - * UUID based Constructor - * @param ctx Context - * @param R_InterestArea_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param R_InterestArea_UU UUID key + * @param trxName Transaction + */ public MInterestArea(Properties ctx, String R_InterestArea_UU, String trxName) { super(ctx, R_InterestArea_UU, trxName); if (Util.isEmpty(R_InterestArea_UU)) @@ -164,7 +160,7 @@ public class MInterestArea extends X_R_InterestArea implements ImmutablePOSuppor } // MInterestArea /** - * + * Copy constructor * @param copy */ public MInterestArea(MInterestArea copy) @@ -173,7 +169,7 @@ public class MInterestArea extends X_R_InterestArea implements ImmutablePOSuppor } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -183,7 +179,7 @@ public class MInterestArea extends X_R_InterestArea implements ImmutablePOSuppor } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -196,11 +192,11 @@ public class MInterestArea extends X_R_InterestArea implements ImmutablePOSuppor this.m_ci = copy.m_ci != null ? new MContactInterest(ctx, copy.m_ci, trxName) : null; } - /** * Get Value - * @return value + * @return value or name (if value is empty/null) */ + @Override public String getValue() { String s = super.getValue (); @@ -213,6 +209,7 @@ public class MInterestArea extends X_R_InterestArea implements ImmutablePOSuppor * String representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MInterestArea[") @@ -221,14 +218,11 @@ public class MInterestArea extends X_R_InterestArea implements ImmutablePOSuppor return sb.toString (); } // toString - /*************************************************************************/ - private int m_AD_User_ID = -1; private MContactInterest m_ci = null; /** - * Set Subscription info "constructor". - * Create inactive Subscription + * Set Subscription info. Create inactive MContactInterest if no existing MContactInterest for contact. * @param AD_User_ID contact */ public void setSubscriptionInfo (int AD_User_ID) diff --git a/org.adempiere.base/src/org/compiere/model/MInventory.java b/org.adempiere.base/src/org/compiere/model/MInventory.java index af3c6eec90..0232291de3 100644 --- a/org.adempiere.base/src/org/compiere/model/MInventory.java +++ b/org.adempiere.base/src/org/compiere/model/MInventory.java @@ -37,7 +37,7 @@ import org.compiere.util.TimeUtil; import org.compiere.util.Util; /** - * Physical Inventory Model + * Inventory Document Model * * @author Jorg Janke * @version $Id: MInventory.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $ @@ -52,7 +52,7 @@ import org.compiere.util.Util; public class MInventory extends X_M_Inventory implements DocAction { /** - * + * generated serial id */ private static final long serialVersionUID = 3877357565525655884L; @@ -60,7 +60,7 @@ public class MInventory extends X_M_Inventory implements DocAction public static String REVERSE_INDICATOR = "^"; /** - * Get Inventory + * Get Inventory from DB * @param M_Inventory_ID id * @return MInventory */ @@ -70,7 +70,7 @@ public class MInventory extends X_M_Inventory implements DocAction } /** - * Get Inventory + * Get Inventory from DB * @param ctx context * @param M_Inventory_ID id * @return MInventory @@ -85,11 +85,11 @@ public class MInventory extends X_M_Inventory implements DocAction } // get /** - * UUID based Constructor - * @param ctx Context - * @param M_Inventory_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_Inventory_UU UUID key + * @param trxName Transaction + */ public MInventory(Properties ctx, String M_Inventory_UU, String trxName) { super(ctx, M_Inventory_UU, trxName); if (Util.isEmpty(M_Inventory_UU)) @@ -138,6 +138,7 @@ public class MInventory extends X_M_Inventory implements DocAction * @param wh warehouse * @deprecated since 3.5.3a . Please use {@link #MInventory(MWarehouse, String)}. */ + @Deprecated public MInventory (MWarehouse wh) { this(wh, wh.get_TrxName()); @@ -156,7 +157,7 @@ public class MInventory extends X_M_Inventory implements DocAction } /** - * + * Copy constructor * @param copy */ public MInventory(MInventory copy) @@ -165,7 +166,7 @@ public class MInventory extends X_M_Inventory implements DocAction } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -175,7 +176,7 @@ public class MInventory extends X_M_Inventory implements DocAction } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -192,7 +193,7 @@ public class MInventory extends X_M_Inventory implements DocAction /** * Get Lines - * @param requery requery + * @param requery true to requery from DB * @return array of lines */ public MInventoryLine[] getLines (boolean requery) @@ -230,6 +231,7 @@ public class MInventory extends X_M_Inventory implements DocAction * @param AD_Client_ID client * @param AD_Org_ID org */ + @Override public void setClientOrg (int AD_Client_ID, int AD_Org_ID) { super.setClientOrg(AD_Client_ID, AD_Org_ID); @@ -239,6 +241,7 @@ public class MInventory extends X_M_Inventory implements DocAction * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MInventory["); @@ -253,6 +256,7 @@ public class MInventory extends X_M_Inventory implements DocAction * Get Document Info * @return document info (untranslated) */ + @Override public String getDocumentInfo() { MDocType dt = MDocType.get(getC_DocType_ID()); @@ -264,6 +268,7 @@ public class MInventory extends X_M_Inventory implements DocAction * Create PDF * @return File or null */ + @Override public File createPDF () { try @@ -282,7 +287,7 @@ public class MInventory extends X_M_Inventory implements DocAction /** * Create PDF file * @param file output file - * @return file if success + * @return not implemented, always return null */ public File createPDF (File file) { @@ -295,6 +300,7 @@ public class MInventory extends X_M_Inventory implements DocAction * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getC_DocType_ID() == 0) @@ -320,13 +326,13 @@ public class MInventory extends X_M_Inventory implements DocAction return true; } // beforeSave - - + /** * Set Processed. - * Propagate to Lines/Taxes + * Propagate to Lines. * @param processed processed */ + @Override public void setProcessed (boolean processed) { super.setProcessed (processed); @@ -338,13 +344,13 @@ public class MInventory extends X_M_Inventory implements DocAction m_lines = null; if (log.isLoggable(Level.FINE)) log.fine("Processed=" + processed + " - Lines=" + noLine); } // setProcessed - - /************************************************************************** + /** * Process document * @param processAction document action * @return true if performed */ + @Override public boolean processIt (String processAction) { m_processMsg = null; @@ -361,6 +367,7 @@ public class MInventory extends X_M_Inventory implements DocAction * Unlock Document. * @return true if success */ + @Override public boolean unlockIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -372,6 +379,7 @@ public class MInventory extends X_M_Inventory implements DocAction * Invalidate Document * @return true if success */ + @Override public boolean invalidateIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -383,6 +391,7 @@ public class MInventory extends X_M_Inventory implements DocAction * Prepare Document * @return new status (In Progress or Invalid) */ + @Override public String prepareIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -447,6 +456,7 @@ public class MInventory extends X_M_Inventory implements DocAction * Approve Document * @return true if success */ + @Override public boolean approveIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -458,6 +468,7 @@ public class MInventory extends X_M_Inventory implements DocAction * Reject Approval * @return true if success */ + @Override public boolean rejectIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -469,6 +480,7 @@ public class MInventory extends X_M_Inventory implements DocAction * Complete Document * @return new status (Complete, In Progress, Invalid, Waiting ..) */ + @Override public String completeIt() { MDocType dt = MDocType.get(getC_DocType_ID()); @@ -732,11 +744,12 @@ public class MInventory extends X_M_Inventory implements DocAction } /** - * Check Material Policy. + * Check Material Policy and create MInventoryLineMA records (if M_AttributeSetInstance_ID==0) + * @param line + * @param qtyDiff qty to allocate */ protected void checkMaterialPolicy(MInventoryLine line, BigDecimal qtyDiff) - { - + { int no = MInventoryLineMA.deleteInventoryLineMA(line.getM_InventoryLine_ID(), get_TrxName()); if (no > 0) if (log.isLoggable(Level.CONFIG)) log.config("Delete old #" + no); @@ -915,6 +928,7 @@ public class MInventory extends X_M_Inventory implements DocAction * Void Document. * @return false */ + @Override public boolean voidIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -988,6 +1002,7 @@ public class MInventory extends X_M_Inventory implements DocAction * Close Document. * @return true if success */ + @Override public boolean closeIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -1008,6 +1023,7 @@ public class MInventory extends X_M_Inventory implements DocAction * Reverse Correction * @return false */ + @Override public boolean reverseCorrectIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -1030,6 +1046,11 @@ public class MInventory extends X_M_Inventory implements DocAction return true; } // reverseCorrectIt + /** + * Reverse this document + * @param accrual true to use current date, false to use this document's movement date + * @return reversal MInventory document + */ protected MInventory reverse(boolean accrual) { Timestamp reversalDate = accrual ? Env.getContextAsDate(getCtx(), Env.DATE) : getMovementDate(); if (reversalDate == null) { @@ -1118,6 +1139,7 @@ public class MInventory extends X_M_Inventory implements DocAction * Reverse Accrual * @return false */ + @Override public boolean reverseAccrualIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -1144,6 +1166,7 @@ public class MInventory extends X_M_Inventory implements DocAction * Re-activate * @return false */ + @Override public boolean reActivateIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -1159,12 +1182,12 @@ public class MInventory extends X_M_Inventory implements DocAction return false; } // reActivateIt - - - /************************************************************************* + + /** * Get Summary * @return Summary of Document */ + @Override public String getSummary() { StringBuilder sb = new StringBuilder(); @@ -1183,6 +1206,7 @@ public class MInventory extends X_M_Inventory implements DocAction * Get Process Message * @return clear text error message */ + @Override public String getProcessMsg() { return m_processMsg; @@ -1192,17 +1216,17 @@ public class MInventory extends X_M_Inventory implements DocAction * Get Document Owner (Responsible) * @return AD_User_ID */ + @Override public int getDoc_User_ID() { return getUpdatedBy(); } // getDoc_User_ID - - + /** Reversal Flag */ protected boolean m_reversal = false; /** - * Set Reversal + * Set Reversal state (instance flag) * @param reversal reversal */ protected void setReversal(boolean reversal) @@ -1211,7 +1235,7 @@ public class MInventory extends X_M_Inventory implements DocAction } // setReversal /** * Is Reversal - * @return reversal + * @return reversal state (instance flag) */ protected boolean isReversal() { diff --git a/org.adempiere.base/src/org/compiere/model/MInventoryLine.java b/org.adempiere.base/src/org/compiere/model/MInventoryLine.java index a86c7ce7f2..2d119dddf6 100644 --- a/org.adempiere.base/src/org/compiere/model/MInventoryLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInventoryLine.java @@ -28,7 +28,7 @@ import org.compiere.util.Msg; import org.compiere.util.Util; /** - * Physical Inventory Line Model + * Inventory Document Line Model * * @author Jorg Janke * @version $Id: MInventoryLine.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $ @@ -40,7 +40,7 @@ import org.compiere.util.Util; public class MInventoryLine extends X_M_InventoryLine { /** - * + * generated serial id */ private static final long serialVersionUID = 3973418005721380194L; @@ -63,18 +63,18 @@ public class MInventoryLine extends X_M_InventoryLine } // get /** - * UUID based Constructor - * @param ctx Context - * @param M_InventoryLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_InventoryLine_UU UUID key + * @param trxName Transaction + */ public MInventoryLine(Properties ctx, String M_InventoryLine_UU, String trxName) { super(ctx, M_InventoryLine_UU, trxName); if (Util.isEmpty(M_InventoryLine_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Default Constructor * @param ctx context * @param M_InventoryLine_ID line @@ -85,6 +85,12 @@ public class MInventoryLine extends X_M_InventoryLine this (ctx, M_InventoryLine_ID, trxName, (String[]) null); } // MInventoryLine + /** + * @param ctx + * @param M_InventoryLine_ID + * @param trxName + * @param virtualColumns + */ public MInventoryLine(Properties ctx, int M_InventoryLine_ID, String trxName, String... virtualColumns) { super(ctx, M_InventoryLine_ID, trxName, virtualColumns); if (M_InventoryLine_ID == 0) @@ -116,7 +122,7 @@ public class MInventoryLine extends X_M_InventoryLine /** * Detail Constructor. - * Locator/Product/AttributeSetInstance must be unique + * Locator/Product/AttributeSetInstance must be unique. * @param inventory parent * @param M_Locator_ID locator * @param M_Product_ID product @@ -147,6 +153,14 @@ public class MInventoryLine extends X_M_InventoryLine setQtyInternalUse (QtyInternalUse); } // MInventoryLine + /** + * @param inventory + * @param M_Locator_ID + * @param M_Product_ID + * @param M_AttributeSetInstance_ID + * @param QtyBook + * @param QtyCount + */ public MInventoryLine (MInventory inventory, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, BigDecimal QtyBook, BigDecimal QtyCount) @@ -155,7 +169,7 @@ public class MInventoryLine extends X_M_InventoryLine } /** - * + * Copy constructor * @param copy */ public MInventoryLine(MInventoryLine copy) @@ -164,7 +178,7 @@ public class MInventoryLine extends X_M_InventoryLine } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -174,7 +188,7 @@ public class MInventoryLine extends X_M_InventoryLine } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -211,7 +225,7 @@ public class MInventoryLine extends X_M_InventoryLine } // getProduct /** - * Set Count Qty - enforce UOM + * Set Count Qty - enforce product UOM precision * @param QtyCount qty */ @Override @@ -230,7 +244,7 @@ public class MInventoryLine extends X_M_InventoryLine } // setQtyCount /** - * Set Internal Use Qty - enforce UOM + * Set Internal Use Qty - enforce product UOM precision * @param QtyInternalUse qty */ @Override @@ -265,7 +279,7 @@ public class MInventoryLine extends X_M_InventoryLine } // addDescription /** - * Get Parent + * Set Parent * @param parent parent */ protected void setParent(MInventory parent) @@ -288,6 +302,7 @@ public class MInventoryLine extends X_M_InventoryLine * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MInventoryLine["); @@ -306,6 +321,7 @@ public class MInventoryLine extends X_M_InventoryLine * @param newRecord new * @return true if can be saved */ + @Override protected boolean beforeSave (boolean newRecord) { if (newRecord && getParent().isProcessed()) { @@ -428,7 +444,7 @@ public class MInventoryLine extends X_M_InventoryLine /** * Is Internal Use Inventory - * @return true if is internal use inventory + * @return true if this is an internal use inventory document */ public boolean isInternalUseInventory() { // IDEMPIERE-675 @@ -438,7 +454,7 @@ public class MInventoryLine extends X_M_InventoryLine } /** - * Get Movement Qty (absolute value) + * Get Movement Qty *
      • negative value means outgoing trx *
      • positive value means incoming trx * @return movement qty @@ -453,7 +469,7 @@ public class MInventoryLine extends X_M_InventoryLine } /** - * @return true if is an outgoing transaction + * @return true if is an outgoing transaction (movement qty < 0) */ public boolean isSOTrx() { return getMovementQty().signum() < 0; diff --git a/org.adempiere.base/src/org/compiere/model/MInventoryLineMA.java b/org.adempiere.base/src/org/compiere/model/MInventoryLineMA.java index f3a087fbcf..e111bbb29e 100644 --- a/org.adempiere.base/src/org/compiere/model/MInventoryLineMA.java +++ b/org.adempiere.base/src/org/compiere/model/MInventoryLineMA.java @@ -30,9 +30,8 @@ import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.Util; - /** - * Inventory Material Allocation + * Material Allocation for Inventory Line * * @author Jorg Janke * @version $Id: MInventoryLineMA.java,v 1.3 2006/07/30 00:51:04 jjanke Exp $ @@ -40,11 +39,10 @@ import org.compiere.util.Util; public class MInventoryLineMA extends X_M_InventoryLineMA { /** - * + * generated serial id */ private static final long serialVersionUID = -5654504108476140057L; - /** * Get Material Allocations for Line * @param ctx context @@ -111,19 +109,18 @@ public class MInventoryLineMA extends X_M_InventoryLineMA /** Logger */ private static CLogger s_log = CLogger.getCLogger (MInventoryLineMA.class); - /** - * UUID based Constructor - * @param ctx Context - * @param M_InventoryLineMA_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_InventoryLineMA_UU UUID key + * @param trxName Transaction + */ public MInventoryLineMA(Properties ctx, String M_InventoryLineMA_UU, String trxName) { super(ctx, M_InventoryLineMA_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param M_InventoryLineMA_ID ignored @@ -164,7 +161,7 @@ public class MInventoryLineMA extends X_M_InventoryLineMA * @param M_AttributeSetInstance_ID * @param MovementQty * @param DateMaterialPolicy - * @param isAutoGenerated + * @param isAutoGenerated true if auto created by application instead of by user */ public MInventoryLineMA (MInventoryLine parent, int M_AttributeSetInstance_ID, BigDecimal MovementQty,Timestamp DateMaterialPolicy,boolean isAutoGenerated) { @@ -200,6 +197,7 @@ public class MInventoryLineMA extends X_M_InventoryLineMA * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MInventoryLineMA["); @@ -210,11 +208,27 @@ public class MInventoryLineMA extends X_M_InventoryLineMA return sb.toString (); } // toString - + /** + * Create new MInventoryLineMA or add Movement Qty to existing MInventoryLineMA + * @param line + * @param M_AttributeSetInstance_ID + * @param MovementQty + * @param DateMaterialPolicy + * @return MInventoryLineMA + */ public static MInventoryLineMA addOrCreate(MInventoryLine line, int M_AttributeSetInstance_ID, BigDecimal MovementQty, Timestamp DateMaterialPolicy){ return addOrCreate(line, M_AttributeSetInstance_ID, MovementQty,DateMaterialPolicy,true); } + /** + * Create new MInventoryLineMA or add Movement Qty to existing MInventoryLineMA + * @param line + * @param M_AttributeSetInstance_ID + * @param MovementQty + * @param DateMaterialPolicy + * @param isAutoGenerated + * @return MInventoryLineMA + */ public static MInventoryLineMA addOrCreate(MInventoryLine line, int M_AttributeSetInstance_ID, BigDecimal MovementQty, Timestamp DateMaterialPolicy,boolean isAutoGenerated) { Query query = new Query(Env.getCtx(), I_M_InventoryLineMA.Table_Name, "M_InventoryLine_ID=? AND M_AttributeSetInstance_ID=? AND DateMaterialPolicy=trunc(cast(? as date))", @@ -228,10 +242,10 @@ public class MInventoryLineMA extends X_M_InventoryLineMA } /** - * + * Get total movement qty for LineMA created manually by user * @param M_MovementLine_ID * @param trxName - * @return + * @return total movement qty from MInventoryLineMA created by user */ public static BigDecimal getManualQty (int M_MovementLine_ID, String trxName) { @@ -240,11 +254,12 @@ public class MInventoryLineMA extends X_M_InventoryLineMA return totalQty==null?Env.ZERO:totalQty.negate(); } //totalLineQty - /************************************************************************** + /** * Before Save * @param newRecord new * @return save */ + @Override protected boolean beforeSave (boolean newRecord) { MInventoryLine parentline = new MInventoryLine(getCtx(), getM_InventoryLine_ID(), get_TrxName()); diff --git a/org.adempiere.base/src/org/compiere/model/MInvoice.java b/org.adempiere.base/src/org/compiere/model/MInvoice.java index afeb88da99..8972c54c0f 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoice.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoice.java @@ -56,13 +56,13 @@ import org.compiere.util.Util; import org.eevolution.model.MPPProductBOM; import org.eevolution.model.MPPProductBOMLine; - /** + *
          *	Invoice Model.
          * 	Please do not set DocStatus and C_DocType_ID directly.
          * 	They are set in the process() method.
          * 	Use DocAction and C_DocTypeTarget_ID instead.
        - *
        + *  
        * @author Jorg Janke * @version $Id: MInvoice.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $ * @author victor.perez@e-evolution.com, e-Evolution http://www.e-evolution.com @@ -94,6 +94,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess WHERE hdr.DocStatus IN ('CO','CL') """; + /** Matching to Receipt Group By Template */ private static final String BASE_MATCHING_GROUP_BY_SQL = """ GROUP BY hdr.C_Invoice_ID,hdr.DocumentNo,hdr.DateInvoiced,bp.Name,hdr.C_BPartner_ID, @@ -200,11 +201,11 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess String productName, int M_Product_ID, BigDecimal qtyInvoiced, BigDecimal matchedQty, String organizationName, int AD_Org_ID) {} /** - * Get Payments Of BPartner + * Get invoices Of BPartner * @param ctx context * @param C_BPartner_ID id * @param trxName transaction - * @return array + * @return array of invoice */ public static MInvoice[] getOfBPartner (Properties ctx, int C_BPartner_ID, String trxName) { @@ -338,6 +339,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess * @param setOrder set Order links * @return Invoice */ + @Deprecated public static MInvoice copyFrom (MInvoice from, Timestamp dateDoc, int C_DocTypeTarget_ID, boolean isSOTrx, boolean counter, String trxName, boolean setOrder) @@ -368,7 +370,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess } // getPDFFileName /** - * Get MInvoice from db + * Get MInvoice from DB * @param C_Invoice_ID id * @return MInvoice */ @@ -378,7 +380,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess } /** - * Get MInvoice from db + * Get MInvoice from DB * @param C_Invoice_ID id * @return MInvoice */ @@ -393,18 +395,18 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess } // get /** - * UUID based Constructor - * @param ctx Context - * @param C_Invoice_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Invoice_UU UUID key + * @param trxName Transaction + */ public MInvoice(Properties ctx, String C_Invoice_UU, String trxName) { super(ctx, C_Invoice_UU, trxName); if (Util.isEmpty(C_Invoice_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Invoice Constructor * @param ctx context * @param C_Invoice_ID invoice or 0 for new @@ -415,6 +417,12 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess this (ctx, C_Invoice_ID, trxName, (String[]) null); } // MInvoice + /** + * @param ctx + * @param C_Invoice_ID + * @param trxName + * @param virtualColumns + */ public MInvoice(Properties ctx, int C_Invoice_ID, String trxName, String... virtualColumns) { super(ctx, C_Invoice_ID, trxName, virtualColumns); if (C_Invoice_ID == 0) @@ -499,8 +507,8 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess } // MInvoice /** - * Create Invoice from Shipment - * @param ship shipment + * Create Invoice from Shipment/Receipt + * @param ship shipment/receipt * @param invoiceDate date or null */ public MInvoice (MInOut ship, Timestamp invoiceDate) @@ -557,7 +565,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess } // MInvoice /** - * + * Copy constructor * @param copy */ public MInvoice(MInvoice copy) @@ -566,7 +574,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -576,7 +584,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -605,6 +613,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess * @param AD_Client_ID client * @param AD_Org_ID org */ + @Override public void setClientOrg (int AD_Client_ID, int AD_Org_ID) { super.setClientOrg(AD_Client_ID, AD_Org_ID); @@ -665,7 +674,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess } // setBPartner /** - * Set Order References + * Set Order Reference * @param order order */ public void setOrder (MOrder order) @@ -699,7 +708,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess } // setOrder /** - * Set Shipment References + * Set Shipment Reference * @param ship shipment */ public void setShipment (MInOut ship) @@ -805,7 +814,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess /** * Set Target Document Type. - * Based on SO flag AP/AP Invoice + * Based on SO flag AR/AP Invoice. */ public void setC_DocTypeTarget_ID () { @@ -820,7 +829,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess /** * Get Grand Total - * @param creditMemoAdjusted adjusted for CM (negative) + * @param creditMemoAdjusted true to negate amount return * @return grand total */ public BigDecimal getGrandTotal (boolean creditMemoAdjusted) @@ -836,7 +845,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess /** * Get Total Lines - * @param creditMemoAdjusted adjusted for CM (negative) + * @param creditMemoAdjusted true to negate amount return * @return total lines */ public BigDecimal getTotalLines (boolean creditMemoAdjusted) @@ -852,7 +861,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess /** * Get Invoice Lines of Invoice - * @param whereClause starting with AND + * @param whereClause must start with AND * @return lines */ private MInvoiceLine[] getLines (String whereClause) @@ -891,10 +900,9 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess return getLines(false); } // getLines - /** * Renumber Lines - * @param step start and step + * @param step start and step to increment */ public void renumberLines (int step) { @@ -986,11 +994,9 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess fromLine.saveEx(get_TrxName()); } - // MZ Goodwill // copy the landed cost line.copyLandedCostFrom(fromLine); line.allocateLandedCosts(); - // end MZ } if (fromLines.length != count) log.log(Level.SEVERE, "Line difference - From=" + fromLines.length + " <> Saved=" + count); @@ -1001,7 +1007,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess private boolean m_reversal = false; /** - * Set Reversal + * Set Reversal state (in memory flag) * @param reversal reversal */ public void setReversal(boolean reversal) @@ -1010,7 +1016,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess } // setReversal /** * Is Reversal - * @return reversal + * @return reversal state (in memory flag) */ public boolean isReversal() { @@ -1019,7 +1025,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess /** * Get Taxes - * @param requery requery + * @param requery true to requery from DB * @return array of taxes */ public MInvoiceTax[] getTaxes (boolean requery) @@ -1052,7 +1058,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess /** * Is it a Credit Memo? - * @return true if CM + * @return true if this is CM document (DOCBASETYPE_APCreditMemo or DOCBASETYPE_ARCreditMemo) */ public boolean isCreditMemo() { @@ -1063,9 +1069,10 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess /** * Set Processed. - * Propergate to Lines/Taxes + * Propagate to Lines/Taxes. * @param processed processed */ + @Override public void setProcessed (boolean processed) { super.setProcessed (processed); @@ -1086,7 +1093,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess /** * Validate Invoice Pay Schedule - * @return pay schedule is valid + * @return true if pay schedule is valid */ public boolean validatePaySchedule() { @@ -1122,16 +1129,17 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess return valid; } // validatePaySchedule - private volatile static boolean recursiveCall = false; - /************************************************************************** + + /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { - log.fine(""); + if (log.isLoggable(Level.FINE)) log.fine(""); // No Partner Info - set Template if (getC_BPartner_ID() == 0) setBPartner(MBPartner.getTemplate(getCtx(), getAD_Client_ID())); @@ -1270,6 +1278,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess * Before Delete * @return true if it can be deleted */ + @Override protected boolean beforeDelete () { if (getC_Order_ID() != 0) @@ -1283,8 +1292,9 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess /** * After Delete * @param success success - * @return deleted + * @return true if deleted */ + @Override protected boolean afterDelete(boolean success) { // If delete invoice failed then do nothing if (!success) @@ -1308,6 +1318,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MInvoice[") @@ -1323,6 +1334,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess * Get Document Info * @return document info (untranslated) */ + @Override public String getDocumentInfo() { MDocType dt; @@ -1335,13 +1347,13 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess return msgreturn.toString(); } // getDocumentInfo - /** * After Save * @param newRecord new * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success || newRecord) @@ -1361,7 +1373,6 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess return true; } // afterSave - /** * Set Price List (and Currency) when valid * @param M_PriceList_ID price list @@ -1418,7 +1429,8 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess /** * Test Allocation (and set paid flag) - * @return true if updated + * @param beingCompleted true if call during processing of Complete document action + * @return true if updated IsPaid */ public boolean testAllocation(boolean beingCompleted) { @@ -1444,6 +1456,10 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess return change; } // testAllocation + /** + * Test Allocation (and set paid flag) + * @return true if updated IsPaid + */ public boolean testAllocation() { return testAllocation(false); } @@ -1485,26 +1501,30 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess DB.close(rs); } if (s_log.isLoggable(Level.CONFIG)) s_log.config("#" + counter); - /**/ } // setIsPaid /** * Get Open Amount. - * Used by web interface - * @return Open Amt + * @return Open Amount */ public BigDecimal getOpenAmt () { return getOpenAmt (true, null, false); } // getOpenAmt + /** + * @param creditMemoAdjusted + * @param paymentDate + * @return Open Amount + */ public BigDecimal getOpenAmt (boolean creditMemoAdjusted, Timestamp paymentDate) { return getOpenAmt(creditMemoAdjusted, paymentDate, false); } + /** * Get Open Amount - * @param creditMemoAdjusted adjusted for CM (negative) + * @param creditMemoAdjusted true to negate return amount * @param paymentDate Payment Date * @return Open Amt */ @@ -1529,9 +1549,10 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess return m_openAmt; } // getOpenAmt - /* - * Get open amt depending on payment date - * @return open Amt + /** + * Get open amt depending on payment date + * @param paymentDate + * @return open Amt */ public BigDecimal getOpenAmt (Timestamp paymentDate) { @@ -1548,9 +1569,10 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess return retValue; } // getOpenAmt - /* - * Get discount amt depending on payment date - * @return discount Amt + /** + * Get discount amt depending on payment date + * @param paymentDate + * @return discount Amt */ public BigDecimal getDiscountAmt(Timestamp paymentDate) { @@ -1561,19 +1583,19 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess } /** - * Get Document Status - * @return Document Status Clear Text + * Get Document Status Name + * @return Document Status Name */ public String getDocStatusName() { return MRefList.getListName(getCtx(), 131, getDocStatus()); } // getDocStatusName - - /************************************************************************** + /** * Create PDF * @return File or null */ + @Override public File createPDF () { try @@ -1645,12 +1667,12 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess return MCurrency.getStdPrecision(getCtx(), getC_Currency_ID()); } // getPrecision - - /************************************************************************** + /** * Process document * @param processAction document action * @return true if performed */ + @Override public boolean processIt (String processAction) { m_processMsg = null; @@ -1667,6 +1689,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess * Unlock Document. * @return true if success */ + @Override public boolean unlockIt() { if (log.isLoggable(Level.INFO)) log.info("unlockIt - " + toString()); @@ -1678,6 +1701,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess * Invalidate Document * @return true if success */ + @Override public boolean invalidateIt() { if (log.isLoggable(Level.INFO)) log.info("invalidateIt - " + toString()); @@ -1689,6 +1713,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess * Prepare Document * @return new status (In Progress or Invalid) */ + @Override public String prepareIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -1777,7 +1802,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess } // prepareIt /** - * Explode non stocked BOM. + * Explode non stocked BOM (IsBOM=Y and IsStocked=N) */ private void explodeBOM () { @@ -1847,7 +1872,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess */ public boolean calculateTaxTotal() { - log.fine(""); + if (log.isLoggable(Level.FINE)) log.fine(""); // Delete Taxes StringBuilder msgdb = new StringBuilder("DELETE FROM C_InvoiceTax WHERE C_Invoice_ID=").append(getC_Invoice_ID()); DB.executeUpdateEx(msgdb.toString(), get_TrxName()); @@ -1866,7 +1891,6 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess return true; } // calculateTaxTotal - /** * (Re) Create Pay Schedule * @return true if valid schedule @@ -1896,11 +1920,11 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess } } // createPaySchedule - /** * Approve Document * @return true if success */ + @Override public boolean approveIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -1912,6 +1936,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess * Reject Approval * @return true if success */ + @Override public boolean rejectIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -1923,6 +1948,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess * Complete Document * @return new status (Complete, In Progress, Invalid, Waiting ..) */ + @Override public String completeIt() { // Re-Check @@ -2322,8 +2348,12 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess } // completeIt /* Save array of documents to process AFTER completing this one */ - ArrayList docsPostProcess = new ArrayList(); + protected ArrayList docsPostProcess = new ArrayList(); + /** + * Add doc for post processing (after processing of document action) + * @param doc + */ private void addDocsPostProcess(PO doc) { docsPostProcess.add(doc); } @@ -2441,6 +2471,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess * Void Document. * @return true if success */ + @Override public boolean voidIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2527,6 +2558,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess * Close Document. * @return true if success */ + @Override public boolean closeIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2549,6 +2581,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess * Reverse Correction - same date * @return true if success */ + @Override public boolean reverseCorrectIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2571,6 +2604,11 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess return true; } // reverseCorrectIt + /** + * Reverse this document + * @param accrual true to use current date, false to use this document's accounting date + * @return reversal invoice document + */ private MInvoice reverse(boolean accrual) { Timestamp reversalDate = accrual ? Env.getContextAsDate(getCtx(), Env.DATE) : getDateAcct(); if (reversalDate == null) { @@ -2752,6 +2790,11 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess return reversal; } + /** + * Reverse allocations + * @param accrual + * @param invoiceID + */ private void reverseAllocations(boolean accrual, int invoiceID) { for (MAllocationHdr allocation : MAllocationHdr.getOfInvoice(getCtx(), invoiceID, get_TrxName())) { if (accrual) { @@ -2766,9 +2809,10 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess } /** - * Reverse Accrual - none + * Reverse Accrual - use current date * @return false */ + @Override public boolean reverseAccrualIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2795,6 +2839,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess * Re-activate * @return false */ + @Override public boolean reActivateIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2812,11 +2857,11 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess return false; } // reActivateIt - - /************************************************************************* + /** * Get Summary * @return Summary of Document */ + @Override public String getSummary() { StringBuilder sb = new StringBuilder(); @@ -2835,6 +2880,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess * Get Process Message * @return clear text error message */ + @Override public String getProcessMsg() { return m_processMsg; @@ -2844,6 +2890,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess * Get Document Owner (Responsible) * @return AD_User_ID */ + @Override public int getDoc_User_ID() { return getSalesRep_ID(); @@ -2853,13 +2900,13 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess * Get Document Approval Amount * @return amount */ + @Override public BigDecimal getApprovalAmt() { return getGrandTotal(); } // getApprovalAmt /** - * * @param rma */ public void setRMA(MRMA rma) @@ -2963,7 +3010,10 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess return retValue; } - /** Returns C_DocType_ID (or C_DocTypeTarget_ID if C_DocType_ID is not set) */ + /** + * Get C_DocType_ID (or C_DocTypeTarget_ID if C_DocType_ID is not set) + * @return C_DocType_ID + */ public int getDocTypeID() { return getC_DocType_ID() > 0 ? getC_DocType_ID() : getC_DocTypeTarget_ID(); @@ -3010,7 +3060,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess public static final int UNPAID_INVOICE_SINGLE_CURRENCY_OVER_UNDER_AMT = 8; /** - * + * Get unpaid invoices * @param isMultiCurrency false to apply currency filter * @param date invoice open amount as at date * @param AD_Org_ID 0 for all orgs diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceBatch.java b/org.adempiere.base/src/org/compiere/model/MInvoiceBatch.java index 83733dd82c..66517469ab 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceBatch.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceBatch.java @@ -27,7 +27,6 @@ import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.Util; - /** * Invoice Batch Header Model * @@ -36,19 +35,17 @@ import org.compiere.util.Util; */ public class MInvoiceBatch extends X_C_InvoiceBatch { - /** - * + * generated serial id */ private static final long serialVersionUID = 3449653049236263604L; - /** - * UUID based Constructor - * @param ctx Context - * @param C_InvoiceBatch_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_InvoiceBatch_UU UUID key + * @param trxName Transaction + */ public MInvoiceBatch(Properties ctx, String C_InvoiceBatch_UU, String trxName) { super(ctx, C_InvoiceBatch_UU, trxName); if (Util.isEmpty(C_InvoiceBatch_UU)) @@ -92,7 +89,6 @@ public class MInvoiceBatch extends X_C_InvoiceBatch /** The Lines */ private MInvoiceBatchLine[] m_lines = null; - /** * Get Lines @@ -134,12 +130,13 @@ public class MInvoiceBatch extends X_C_InvoiceBatch list.toArray (m_lines); return m_lines; } // getLines - /** - * Set Processed + * Set Processed. + * Propagate to lines. * @param processed processed */ + @Override public void setProcessed (boolean processed) { super.setProcessed (processed); diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceBatchLine.java b/org.adempiere.base/src/org/compiere/model/MInvoiceBatchLine.java index 52bd9b1794..3982fdd124 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceBatchLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceBatchLine.java @@ -25,7 +25,6 @@ import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.Util; - /** * Invoice Batch Line Model * @@ -35,16 +34,16 @@ import org.compiere.util.Util; public class MInvoiceBatchLine extends X_C_InvoiceBatchLine { /** - * + * generated serial id */ private static final long serialVersionUID = -4022629343631759064L; /** - * UUID based Constructor - * @param ctx Context - * @param C_InvoiceBatchLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_InvoiceBatchLine_UU UUID key + * @param trxName Transaction + */ public MInvoiceBatchLine(Properties ctx, String C_InvoiceBatchLine_UU, String trxName) { super(ctx, C_InvoiceBatchLine_UU, trxName); if (Util.isEmpty(C_InvoiceBatchLine_UU)) @@ -97,6 +96,7 @@ public class MInvoiceBatchLine extends X_C_InvoiceBatchLine * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { // Amount @@ -110,11 +110,12 @@ public class MInvoiceBatchLine extends X_C_InvoiceBatchLine /** * After Save. - * Update Header + * Update Header. * @param newRecord new * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (success) diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java index ffa49107bf..7b75a7f626 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java @@ -36,7 +36,6 @@ import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.Util; - /** * Invoice Line Model * @@ -51,7 +50,7 @@ import org.compiere.util.Util; public class MInvoiceLine extends X_C_InvoiceLine { /** - * + * generated serial id */ private static final long serialVersionUID = -1590896898028805978L; @@ -109,21 +108,20 @@ public class MInvoiceLine extends X_C_InvoiceLine /** Tax */ protected MTax m_tax = null; - - + /** - * UUID based Constructor - * @param ctx Context - * @param C_InvoiceLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_InvoiceLine_UU UUID key + * @param trxName Transaction + */ public MInvoiceLine(Properties ctx, String C_InvoiceLine_UU, String trxName) { super(ctx, C_InvoiceLine_UU, trxName); if (Util.isEmpty(C_InvoiceLine_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Invoice Line Constructor * @param ctx context * @param C_InvoiceLine_ID invoice line or 0 @@ -134,6 +132,12 @@ public class MInvoiceLine extends X_C_InvoiceLine this (ctx, C_InvoiceLine_ID, trxName, (String[]) null); } // MInvoiceLine + /** + * @param ctx + * @param C_InvoiceLine_ID + * @param trxName + * @param virtualColumns + */ public MInvoiceLine(Properties ctx, int C_InvoiceLine_ID, String trxName, String... virtualColumns) { super(ctx, C_InvoiceLine_ID, trxName, virtualColumns); if (C_InvoiceLine_ID == 0) @@ -185,7 +189,7 @@ public class MInvoiceLine extends X_C_InvoiceLine } // MInvoiceLine /** - * + * Copy constructor * @param copy */ public MInvoiceLine(MInvoiceLine copy) @@ -194,7 +198,7 @@ public class MInvoiceLine extends X_C_InvoiceLine } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -204,7 +208,7 @@ public class MInvoiceLine extends X_C_InvoiceLine } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -248,8 +252,8 @@ public class MInvoiceLine extends X_C_InvoiceLine /** * Set Defaults from Order. - * Called also from copy lines from invoice - * Does not set Parent !! + * Called also from copy lines from invoice. + * Does not update C_Invoice_ID column. * @param invoice invoice */ public void setInvoice (MInvoice invoice) @@ -408,15 +412,15 @@ public class MInvoiceLine extends X_C_InvoiceLine * Set M_AttributeSetInstance_ID * @param M_AttributeSetInstance_ID id */ + @Override public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) { super.setM_AttributeSetInstance_ID (M_AttributeSetInstance_ID); } // setM_AttributeSetInstance_ID - - /************************************************************************** - * Set Price for Product and PriceList. - * Uses standard SO price list of not set by invoice constructor + /** + * Set Price for Product and PriceList.
        + * Uses standard SO price list if not set by invoice constructor. */ public void setPrice() { @@ -430,7 +434,7 @@ public class MInvoiceLine extends X_C_InvoiceLine } // setPrice /** - * Set Price for Product and PriceList + * Set Price for Product * @param M_PriceList_ID price list * @param C_BPartner_ID business partner */ @@ -462,7 +466,7 @@ public class MInvoiceLine extends X_C_InvoiceLine /** * Set Price Entered/Actual. - * Use this Method if the Line UOM is the Product UOM + * Use this Method if the Line UOM is the Product UOM. * @param PriceActual price */ public void setPrice (BigDecimal PriceActual) @@ -473,9 +477,10 @@ public class MInvoiceLine extends X_C_InvoiceLine /** * Set Price Actual. - * (actual price is not updateable) + * (actual price is not updateable). * @param PriceActual actual price */ + @Override public void setPriceActual (BigDecimal PriceActual) { if (PriceActual == null) @@ -483,7 +488,6 @@ public class MInvoiceLine extends X_C_InvoiceLine set_ValueNoCheck("PriceActual", PriceActual); } // setPriceActual - /** * Set Tax - requires Warehouse * @return true if found @@ -516,10 +520,9 @@ public class MInvoiceLine extends X_C_InvoiceLine return true; } // setTax - /** * Calculate Tax Amt. - * Assumes Line Net is calculated + * Assumes Line Net is calculated. */ public void setTaxAmt () { @@ -540,8 +543,8 @@ public class MInvoiceLine extends X_C_InvoiceLine } // setTaxAmt /** - * Calculate Extended Amt. - * May or may not include tax + * Calculate Line Net Amt. + * Include tax if tax is included in price. */ public void setLineNetAmt () { @@ -552,9 +555,10 @@ public class MInvoiceLine extends X_C_InvoiceLine bd = bd.setScale(precision, RoundingMode.HALF_UP); super.setLineNetAmt (bd); } // setLineNetAmt + /** * Get Charge - * @return product or null + * @return charge or null */ public MCharge getCharge() { @@ -583,7 +587,7 @@ public class MInvoiceLine extends X_C_InvoiceLine } // setQtyInvoiced /** - * Set Qty Invoiced + * Set Qty Invoiced/Entered. * @param Qty Invoiced/Entered */ public void setQty (BigDecimal Qty) @@ -593,9 +597,10 @@ public class MInvoiceLine extends X_C_InvoiceLine } // setQtyInvoiced /** - * Set Qty Entered - enforce entered UOM + * Set Qty Entered - enforce entered UOM precision * @param QtyEntered */ + @Override public void setQtyEntered (BigDecimal QtyEntered) { if (QtyEntered != null && getC_UOM_ID() != 0) @@ -607,9 +612,10 @@ public class MInvoiceLine extends X_C_InvoiceLine } // setQtyEntered /** - * Set Qty Invoiced - enforce Product UOM + * Set Qty Invoiced - enforce Product UOM precision * @param QtyInvoiced */ + @Override public void setQtyInvoiced (BigDecimal QtyInvoiced) { MProduct product = getProduct(); @@ -641,11 +647,10 @@ public class MInvoiceLine extends X_C_InvoiceLine setM_AttributeSetInstance_ID(0); } // setProduct - /** * Set M_Product_ID * @param M_Product_ID product - * @param setUOM set UOM from product + * @param setUOM true to set UOM from product */ public void setM_Product_ID (int M_Product_ID, boolean setUOM) { @@ -681,7 +686,7 @@ public class MInvoiceLine extends X_C_InvoiceLine /** * Get C_Project_ID - * @return project + * @return C_Project_ID */ public int getC_Project_ID() { @@ -693,7 +698,7 @@ public class MInvoiceLine extends X_C_InvoiceLine /** * Get C_Activity_ID - * @return Activity + * @return C_Activity_ID */ public int getC_Activity_ID() { @@ -705,7 +710,7 @@ public class MInvoiceLine extends X_C_InvoiceLine /** * Get C_Campaign_ID - * @return Campaign + * @return C_Campaign_ID */ public int getC_Campaign_ID() { @@ -716,8 +721,8 @@ public class MInvoiceLine extends X_C_InvoiceLine } // getC_Campaign_ID /** - * Get User2_ID - * @return User2 + * Get User1_ID + * @return User1_ID */ public int getUser1_ID () { @@ -729,7 +734,7 @@ public class MInvoiceLine extends X_C_InvoiceLine /** * Get User2_ID - * @return User2 + * @return User2_ID */ public int getUser2_ID () { @@ -741,7 +746,7 @@ public class MInvoiceLine extends X_C_InvoiceLine /** * Get AD_OrgTrx_ID - * @return trx org + * @return AD_OrgTrx_ID */ public int getAD_OrgTrx_ID() { @@ -755,6 +760,7 @@ public class MInvoiceLine extends X_C_InvoiceLine * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MInvoiceLine[") @@ -815,7 +821,6 @@ public class MInvoiceLine extends X_C_InvoiceLine /** * Get Description Text. - * For jsp access (vs. isDescription) * @return description */ public String getDescriptionText() @@ -861,12 +866,12 @@ public class MInvoiceLine extends X_C_InvoiceLine return pl.isTaxIncluded(); } // isTaxIncluded - - /************************************************************************** + /** * Before Save * @param newRecord * @return true if save */ + @Override protected boolean beforeSave (boolean newRecord) { if (log.isLoggable(Level.FINE)) log.fine("New=" + newRecord); @@ -1014,6 +1019,7 @@ public class MInvoiceLine extends X_C_InvoiceLine * @param success success * @return saved */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -1031,6 +1037,7 @@ public class MInvoiceLine extends X_C_InvoiceLine * @param success success * @return deleted */ + @Override protected boolean afterDelete (boolean success) { if (!success) @@ -1069,8 +1076,7 @@ public class MInvoiceLine extends X_C_InvoiceLine return calculator.updateHeaderTax(provider, this); } // updateHeaderTax - - /************************************************************************** + /** * Allocate Landed Costs * @return error message or "" */ @@ -1264,10 +1270,8 @@ public class MInvoiceLine extends X_C_InvoiceLine lca.setM_InOutLine_ID(iol.getM_InOutLine_ID()); BigDecimal base = iol.getBase(LandedCostDistribution); lca.setBase(base); - // MZ Goodwill // add set Qty from InOutLine lca.setQty(iol.getMovementQty()); - // end MZ if (base.signum() != 0) { double result = getLineNetAmt().multiply(base).doubleValue(); @@ -1314,11 +1318,10 @@ public class MInvoiceLine extends X_C_InvoiceLine } } // allocateLandedCostRounding - // MZ Goodwill /** * Get LandedCost of InvoiceLine * @param whereClause starting with AND - * @return landedCost + * @return array of landedCost */ public MLandedCost[] getLandedCost (String whereClause) { @@ -1358,7 +1361,7 @@ public class MInvoiceLine extends X_C_InvoiceLine /** * Copy LandedCost From other InvoiceLine. - * @param otherInvoiceLine invoiceline + * @param otherInvoiceLine other invoice line * @return number of lines copied */ public int copyLandedCostFrom (MInvoiceLine otherInvoiceLine) @@ -1381,7 +1384,6 @@ public class MInvoiceLine extends X_C_InvoiceLine log.log(Level.SEVERE, "LandedCost difference - From=" + fromLandedCosts.length + " <> Saved=" + count); return count; } // copyLinesFrom - // end MZ /** * @param rmaLine @@ -1426,6 +1428,9 @@ public class MInvoiceLine extends X_C_InvoiceLine return DB.getSQLValueBDEx(get_TrxName(), sql, getC_InvoiceLine_ID(), true); } + /** + * Clear cache parent (invoice) reference + */ public void clearParent() { this.m_parent = null; diff --git a/org.adempiere.base/src/org/compiere/model/MInvoicePaySchedule.java b/org.adempiere.base/src/org/compiere/model/MInvoicePaySchedule.java index 9121920c04..ec26a3f626 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoicePaySchedule.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoicePaySchedule.java @@ -40,12 +40,12 @@ import org.compiere.util.Util; public class MInvoicePaySchedule extends X_C_InvoicePaySchedule { /** - * + * generated serial id */ private static final long serialVersionUID = 4613382619117842586L; /** - * Get Payment Schedule of the invoice + * Get Payment Schedule of invoice * @param ctx context * @param C_Invoice_ID invoice id (direct) * @param C_InvoicePaySchedule_ID id (indirect) @@ -99,18 +99,18 @@ public class MInvoicePaySchedule extends X_C_InvoicePaySchedule private static CLogger s_log = CLogger.getCLogger (MInvoicePaySchedule.class); /** - * UUID based Constructor - * @param ctx Context - * @param C_InvoicePaySchedule_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_InvoicePaySchedule_UU UUID key + * @param trxName Transaction + */ public MInvoicePaySchedule(Properties ctx, String C_InvoicePaySchedule_UU, String trxName) { super(ctx, C_InvoicePaySchedule_UU, trxName); if (Util.isEmpty(C_InvoicePaySchedule_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_InvoicePaySchedule_ID id @@ -183,10 +183,9 @@ public class MInvoicePaySchedule extends X_C_InvoicePaySchedule /** Parent */ private MInvoice m_parent = null; - /** - * @return Returns the parent. + * @return parent invoice */ public MInvoice getParent () { @@ -207,6 +206,7 @@ public class MInvoicePaySchedule extends X_C_InvoicePaySchedule * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder("MInvoicePaySchedule["); @@ -216,13 +216,12 @@ public class MInvoicePaySchedule extends X_C_InvoicePaySchedule return sb.toString(); } // toString - - /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (is_ValueChanged("DueAmt")) @@ -239,6 +238,7 @@ public class MInvoicePaySchedule extends X_C_InvoicePaySchedule * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceSchedule.java b/org.adempiere.base/src/org/compiere/model/MInvoiceSchedule.java index 2279e59e12..f40f887d6e 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceSchedule.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceSchedule.java @@ -29,7 +29,7 @@ import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; /** - * Invoice Schedule Model + * Invoicing Schedule Model * * @author Jorg Janke * @version $Id: MInvoiceSchedule.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $ @@ -37,7 +37,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MInvoiceSchedule extends X_C_InvoiceSchedule implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -2480759794244343907L; @@ -86,19 +86,18 @@ public class MInvoiceSchedule extends X_C_InvoiceSchedule implements ImmutablePO /** Cache */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 5); - - + /** - * UUID based Constructor - * @param ctx Context - * @param C_InvoiceSchedule_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_InvoiceSchedule_UU UUID key + * @param trxName Transaction + */ public MInvoiceSchedule(Properties ctx, String C_InvoiceSchedule_UU, String trxName) { super(ctx, C_InvoiceSchedule_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_InvoiceSchedule_ID id @@ -120,8 +119,8 @@ public class MInvoiceSchedule extends X_C_InvoiceSchedule implements ImmutablePO super(ctx, rs, trxName); } // MInvoiceSchedule - /** - * + /**constructor + * Copy constructor * @param copy */ public MInvoiceSchedule(MInvoiceSchedule copy) @@ -130,7 +129,7 @@ public class MInvoiceSchedule extends X_C_InvoiceSchedule implements ImmutablePO } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -140,7 +139,7 @@ public class MInvoiceSchedule extends X_C_InvoiceSchedule implements ImmutablePO } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceTax.java b/org.adempiere.base/src/org/compiere/model/MInvoiceTax.java index d4da5c1ff9..018c5cf52c 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceTax.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceTax.java @@ -43,11 +43,10 @@ import org.compiere.util.Util; public class MInvoiceTax extends X_C_InvoiceTax { /** - * + * generated serial id */ private static final long serialVersionUID = -5560880305482497098L; - /** * Get Tax Line for Invoice Line * @param line invoice line @@ -113,7 +112,7 @@ public class MInvoiceTax extends X_C_InvoiceTax * @param precision currency precision * @param oldTax if true old tax is returned * @param trxName transaction name - * @return existing or new tax + * @return array of existing or new tax */ public static MInvoiceTax[] getChildTaxes(MInvoiceLine line, int precision, boolean oldTax, String trxName) @@ -177,22 +176,20 @@ public class MInvoiceTax extends X_C_InvoiceTax /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MInvoiceTax.class); - - + /** - * UUID based Constructor - * @param ctx Context - * @param C_InvoiceTax_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_InvoiceTax_UU UUID key + * @param trxName Transaction + */ public MInvoiceTax(Properties ctx, String C_InvoiceTax_UU, String trxName) { super(ctx, C_InvoiceTax_UU, trxName); if (Util.isEmpty(C_InvoiceTax_UU)) setInitialDefaults(); } - /************************************************************************** - * Persistency Constructor + /** * @param ctx context * @param ignored ignored * @param trxName transaction @@ -216,7 +213,6 @@ public class MInvoiceTax extends X_C_InvoiceTax /** * Load Constructor. - * Set Precision and TaxIncluded for tax calculations! * @param ctx context * @param rs result set * @param trxName transaction @@ -227,7 +223,7 @@ public class MInvoiceTax extends X_C_InvoiceTax } // MInvoiceTax /** - * + * Copy constructor * @param copy */ public MInvoiceTax(MInvoiceTax copy) @@ -236,7 +232,7 @@ public class MInvoiceTax extends X_C_InvoiceTax } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -246,7 +242,7 @@ public class MInvoiceTax extends X_C_InvoiceTax } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -263,11 +259,10 @@ public class MInvoiceTax extends X_C_InvoiceTax private MTax m_tax = null; /** Cached Precision */ private Integer m_precision = null; - - + /** * Get Precision - * @return Returns the precision or 2 + * @return precision set or 2 */ private int getPrecision () { @@ -295,10 +290,9 @@ public class MInvoiceTax extends X_C_InvoiceTax m_tax = MTax.get(getCtx(), getC_Tax_ID()); return m_tax; } // getTax - - - /************************************************************************** - * Calculate/Set Tax Base Amt from Invoice Lines + + /** + * Calculate/Set Tax and Tax Base Amt from Invoice Lines * @return true if tax calculated */ public boolean calculateTaxFromLines () @@ -378,6 +372,7 @@ public class MInvoiceTax extends X_C_InvoiceTax * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MInvoiceTax["); diff --git a/org.adempiere.base/src/org/compiere/model/MIssue.java b/org.adempiere.base/src/org/compiere/model/MIssue.java index 6d644da1f0..8b48cacaf2 100644 --- a/org.adempiere.base/src/org/compiere/model/MIssue.java +++ b/org.adempiere.base/src/org/compiere/model/MIssue.java @@ -43,7 +43,7 @@ import org.compiere.util.Util; public class MIssue extends X_AD_Issue { /** - * + * generated serial id */ private static final long serialVersionUID = -3680542992654002121L; @@ -75,8 +75,10 @@ public class MIssue extends X_AD_Issue * @param ctx context * @param hexInput hex string * @return issue + * @deprecated */ @SuppressWarnings("unchecked") + @Deprecated public static MIssue create (Properties ctx, String hexInput) { HashMap hmIn = null; @@ -105,18 +107,18 @@ public class MIssue extends X_AD_Issue public static String DELIMITER = "|"; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Issue_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Issue_UU UUID key + * @param trxName Transaction + */ public MIssue(Properties ctx, String AD_Issue_UU, String trxName) { super(ctx, AD_Issue_UU, trxName); if (Util.isEmpty(AD_Issue_UU)) setInitialDefaults(ctx); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param AD_Issue_ID issue @@ -214,7 +216,9 @@ public class MIssue extends X_AD_Issue * HashMap Constructor * @param ctx context * @param hmIn hash map + * @deprecated */ + @Deprecated public MIssue (Properties ctx, HashMap hmIn) { super (ctx, 0, null); @@ -253,7 +257,7 @@ public class MIssue extends X_AD_Issue /** * Set Issue Summary. - * Truncate it to 2000 char + * Truncate to 2000 char. * @param IssueSummary summary */ public void setIssueSummary (String IssueSummary) @@ -269,7 +273,7 @@ public class MIssue extends X_AD_Issue /** * Set Stack Trace. - * Truncate it to 2000 char + * Truncate to 2000 char. * @param StackTrace trace */ public void setStackTrace (String StackTrace) @@ -282,11 +286,10 @@ public class MIssue extends X_AD_Issue StackTrace = StackTrace.substring(0,INFOLENGTH-1); super.setStackTrace (StackTrace); } // setStackTrace - - + /** * Set Error Trace. - * Truncate it to 2000 char + * Truncate to 2000 char. * @param ErrorTrace trace */ public void setErrorTrace (String ErrorTrace) @@ -320,7 +323,7 @@ public class MIssue extends X_AD_Issue /** * Set Comments. - * Truncate it to 2000 char + * Truncate to 2000 char. * @param Comments */ public void setComments (String Comments) @@ -334,7 +337,7 @@ public class MIssue extends X_AD_Issue /** * Set ResponseText. - * Truncate it to 2000 char + * Truncate to 2000 char. * @param ResponseText */ public void setResponseText (String ResponseText) @@ -349,7 +352,9 @@ public class MIssue extends X_AD_Issue /** * Process Request. * @return answer + * @deprecated */ + @Deprecated public String process() { MIssueProject.get(this); // sets also Asset @@ -361,7 +366,9 @@ public class MIssue extends X_AD_Issue /** * Create Answer to send to User * @return answer + * @deprecated */ + @Deprecated public String createAnswer() { StringBuilder sb = new StringBuilder(); @@ -388,7 +395,7 @@ public class MIssue extends X_AD_Issue if (getR_Request_ID() == 0) return null; return new X_R_Request(getCtx(), getR_Request_ID(), null); - } // getRequestDocumentNo + } // getRequest /** * Get Request Document No @@ -404,8 +411,9 @@ public class MIssue extends X_AD_Issue /** * Get System Status - * @return system status + * @return system status or SYSTEMSTATUS_Evaluation if not set by user */ + @Override public String getSystemStatus () { String s = super.getSystemStatus (); @@ -413,12 +421,13 @@ public class MIssue extends X_AD_Issue s = SYSTEMSTATUS_Evaluation; return s; } // getSystemStatus - - - /************************************************************************** + + /** * Report/Update Issue. * @return error message + * @deprecated not implemented */ + @Deprecated public String report() { return null; @@ -428,6 +437,7 @@ public class MIssue extends X_AD_Issue * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MIssue["); diff --git a/org.adempiere.base/src/org/compiere/model/MIssueProject.java b/org.adempiere.base/src/org/compiere/model/MIssueProject.java index cc0d4593f9..027893e480 100644 --- a/org.adempiere.base/src/org/compiere/model/MIssueProject.java +++ b/org.adempiere.base/src/org/compiere/model/MIssueProject.java @@ -25,19 +25,21 @@ import org.compiere.util.CLogger; import org.compiere.util.DB; /** - * Issue Project (and Asset Link) + * Issue Project (and Asset Link).
        + * Note: Not fully implemented and have been marked as inactive in Application Dictionary. * * @author Jorg Janke * @version $Id: MIssueProject.java,v 1.2 2006/07/30 00:58:18 jjanke Exp $ + * @deprecated */ +@Deprecated public class MIssueProject extends X_R_IssueProject { /** - * + * generated serial id */ private static final long serialVersionUID = -9115162283984109370L; - /** * Get/Set Project * @param issue issue @@ -91,19 +93,18 @@ public class MIssueProject extends X_R_IssueProject /** Logger */ private static CLogger s_log = CLogger.getCLogger (MIssueProject.class); - - + /** - * UUID based Constructor - * @param ctx Context - * @param R_IssueProject_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param R_IssueProject_UU UUID key + * @param trxName Transaction + */ public MIssueProject(Properties ctx, String R_IssueProject_UU, String trxName) { super(ctx, R_IssueProject_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param R_IssueProject_ID id @@ -139,6 +140,7 @@ public class MIssueProject extends X_R_IssueProject * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MIssueProject["); diff --git a/org.adempiere.base/src/org/compiere/model/MIssueSystem.java b/org.adempiere.base/src/org/compiere/model/MIssueSystem.java index f996b8fbe3..03c986060f 100644 --- a/org.adempiere.base/src/org/compiere/model/MIssueSystem.java +++ b/org.adempiere.base/src/org/compiere/model/MIssueSystem.java @@ -25,15 +25,18 @@ import org.compiere.util.CLogger; import org.compiere.util.DB; /** - * Issue System Model + * Issue System Model.
        + * Note: Not fully implemented and have been marked as inactive in Application Dictionary. * * @author Jorg Janke * @version $Id: MIssueSystem.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ + * @deprecated */ +@Deprecated public class MIssueSystem extends X_R_IssueSystem { /** - * + * generated serial id */ private static final long serialVersionUID = -1652388382466287269L; diff --git a/org.adempiere.base/src/org/compiere/model/MIssueUser.java b/org.adempiere.base/src/org/compiere/model/MIssueUser.java index 8080336d4f..aeb5d6c6ed 100644 --- a/org.adempiere.base/src/org/compiere/model/MIssueUser.java +++ b/org.adempiere.base/src/org/compiere/model/MIssueUser.java @@ -25,15 +25,18 @@ import org.compiere.util.CLogger; import org.compiere.util.DB; /** - * Issue User Model + * Issue User Model.
        + * Note: Not fully implemented and have been marked as inactive in Application Dictionary. * * @author Jorg Janke * @version $Id: MIssueUser.java,v 1.2 2006/07/30 00:54:54 jjanke Exp $ + * @deprecated */ +@Deprecated public class MIssueUser extends X_R_IssueUser { /** - * + * generated serial id */ private static final long serialVersionUID = -6761335385032704707L; @@ -88,16 +91,16 @@ public class MIssueUser extends X_R_IssueUser private static CLogger s_log = CLogger.getCLogger (MIssueUser.class); /** - * UUID based Constructor - * @param ctx Context - * @param R_IssueUser_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param R_IssueUser_UU UUID key + * @param trxName Transaction + */ public MIssueUser(Properties ctx, String R_IssueUser_UU, String trxName) { super(ctx, R_IssueUser_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param R_IssueUser_ID id @@ -118,8 +121,7 @@ public class MIssueUser extends X_R_IssueUser { super (ctx, rs, trxName); } // MIssueUser - - + /** * Set AD_User_ID */ @@ -135,6 +137,7 @@ public class MIssueUser extends X_R_IssueUser * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MIssueUser["); diff --git a/org.adempiere.base/src/org/compiere/model/MJournal.java b/org.adempiere.base/src/org/compiere/model/MJournal.java index 110927e799..af2c02baf6 100644 --- a/org.adempiere.base/src/org/compiere/model/MJournal.java +++ b/org.adempiere.base/src/org/compiere/model/MJournal.java @@ -55,16 +55,16 @@ import org.compiere.util.Util; public class MJournal extends X_GL_Journal implements DocAction { /** - * + * generated serial id */ private static final long serialVersionUID = 4661098755828765138L; /** - * UUID based Constructor - * @param ctx Context - * @param GL_Journal_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param GL_Journal_UU UUID key + * @param trxName Transaction + */ public MJournal(Properties ctx, String GL_Journal_UU, String trxName) { super(ctx, GL_Journal_UU, trxName); if (Util.isEmpty(GL_Journal_UU)) @@ -132,8 +132,8 @@ public class MJournal extends X_GL_Journal implements DocAction /** * Copy Constructor. - * Dos not copy: Dates/Period - * @param original original + * Does not copy: Dates/Period. + * @param original original journal document */ public MJournal (MJournal original) { @@ -160,6 +160,7 @@ public class MJournal extends X_GL_Journal implements DocAction * @param AD_Client_ID client * @param AD_Org_ID org */ + @Override public void setClientOrg (int AD_Client_ID, int AD_Org_ID) { super.setClientOrg(AD_Client_ID, AD_Org_ID); @@ -167,7 +168,7 @@ public class MJournal extends X_GL_Journal implements DocAction /** * Set Accounting Date. - * Set also Period if not set earlier + * Set also Period if not set earlier. * @param DateAcct date */ public void setDateAcct (Timestamp DateAcct) @@ -214,14 +215,13 @@ public class MJournal extends X_GL_Journal implements DocAction } } - /************************************************************************** + /** * Get Journal Lines - * @param requery requery (not used) + * @param requery ignore * @return Array of lines */ public MJournalLine[] getLines (boolean requery) { - //FR: [ 2214883 ] Remove SQL code and Replace for Query - red1 final String whereClause = "GL_Journal_ID=?"; List list = new Query(getCtx(), I_GL_JournalLine.Table_Name, whereClause, get_TrxName()) .setParameters(getGL_Journal_ID()) @@ -281,6 +281,7 @@ public class MJournal extends X_GL_Journal implements DocAction * Propagate to Lines/Taxes * @param processed processed */ + @Override public void setProcessed (boolean processed) { super.setProcessed (processed); @@ -294,11 +295,12 @@ public class MJournal extends X_GL_Journal implements DocAction } // setProcessed - /************************************************************************** + /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getGL_JournalBatch_ID() > 0) { @@ -379,8 +381,7 @@ public class MJournal extends X_GL_Journal implements DocAction } return true; } // beforeSave - - + /** * After Save. * Update Batch Total @@ -388,6 +389,7 @@ public class MJournal extends X_GL_Journal implements DocAction * @param success true if success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -400,6 +402,7 @@ public class MJournal extends X_GL_Journal implements DocAction * @param success true if deleted * @return true if success */ + @Override protected boolean afterDelete (boolean success) { if (!success) @@ -425,13 +428,13 @@ public class MJournal extends X_GL_Journal implements DocAction } return true; } // updateBatch - - - /************************************************************************** + + /** * Process document * @param processAction document action * @return true if performed */ + @Override public boolean processIt (String processAction) { m_processMsg = null; @@ -448,6 +451,7 @@ public class MJournal extends X_GL_Journal implements DocAction * Unlock Document. * @return true if success */ + @Override public boolean unlockIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -459,6 +463,7 @@ public class MJournal extends X_GL_Journal implements DocAction * Invalidate Document * @return true if success */ + @Override public boolean invalidateIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -469,6 +474,7 @@ public class MJournal extends X_GL_Journal implements DocAction * Prepare Document * @return new status (In Progress or Invalid) */ + @Override public String prepareIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -584,6 +590,10 @@ public class MJournal extends X_GL_Journal implements DocAction return DocAction.STATUS_InProgress; } // prepareIt + /** + * @param dateAcct + * @return null or error message + */ private String validatePeriod(Timestamp dateAcct) { // Get Period MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); @@ -617,6 +627,7 @@ public class MJournal extends X_GL_Journal implements DocAction * Approve Document * @return true if success */ + @Override public boolean approveIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -628,6 +639,7 @@ public class MJournal extends X_GL_Journal implements DocAction * Reject Approval * @return true if success */ + @Override public boolean rejectIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -639,6 +651,7 @@ public class MJournal extends X_GL_Journal implements DocAction * Complete Document * @return new status (Complete, In Progress, Invalid, Waiting ..) */ + @Override public String completeIt() { // Re-Check @@ -702,6 +715,7 @@ public class MJournal extends X_GL_Journal implements DocAction * Void Document. * @return true if success */ + @Override public boolean voidIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -747,6 +761,7 @@ public class MJournal extends X_GL_Journal implements DocAction * Cancel not delivered Qunatities * @return true if success */ + @Override public boolean closeIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -774,10 +789,11 @@ public class MJournal extends X_GL_Journal implements DocAction } // closeIt /** - * Reverse Correction (in same batch). - * As if nothing happened - same date + * Reverse Correction (in same batch if using batch). + * Flip Dr/Cr - Use date of this document. * @return true if success */ + @Override public boolean reverseCorrectIt() { // Before reverseCorrect @@ -800,8 +816,8 @@ public class MJournal extends X_GL_Journal implements DocAction /** * Reverse Correction. - * As if nothing happened - same date - * @param GL_JournalBatch_ID reversal batch + * Flip Dr/Cr - Use date of this document. + * @param GL_JournalBatch_ID optional reversal batch * @return reversed Journal or null */ public MJournal reverseCorrectIt (int GL_JournalBatch_ID) @@ -849,10 +865,11 @@ public class MJournal extends X_GL_Journal implements DocAction } // reverseCorrectionIt /** - * Reverse Accrual (sane batch). - * Flip Dr/Cr - Use Today's date + * Reverse Accrual (in same batch if using batch). + * Flip Dr/Cr - Use Today's date. * @return true if success */ + @Override public boolean reverseAccrualIt() { // Before reverseAccrual @@ -875,8 +892,8 @@ public class MJournal extends X_GL_Journal implements DocAction /** * Reverse Accrual. - * Flip Dr/Cr - Use Today's date - * @param GL_JournalBatch_ID reversal batch + * Flip Dr/Cr - Use Today's date. + * @param GL_JournalBatch_ID optional reversal batch * @return reversed journal or null */ public MJournal reverseAccrualIt (int GL_JournalBatch_ID) @@ -923,9 +940,10 @@ public class MJournal extends X_GL_Journal implements DocAction } // reverseAccrualIt /** - * Re-activate + * Re-activate document and delete Fact_Acct entries. * @return true if success */ + @Override public boolean reActivateIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -948,12 +966,12 @@ public class MJournal extends X_GL_Journal implements DocAction return true; } // reActivateIt - - - /************************************************************************* + + /** * Get Summary * @return Summary of Document */ + @Override public String getSummary() { StringBuilder sb = new StringBuilder(); @@ -974,6 +992,7 @@ public class MJournal extends X_GL_Journal implements DocAction * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MJournal["); @@ -988,6 +1007,7 @@ public class MJournal extends X_GL_Journal implements DocAction * Get Document Info * @return document info (untranslated) */ + @Override public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); @@ -999,6 +1019,7 @@ public class MJournal extends X_GL_Journal implements DocAction * Create PDF * @return File or null */ + @Override public File createPDF () { try @@ -1017,18 +1038,18 @@ public class MJournal extends X_GL_Journal implements DocAction /** * Create PDF file * @param file output file - * @return file if success + * @return not implemented, always return null */ public File createPDF (File file) { return null; } // createPDF - /** * Get Process Message * @return clear text error message */ + @Override public String getProcessMsg() { return m_processMsg; @@ -1038,6 +1059,7 @@ public class MJournal extends X_GL_Journal implements DocAction * Get Document Owner (Responsible) * @return AD_User_ID (Created) */ + @Override public int getDoc_User_ID() { return getCreatedBy(); @@ -1047,6 +1069,7 @@ public class MJournal extends X_GL_Journal implements DocAction * Get Document Approval Amount * @return DR amount */ + @Override public BigDecimal getApprovalAmt() { return getTotalDr(); @@ -1065,8 +1088,8 @@ public class MJournal extends X_GL_Journal implements DocAction } // isComplete /** - * Get Document Status - * @return Document Status Clear Text + * Get Document Status Name + * @return Document Status Name */ public String getDocStatusName() { diff --git a/org.adempiere.base/src/org/compiere/model/MJournalBatch.java b/org.adempiere.base/src/org/compiere/model/MJournalBatch.java index 49c4e784b5..8d20f0cc47 100644 --- a/org.adempiere.base/src/org/compiere/model/MJournalBatch.java +++ b/org.adempiere.base/src/org/compiere/model/MJournalBatch.java @@ -53,7 +53,7 @@ import org.compiere.util.Util; public class MJournalBatch extends X_GL_JournalBatch implements DocAction { /** - * + * generated serial id */ private static final long serialVersionUID = 4447134860127309777L; @@ -91,22 +91,20 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction return to; } // copyFrom - - + /** - * UUID based Constructor - * @param ctx Context - * @param GL_JournalBatch_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param GL_JournalBatch_UU UUID key + * @param trxName Transaction + */ public MJournalBatch(Properties ctx, String GL_JournalBatch_UU, String trxName) { super(ctx, GL_JournalBatch_UU, trxName); if (Util.isEmpty(GL_JournalBatch_UU)) setInitialDefaults(); } - /************************************************************************** - * Standard Construvtore + /** * @param ctx context * @param GL_JournalBatch_ID id if 0 - create actual batch * @param trxName transaction @@ -145,7 +143,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction /** * Copy Constructor. - * Dos not copy: Dates/Period + * Does not copy: Dates/Period * @param original original */ public MJournalBatch (MJournalBatch original) @@ -161,13 +159,12 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction setC_Currency_ID(original.getC_Currency_ID()); } // MJournal - - /** * Overwrite Client/Org if required * @param AD_Client_ID client * @param AD_Org_ID org */ + @Override public void setClientOrg (int AD_Client_ID, int AD_Org_ID) { super.setClientOrg(AD_Client_ID, AD_Org_ID); @@ -175,9 +172,10 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction /** * Set Accounting Date. - * Set also Period if not set earlier + * Set also Period if not set earlier. * @param DateAcct date */ + @Override public void setDateAcct (Timestamp DateAcct) { super.setDateAcct(DateAcct); @@ -192,7 +190,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction /** * Get Journal Lines - * @param requery requery + * @param requery ignore * @return Array of lines */ public MJournal[] getJournals (boolean requery) @@ -265,13 +263,13 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction return count + lineCount; } // copyLinesFrom - - /************************************************************************** + /** * Process document * @param processAction document action * @return true if performed */ + @Override public boolean processIt (String processAction) { m_processMsg = null; @@ -288,6 +286,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction * Unlock Document. * @return true if success */ + @Override public boolean unlockIt() { if (log.isLoggable(Level.INFO)) log.info("unlockIt - " + toString()); @@ -299,6 +298,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction * Invalidate Document * @return true if success */ + @Override public boolean invalidateIt() { if (log.isLoggable(Level.INFO)) log.info("invalidateIt - " + toString()); @@ -309,6 +309,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction * Prepare Document * @return new status (In Progress or Invalid) */ + @Override public String prepareIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -411,6 +412,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction * Approve Document * @return true if success */ + @Override public boolean approveIt() { if (log.isLoggable(Level.INFO)) log.info("approveIt - " + toString()); @@ -422,6 +424,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction * Reject Approval * @return true if success */ + @Override public boolean rejectIt() { if (log.isLoggable(Level.INFO)) log.info("rejectIt - " + toString()); @@ -433,6 +436,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction * Complete Document * @return new status (Complete, In Progress, Invalid, Waiting ..) */ + @Override public String completeIt() { if (log.isLoggable(Level.INFO)) log.info("completeIt - " + toString()); @@ -532,6 +536,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction * Void Document. * @return false */ + @Override public boolean voidIt() { if (log.isLoggable(Level.INFO)) log.info("voidIt - " + toString()); @@ -551,6 +556,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction * Close Document. * @return true if success */ + @Override public boolean closeIt() { if (log.isLoggable(Level.INFO)) log.info("closeIt - " + toString()); @@ -604,9 +610,10 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction /** * Reverse Correction. - * As if nothing happened - same date + * Flip Dr/Cr - Use this document's date. * @return true if success */ + @Override public boolean reverseCorrectIt() { if (log.isLoggable(Level.INFO)) log.info("reverseCorrectIt - " + toString()); @@ -689,9 +696,10 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction /** * Reverse Accrual. - * Flip Dr/Cr - Use Today's date + * Flip Dr/Cr - Use Today's date. * @return true if success */ + @Override public boolean reverseAccrualIt() { if (log.isLoggable(Level.INFO)) log.info("reverseAccrualIt - " + toString()); @@ -773,9 +781,10 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction } // reverseAccrualIt /** - * Re-activate - same as reverse correct + * Re-activate document and delete Fact_Acct entries. * @return true if success */ + @Override public boolean reActivateIt() { if (log.isLoggable(Level.INFO)) log.info("reActivateIt - " + toString()); @@ -810,11 +819,11 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction return true; } // reActivateIt - - /************************************************************************* + /** * Get Summary * @return Summary of Document */ + @Override public String getSummary() { StringBuilder sb = new StringBuilder(); @@ -835,6 +844,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MJournalBatch["); @@ -849,6 +859,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction * Get Document Info * @return document info (untranslated) */ + @Override public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); @@ -860,6 +871,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction * Create PDF * @return File or null */ + @Override public File createPDF () { try @@ -878,18 +890,18 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction /** * Create PDF file * @param file output file - * @return file if success + * @return not implemented, always return null */ public File createPDF (File file) { return null; } // createPDF - /** * Get Process Message * @return clear text error message */ + @Override public String getProcessMsg() { return m_processMsg; @@ -899,6 +911,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction * Get Document Owner (Responsible) * @return AD_User_ID (Created By) */ + @Override public int getDoc_User_ID() { return getCreatedBy(); @@ -908,11 +921,16 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction * Get Document Approval Amount * @return DR amount */ + @Override public BigDecimal getApprovalAmt() { return getTotalDr(); } // getApprovalAmt + /** + * append description to current Description text + * @param description + */ public void addDescription (String description) { String desc = getDescription(); @@ -924,7 +942,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction } } - /************************************************************************** + /** * Before Save * @param newRecord new * @return true diff --git a/org.adempiere.base/src/org/compiere/model/MJournalGenerator.java b/org.adempiere.base/src/org/compiere/model/MJournalGenerator.java index 52df835e6b..45c3160891 100644 --- a/org.adempiere.base/src/org/compiere/model/MJournalGenerator.java +++ b/org.adempiere.base/src/org/compiere/model/MJournalGenerator.java @@ -38,7 +38,7 @@ import org.compiere.util.CLogger; public class MJournalGenerator extends X_GL_JournalGenerator { /** - * + * generated serial id */ private static final long serialVersionUID = -8044550395699815424L; @@ -47,16 +47,16 @@ public class MJournalGenerator extends X_GL_JournalGenerator private static CLogger s_log = CLogger.getCLogger(MJournalGenerator.class); /** - * UUID based Constructor - * @param ctx Context - * @param GL_JournalGenerator_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param GL_JournalGenerator_UU UUID key + * @param trxName Transaction + */ public MJournalGenerator(Properties ctx, String GL_JournalGenerator_UU, String trxName) { super(ctx, GL_JournalGenerator_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param GL_JournalGenerator_ID id diff --git a/org.adempiere.base/src/org/compiere/model/MJournalGeneratorLine.java b/org.adempiere.base/src/org/compiere/model/MJournalGeneratorLine.java index 344c2bdbb5..19f954384a 100644 --- a/org.adempiere.base/src/org/compiere/model/MJournalGeneratorLine.java +++ b/org.adempiere.base/src/org/compiere/model/MJournalGeneratorLine.java @@ -31,14 +31,14 @@ import java.util.Properties; import org.compiere.util.CLogger; /** - * GL Journal Generator Model + * GL Journal Generator Line Model * * @author Carlos Ruiz - GlobalQSS */ public class MJournalGeneratorLine extends X_GL_JournalGeneratorLine { /** - * + * generated serial id */ private static final long serialVersionUID = -8151648371117046820L; @@ -47,16 +47,16 @@ public class MJournalGeneratorLine extends X_GL_JournalGeneratorLine private static CLogger s_log = CLogger.getCLogger(MJournalGeneratorLine.class); /** - * UUID based Constructor - * @param ctx Context - * @param GL_JournalGeneratorLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param GL_JournalGeneratorLine_UU UUID key + * @param trxName Transaction + */ public MJournalGeneratorLine(Properties ctx, String GL_JournalGeneratorLine_UU, String trxName) { super(ctx, GL_JournalGeneratorLine_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param GL_JournalGeneratorLine_ID id diff --git a/org.adempiere.base/src/org/compiere/model/MJournalGeneratorSource.java b/org.adempiere.base/src/org/compiere/model/MJournalGeneratorSource.java index 2c2481159e..0cf3c0c4ed 100644 --- a/org.adempiere.base/src/org/compiere/model/MJournalGeneratorSource.java +++ b/org.adempiere.base/src/org/compiere/model/MJournalGeneratorSource.java @@ -30,14 +30,14 @@ import java.util.Properties; import org.compiere.util.CLogger; /** - * GL Journal Generator Model + * GL Journal Generator Source Model * * @author Carlos Ruiz - GlobalQSS */ public class MJournalGeneratorSource extends X_GL_JournalGeneratorSource { /** - * + * generated serial id */ private static final long serialVersionUID = 7489445330989092988L; @@ -46,16 +46,16 @@ public class MJournalGeneratorSource extends X_GL_JournalGeneratorSource private static CLogger s_log = CLogger.getCLogger(MJournalGeneratorSource.class); /** - * UUID based Constructor - * @param ctx Context - * @param GL_JournalGeneratorSource_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param GL_JournalGeneratorSource_UU UUID key + * @param trxName Transaction + */ public MJournalGeneratorSource(Properties ctx, String GL_JournalGeneratorSource_UU, String trxName) { super(ctx, GL_JournalGeneratorSource_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param GL_JournalGeneratorSource_ID id diff --git a/org.adempiere.base/src/org/compiere/model/MJournalLine.java b/org.adempiere.base/src/org/compiere/model/MJournalLine.java index 478644ad21..6c0c32e52c 100644 --- a/org.adempiere.base/src/org/compiere/model/MJournalLine.java +++ b/org.adempiere.base/src/org/compiere/model/MJournalLine.java @@ -28,7 +28,7 @@ import org.compiere.util.Msg; import org.compiere.util.Util; /** - * Journal Line Model + * GL Journal Line Model * * @author Jorg Janke * @author Cristina Ghita @@ -39,16 +39,16 @@ import org.compiere.util.Util; public class MJournalLine extends X_GL_JournalLine { /** - * + * generated serial id */ private static final long serialVersionUID = 253571209449736797L; /** - * UUID based Constructor - * @param ctx Context - * @param GL_JournalLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param GL_JournalLine_UU UUID key + * @param trxName Transaction + */ public MJournalLine(Properties ctx, String GL_JournalLine_UU, String trxName) { super(ctx, GL_JournalLine_UU, trxName); if (Util.isEmpty(GL_JournalLine_UU)) @@ -122,9 +122,8 @@ public class MJournalLine extends X_GL_JournalLine return m_parent; } // getParent - /** Currency Precision */ - protected int m_precision = 2; + protected int m_precision = 2; /** Account Combination */ protected MAccount m_account = null; /** Account Element */ @@ -168,8 +167,9 @@ public class MJournalLine extends X_GL_JournalLine /** * Set Currency Rate - * @param CurrencyRate check for null (->one) + * @param CurrencyRate check for null or negative value (->one) */ + @Override public void setCurrencyRate (BigDecimal CurrencyRate) { if (CurrencyRate == null) @@ -188,7 +188,7 @@ public class MJournalLine extends X_GL_JournalLine /** * Set Accounted Amounts only if not 0. - * Amounts overwritten in beforeSave - set conversion rate + * Amounts overwritten in beforeSave - set conversion rate. * @param AmtAcctDr Dr * @param AmtAcctCr Cr */ @@ -294,13 +294,13 @@ public class MJournalLine extends X_GL_JournalLine } return acct.isDocControlled(); } // isDocControlled - - - /************************************************************************** + + /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (newRecord && getParent().isProcessed()) { @@ -317,7 +317,6 @@ public class MJournalLine extends X_GL_JournalLine if (getC_ConversionType_ID() == 0) setC_ConversionType_ID(getParent().getC_ConversionType_ID()); - // idempiere 344 - nmicoud if (!getOrCreateCombination()) return false; if (getC_ValidCombination_ID() <= 0) @@ -326,7 +325,6 @@ public class MJournalLine extends X_GL_JournalLine return false; } fillDimensionsFromCombination(); - // end idempiere 344 - nmicoud // Acct Amts BigDecimal rate = getCurrencyRate(); @@ -349,6 +347,7 @@ public class MJournalLine extends X_GL_JournalLine * @param success true if success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -362,6 +361,7 @@ public class MJournalLine extends X_GL_JournalLine * @param success true if deleted * @return true if success */ + @Override protected boolean afterDelete (boolean success) { if (!success) @@ -401,7 +401,9 @@ public class MJournalLine extends X_GL_JournalLine return no == 1; } // updateJournalTotal - /** Update combination and optionally **/ + /** + * Get or create new valid combination record. Set C_ValidCombination_ID. + */ protected boolean getOrCreateCombination() { if (getC_ValidCombination_ID() == 0 @@ -477,7 +479,9 @@ public class MJournalLine extends X_GL_JournalLine return true; } // getOrCreateCombination - /** Fill Accounting Dimensions from line combination **/ + /** + * Fill Accounting Dimensions from line valid combination. + */ protected void fillDimensionsFromCombination() { if (getC_ValidCombination_ID() > 0) diff --git a/org.adempiere.base/src/org/compiere/model/MLabel.java b/org.adempiere.base/src/org/compiere/model/MLabel.java index 52eb8ded39..a95ae5cd52 100644 --- a/org.adempiere.base/src/org/compiere/model/MLabel.java +++ b/org.adempiere.base/src/org/compiere/model/MLabel.java @@ -33,7 +33,7 @@ import java.util.UUID; import org.compiere.util.Env; /** - * Label Model + * Record Label Model */ public class MLabel extends X_AD_Label { private static final long serialVersionUID = -964945898771768568L; @@ -73,11 +73,11 @@ public class MLabel extends X_AD_Label { }; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Label_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Label_UU UUID key + * @param trxName Transaction + */ public MLabel(Properties ctx, String AD_Label_UU, String trxName) { super(ctx, AD_Label_UU, trxName); } @@ -103,10 +103,12 @@ public class MLabel extends X_AD_Label { } /** + *
         	 * Calculates the label css style based on priorities:
         	 * 1- Label style;
         	 * 2- Category style;
        -	 * 3- Label Hash to Hex 
        +	 * 3- Label Hash to Hex
        +	 * 
        * @return css style */ public String buildStyle() { @@ -128,6 +130,10 @@ public class MLabel extends X_AD_Label { return result.toString(); } + /** + * @param AD_Style_ID + * @return css + */ private String buildStyle(int AD_Style_ID) { StringBuilder result = new StringBuilder(); @@ -161,6 +167,13 @@ public class MLabel extends X_AD_Label { return VIVID_COLORS[colorIndex]; } + /** + * Get Label record by name + * @param ctx + * @param name + * @param trxName + * @return MLabel + */ public static MLabel getByName(Properties ctx, String name, String trxName) { String sqlWhere = " AD_Client_ID=? AND UPPER(Name) LIKE ?"; diff --git a/org.adempiere.base/src/org/compiere/model/MLabelAssignment.java b/org.adempiere.base/src/org/compiere/model/MLabelAssignment.java index 2a448cc079..5ab3e9991d 100644 --- a/org.adempiere.base/src/org/compiere/model/MLabelAssignment.java +++ b/org.adempiere.base/src/org/compiere/model/MLabelAssignment.java @@ -37,16 +37,16 @@ import org.compiere.util.Util; */ public class MLabelAssignment extends X_AD_LabelAssignment { /** - * + * generated serial id */ private static final long serialVersionUID = 310053368504090622L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_LabelAssignment_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_LabelAssignment_UU UUID key + * @param trxName Transaction + */ public MLabelAssignment(Properties ctx, String AD_LabelAssignment_UU, String trxName) { super(ctx, AD_LabelAssignment_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MLabelCategory.java b/org.adempiere.base/src/org/compiere/model/MLabelCategory.java index 74314b5aa1..88bc77beca 100644 --- a/org.adempiere.base/src/org/compiere/model/MLabelCategory.java +++ b/org.adempiere.base/src/org/compiere/model/MLabelCategory.java @@ -48,11 +48,11 @@ public class MLabelCategory extends X_AD_LabelCategory implements ImmutablePOSup private static CCache s_cacheAll = new CCache(Table_Name, Table_Name+"_Of_Client", 5); /** - * UUID based Constructor - * @param ctx Context - * @param AD_LabelCategory_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_LabelCategory_UU UUID key + * @param trxName Transaction + */ public MLabelCategory(Properties ctx, String AD_LabelCategory_UU, String trxName) { super(ctx, AD_LabelCategory_UU, trxName); } @@ -115,7 +115,7 @@ public class MLabelCategory extends X_AD_LabelCategory implements ImmutablePOSup } /** - * Load Constructor + * Copy Constructor * @param copy */ public MLabelCategory(MLabelCategory copy) @@ -124,7 +124,7 @@ public class MLabelCategory extends X_AD_LabelCategory implements ImmutablePOSup } /** - * Load Constructor + * Copy Constructor * @param ctx * @param copy */ @@ -134,7 +134,7 @@ public class MLabelCategory extends X_AD_LabelCategory implements ImmutablePOSup } /** - * Load Constructor + * Copy Constructor * @param ctx * @param copy * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MLabelCategoryTable.java b/org.adempiere.base/src/org/compiere/model/MLabelCategoryTable.java index 0b380bdfce..fbf505df6b 100644 --- a/org.adempiere.base/src/org/compiere/model/MLabelCategoryTable.java +++ b/org.adempiere.base/src/org/compiere/model/MLabelCategoryTable.java @@ -33,14 +33,17 @@ import java.util.Properties; * Label Category Table Model */ public class MLabelCategoryTable extends X_AD_LabelCategoryTable { + /** + * Generated serial id + */ private static final long serialVersionUID = -964945828771768568L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_LabelCategoryTable_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_LabelCategoryTable_UU UUID key + * @param trxName Transaction + */ public MLabelCategoryTable(Properties ctx, String AD_LabelCategoryTable_UU, String trxName) { super(ctx, AD_LabelCategoryTable_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MLandedCost.java b/org.adempiere.base/src/org/compiere/model/MLandedCost.java index 68ecf42d77..066ad263a6 100644 --- a/org.adempiere.base/src/org/compiere/model/MLandedCost.java +++ b/org.adempiere.base/src/org/compiere/model/MLandedCost.java @@ -35,13 +35,12 @@ import org.compiere.util.Util; public class MLandedCost extends X_C_LandedCost { /** - * + * generated serial id */ private static final long serialVersionUID = -5645509613930428050L; - /** - * Get Costs of Invoice Line + * Get Landed Costs of Invoice Line * @param il invoice line * @return array of landed cost lines */ @@ -79,21 +78,20 @@ public class MLandedCost extends X_C_LandedCost /** Logger */ private static CLogger s_log = CLogger.getCLogger (MLandedCost.class); - /** - * UUID based Constructor - * @param ctx Context - * @param C_LandedCost_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_LandedCost_UU UUID key + * @param trxName Transaction + */ public MLandedCost(Properties ctx, String C_LandedCost_UU, String trxName) { super(ctx, C_LandedCost_UU, trxName); if (Util.isEmpty(C_LandedCost_UU)) setInitialDefaults(); } - /*************************************************************************** + /** * Standard Constructor * * @param ctx context @@ -130,6 +128,7 @@ public class MLandedCost extends X_C_LandedCost * @param newRecord new * @return true if ok */ + @Override protected boolean beforeSave (boolean newRecord) { // One Reference @@ -149,8 +148,8 @@ public class MLandedCost extends X_C_LandedCost } // beforeSave /** - * Allocate Costs. - * Done at Invoice Line Level + * Allocate Landed Costs. + * Done at Invoice Line Level. * @return error message or "" */ public String allocateCosts() @@ -163,6 +162,7 @@ public class MLandedCost extends X_C_LandedCost * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MLandedCost["); diff --git a/org.adempiere.base/src/org/compiere/model/MLandedCostAllocation.java b/org.adempiere.base/src/org/compiere/model/MLandedCostAllocation.java index f40d4b06ba..928c5a9926 100644 --- a/org.adempiere.base/src/org/compiere/model/MLandedCostAllocation.java +++ b/org.adempiere.base/src/org/compiere/model/MLandedCostAllocation.java @@ -37,13 +37,12 @@ import org.compiere.util.Util; public class MLandedCostAllocation extends X_C_LandedCostAllocation { /** - * + * generated serial id */ private static final long serialVersionUID = -8645283018475474574L; - /** - * Get Cost Allocations for invoice Line + * Get Landed Cost Allocations for invoice Line * @param ctx context * @param C_InvoiceLine_ID invoice line * @param trxName trx @@ -81,21 +80,20 @@ public class MLandedCostAllocation extends X_C_LandedCostAllocation /** Logger */ private static CLogger s_log = CLogger.getCLogger (MLandedCostAllocation.class); - - + /** - * UUID based Constructor - * @param ctx Context - * @param C_LandedCostAllocation_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_LandedCostAllocation_UU UUID key + * @param trxName Transaction + */ public MLandedCostAllocation(Properties ctx, String C_LandedCostAllocation_UU, String trxName) { super(ctx, C_LandedCostAllocation_UU, trxName); if (Util.isEmpty(C_LandedCostAllocation_UU)) setInitialDefaults(); } - /*************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_LandedCostAllocation_ID id @@ -127,7 +125,6 @@ public class MLandedCostAllocation extends X_C_LandedCostAllocation { super (ctx, rs, trxName); } // MLandedCostAllocation - /** * Parent Constructor @@ -159,10 +156,10 @@ public class MLandedCostAllocation extends X_C_LandedCostAllocation * Set Allocation Qty (e.g. free products) * @param Qty */ + @Override public void setQty (BigDecimal Qty) { super.setQty (Qty); } // setQty - - + } // MLandedCostAllocation diff --git a/org.adempiere.base/src/org/compiere/model/MLanguage.java b/org.adempiere.base/src/org/compiere/model/MLanguage.java index f86aee2bd5..db8464e693 100644 --- a/org.adempiere.base/src/org/compiere/model/MLanguage.java +++ b/org.adempiere.base/src/org/compiere/model/MLanguage.java @@ -47,7 +47,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MLanguage extends X_AD_Language implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 6553711529361500744L; @@ -57,7 +57,7 @@ public class MLanguage extends X_AD_Language implements ImmutablePOSupport private static final ImmutablePOCache s_cache = new ImmutablePOCache(Table_Name, Table_Name+"|AD_Language", 100, false); /** - * Get Language Model from Language + * Get Language Model from Language (immutable) * @param ctx context * @param lang language * @return language @@ -68,7 +68,7 @@ public class MLanguage extends X_AD_Language implements ImmutablePOSupport } // getMLanguage /** - * Get Language Model from AD_Language + * Get Language Model from AD_Language (immutable) * @param ctx context * @param AD_Language language e.g. en_US * @return language or null @@ -88,10 +88,10 @@ public class MLanguage extends X_AD_Language implements ImmutablePOSupport } // get /** - * Load Languages (variants) with Language + * Load Languages via ISO code * @param ctx context - * @param LanguageISO language (2 letter) e.g. en - * @return language + * @param LanguageISO language ISO code (2 letter) e.g. en + * @return array of MLanguage */ public static MLanguage[] getWithLanguage (Properties ctx, String LanguageISO) { @@ -102,7 +102,7 @@ public class MLanguage extends X_AD_Language implements ImmutablePOSupport } // get /** - * Maintain all active languages + * Maintain translation of all active languages * @param ctx context */ public static void maintain (Properties ctx) @@ -117,16 +117,16 @@ public class MLanguage extends X_AD_Language implements ImmutablePOSupport } // maintain /** - * UUID based Constructor - * @param ctx Context - * @param AD_Language_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Language_UU UUID key + * @param trxName Transaction + */ public MLanguage(Properties ctx, String AD_Language_UU, String trxName) { super(ctx, AD_Language_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param AD_Language_ID id @@ -170,7 +170,7 @@ public class MLanguage extends X_AD_Language implements ImmutablePOSupport } // MLanguage /** - * + * Copy constructor * @param ctx * @param copy */ @@ -179,7 +179,7 @@ public class MLanguage extends X_AD_Language implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -199,6 +199,7 @@ public class MLanguage extends X_AD_Language implements ImmutablePOSupport * String Representation * @return info */ + @Override public String toString() { StringBuilder str = new StringBuilder("MLanguage[").append(getAD_Language()).append("-").append(getName()) @@ -217,12 +218,9 @@ public class MLanguage extends X_AD_Language implements ImmutablePOSupport m_locale = new Locale (getLanguageISO(), getCountryCode()); return m_locale; } // getLocale - /** * Get (Short) Date Format. - * The date format must parseable by org.compiere.grid.ed.MDocDate - * i.e. leading zero for date and month * @return date format MM/dd/yyyy - dd.MM.yyyy */ public SimpleDateFormat getDateFormat() @@ -310,6 +308,7 @@ public class MLanguage extends X_AD_Language implements ImmutablePOSupport * @param newRecord new * @return true/false */ + @Override protected boolean beforeSave (boolean newRecord) { String dp = getDatePattern(); @@ -387,6 +386,7 @@ public class MLanguage extends X_AD_Language implements ImmutablePOSupport * @param success success * @return true if saved */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -395,9 +395,8 @@ public class MLanguage extends X_AD_Language implements ImmutablePOSupport if (log.isLoggable(Level.FINE)) log.fine("Active Languages=" + no); return true; } // afterSave - - /************************************************************************** + /** * Maintain Translation * @param add if true add missing records - otherwise delete * @return number of records deleted/inserted diff --git a/org.adempiere.base/src/org/compiere/model/MLdapAccess.java b/org.adempiere.base/src/org/compiere/model/MLdapAccess.java index cf912e0671..f8bde8bb05 100755 --- a/org.adempiere.base/src/org/compiere/model/MLdapAccess.java +++ b/org.adempiere.base/src/org/compiere/model/MLdapAccess.java @@ -19,7 +19,6 @@ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; - /** * Ldap Access Log * @@ -28,18 +27,17 @@ import java.util.Properties; */ public class MLdapAccess extends X_AD_LdapAccess { - /** - * + * generated serial id */ private static final long serialVersionUID = 7873484319494804583L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_LdapAccess_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_LdapAccess_UU UUID key + * @param trxName Transaction + */ public MLdapAccess(Properties ctx, String AD_LdapAccess_UU, String trxName) { super(ctx, AD_LdapAccess_UU, trxName); } @@ -65,8 +63,4 @@ public class MLdapAccess extends X_AD_LdapAccess { super (ctx, rs, trxName); } // MLdapAccess - - - - } // MLdapAccess diff --git a/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java b/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java index 434208d55e..e0b229bfbe 100755 --- a/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java @@ -27,7 +27,6 @@ import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Msg; - /** * LDAP Server Model * @@ -37,13 +36,13 @@ import org.compiere.util.Msg; public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProcessor { /** - * + * generated serial id */ private static final long serialVersionUID = -1477519989047580644L; /** - * Get Active LDAP Server - * @return array of Servers + * Get Active LDAP Processor + * @return array of processors */ public static MLdapProcessor[] getActive(Properties ctx) { @@ -76,16 +75,16 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce private static CLogger log = CLogger.getCLogger (MLdapProcessor.class); /** - * UUID based Constructor - * @param ctx Context - * @param AD_LdapProcessor_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_LdapProcessor_UU UUID key + * @param trxName Transaction + */ public MLdapProcessor(Properties ctx, String AD_LdapProcessor_UU, String trxName) { super(ctx, AD_LdapProcessor_UU, trxName); } - /************************************************************************** + /** * Ldap Processor * @param ctx context * @param AD_LdapProcessor_ID id @@ -120,6 +119,7 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce * Get Server ID * @return id */ + @Override public String getServerID () { return "Ldap" + get_ID(); @@ -184,8 +184,8 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce } // getLogs /** - * Delete old Request Log - * @return number of records + * Delete old processor logs + * @return number of records deleted */ public int deleteLog() { @@ -209,7 +209,7 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce /** * Get Frequency Type (n/a) - * @return minute + * @return FREQUENCYTYPE_Minute */ public String getFrequencyType() { @@ -220,6 +220,7 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder ("MLdapProcessor["); @@ -228,9 +229,8 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce .append ("]"); return sb.toString (); } // toString - - - /************************************************************************** + + /** * Authenticate and Authorize * @param ldapUser MLdapUser object * @param usr user name @@ -487,8 +487,9 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce /** * Find Interest Area - * @param interset Name client name - * @return AD_Client_ID + * @param AD_Client_ID + * @param interestArea + * @return R_InterestArea_ID */ private int findInterestArea (int AD_Client_ID, String interestArea) { diff --git a/org.adempiere.base/src/org/compiere/model/MLdapProcessorLog.java b/org.adempiere.base/src/org/compiere/model/MLdapProcessorLog.java index 1ae4f51631..c8cdacd133 100755 --- a/org.adempiere.base/src/org/compiere/model/MLdapProcessorLog.java +++ b/org.adempiere.base/src/org/compiere/model/MLdapProcessorLog.java @@ -21,26 +21,24 @@ import java.util.Properties; import org.compiere.util.Util; - /** - * LDAP Server Log + * LDAP Processor Log * @author Jorg Janke * @version $Id$ */ public class MLdapProcessorLog extends X_AD_LdapProcessorLog implements AdempiereProcessorLog { - /** - * + * generated serial id */ private static final long serialVersionUID = -2587778949013986055L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_LdapProcessorLog_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_LdapProcessorLog_UU UUID key + * @param trxName Transaction + */ public MLdapProcessorLog(Properties ctx, String AD_LdapProcessorLog_UU, String trxName) { super(ctx, AD_LdapProcessorLog_UU, trxName); if (Util.isEmpty(AD_LdapProcessorLog_UU)) diff --git a/org.adempiere.base/src/org/compiere/model/MLdapUser.java b/org.adempiere.base/src/org/compiere/model/MLdapUser.java index 54cacb8519..c2adf56742 100755 --- a/org.adempiere.base/src/org/compiere/model/MLdapUser.java +++ b/org.adempiere.base/src/org/compiere/model/MLdapUser.java @@ -16,7 +16,7 @@ *****************************************************************************/ package org.compiere.model; -/* +/** * MLdapUser, data object stores the user information such as userid, * password, organization and so on. */ @@ -37,7 +37,7 @@ public class MLdapUser { } - /* + /** * Reset attributes */ public void reset() diff --git a/org.adempiere.base/src/org/compiere/model/MLocation.java b/org.adempiere.base/src/org/compiere/model/MLocation.java index 1515cbffda..752019f7cf 100644 --- a/org.adempiere.base/src/org/compiere/model/MLocation.java +++ b/org.adempiere.base/src/org/compiere/model/MLocation.java @@ -49,7 +49,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MLocation extends X_C_Location implements Comparator, ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -3421958100626539835L; @@ -60,7 +60,7 @@ public class MLocation extends X_C_Location implements Comparator, Immut public static String LOCATION_MAPS_DESTINATION_ADDRESS = MSysConfig.getValue(MSysConfig.LOCATION_MAPS_DESTINATION_ADDRESS); /** - * Get Location from Cache + * Get Location from Cache (Immutable) * @param C_Location_ID id * @param trxName transaction * @return MLocation @@ -122,7 +122,7 @@ public class MLocation extends X_C_Location implements Comparator, Immut } /** - * Load Location with ID if Business Partner Location + * Load Location via Business Partner Location id * @param ctx context * @param C_BPartner_Location_ID Business Partner Location * @param trxName transaction @@ -164,21 +164,20 @@ public class MLocation extends X_C_Location implements Comparator, Immut private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 100, 30); /** Static Logger */ private static CLogger s_log = CLogger.getCLogger(MLocation.class); - /** - * UUID based Constructor - * @param ctx Context - * @param C_Location_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Location_UU UUID key + * @param trxName Transaction + */ public MLocation(Properties ctx, String C_Location_UU, String trxName) { super(ctx, C_Location_UU, trxName); if (Util.isEmpty(C_Location_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_Location_ID id @@ -216,7 +215,6 @@ public class MLocation extends X_C_Location implements Comparator, Immut } // MLocation /** - * Full Constructor * @param ctx context * @param C_Country_ID country * @param C_Region_ID region @@ -243,7 +241,7 @@ public class MLocation extends X_C_Location implements Comparator, Immut } // MLocation /** - * + * Copy constructor * @param copy */ public MLocation(MLocation copy) @@ -252,7 +250,7 @@ public class MLocation extends X_C_Location implements Comparator, Immut } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -262,7 +260,7 @@ public class MLocation extends X_C_Location implements Comparator, Immut } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -332,9 +330,9 @@ public class MLocation extends X_C_Location implements Comparator, Immut } // getCountryName /** - * Get Country Line - * @param local if true only foreign country is returned - * @return country or null + * Get Country Name + * @param local if true return null for default country + * @return country name or null */ public String getCountry (boolean local) { @@ -343,10 +341,11 @@ public class MLocation extends X_C_Location implements Comparator, Immut return null; return getCountryName(); } // getCountry + /** - * Get Country Line - * @param local if true only foreign country is returned - * @return country or null + * Get Translated Country Name + * @param local if true return null for default country + * @return country name or null */ public String getCountry (boolean local, String language) { @@ -420,7 +419,7 @@ public class MLocation extends X_C_Location implements Comparator, Immut } // getRegion /** - * Get (local) Region Name + * Get Region Name * @return region Name or "" */ public String getRegionName() @@ -430,7 +429,7 @@ public class MLocation extends X_C_Location implements Comparator, Immut /** * Get Region Name - * @param getFromRegion get from region (not locally) + * @param getFromRegion true to get from region (C_Region) * @return region Name or "" */ public String getRegionName (boolean getFromRegion) @@ -447,7 +446,6 @@ public class MLocation extends X_C_Location implements Comparator, Immut regionName = ""; return regionName; } // getRegionName - /** * Compares to current record @@ -482,7 +480,7 @@ public class MLocation extends X_C_Location implements Comparator, Immut } // equals /** - * Equals if "" or Null + * Case insensitive equal check (null treated as "") * @param c1 c1 * @param c2 c2 * @return true if equal (ignore case) @@ -498,9 +496,10 @@ public class MLocation extends X_C_Location implements Comparator, Immut /** * Equals - * @param cmp comparator + * @param cmp object to compare * @return true if ID the same */ + @Override public boolean equals (Object cmp) { if (cmp == null) @@ -510,6 +509,7 @@ public class MLocation extends X_C_Location implements Comparator, Immut return equals(cmp); } // equals + @Override public int hashCode() { assert false : "hashCode not designed"; @@ -517,7 +517,7 @@ public class MLocation extends X_C_Location implements Comparator, Immut } /** - * Print Address Reverse Order + * Is Print Address in Reverse Order * @return true if reverse depending on country */ public boolean isAddressLinesReverse() @@ -527,7 +527,6 @@ public class MLocation extends X_C_Location implements Comparator, Immut return getCountry().isAddressLinesLocalReverse(); return getCountry().isAddressLinesReverse(); } // isAddressLinesReverse - /** * Get formatted City Region Postal line @@ -539,8 +538,10 @@ public class MLocation extends X_C_Location implements Comparator, Immut } // getCityRegionPostal /** - * Parse according City/Postal/Region according to displaySequence. - * @C@ - City @R@ - Region @P@ - Postal @A@ - PostalAdd + *
        +	 *  Parse City/Postal/Region according to displaySequence.
        +	 *  @C@ - City   @R@ - Region   @P@ - Postal   @A@ - PostalAdd
        +	 *  
        * @param c country * @return parsed String */ @@ -616,13 +617,13 @@ public class MLocation extends X_C_Location implements Comparator, Immut String retValue = Util.replace(outStr.toString(), "\\n", "\n"); if (log.isLoggable(Level.FINEST)) log.finest("parseCRP - " + c.getDisplaySequence() + " -> " + retValue); return retValue; - } // parseContext - + } // parseCRP - /************************************************************************** + /** * Return printable String representation * @return String */ + @Override public String toString() { StringBuilder retStr = new StringBuilder(); @@ -719,6 +720,7 @@ public class MLocation extends X_C_Location implements Comparator, Immut * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getAD_Org_ID() != 0) @@ -774,6 +776,7 @@ public class MLocation extends X_C_Location implements Comparator, Immut * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -821,8 +824,8 @@ public class MLocation extends X_C_Location implements Comparator, Immut } // afterSave /** - * Get edited Value (MLocation) for GoogleMaps / IDEMPIERE-147 - * @return String address + * Get formatted address for GoogleMap / IDEMPIERE-147 + * @return formatted address for GoogleMap */ public String getMapsLocation() { @@ -838,6 +841,10 @@ public class MLocation extends X_C_Location implements Comparator, Immut return address.toString().replace(" ", "+"); } + /** + * @param columnName + * @return field length for column + */ public static int getFieldLength(String columnName) { MTable loctable = MTable.get(Env.getCtx(), Table_ID); MColumn column = loctable.getColumn(columnName); diff --git a/org.adempiere.base/src/org/compiere/model/MLocationLookup.java b/org.adempiere.base/src/org/compiere/model/MLocationLookup.java index ae7263f8c3..6ecd3dd119 100644 --- a/org.adempiere.base/src/org/compiere/model/MLocationLookup.java +++ b/org.adempiere.base/src/org/compiere/model/MLocationLookup.java @@ -26,7 +26,7 @@ import org.compiere.util.KeyNamePair; import org.compiere.util.NamePair; /** - * Address Loaction Lookup Model. + * Address Location Lookup Model. * * @author Jorg Janke * @version $Id: MLocationLookup.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $ @@ -35,7 +35,7 @@ public final class MLocationLookup extends Lookup implements Serializable { /** - * + * generated serial id */ private static final long serialVersionUID = 7238110708451510319L; @@ -55,31 +55,33 @@ public final class MLocationLookup extends Lookup /** * Get Display for Value (not cached) - * @param value Location_ID - * @return String Value + * @param key Location_ID + * @return display text */ - public String getDisplay (Object value) + @Override + public String getDisplay (Object key) { - if (value == null) + if (key == null) return null; - MLocation loc = getLocation (value, null); + MLocation loc = getLocation (key, null); if (loc == null){ - StringBuilder msgreturn = new StringBuilder("<").append(value.toString()).append(">"); + StringBuilder msgreturn = new StringBuilder("<").append(key.toString()).append(">"); return msgreturn.toString(); } return loc.toString(); } // getDisplay /** - * Get Object of Key Value - * @param value value - * @return Object or null + * Get NamePair of Key Value + * @param key value + * @return NamePair or null */ - public NamePair get (Object value) + @Override + public NamePair get (Object key) { - if (value == null) + if (key == null) return null; - MLocation loc = getLocation (value, null); + MLocation loc = getLocation (key, null); if (loc == null) return null; return new KeyNamePair (loc.getC_Location_ID(), loc.toString()); @@ -88,23 +90,28 @@ public final class MLocationLookup extends Lookup /** * The Lookup contains the key * @param key Location_ID - * @return true if key known + * @return true if key exists */ + @Override public boolean containsKey (Object key) { return getLocation(key, null) != null; } // containsKey + /** + * Same as {@link #containsKey(Object)} in this class + */ + @Override public boolean containsKeyNoDirect (Object key) { return containsKey(key); } - /************************************************************************** + /** * Get Location * @param key ID as string or integer * @param trxName transaction - * @return Location + * @return Location or null */ public MLocation getLocation (Object key, String trxName) { @@ -132,9 +139,9 @@ public final class MLocationLookup extends Lookup /** * Get underlying fully qualified Table.Column Name. - * Used for VLookup.actionButton (Zoom) - * @return column name + * @return "C_Location.C_Location_ID" */ + @Override public String getColumnName() { return "C_Location.C_Location_ID"; @@ -157,6 +164,7 @@ public final class MLocationLookup extends Lookup * @param temporary force load for temporary display * @return null */ + @Override public ArrayList getData (boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary, boolean shortlist) // IDEMPIERE 90 { log.log(Level.SEVERE, "not implemented"); diff --git a/org.adempiere.base/src/org/compiere/model/MLocator.java b/org.adempiere.base/src/org/compiere/model/MLocator.java index bb9370e793..7fe93e1d8d 100644 --- a/org.adempiere.base/src/org/compiere/model/MLocator.java +++ b/org.adempiere.base/src/org/compiere/model/MLocator.java @@ -30,7 +30,7 @@ import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; /** - * Warehouse Locator Object + * Warehouse Locator Model * * @author Jorg Janke * @author victor.perez@e-evolution.com @@ -40,12 +40,12 @@ import org.idempiere.cache.ImmutablePOSupport; public class MLocator extends X_M_Locator implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 539879105479299988L; /** - * Get oldest Default Locator of warehouse with locator + * Get oldest Default Locator of warehouse for M_Locator_ID * @param ctx context * @param M_Locator_ID locator * @return locator or null @@ -83,8 +83,7 @@ public class MLocator extends X_M_Locator implements ImmutablePOSupport } // getDefault /** - * FR [ 1966333 ] - * Get oldest Default Locator of warehouse with locator + * Get highest priority default Locator of warehouse (smaller PriorityNo is of higher priority) * @param warehouse * @return locator or null */ @@ -118,21 +117,30 @@ public class MLocator extends X_M_Locator implements ImmutablePOSupport return retValue; } // getDefault - + /** + * Get the Locator with the combination or create new one (if user has permission) + * @param ctx + * @param M_Warehouse_ID + * @param Value + * @param X + * @param Y + * @param Z + * @return locator (or null if no existing locator and user has no insert permission on MLocator) + */ public static MLocator get (Properties ctx, int M_Warehouse_ID, String Value, String X, String Y, String Z) { return get (ctx, M_Warehouse_ID, Value, X, Y, Z, 0); } /** - * Get the Locator with the combination or create new one (when user has permission) + * Get the Locator with the combination or create new one (if user has permission) * @param ctx Context * @param M_Warehouse_ID warehouse * @param Value value * @param X x * @param Y y * @param Z z - * @return locator (or null when no insert permission on MLocator) + * @return locator (or null if no existing locator and user has no insert permission on MLocator) */ public static MLocator get (Properties ctx, int M_Warehouse_ID, String Value, String X, String Y, String Z, int M_LocatorType_ID) @@ -237,21 +245,20 @@ public class MLocator extends X_M_Locator implements ImmutablePOSupport /** Logger */ private static CLogger s_log = CLogger.getCLogger (MLocator.class); - - + /** - * UUID based Constructor - * @param ctx Context - * @param M_Locator_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_Locator_UU UUID key + * @param trxName Transaction + */ public MLocator(Properties ctx, String M_Locator_UU, String trxName) { super(ctx, M_Locator_UU, trxName); if (Util.isEmpty(M_Locator_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Locator Constructor * @param ctx Context * @param M_Locator_ID id @@ -298,7 +305,7 @@ public class MLocator extends X_M_Locator implements ImmutablePOSupport } // MLocator /** - * + * Copy constructor * @param copy */ public MLocator(MLocator copy) @@ -307,7 +314,7 @@ public class MLocator extends X_M_Locator implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -317,7 +324,7 @@ public class MLocator extends X_M_Locator implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -366,9 +373,9 @@ public class MLocator extends X_M_Locator implements ImmutablePOSupport } // getWarehouseName /** - * Can Locator Store Product + * No op, always return true * @param M_Product_ID id - * @return true if can be stored + * @return No op, always return true */ public boolean isCanStoreProduct (int M_Product_ID) { diff --git a/org.adempiere.base/src/org/compiere/model/MLocatorLookup.java b/org.adempiere.base/src/org/compiere/model/MLocatorLookup.java index b054f7277d..f966658aa1 100644 --- a/org.adempiere.base/src/org/compiere/model/MLocatorLookup.java +++ b/org.adempiere.base/src/org/compiere/model/MLocatorLookup.java @@ -36,19 +36,18 @@ import org.compiere.util.Util; /** * Warehouse Locator Lookup Model. - * (Lookup Model is model.Lookup.java) * * @author Jorg Janke * @version $Id: MLocatorLookup.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL + * @author Teo Sarca, SC ARHIPAC SERVICE SRL *
      • BF [ 1892920 ] Locators fieldshould be ordered by Warehouse/Value *
      • FR [ 2306161 ] Removed limit of 200 on max number of locators. */ public final class MLocatorLookup extends Lookup implements Serializable { /** - * + * generated serial id */ private static final long serialVersionUID = -6041455174391573888L; @@ -121,7 +120,7 @@ public final class MLocatorLookup extends Lookup implements Serializable /** * Get Only Wahrehouse - * @return warehouse + * @return M_Warehouse_ID */ public int getOnly_Warehouse_ID() { @@ -139,7 +138,7 @@ public final class MLocatorLookup extends Lookup implements Serializable /** * Get Only Product - * @return Product + * @return M_Product_ID */ public int getOnly_Product_ID() { @@ -149,6 +148,7 @@ public final class MLocatorLookup extends Lookup implements Serializable /** * Wait until async Load Complete */ + @Override public void loadComplete() { if (m_loader != null) @@ -165,10 +165,12 @@ public final class MLocatorLookup extends Lookup implements Serializable } // loadComplete /** - * Get value - * @param key key - * @return value value + * Get KeyNamePair via key value. + * Delegate to {@link #getDirect(Object, boolean, String)} if key not in local lookup cache({@link #m_lookup}). + * @param key key value + * @return KeyNamePair */ + @Override public NamePair get (Object key) { if (key == null) @@ -195,18 +197,19 @@ public final class MLocatorLookup extends Lookup implements Serializable } // get /** - * Get Display value - * @param value value - * @return String to display + * Get Display text + * @param key key value + * @return display text */ - public String getDisplay (Object value) + @Override + public String getDisplay (Object key) { - if (value == null) + if (key == null) return ""; // - NamePair display = get (value); + NamePair display = get (key); if (display == null){ - StringBuilder msgreturn = new StringBuilder("<").append(value.toString()).append(">"); + StringBuilder msgreturn = new StringBuilder("<").append(key.toString()).append(">"); return msgreturn.toString(); } return display.toString(); @@ -217,22 +220,27 @@ public final class MLocatorLookup extends Lookup implements Serializable * @param key key * @return true, if lookup contains key */ + @Override public boolean containsKey (Object key) { return m_lookup.containsKey(key); } // containsKey + /** + * Same as {@link #containsKey(Object)} in this lookup implementation. + */ + @Override public boolean containsKeyNoDirect (Object key) { return containsKey(key); } /** - * Get Data Direct from Table + * Get from MLocator cache or DB * @param keyValue integer key value - * @param saveInCache save in cache + * @param saveInCache true save in lookup cache * @param trxName transaction - * @return Object directly loaded + * @return KeyNamePair */ public NamePair getDirect (Object keyValue, boolean saveInCache, String trxName) { @@ -248,10 +256,10 @@ public final class MLocatorLookup extends Lookup implements Serializable } // getDirect /** - * Get Data Direct from Table + * Get from MLocator cache or DB * @param keyValue integer key value * @param trxName transaction - * @return Object directly loaded + * @return MLocator */ public MLocator getMLocator (Object keyValue, String trxName) { @@ -274,6 +282,7 @@ public final class MLocatorLookup extends Lookup implements Serializable /** * @return a string representation of the object. */ + @Override public String toString() { StringBuilder msgreturn = new StringBuilder("MLocatorLookup[Size=").append(m_lookup.size()).append("]"); @@ -312,6 +321,9 @@ public final class MLocatorLookup extends Lookup implements Serializable return false; } // isValid + /** + * @return true if local lookup cache need refresh + */ private boolean isNeedRefresh() { if (!Util.isEmpty(m_validationCode)) @@ -342,13 +354,13 @@ public final class MLocatorLookup extends Lookup implements Serializable return false; } - /************************************************************************** - * Loader + /** + * Data Loader */ class Loader extends Thread implements Serializable { /** - * + * generated serial id */ private static final long serialVersionUID = 3472186635409000236L; @@ -361,7 +373,7 @@ public final class MLocatorLookup extends Lookup implements Serializable } // Loader /** - * Load Lookup + * Load Lookup Data */ public void run() { @@ -449,8 +461,8 @@ public final class MLocatorLookup extends Lookup implements Serializable } // Loader /** - * Return info as ArrayList containing Locator, waits for the loader to finish - * @return Collection of lookup values + * Return data as Locator ArrayList, waits for loader to finish if loading is in progress. + * @return Collection of MLocator */ public Collection getData () { @@ -474,13 +486,14 @@ public final class MLocatorLookup extends Lookup implements Serializable } // getData /** - * Return data as sorted ArrayList + * Get lookup data * @param mandatory mandatory * @param onlyValidated only validated * @param onlyActive only active * @param temporary force load for temporary display * @return ArrayList of lookup values */ + @Override public ArrayList getData (boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary, boolean shortlist) // IDEMPIERE 90 { // create list @@ -497,11 +510,11 @@ public final class MLocatorLookup extends Lookup implements Serializable return list; } // getArray - /** - * Refresh Values + * Refresh local lookup cache * @return new size of lookup */ + @Override public int refresh() { if (log.isLoggable(Level.FINE)) log.fine("start"); @@ -518,6 +531,10 @@ public final class MLocatorLookup extends Lookup implements Serializable return m_lookup.size(); } // refresh + /** + * Call {@link #refresh()} if {@link #isNeedRefresh()} return true. + * @return lookup size + */ public int refreshIfNeeded() { if (m_loader != null && m_loader.isAlive()) diff --git a/org.adempiere.base/src/org/compiere/model/MLocatorType.java b/org.adempiere.base/src/org/compiere/model/MLocatorType.java index c5104f7192..9b68d5d3cb 100644 --- a/org.adempiere.base/src/org/compiere/model/MLocatorType.java +++ b/org.adempiere.base/src/org/compiere/model/MLocatorType.java @@ -40,7 +40,7 @@ import org.idempiere.cache.ImmutablePOSupport; */ public class MLocatorType extends X_M_LocatorType implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 3021833597380696668L; @@ -80,18 +80,18 @@ public class MLocatorType extends X_M_LocatorType implements ImmutablePOSupport private static CLogger s_log = CLogger.getCLogger (MLocatorType.class); /** - * UUID based Constructor - * @param ctx Context - * @param M_LocatorType_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_LocatorType_UU UUID key + * @param trxName Transaction + */ public MLocatorType(Properties ctx, String M_LocatorType_UU, String trxName) { super(ctx, M_LocatorType_UU, trxName); if (Util.isEmpty(M_LocatorType_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Locator Constructor * @param ctx Context * @param M_LocatorType_ID id @@ -123,7 +123,7 @@ public class MLocatorType extends X_M_LocatorType implements ImmutablePOSupport } // MLocatorType /** - * + * Copy constructor * @param copy */ public MLocatorType(MLocatorType copy) { @@ -131,7 +131,7 @@ public class MLocatorType extends X_M_LocatorType implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -140,7 +140,7 @@ public class MLocatorType extends X_M_LocatorType implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -154,6 +154,7 @@ public class MLocatorType extends X_M_LocatorType implements ImmutablePOSupport * Get String Representation * @return Name */ + @Override public String toString() { return getName(); } // toString diff --git a/org.adempiere.base/src/org/compiere/model/MLookup.java b/org.adempiere.base/src/org/compiere/model/MLookup.java index 8a9d464bc3..7008c43dc9 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookup.java +++ b/org.adempiere.base/src/org/compiere/model/MLookup.java @@ -36,7 +36,6 @@ import org.compiere.util.CLogMgt; import org.compiere.util.DB; import org.compiere.util.DisplayType; import org.compiere.util.Env; -import org.compiere.util.Ini; import org.compiere.util.KeyNamePair; import org.compiere.util.NamePair; import org.compiere.util.ValueNamePair; @@ -58,7 +57,7 @@ import org.compiere.util.ValueNamePair; public final class MLookup extends Lookup implements Serializable { /** - * + * generated serial id */ private static final long serialVersionUID = 2288661955135689187L; @@ -74,13 +73,6 @@ public final class MLookup extends Lookup implements Serializable m_tabNo = TabNo; if (log.isLoggable(Level.FINE)) log.fine(m_info.KeyColumn); - // load into local lookup, if already cached - if (Ini.isClient()) - { - if (MLookupCache.loadFromCache (m_info, m_lookup)) - return; - } - // Don't load Search or CreatedBy/UpdatedBy if (m_info.DisplayType == DisplayType.Search || m_info.DisplayType == DisplayType.SearchUU || m_info.IsCreadedUpdatedBy) @@ -132,6 +124,7 @@ public final class MLookup extends Lookup implements Serializable private boolean m_hasShortListItems = false; // IDEMPIERE 90 private final static int MAX_NAMEPAIR_CACHE_SIZE = 1000; + /** * Dispose */ @@ -157,7 +150,7 @@ public final class MLookup extends Lookup implements Serializable } // dispose /** - * Wait until async Load Complete + * Wait until asynchronous Load Complete */ public void loadComplete() { @@ -177,10 +170,10 @@ public final class MLookup extends Lookup implements Serializable } // loadComplete /** - * Get value (name) for key. - * If not found return null; - * @param key key (Integer for Keys or String for Lists) - * @return value + * Get NamePair/KeyNamePair for key. + * If not found return null. + * @param key key value (Integer for Keys or String for Lists) + * @return NamePair/KeyNamePair */ public NamePair get (Object key, boolean includeDirect) { @@ -209,14 +202,14 @@ public final class MLookup extends Lookup implements Serializable { if (log.isLoggable(Level.FINER)) log.finer((m_info.KeyColumn==null ? "ID="+m_info.Column_ID : m_info.KeyColumn) + ": waiting for Loader"); loadComplete(); - // is most current + // try again after loading completed retValue = (NamePair)m_lookup.get(key); if (retValue != null) return retValue; } if (includeDirect) { - // Try to get it directly + // Try to get it directly from DB boolean cacheLocal = m_info.IsValidated ; return getDirect(key, false, cacheLocal); // do NOT cache } @@ -224,19 +217,30 @@ public final class MLookup extends Lookup implements Serializable return null; } // get + /** + * Get NamePair/KeyNamePair for key. + * @param key + * @return NamePair/KeyNamePair or null + */ public NamePair get(Object key) { return get(key, true); } + /** + * Get NamePair/KeyNamePair for key.
        + * If not found in local lookup cache, do not try to load direct from DB. + * @param key + * @return NamePair/KeyNamePair or null + */ public NamePair getNoDirect(Object key) { return get(key, false); } /** - * Get Display value (name). - * If not found return key embedded in inactive signs. - * @param key key - * @return value + * Get Display Text.
        + * If not found, return key embedded in "<>". + * @param key key value + * @return display text */ public String getDisplay (Object key) { @@ -273,9 +277,8 @@ public final class MLookup extends Lookup implements Serializable } // getDisplay /** - * The Lookup contains the key * @param key key - * @return true if key is known + * @return true if key exists in local lookup cache or in DB */ public boolean containsKey (Object key) { @@ -291,9 +294,8 @@ public final class MLookup extends Lookup implements Serializable } // containsKey /** - * The Lookup contains the key, do not get direct * @param key key - * @return true if key is known + * @return true if key exists in local lookup cache (do not check DB) */ public boolean containsKeyNoDirect (Object key) { @@ -311,6 +313,7 @@ public final class MLookup extends Lookup implements Serializable /** * @return a string representation of the object. */ + @Override public String toString() { StringBuilder msgreturn = new StringBuilder("MLookup[").append(m_info.KeyColumn).append(",Column_ID=").append(m_info.Column_ID) @@ -326,6 +329,7 @@ public final class MLookup extends Lookup implements Serializable * @return true if this object is the same as the obj * argument; false otherwise. */ + @Override public boolean equals(Object obj) { if (obj instanceof MLookup) @@ -337,6 +341,7 @@ public final class MLookup extends Lookup implements Serializable return false; } // equals + @Override public int hashCode() { assert false : "hashCode not designed"; @@ -354,7 +359,7 @@ public final class MLookup extends Lookup implements Serializable /** * Is it all loaded - * @return true, if all loaded + * @return true if all loaded */ public boolean isAllLoaded() { @@ -363,8 +368,9 @@ public final class MLookup extends Lookup implements Serializable /** * Is the List fully Validated - * @return true, if validated + * @return true if validated (i.e validation code have been parsed) */ + @Override public boolean isValidated() { if (m_info == null) @@ -376,25 +382,26 @@ public final class MLookup extends Lookup implements Serializable * Get Validation SQL * @return Validation SQL */ + @Override public String getValidation() { return m_info.ValidationCode; } // getValidation /** - * Get Reference Value - * @return Reference Value + * Get Reference Value ID + * @return AD_Reference_Value_ID */ public int getAD_Reference_Value_ID() { return m_info.AD_Reference_Value_ID; } // getAD_Reference_Value_ID - /** * Has inactive elements in list - * @return true, if list contains inactive values + * @return true if list contains inactive values */ + @Override public boolean hasInactive() { return m_hasInactive; @@ -409,9 +416,9 @@ public final class MLookup extends Lookup implements Serializable } /** - * Return info as ArrayList containing Value/KeyNamePair - * @param onlyValidated only validated - * @param loadParent get Data even for parent lookups + * Return data as ArrayList containing Value/KeyNamePair. + * @param onlyValidated true to reload lookup data if validation code have not been parsed or needs re-parse + * @param loadParent true to load data for lookup with IsParent=true * @return List */ private ArrayList getData (boolean onlyValidated, boolean loadParent) @@ -450,6 +457,7 @@ public final class MLookup extends Lookup implements Serializable * @param shortlist * @return list */ + @Override public ArrayList getData (boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary, boolean shortlist) // idempiere 90 { // create list @@ -506,17 +514,18 @@ public final class MLookup extends Lookup implements Serializable private HashMap m_lookupDirect = null; private Future m_loaderFuture; + @Override public NamePair getDirect (Object key, boolean saveInCache, boolean cacheLocal) { return getDirect(key, saveInCache, cacheLocal, null); } // getDirect /** - * Get Data Direct from Table. + * Get Data Direct from DB. * @param key key - * @param saveInCache save in cache for r/w - * @param cacheLocal cache locally for r/o - * @return value + * @param saveInCache true save in local lookup cache + * @param cacheLocal true to save in direct lookup cache + * @return NamePair/KeyNamePir */ public NamePair getDirect (Object key, boolean saveInCache, boolean cacheLocal, String trxName) { @@ -637,7 +646,6 @@ public final class MLookup extends Lookup implements Serializable m_hasInactive = true; return directValue; } // getDirect - @Override public NamePair[] getDirect(Object[] keys) @@ -789,6 +797,7 @@ public final class MLookup extends Lookup implements Serializable * Get Zoom Query String * @return Zoom SQL Where Clause */ + @Override public MQuery getZoomQuery() { return m_info.ZoomQuery; @@ -798,6 +807,7 @@ public final class MLookup extends Lookup implements Serializable * Get underlying fully qualified Table.Column Name * @return Key Column */ + @Override public String getColumnName() { return m_info.KeyColumn; @@ -805,15 +815,18 @@ public final class MLookup extends Lookup implements Serializable /** * Refresh and return number of items read. - * Get get data of parent lookups * @return no of items read */ + @Override public int refresh () { if (m_refreshing) return 0; return refresh(true); } // refresh + /** + * @return number of items read + */ public int refreshItemsAndCache() { if (m_refreshing) return 0; @@ -830,7 +843,7 @@ public final class MLookup extends Lookup implements Serializable /** * Refresh and return number of items read - * @param loadParent get data of parent lookups + * @param loadParent true to load data of lookup with IsParent=true * @return no of items refresh */ public int refresh (boolean loadParent) @@ -865,7 +878,7 @@ public final class MLookup extends Lookup implements Serializable /** * Do the actual loading from database - * @param loadParent + * @param loadParent true to load data for lookup with IsParent=true * @return number of records loaded */ private int loadData(boolean loadParent) @@ -899,6 +912,10 @@ public final class MLookup extends Lookup implements Serializable m_lookupDirect.clear(); } // removeAllElements + /** + * @param info + * @return true if validation code have been parsed and doesn't need re-parse + */ private boolean isValidated(MLookupInfo info) { if (info.IsValidated) return true; @@ -916,8 +933,6 @@ public final class MLookup extends Lookup implements Serializable return m_info; } - - private final static CCache>> s_keyNamePairCache = new CCache>>(null, "MLookup.KeyNamePairCache", 100, CCache.DEFAULT_EXPIRE_MINUTE, false, 500); private final static CCache>> s_valueNamePairCache = new CCache>>(null, "MLookup.ValueNamePairCache", 100, CCache.DEFAULT_EXPIRE_MINUTE, false, 500); @@ -980,13 +995,13 @@ public final class MLookup extends Lookup implements Serializable return vnpCache; } - /************************************************************************** - * MLookup Loader + /** + * Background Data Loader */ - class MLoader extends ContextRunnable implements Serializable + protected class MLoader extends ContextRunnable implements Serializable { /** - * + * generated serial id */ private static final long serialVersionUID = -7868426685745727939L; @@ -1001,7 +1016,7 @@ public final class MLookup extends Lookup implements Serializable private long m_startTime = System.currentTimeMillis(); /** - * Load Lookup + * Load data */ protected void doRun() { diff --git a/org.adempiere.base/src/org/compiere/model/MLookupCache.java b/org.adempiere.base/src/org/compiere/model/MLookupCache.java index 22cfd385fb..3affaf073c 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookupCache.java +++ b/org.adempiere.base/src/org/compiere/model/MLookupCache.java @@ -28,10 +28,11 @@ import org.compiere.util.CLogger; * MLookup Data Cache. * - not synchronized on purpose - * Called from MLookup. - * Only caches multiple use for a single window! * @author Jorg Janke * @version $Id: MLookupCache.java,v 1.2 2006/07/30 00:58:37 jjanke Exp $ + * @deprecated for deprecated swing client only */ +@Deprecated public class MLookupCache { /** Static Logger */ diff --git a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java index 2dd053f3c9..caaf9835ec 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java +++ b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java @@ -32,10 +32,10 @@ import org.compiere.util.Env; import org.compiere.util.Language; /** - * Create MLookups + * Factory to create MLookup instance. * - * @author Jorg Janke - * @version $Id: MLookupFactory.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ + * @author Jorg Janke + * @version $Id: MLookupFactory.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ * * @author Teo Sarca, SC ARHIPAC SERVICE SRL *
      • BF [ 1734394 ] MLookupFactory.getLookup_TableDirEmbed is not translated @@ -59,19 +59,18 @@ public class MLookupFactory /** List Reference Cache */ private static CCache s_cacheRefList = new CCache(I_AD_Ref_List.Table_Name, 30, CCache.DEFAULT_EXPIRE_MINUTE); // 1h - /** * Create MLookup * * @param ctx context for access * @param WindowNo window no - * @param AD_Reference_ID display type + * @param AD_Reference_ID lookup display type * @param Column_ID AD_Column_ID or AD_Process_Para_ID - * @param language report language + * @param language language * @param ColumnName key column name - * @param AD_Reference_Value_ID AD_Reference (List, Table) + * @param AD_Reference_Value_ID AD_Reference (List - AD_Ref_List, Table - AD_Ref_Table) * @param IsParent parent (prevents query to directly access value) - * @param ValidationCode optional SQL validation + * @param ValidationCode optional SQL validation/filter * @throws Exception if Lookup could not be created * @return MLookup */ @@ -87,11 +86,26 @@ public class MLookupFactory return new MLookup(info, 0); } // create + /** + * @param ctx + * @param WindowNo + * @param Column_ID + * @param AD_Reference_ID + * @return MLookupInfo + */ public static MLookupInfo getLookupInfo(Properties ctx, int WindowNo, int Column_ID, int AD_Reference_ID) { return getLookupInfo(ctx, WindowNo, 0, Column_ID, AD_Reference_ID); } + /** + * @param ctx + * @param WindowNo + * @param TabNo + * @param Column_ID + * @param AD_Reference_ID + * @return MLookupInfo + */ public static MLookupInfo getLookupInfo(Properties ctx, int WindowNo, int TabNo, int Column_ID, int AD_Reference_ID) { MColumn column = MColumn.get(ctx, Column_ID); @@ -131,14 +145,8 @@ public class MLookupFactory return new MLookup(info, TabNo); } // get - - /************************************************************************** + /** * Get Information for Lookups based on Column_ID for Table Columns or Process Parameters. - * - * The SQL returns three columns: - *
        -	 *		Key, Value, Name, IsActive	(where either key or value is null)
        -	 *  
        * @param ctx context for access * @param language report language * @param WindowNo window no @@ -161,13 +169,8 @@ public class MLookupFactory IsParent, ValidationCode); } // getLookupInfo - /************************************************************************** + /** * Get Information for Lookups based on Column_ID for Table Columns or Process Parameters. - * - * The SQL returns three columns: - *
        -	 *		Key, Value, Name, IsActive	(where either key or value is null)
        -	 *  
        * @param ctx context for access * @param language report language * @param WindowNo window no @@ -268,12 +271,11 @@ public class MLookupFactory return info; } // getLookupInfo - - /************************************************************************** - * Get Lookup SQL for Lists - * @param language report language - * @param AD_Reference_Value_ID reference value - * @return SELECT NULL, Value, Name, IsActive FROM AD_Ref_List + /** + * Get Lookup Info for List display type + * @param language language + * @param AD_Reference_Value_ID list reference id (AD_Ref_List) + * @return MLookupInfo */ static public MLookupInfo getLookup_List(Language language, int AD_Reference_Value_ID) { @@ -339,9 +341,9 @@ public class MLookupFactory } // getLookup_List /** - * Get Lookup SQL for List - * @param language report Language - * @param AD_Reference_Value_ID reference value + * Get Lookup SQL for List (for use as embedded query in SELECT) + * @param language Language + * @param AD_Reference_Value_ID list reference id (AD_Ref_List) * @param linkColumnName link column name * @return SELECT Name FROM AD_Ref_List WHERE AD_Reference_ID=x AND Value=linkColumn */ @@ -363,14 +365,13 @@ public class MLookupFactory return realSQL.toString(); } // getLookup_ListEmbed - /*************************************************************************** - * Get Lookup SQL for Table Lookup + /** + * Get Lookup Info for Table Lookup display type * @param ctx context for access and dynamic access * @param language report language * @param WindowNo window no - * @param AD_Reference_Value_ID reference value - * @return SELECT Key, NULL, Name, IsActive FROM Table - if KeyColumn end with _ID - * otherwise SELECT NULL, Key, Name, IsActive FROM Table + * @param AD_Reference_Value_ID table reference id (AD_Ref_Table) + * @return MLookupInfo */ static private MLookupInfo getLookup_Table (Properties ctx, Language language, int WindowNo, int AD_Reference_Value_ID) @@ -618,11 +619,11 @@ public class MLookupFactory } // getLookup_Table /** - * Get Embedded Lookup SQL for Table Lookup - * @param language report language + * Get Embedded Lookup SQL for Table Lookup display type + * @param language language * @param BaseColumn base column name * @param BaseTable base table name - * @param AD_Reference_Value_ID reference value + * @param AD_Reference_Value_ID table reference id (AD_Ref_Table) * @return SELECT Name FROM Table */ public static String getLookup_TableEmbed (Language language, @@ -755,14 +756,13 @@ public class MLookupFactory return embedSQL.toString(); } // getLookup_TableEmbed - - /************************************************************************** - * Get Lookup SQL for direct Table Lookup + /** + * Get Lookup Info for Table Direct lookup display type * @param ctx context for access - * @param language report language + * @param language language * @param ColumnName column name - * @param WindowNo Window (for SOTrx) - * @return SELECT Key, NULL, Name, IsActive from Table (fully qualified) + * @param WindowNo Window number + * @return MLookupInfo */ static private MLookupInfo getLookup_TableDir (Properties ctx, Language language, int WindowNo, String ColumnName) @@ -870,11 +870,24 @@ public class MLookupFactory return lInfo; } // getLookup_TableDir + /** + * @param language + * @param tableName + * @param list + * @return display columns + */ private static StringBuilder getDisplayColumn(Language language, String tableName, ArrayList list) { return getDisplayColumn(language, tableName, list, tableName); } + /** + * @param language + * @param TableName + * @param list + * @param baseTable + * @return display columns + */ private static StringBuilder getDisplayColumn(Language language, String TableName, ArrayList list, String baseTable) { @@ -962,9 +975,9 @@ public class MLookupFactory } /** - * Get embedded SQL for TableDir Lookup + * Get embedded SQL for TableDir Lookup display type * - * @param language report language + * @param language language * @param ColumnName column name * @param BaseTable base table * @return SELECT Column FROM TableName WHERE BaseTable.ColumnName=TableName.ColumnName @@ -976,9 +989,9 @@ public class MLookupFactory } // getLookup_TableDirEmbed /** - * Get embedded SQL for TableDir Lookup + * Get embedded SQL for TableDir Lookup display type * - * @param language report language + * @param language language * @param ColumnName column name * @param BaseTable base table * @param BaseColumn base column @@ -1036,6 +1049,10 @@ public class MLookupFactory return embedSQL.toString(); } // getLookup_TableDirEmbed + /** + * @param TableName + * @return identifier list for a table + */ private static ArrayList getListIdentifiers(String TableName) { ArrayList list = new ArrayList(); MTable table = MTable.get(Env.getCtx(), TableName); diff --git a/org.adempiere.base/src/org/compiere/model/MLookupInfo.java b/org.adempiere.base/src/org/compiere/model/MLookupInfo.java index 94fac2742e..3317581030 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookupInfo.java +++ b/org.adempiere.base/src/org/compiere/model/MLookupInfo.java @@ -29,7 +29,7 @@ import org.compiere.util.DB; import org.compiere.util.Util; /** - * Info Class for Lookup SQL (ValueObject) + * Info Class for Lookup (ValueObject) * * @author Jorg Janke * @version $Id: MLookupInfo.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ @@ -42,7 +42,9 @@ public class MLookupInfo implements Serializable, Cloneable * (This is more a development tool than used for production) * @param referenceName reference name * @return AD_Reference_ID + * @deprecated */ + @Deprecated public static int getAD_Reference_ID (String referenceName) { int retValue = 0; @@ -93,7 +95,9 @@ public class MLookupInfo implements Serializable, Cloneable * (This is more a development tool than used for production) * @param columnName column name * @return AD_Column_ID + * @deprecated */ + @Deprecated public static int getAD_Column_ID (String columnName) { int retValue = 0; @@ -135,11 +139,8 @@ public class MLookupInfo implements Serializable, Cloneable } return retValue; } // getAD_Column_ID - - /************************************************************************** - * Constructor. - * (called from MLookupFactory) + /** * @param sqlQuery SQL query * @param tableName table name * @param keyColumn key column @@ -218,6 +219,7 @@ public class MLookupInfo implements Serializable, Cloneable * String representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder ("MLookupInfo[") @@ -229,7 +231,7 @@ public class MLookupInfo implements Serializable, Cloneable /** * Clone - * @return deep copy + * @return deep copy clone */ public MLookupInfo cloneIt() { diff --git a/org.adempiere.base/src/org/compiere/model/MLot.java b/org.adempiere.base/src/org/compiere/model/MLot.java index b22f1cadfb..48bc51d407 100644 --- a/org.adempiere.base/src/org/compiere/model/MLot.java +++ b/org.adempiere.base/src/org/compiere/model/MLot.java @@ -38,7 +38,7 @@ import org.compiere.util.KeyNamePair; public class MLot extends X_M_Lot { /** - * + * generated serial id */ private static final long serialVersionUID = -2238962371935615958L; /** Logger */ @@ -116,19 +116,18 @@ public class MLot extends X_M_Lot list.toArray(retValue); return retValue; } // getProductLotPairs - /** - * UUID based Constructor - * @param ctx Context - * @param M_Lot_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_Lot_UU UUID key + * @param trxName Transaction + */ public MLot(Properties ctx, String M_Lot_UU, String trxName) { super(ctx, M_Lot_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param M_Lot_ID ID @@ -151,7 +150,6 @@ public class MLot extends X_M_Lot } // MLot /** - * Parent Constructor * @param ctl lot control * @param M_Product_ID product * @param Name name @@ -169,6 +167,7 @@ public class MLot extends X_M_Lot * String Representation * @return info */ + @Override public String toString() { return getName(); diff --git a/org.adempiere.base/src/org/compiere/model/MLotCtl.java b/org.adempiere.base/src/org/compiere/model/MLotCtl.java index 365619602a..79455b6799 100644 --- a/org.adempiere.base/src/org/compiere/model/MLotCtl.java +++ b/org.adempiere.base/src/org/compiere/model/MLotCtl.java @@ -30,16 +30,16 @@ import org.compiere.util.Util; public class MLotCtl extends X_M_LotCtl { /** - * + * generated serial id */ private static final long serialVersionUID = -1020114756336617138L; /** - * UUID based Constructor - * @param ctx Context - * @param M_LotCtl_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_LotCtl_UU UUID key + * @param trxName Transaction + */ public MLotCtl(Properties ctx, String M_LotCtl_UU, String trxName) { super(ctx, M_LotCtl_UU, trxName); if (Util.isEmpty(M_LotCtl_UU)) @@ -80,10 +80,10 @@ public class MLotCtl extends X_M_LotCtl } // MLotCtl /** - * Create new Lot. - * Increments Current Next and Commits + * Create and save new Lot. + * Increments Current Next and Save. * @param M_Product_ID product - * @return saved Lot + * @return new Lot */ public MLot createLot (int M_Product_ID) { diff --git a/org.adempiere.base/src/org/compiere/model/MLotCtlExclude.java b/org.adempiere.base/src/org/compiere/model/MLotCtlExclude.java index b1e8291efc..54857b9a2b 100644 --- a/org.adempiere.base/src/org/compiere/model/MLotCtlExclude.java +++ b/org.adempiere.base/src/org/compiere/model/MLotCtlExclude.java @@ -31,22 +31,22 @@ import java.util.Properties; import org.compiere.util.Env; /** + * Exclude create of Lot for a table (for e.g C_OrderLine). * @author hengsin - * */ public class MLotCtlExclude extends X_M_LotCtlExclude { /** - * + * generated serial id */ private static final long serialVersionUID = -7189245472896373850L; /** - * UUID based Constructor - * @param ctx Context - * @param M_LotCtlExclude_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_LotCtlExclude_UU UUID key + * @param trxName Transaction + */ public MLotCtlExclude(Properties ctx, String M_LotCtlExclude_UU, String trxName) { super(ctx, M_LotCtlExclude_UU, trxName); } @@ -70,7 +70,7 @@ public class MLotCtlExclude extends X_M_LotCtlExclude { } /** - * + * Copy constructor * @param copy */ public MLotCtlExclude(MLotCtlExclude copy) { @@ -78,7 +78,7 @@ public class MLotCtlExclude extends X_M_LotCtlExclude { } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -87,7 +87,7 @@ public class MLotCtlExclude extends X_M_LotCtlExclude { } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MMFAMethod.java b/org.adempiere.base/src/org/compiere/model/MMFAMethod.java index 4b1e4d302e..5d558dd0c3 100644 --- a/org.adempiere.base/src/org/compiere/model/MMFAMethod.java +++ b/org.adempiere.base/src/org/compiere/model/MMFAMethod.java @@ -22,7 +22,6 @@ * Contributors: * * - Carlos Ruiz (sponsored by FH) * **********************************************************************/ - package org.compiere.model; import java.sql.ResultSet; @@ -39,16 +38,16 @@ import org.compiere.util.CCache; */ public class MMFAMethod extends X_MFA_Method { /** - * + * generated serial id */ private static final long serialVersionUID = -7954271872310037840L; /** - * UUID based Constructor - * @param ctx Context - * @param MFA_Method_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param MFA_Method_UU UUID key + * @param trxName Transaction + */ public MMFAMethod(Properties ctx, String MFA_Method_UU, String trxName) { super(ctx, MFA_Method_UU, trxName); } @@ -76,8 +75,8 @@ public class MMFAMethod extends X_MFA_Method { } // MMFAMethod /** - * - * @return {@link IMFAMechanism} + * Get OSGi IMFAMechanism service + * @return {@link IMFAMechanism} service */ public IMFAMechanism getMFAMechanism() { ServiceQuery query = new ServiceQuery(); @@ -94,9 +93,9 @@ public class MMFAMethod extends X_MFA_Method { private static CCache> s_MFAMechanismReference = new CCache<>(null, "IMFAMechanism", 3, false); /** - * + * Get OSGi IMFAMechanism service * @param query - * @return {@link IMFAMechanism} + * @return {@link IMFAMechanism} service */ public static IMFAMechanism getMFAMechanismService(ServiceQuery query) { IMFAMechanism mechanism = null; diff --git a/org.adempiere.base/src/org/compiere/model/MMFARegisteredDevice.java b/org.adempiere.base/src/org/compiere/model/MMFARegisteredDevice.java index 953206c370..684dd44b8a 100644 --- a/org.adempiere.base/src/org/compiere/model/MMFARegisteredDevice.java +++ b/org.adempiere.base/src/org/compiere/model/MMFARegisteredDevice.java @@ -22,7 +22,6 @@ * Contributors: * * - Carlos Ruiz (sponsored by FH) * **********************************************************************/ - package org.compiere.model; import java.sql.ResultSet; @@ -35,16 +34,16 @@ import org.compiere.util.Env; */ public class MMFARegisteredDevice extends X_MFA_RegisteredDevice { /** - * + * generated serial id */ private static final long serialVersionUID = 7913538709234444407L; /** - * UUID based Constructor - * @param ctx Context - * @param MFA_RegisteredDevice_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param MFA_RegisteredDevice_UU UUID key + * @param trxName Transaction + */ public MMFARegisteredDevice(Properties ctx, String MFA_RegisteredDevice_UU, String trxName) { super(ctx, MFA_RegisteredDevice_UU, trxName); } @@ -72,8 +71,8 @@ public class MMFARegisteredDevice extends X_MFA_RegisteredDevice { } // MMFARegisteredDevice /** - * Validate if there is a non-expired device registered with that code - * @param identifier + * Validate if there is a non-expired device registered with identifier + * @param identifier device identifier * @return true if device is valid */ public static boolean isValid(String identifier) { @@ -86,10 +85,12 @@ public class MMFARegisteredDevice extends X_MFA_RegisteredDevice { } /** - * Set User/Contact. + * Set User/Contact. * @param AD_User_ID - * User within the system - Internal or Business Partner Contact - * Overridden to allow saving System record (zero ID) + *
        +     * User within the system - Internal or Business Partner Contact.
        +     * Overridden to allow saving System record (zero ID).
        +     * 
        */ @Override public void setAD_User_ID (int AD_User_ID) diff --git a/org.adempiere.base/src/org/compiere/model/MMFARegistration.java b/org.adempiere.base/src/org/compiere/model/MMFARegistration.java index ebe3b85345..b1ff9d9267 100644 --- a/org.adempiere.base/src/org/compiere/model/MMFARegistration.java +++ b/org.adempiere.base/src/org/compiere/model/MMFARegistration.java @@ -22,7 +22,6 @@ * Contributors: * * - Carlos Ruiz (sponsored by FH) * **********************************************************************/ - package org.compiere.model; import java.sql.ResultSet; @@ -38,16 +37,16 @@ import org.compiere.util.Env; */ public class MMFARegistration extends X_MFA_Registration { /** - * + * generated serial id */ private static final long serialVersionUID = -1441495978065471474L; /** - * UUID based Constructor - * @param ctx Context - * @param MFA_Registration_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param MFA_Registration_UU UUID key + * @param trxName Transaction + */ public MMFARegistration(Properties ctx, String MFA_Registration_UU, String trxName) { super(ctx, MFA_Registration_UU, trxName); } @@ -78,7 +77,7 @@ public class MMFARegistration extends X_MFA_Registration { * Validate if a method is already registered for this user * @param method * @param prm - * @return + * @return true if valid registration exists */ public static boolean alreadyExistsValid(MMFAMethod method, String prm) { List params = new ArrayList(); @@ -101,6 +100,12 @@ public class MMFARegistration extends X_MFA_Registration { return cnt != 0; } + /** + * Mark previous invalid registration as inactive. + * @param method + * @param prm + * @param reg + */ public static void invalidatePreviousPending(MMFAMethod method, String prm, MMFARegistration reg) { List params = new ArrayList(); params.add(Env.getAD_User_ID(method.getCtx())); @@ -146,7 +151,7 @@ public class MMFARegistration extends X_MFA_Registration { /** * Get the valid registrations from this user - * @return + * @return list of valid registrations */ public static List getValidRegistrationsFromUser() { final String where = "IsValid ='Y' AND AD_User_ID=? AND AD_Client_ID IN (0,?)"; @@ -160,7 +165,7 @@ public class MMFARegistration extends X_MFA_Registration { /** * If the user has valid registration mechanisms - * @return + * @return true if user has valid registration */ public static boolean userHasValidRegistration() { final String sql = "" @@ -176,8 +181,8 @@ public class MMFARegistration extends X_MFA_Registration { /** * Generate a validation code using the registered method - * @param reg - * @return + * @param reg registration record + * @return validation code */ public String generateValidationCode(MMFARegistration reg) { MMFAMethod method = new MMFAMethod(getCtx(), getMFA_Method_ID(), get_TrxName()); @@ -188,10 +193,10 @@ public class MMFARegistration extends X_MFA_Registration { /** * Validate the code using the registered method - * @param reg - * @param code + * @param reg registration record + * @param code validation code * @param setPreferred - * @return + * @return message on error, null when OK */ public String validateCode(MMFARegistration reg, String code, boolean setPreferred) { MMFAMethod method = new MMFAMethod(getCtx(), getMFA_Method_ID(), get_TrxName()); diff --git a/org.adempiere.base/src/org/compiere/model/MMailText.java b/org.adempiere.base/src/org/compiere/model/MMailText.java index e6392a7a2f..94cc816225 100644 --- a/org.adempiere.base/src/org/compiere/model/MMailText.java +++ b/org.adempiere.base/src/org/compiere/model/MMailText.java @@ -27,24 +27,24 @@ import org.compiere.util.Env; import org.compiere.util.Util; /** - * Request Mail Template Model. - * Cannot be cached as it holds PO/BPartner/User to parse + * Mail Template Model. + * Cannot be cached as it holds PO/BPartner/User to parse. * @author Jorg Janke * @version $Id: MMailText.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $ */ public class MMailText extends X_R_MailText { /** - * + * generated serial id */ private static final long serialVersionUID = -6458808409321394821L; /** - * UUID based Constructor - * @param ctx Context - * @param R_MailText_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param R_MailText_UU UUID key + * @param trxName Transaction + */ public MMailText(Properties ctx, String R_MailText_UU, String trxName) { super(ctx, R_MailText_UU, trxName); } @@ -90,9 +90,9 @@ public class MMailText extends X_R_MailText protected String m_language = null; /** - * Get parsed/translated Mail Text - * @param all concatenate all - * @return parsed/translated text + * Get translated and parsed Mail Text + * @param all true to concatenate mailtext, mailtext2 and mailtext3 + * @return translated and parsed text */ public String getMailText(boolean all) { @@ -100,10 +100,10 @@ public class MMailText extends X_R_MailText } /** - * Get parsed/translated Mail Text - * @param all concatenate all - * @param parsed - * @return parsed/translated text + * Get translated and parsed (if parsed argument is true) Mail Text + * @param all true to concatenate mailtext, mailtext2 and mailtext3 + * @param parsed true to parsed variables in text + * @return translated and parsed (if parsed argument is true) text */ public String getMailText(boolean all, boolean parsed) { @@ -124,8 +124,8 @@ public class MMailText extends X_R_MailText } // getMailText /** - * Get parsed/translated Mail Text - * @return parsed/translated text + * Get translated and parsed Mail Text + * @return translated and parsed text */ public String getMailText() { @@ -134,8 +134,8 @@ public class MMailText extends X_R_MailText } // getMailText /** - * Get parsed/translated Mail Text 2 - * @return parsed/translated text + * Get translated and parsed Mail Text 2 + * @return translated and parsed text */ public String getMailText2() { @@ -144,8 +144,8 @@ public class MMailText extends X_R_MailText } // getMailText2 /** - * Get parsed/translated Mail Text 2 - * @return parsed/translated text + * Get translated and parsed Mail Text 3 + * @return translated and parsed text */ public String getMailText3() { @@ -154,8 +154,8 @@ public class MMailText extends X_R_MailText } // getMailText3 /** - * Get parsed/translated Mail Header - * @return parsed/translated text + * Get translated and parsed Mail Header + * @return translated and parsed text */ public String getMailHeader() { @@ -163,9 +163,9 @@ public class MMailText extends X_R_MailText } /** - * Get parsed/translated Mail Header - * @param parsed - * @return parsed/translated text + * Get translated and parsed (if parsed argument is true) Header + * @param parsed true to parse variable in text + * @return translated and parsed (if parsed argument is true) text */ public String getMailHeader(boolean parsed) { @@ -173,8 +173,8 @@ public class MMailText extends X_R_MailText return parsed ? parse(m_MailHeader) : m_MailHeader; } // getMailHeader - /************************************************************************** - * Parse Text + /** + * Parse variables in text (@variable expression@) * @param text text * @return parsed text */ @@ -193,9 +193,9 @@ public class MMailText extends X_R_MailText } // parse /** - * Parse text + * Parse variables in text (@variable expression@) * @param text text - * @param po object + * @param po PO instance * @return parsed text */ protected String parse (String text, PO po) @@ -232,10 +232,10 @@ public class MMailText extends X_R_MailText } // parse /** - * Parse Variable - * @param variable variable + * Get value for a variable expression + * @param variable variable expression * @param po po - * @return translated variable or if not found the original tag + * @return value for variable or if not found the original variable expression */ protected String parseVariable (String variable, PO po) { @@ -243,7 +243,7 @@ public class MMailText extends X_R_MailText } // translate /** - * Set User for parse + * Set User for parsing of text * @param AD_User_ID user */ public void setUser (int AD_User_ID) @@ -252,8 +252,8 @@ public class MMailText extends X_R_MailText } // setUser /** - * Set User for parse - * @param user user + * Set User for parsing of text + * @param user MUser instance */ public void setUser (MUser user) { @@ -261,7 +261,7 @@ public class MMailText extends X_R_MailText } // setUser /** - * Set BPartner for parse + * Set BPartner for parsing of text * @param C_BPartner_ID bp */ public void setBPartner (int C_BPartner_ID) @@ -270,8 +270,8 @@ public class MMailText extends X_R_MailText } // setBPartner /** - * Set BPartner for parse - * @param bpartner bp + * Set BPartner for parsing of text + * @param bpartner MBPartner instance */ public void setBPartner (MBPartner bpartner) { @@ -279,8 +279,8 @@ public class MMailText extends X_R_MailText } // setBPartner /** - * Set PO for parse - * @param po po + * Set PO for parsing of text + * @param po PO instance */ public void setPO (PO po) { @@ -288,9 +288,9 @@ public class MMailText extends X_R_MailText } // setPO /** - * Set PO for parse - * @param po po - * @param analyse if set to true, search for BPartner/User + * Set PO for parsing of text + * @param po PO instance + * @param analyse true to search for BPartner/User from po */ public void setPO (PO po, boolean analyse) { @@ -321,7 +321,7 @@ public class MMailText extends X_R_MailText } // setPO /** - * Translate to BPartner Language + * Translate to BPartner Language or language from {@link #setLanguage(String)} call. */ protected void translate() { @@ -354,7 +354,7 @@ public class MMailText extends X_R_MailText /** * Get Translation * @param AD_Language language - * @return trl + * @return MMailTextTrl */ protected MMailTextTrl getTranslation (String AD_Language) { @@ -409,26 +409,42 @@ public class MMailText extends X_R_MailText String MailText3 = null; } // MMailTextTrl + /** + * Set language for translation of text + * @param language + */ public void setLanguage(String language) { m_language = language; } + /** + * @return PO instance + */ public PO getPO() { return m_po; } + /** + * @return MBPartner instance + */ public MBPartner getBPartner() { return m_bpartner; } + /** + * @return language for translation of text + */ public String getLanguage() { return m_language; } + /** + * @return MUser instance + */ public MUser getUser() { return m_user; diff --git a/org.adempiere.base/src/org/compiere/model/MMatchInv.java b/org.adempiere.base/src/org/compiere/model/MMatchInv.java index ded178461b..53b3277fec 100644 --- a/org.adempiere.base/src/org/compiere/model/MMatchInv.java +++ b/org.adempiere.base/src/org/compiere/model/MMatchInv.java @@ -29,30 +29,29 @@ import org.compiere.util.Util; /** * Match Invoice (Receipt<>Invoice) Model. - * Accounting: - * - Not Invoiced Receipts (relief) - * - IPV - * + *
        + *  Accounting:
        + *  - Not Invoiced Receipts (relief)
        + *  - IPV
        + *	
        * @author Jorg Janke * @version $Id: MMatchInv.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $ * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL + * @author Teo Sarca, SC ARHIPAC SERVICE SRL *
      • BF [ 1926113 ] MMatchInv.getNewerDateAcct() should work in trx - * @author victor.perez@e-evolution.com, e-Evolution http://www.e-evolution.com + * @author victor.perez@e-evolution.com, e-Evolution http://www.e-evolution.com *
      • FR [ 2520591 ] Support multiples calendar for Org * @see https://sourceforge.net/p/adempiere/feature-requests/631/ - * @author Bayu Cahya, Sistematika + * @author Bayu Cahya, Sistematika *
      • BF [ 2240484 ] Re MatchingPO, MMatchPO doesn't contains Invoice info - * */ public class MMatchInv extends X_M_MatchInv { /** - * + * generated serial id */ private static final long serialVersionUID = -6673764788466220541L; - /** * Get InOut-Invoice Matches * @param ctx context @@ -73,11 +72,10 @@ public class MMatchInv extends X_M_MatchInv return list.toArray (new MMatchInv[list.size()]); } // get - // MZ Goodwill /** - * Get Inv Matches for InvoiceLine + * Get InOut Matches for InvoiceLine * @param ctx context - * @param C_InvoiceLine_ID invoice + * @param C_InvoiceLine_ID invoice line * @param trxName transaction * @return array of matches */ @@ -92,12 +90,11 @@ public class MMatchInv extends X_M_MatchInv .list(); return list.toArray (new MMatchInv[list.size()]); } // getInvoiceLine - // end MZ /** - * Get Inv Matches for InOut + * Get Invoice Matches for InOut * @param ctx context - * @param M_InOut_ID shipment + * @param M_InOut_ID material receipt * @param trxName transaction * @return array of matches */ @@ -115,7 +112,7 @@ public class MMatchInv extends X_M_MatchInv } // getInOut /** - * Get Inv Matches for Invoice + * Get InOut Matches for Invoice * @param ctx context * @param C_Invoice_ID invoice * @param trxName transaction @@ -135,26 +132,24 @@ public class MMatchInv extends X_M_MatchInv .list(); return list.toArray (new MMatchInv[list.size()]); } // getInvoice - /** Static Logger */ @SuppressWarnings("unused") private static CLogger s_log = CLogger.getCLogger (MMatchInv.class); - /** - * UUID based Constructor - * @param ctx Context - * @param M_MatchInv_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_MatchInv_UU UUID key + * @param trxName Transaction + */ public MMatchInv(Properties ctx, String M_MatchInv_UU, String trxName) { super(ctx, M_MatchInv_UU, trxName); if (Util.isEmpty(M_MatchInv_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param M_MatchInv_ID id @@ -207,14 +202,13 @@ public class MMatchInv extends X_M_MatchInv setQty (qty); setProcessed(true); // auto } // MMatchInv - - - + /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { // Set Trx Date @@ -276,7 +270,7 @@ public class MMatchInv extends X_M_MatchInv } /** - * Get the later Date Acct from invoice or shipment + * Get the newer Date Acct between invoice and shipment * @return date or null */ public Timestamp getNewerDateAcct() @@ -301,12 +295,12 @@ public class MMatchInv extends X_M_MatchInv return invoiceDate; return shipDate; } // getNewerDateAcct - - + /** * Before Delete * @return true if acct was deleted */ + @Override protected boolean beforeDelete () { if (isPosted()) @@ -317,26 +311,26 @@ public class MMatchInv extends X_M_MatchInv } return true; } // beforeDelete - /** * After Delete * @param success success * @return success */ + @Override protected boolean afterDelete (boolean success) { if (success) { - // AZ Goodwill deleteMatchInvCostDetail(); - // end AZ } return success; } // afterDelete - // - //AZ Goodwill + /** + * Delete cost detail records for M_MatchInv + * @return empty string + */ protected String deleteMatchInvCostDetail() { // Get Account Schemas to delete MCostDetail @@ -361,9 +355,8 @@ public class MMatchInv extends X_M_MatchInv return ""; } - // Bayu, Sistematika /** - * Get Inv Matches for InOutLine + * Get Invoice Matches for InOutLine * @param ctx context * @param M_InOutLine_ID shipment * @param trxName transaction @@ -383,13 +376,11 @@ public class MMatchInv extends X_M_MatchInv .list(); return list.toArray (new MMatchInv[list.size()]); } // getInOutLine - // end Bayu /** - * Reverse MatchPO. + * Reverse this MatchInv document. * @param reversalDate - * @return message - * @throws Exception + * @return true if reversed */ public boolean reverse(Timestamp reversalDate) { @@ -413,7 +404,6 @@ public class MMatchInv extends X_M_MatchInv } return false; } - @Override public MInOutLine getM_InOutLine() throws RuntimeException { diff --git a/org.adempiere.base/src/org/compiere/model/MMatchPO.java b/org.adempiere.base/src/org/compiere/model/MMatchPO.java index 1b9f9fef21..38b82e19ee 100644 --- a/org.adempiere.base/src/org/compiere/model/MMatchPO.java +++ b/org.adempiere.base/src/org/compiere/model/MMatchPO.java @@ -46,10 +46,11 @@ import org.compiere.util.ValueNamePair; /** * Match PO Model. - * = Created when processing Shipment or Order - * - Updates Order (delivered, invoiced) - * - Creates PPV acct - * + *
        + *  Created when processing Shipment or Order
        + *  - Updates Order (delivered, invoiced)
        + *  - Creates PPV acct
        + *	
        * @author Jorg Janke * @version $Id: MMatchPO.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $ * @@ -70,7 +71,7 @@ import org.compiere.util.ValueNamePair; public class MMatchPO extends X_M_MatchPO { /** - * + * generated serial id */ private static final long serialVersionUID = 487498668807522050L; @@ -244,7 +245,6 @@ public class MMatchPO extends X_M_MatchPO return retValue; } // getInvoice - // MZ Goodwill /** * Get PO Matches for OrderLine * @param ctx context @@ -282,15 +282,14 @@ public class MMatchPO extends X_M_MatchPO list.toArray (retValue); return retValue; } // getOrderLine - // end MZ /** - * Find/Create PO(Inv) Match + * Update or Create Match PO record * @param iLine invoice line * @param sLine receipt line - * @param dateTrx date - * @param qty qty - * @return Match Record + * @param dateTrx transaction date + * @param qty qty to match + * @return Match PO Record */ public static MMatchPO create (MInvoiceLine iLine, MInOutLine sLine, Timestamp dateTrx, BigDecimal qty) @@ -354,6 +353,17 @@ public class MMatchPO extends X_M_MatchPO } } + /** + * Update or create MatchPO record (if needed, create MatchInv too). + * @param ctx + * @param iLine + * @param sLine + * @param C_OrderLine_ID + * @param dateTrx + * @param qty + * @param trxName + * @return Match PO record + */ protected static MMatchPO create(Properties ctx, MInvoiceLine iLine, MInOutLine sLine, int C_OrderLine_ID, Timestamp dateTrx, BigDecimal qty, String trxName) { @@ -681,6 +691,16 @@ public class MMatchPO extends X_M_MatchPO return retValue; } // create + /** + * Create MatchInv record + * @param mpo + * @param C_InvoiceLine_ID + * @param M_InOutLine_ID + * @param qty + * @param dateTrx + * @param trxName + * @return Match Inv record + */ protected static MMatchInv createMatchInv(MMatchPO mpo, int C_InvoiceLine_ID, int M_InOutLine_ID, BigDecimal qty, Timestamp dateTrx, String trxName) { Savepoint savepoint = null; @@ -738,7 +758,7 @@ public class MMatchPO extends X_M_MatchPO protected MMatchInv m_matchInv; /** - * Register the match inv created for immediate accounting purposes + * Register the match inv created for immediate accounting posting * @param matchInv */ protected void setMatchInvCreated(MMatchInv matchInv) { @@ -746,8 +766,9 @@ public class MMatchPO extends X_M_MatchPO } /** - * Get the match inv created for immediate accounting purposes - * Is cleared after read, so if you read twice second time it returns null + * Get the match inv created for immediate accounting posting.
        + * The Match Inv record reference is set to null after call, so if you call this method twice, the second call will returns null. + * @return Match Inv record or null */ public MMatchInv getMatchInvCreated() { MMatchInv tmp = m_matchInv; @@ -758,20 +779,19 @@ public class MMatchPO extends X_M_MatchPO /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MMatchPO.class); - /** - * UUID based Constructor - * @param ctx Context - * @param M_MatchPO_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_MatchPO_UU UUID key + * @param trxName Transaction + */ public MMatchPO(Properties ctx, String M_MatchPO_UU, String trxName) { super(ctx, M_MatchPO_UU, trxName); if (Util.isEmpty(M_MatchPO_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param M_MatchPO_ID id @@ -846,16 +866,15 @@ public class MMatchPO extends X_M_MatchPO setProcessed(true); // auto } // MMatchPO - /** Invoice Changed */ + /** Invoice Line Changed */ protected boolean m_isInvoiceLineChange = false; - /** InOut Changed */ + /** InOut Line Changed */ protected boolean m_isInOutLineChange = false; /** Order Line */ protected MOrderLine m_oLine = null; /** Invoice Line */ protected MInvoiceLine m_iLine = null; - - + /** * Set C_InvoiceLine_ID * @param line line @@ -934,7 +953,7 @@ public class MMatchPO extends X_M_MatchPO } // getOrderLine /** - * Get PriceActual from Invoice and convert it to Order Currency + * Get PriceActual from Invoice and convert it to Order Currency. * @return Price Actual in Order Currency */ public BigDecimal getInvoicePriceActual() @@ -980,7 +999,6 @@ public class MMatchPO extends X_M_MatchPO setM_AttributeSetInstance_ID(iol.getM_AttributeSetInstance_ID()); } - // Bayu, Sistematika // BF [ 2240484 ] Re MatchingPO, MMatchPO doesn't contains Invoice info // If newRecord, set c_invoiceline_id while null if (newRecord && getC_InvoiceLine_ID() == 0 && getReversal_ID()==0) @@ -1019,7 +1037,6 @@ public class MMatchPO extends X_M_MatchPO } } } - // end Bayu // Find OrderLine if (getC_OrderLine_ID() == 0) @@ -1208,10 +1225,9 @@ public class MMatchPO extends X_M_MatchPO // return success; } // afterSave - /** - * Get the later Date Acct from invoice or shipment + * Get the newer Date Acct between invoice and shipment * @return date or null */ public Timestamp getNewerDateAcct() @@ -1246,7 +1262,6 @@ public class MMatchPO extends X_M_MatchPO return invoiceDate; return shipDate; } // getNewerDateAcct - /** * Before Delete @@ -1263,11 +1278,10 @@ public class MMatchPO extends X_M_MatchPO } return true; } // beforeDelete - /** * After Delete. - * Set Order Qty Delivered/Invoiced + * Update Order Line Qty Delivered/Invoiced . * @param success success * @return success */ @@ -1292,6 +1306,7 @@ public class MMatchPO extends X_M_MatchPO * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MMatchPO["); @@ -1307,22 +1322,21 @@ public class MMatchPO extends X_M_MatchPO } // toString /** - * Reverse MatchPO. + * Reverse this MatchPO document. * @param reversalDate - * @return boolean + * @return true if reversed * @throws Exception */ - public boolean reverse(Timestamp reversalDate) { return reverse(reversalDate, false); } /** - * Reverse MatchPO. + * Reverse this MatchPO document. * @param reversalDate * @param reverseMatchingOnly true if MR is not reverse - * @return boolean + * @return true if reversed * @throws Exception */ @@ -1454,6 +1468,7 @@ public class MMatchPO extends X_M_MatchPO } /** + * Get or create Match PO record for order line. * @param C_OrderLine_ID * @param qty * @param sLine diff --git a/org.adempiere.base/src/org/compiere/model/MMeasure.java b/org.adempiere.base/src/org/compiere/model/MMeasure.java index 91a405fc5d..93eeb26754 100644 --- a/org.adempiere.base/src/org/compiere/model/MMeasure.java +++ b/org.adempiere.base/src/org/compiere/model/MMeasure.java @@ -38,7 +38,6 @@ import org.compiere.util.Util; import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; - /** * Performance Measure * @@ -54,7 +53,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MMeasure extends X_PA_Measure implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -3584012092877837973L; @@ -94,11 +93,11 @@ public class MMeasure extends X_PA_Measure implements ImmutablePOSupport = new ImmutableIntPOCache (Table_Name, 10); /** - * UUID based Constructor - * @param ctx Context - * @param PA_Measure_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param PA_Measure_UU UUID key + * @param trxName Transaction + */ public MMeasure(Properties ctx, String PA_Measure_UU, String trxName) { super(ctx, PA_Measure_UU, trxName); } @@ -126,7 +125,7 @@ public class MMeasure extends X_PA_Measure implements ImmutablePOSupport } // MMeasure /** - * + * Copy constructor * @param copy */ public MMeasure(MMeasure copy) @@ -135,7 +134,7 @@ public class MMeasure extends X_PA_Measure implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -145,7 +144,7 @@ public class MMeasure extends X_PA_Measure implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -156,6 +155,11 @@ public class MMeasure extends X_PA_Measure implements ImmutablePOSupport copyPO(copy); } + /** + * Get chart columns + * @param goal + * @return list of GraphColumn + */ public ArrayList getGraphColumnList(MGoal goal) { ArrayList list = new ArrayList(); @@ -338,6 +342,7 @@ public class MMeasure extends X_PA_Measure implements ImmutablePOSupport * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MMeasure["); @@ -350,6 +355,7 @@ public class MMeasure extends X_PA_Measure implements ImmutablePOSupport * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (MEASURETYPE_Calculated.equals(getMeasureType()) @@ -391,6 +397,7 @@ public class MMeasure extends X_PA_Measure implements ImmutablePOSupport * @param success success * @return succes */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { // Update Goals with Manual Measure @@ -401,7 +408,7 @@ public class MMeasure extends X_PA_Measure implements ImmutablePOSupport } // afterSave /** - * Update/save Goals + * Update Goals * @return true if updated */ public boolean updateGoals() @@ -494,7 +501,7 @@ public class MMeasure extends X_PA_Measure implements ImmutablePOSupport } // updateAchievementGoals /** - * Update/save Goals with Calculation + * Update Goals with Calculation measure type (MEASURETYPE_Calculated) * @return true if updated */ private boolean updateCalculatedGoals() @@ -541,7 +548,7 @@ public class MMeasure extends X_PA_Measure implements ImmutablePOSupport } // updateCalculatedGoals /** - * Update/save Goals with Ratios + * Update Goals with Ratios measure type (MEASURETYPE_Ratio) * @return true if updated */ private boolean updateRatios() @@ -552,7 +559,7 @@ public class MMeasure extends X_PA_Measure implements ImmutablePOSupport } // updateRatios /** - * Update/save Goals with Requests + * Update Goals with Requests measure type (MEASURETYPE_Request) * @return true if updated */ private boolean updateRequests() @@ -595,7 +602,7 @@ public class MMeasure extends X_PA_Measure implements ImmutablePOSupport } // updateRequests /** - * Update/save Goals with Projects + * Update Goals with Projects measure type (MEASURETYPE_Project) * @return true if updated */ private boolean updateProjects() @@ -637,7 +644,7 @@ public class MMeasure extends X_PA_Measure implements ImmutablePOSupport return true; } // updateProjects /** - * Update/save update User Defined + * Update goals with User Defined measure type * @return true if updated */ private boolean updateUserDefined() diff --git a/org.adempiere.base/src/org/compiere/model/MMeasureCalc.java b/org.adempiere.base/src/org/compiere/model/MMeasureCalc.java index c07e188542..73ae930eb5 100644 --- a/org.adempiere.base/src/org/compiere/model/MMeasureCalc.java +++ b/org.adempiere.base/src/org/compiere/model/MMeasureCalc.java @@ -37,7 +37,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MMeasureCalc extends X_PA_MeasureCalc implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -1334100963468705584L; @@ -77,16 +77,16 @@ public class MMeasureCalc extends X_PA_MeasureCalc implements ImmutablePOSupport = new ImmutableIntPOCache (Table_Name, 10); /** - * UUID based Constructor - * @param ctx Context - * @param PA_MeasureCalc_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param PA_MeasureCalc_UU UUID key + * @param trxName Transaction + */ public MMeasureCalc(Properties ctx, String PA_MeasureCalc_UU, String trxName) { super(ctx, PA_MeasureCalc_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param PA_MeasureCalc_ID id @@ -109,7 +109,7 @@ public class MMeasureCalc extends X_PA_MeasureCalc implements ImmutablePOSupport } // MMeasureCalc /** - * + * Copy constructor * @param copy */ public MMeasureCalc(MMeasureCalc copy) @@ -118,7 +118,7 @@ public class MMeasureCalc extends X_PA_MeasureCalc implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -128,7 +128,7 @@ public class MMeasureCalc extends X_PA_MeasureCalc implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -140,7 +140,7 @@ public class MMeasureCalc extends X_PA_MeasureCalc implements ImmutablePOSupport } /** - * Get Sql to return single value for the Performance Indicator + * Get SQL to return single value for the Performance Indicator * @param restrictions array of goal restrictions * @param MeasureScope scope of this value * @param MeasureDataType data type @@ -187,7 +187,7 @@ public class MMeasureCalc extends X_PA_MeasureCalc implements ImmutablePOSupport } // getSql /** - * Get Sql to value for the bar chart + * Get SQL to retrieve value for bar chart * @param restrictions array of goal restrictions * @param MeasureDisplay scope of this value * @param startDate optional report start date @@ -255,7 +255,7 @@ public class MMeasureCalc extends X_PA_MeasureCalc implements ImmutablePOSupport /** * Get Zoom Query * @param restrictions restrictions - * @param MeasureDisplay display + * @param MeasureDisplay measure display type (MGoal.MEASUREDISPLAY_*) * @param date date * @param role role * @return query @@ -329,7 +329,7 @@ public class MMeasureCalc extends X_PA_MeasureCalc implements ImmutablePOSupport } // getQuery /** - * Add Restrictions + * Add Restrictions to SQL * @param sql existing sql * @param restrictions restrictions * @param role role @@ -345,12 +345,12 @@ public class MMeasureCalc extends X_PA_MeasureCalc implements ImmutablePOSupport /** * Add Restrictions to SQL - * @param sql orig sql - * @param queryOnly incomplete sql for query restriction + * @param sql existing sql + * @param queryOnly if true, don't add role access SQL clause * @param restrictions restrictions * @param role role * @param tableName table name - * @param orgColumn org column + * @param orgColumn organization column * @param bpColumn bpartner column * @param pColumn product column * @return updated sql @@ -509,6 +509,7 @@ public class MMeasureCalc extends X_PA_MeasureCalc implements ImmutablePOSupport * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MMeasureCalc["); @@ -526,7 +527,8 @@ public class MMeasureCalc extends X_PA_MeasureCalc implements ImmutablePOSupport } /** - * Get the Where clause adding the WHERE keyword when needed + * Get where clause, add WHERE keyword if where clause not started with it + * @return where clause with "WHERE " keyword */ @Override public String getWhereClause() { diff --git a/org.adempiere.base/src/org/compiere/model/MMenu.java b/org.adempiere.base/src/org/compiere/model/MMenu.java index 70fb8f639b..126caa8502 100644 --- a/org.adempiere.base/src/org/compiere/model/MMenu.java +++ b/org.adempiere.base/src/org/compiere/model/MMenu.java @@ -31,7 +31,7 @@ import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; /** - * Menu Model + * Application Menu Model * * @author Jorg Janke * @author victor.perez@e-evolution.com @@ -41,16 +41,15 @@ import org.idempiere.cache.ImmutablePOSupport; */ public class MMenu extends X_AD_Menu implements ImmutablePOSupport { - /** - * + * generated serial id */ private static final long serialVersionUID = 8157805998814206274L; /** Cache */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 50); /** - * Get Menu method from cache + * Get Menu method from cache (immutable) * * @param AD_Menu_ID menu id */ @@ -60,7 +59,7 @@ public class MMenu extends X_AD_Menu implements ImmutablePOSupport } /** - * Get Menu method from cache + * Get Menu method from cache (immutable) * * @param ctx * @param AD_Menu_ID menu id @@ -100,23 +99,24 @@ public class MMenu extends X_AD_Menu implements ImmutablePOSupport } /** - * Get menues with where clause + * Get menus with where clause * @param ctx context * @param whereClause where clause w/o the actual WHERE - * @return MMenu + * @return MMenu[] * @deprecated */ + @Deprecated public static MMenu[] get (Properties ctx, String whereClause) { return get(ctx, whereClause, null); } /** - * Get menues with where clause + * Get menus with where clause * @param ctx context * @param whereClause where clause w/o the actual WHERE * @param trxName transaction - * @return MMenu + * @return array of MMenu */ public static MMenu[] get (Properties ctx, final String whereClause, String trxName) { @@ -132,18 +132,18 @@ public class MMenu extends X_AD_Menu implements ImmutablePOSupport private static CLogger s_log = CLogger.getCLogger (MMenu.class); /** - * UUID based Constructor - * @param ctx Context - * @param AD_Menu_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Menu_UU UUID key + * @param trxName Transaction + */ public MMenu(Properties ctx, String AD_Menu_UU, String trxName) { super(ctx, AD_Menu_UU, trxName); if (Util.isEmpty(AD_Menu_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param AD_Menu_ID id @@ -182,6 +182,7 @@ public class MMenu extends X_AD_Menu implements ImmutablePOSupport * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { // Reset info @@ -208,14 +209,14 @@ public class MMenu extends X_AD_Menu implements ImmutablePOSupport setAD_InfoWindow_ID(0); return true; } // beforeSave - - + /** * After Save * @param newRecord new * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -240,8 +241,8 @@ public class MMenu extends X_AD_Menu implements ImmutablePOSupport /** * FR [ 1966326 ] * get Menu ID - * @param menuName String Menu Name - * @return int retValue + * @param menuName Menu Name + * @return AD_Menu_ID or 0 (not found) or -1 (has error) */ public static int getMenu_ID(String menuName) { int retValue = 0; @@ -277,7 +278,9 @@ public class MMenu extends X_AD_Menu implements ImmutablePOSupport return this; } - /** Returns the name using UserDef module ; if nothing is defined, fallback to the translated name */ + /** + * @return name using UserDef module ; if nothing is defined, fallback to the translated name + */ public String getDisplayedName() { if (!Util.isEmpty(getAction())) { diff --git a/org.adempiere.base/src/org/compiere/model/MMessage.java b/org.adempiere.base/src/org/compiere/model/MMessage.java index 4f278ff5ea..04b07d3c3d 100644 --- a/org.adempiere.base/src/org/compiere/model/MMessage.java +++ b/org.adempiere.base/src/org/compiere/model/MMessage.java @@ -36,7 +36,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MMessage extends X_AD_Message implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 3305457539918386807L; @@ -117,7 +117,7 @@ public class MMessage extends X_AD_Message implements ImmutablePOSupport } // get /** - * Get Message ID (cached) + * Get Message ID from cache * @param Value message value * @return AD_Message_ID */ @@ -127,7 +127,7 @@ public class MMessage extends X_AD_Message implements ImmutablePOSupport } /** - * Get Message ID (cached) + * Get Message ID from cache * @param ctx context * @param Value message value * @return AD_Message_ID @@ -146,16 +146,16 @@ public class MMessage extends X_AD_Message implements ImmutablePOSupport private static CLogger s_log = CLogger.getCLogger(MMessage.class); /** - * UUID based Constructor - * @param ctx Context - * @param AD_Message_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Message_UU UUID key + * @param trxName Transaction + */ public MMessage(Properties ctx, String AD_Message_UU, String trxName) { super(ctx, AD_Message_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param AD_Message_ID id @@ -178,7 +178,7 @@ public class MMessage extends X_AD_Message implements ImmutablePOSupport } // MMessage /** - * + * Copy constructor * @param copy */ public MMessage(MMessage copy) @@ -187,7 +187,7 @@ public class MMessage extends X_AD_Message implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -197,7 +197,7 @@ public class MMessage extends X_AD_Message implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -217,13 +217,13 @@ public class MMessage extends X_AD_Message implements ImmutablePOSupport return this; } - /* + /** * Before Save * @param newRecord * @return true if save */ + @Override protected boolean beforeSave(boolean newRecord) { - // To avoid conflicts with tenant level messages, the value cannot start with numeric and | if (getValue() != null && getValue().contains("|")) { diff --git a/org.adempiere.base/src/org/compiere/model/MModelGeneratorTemplate.java b/org.adempiere.base/src/org/compiere/model/MModelGeneratorTemplate.java index 84caedf98a..22ede78c51 100644 --- a/org.adempiere.base/src/org/compiere/model/MModelGeneratorTemplate.java +++ b/org.adempiere.base/src/org/compiere/model/MModelGeneratorTemplate.java @@ -31,24 +31,22 @@ import java.util.Properties; * Generate Model Template */ public class MModelGeneratorTemplate extends X_AD_ModelGeneratorTemplate { - /** - * + * generated serial id */ private static final long serialVersionUID = -8215029851779075135L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_ModelGeneratorTemplate_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_ModelGeneratorTemplate_UU UUID key + * @param trxName Transaction + */ public MModelGeneratorTemplate(Properties ctx, String AD_ModelGeneratorTemplate_UU, String trxName) { super(ctx, AD_ModelGeneratorTemplate_UU, trxName); } // MModelGeneratorTemplate /** - * SMTP constructor * @param ctx context * @param AD_ModelGeneratorTemplate_ID ID * @param trxName transaction @@ -58,7 +56,6 @@ public class MModelGeneratorTemplate extends X_AD_ModelGeneratorTemplate { } // MModelGeneratorTemplate /** - * SMTP constructor * @param ctx context * @param rs ResultSet * @param trxName transaction diff --git a/org.adempiere.base/src/org/compiere/model/MMovement.java b/org.adempiere.base/src/org/compiere/model/MMovement.java index 4cc2cf0376..caa24024e2 100644 --- a/org.adempiere.base/src/org/compiere/model/MMovement.java +++ b/org.adempiere.base/src/org/compiere/model/MMovement.java @@ -53,16 +53,16 @@ import org.compiere.util.Util; public class MMovement extends X_M_Movement implements DocAction { /** - * + * generated serial id */ private static final long serialVersionUID = 5415969431202357692L; /** - * UUID based Constructor - * @param ctx Context - * @param M_Movement_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_Movement_UU UUID key + * @param trxName Transaction + */ public MMovement(Properties ctx, String M_Movement_UU, String trxName) { super(ctx, M_Movement_UU, trxName); if (Util.isEmpty(M_Movement_UU)) @@ -169,6 +169,7 @@ public class MMovement extends X_M_Movement implements DocAction * Get Document Info * @return document info (untranslated) */ + @Override public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); @@ -179,6 +180,7 @@ public class MMovement extends X_M_Movement implements DocAction * Create PDF * @return File or null */ + @Override public File createPDF () { try @@ -196,19 +198,19 @@ public class MMovement extends X_M_Movement implements DocAction /** * Create PDF file * @param file output file - * @return file if success + * @return not implemented, always return null */ public File createPDF (File file) { return null; } // createPDF - /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getC_DocType_ID() == 0) @@ -227,7 +229,7 @@ public class MMovement extends X_M_Movement implements DocAction /** * Set Processed. - * Propergate to Lines/Taxes + * Propagate to Lines. * @param processed processed */ @Override @@ -241,13 +243,13 @@ public class MMovement extends X_M_Movement implements DocAction m_lines = null; if (log.isLoggable(Level.FINE)) log.fine("Processed=" + processed + " - Lines=" + noLine); } // setProcessed - - - /************************************************************************** + + /** * Process document * @param processAction document action - * @return true if performed + * @return true if success */ + @Override public boolean processIt (String processAction) { m_processMsg = null; @@ -264,6 +266,7 @@ public class MMovement extends X_M_Movement implements DocAction * Unlock Document. * @return true if success */ + @Override public boolean unlockIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -275,6 +278,7 @@ public class MMovement extends X_M_Movement implements DocAction * Invalidate Document * @return true if success */ + @Override public boolean invalidateIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -286,6 +290,7 @@ public class MMovement extends X_M_Movement implements DocAction * Prepare Document * @return new status (In Progress or Invalid) */ + @Override public String prepareIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -373,6 +378,7 @@ public class MMovement extends X_M_Movement implements DocAction * Approve Document * @return true if success */ + @Override public boolean approveIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -384,6 +390,7 @@ public class MMovement extends X_M_Movement implements DocAction * Reject Approval * @return true if success */ + @Override public boolean rejectIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -395,6 +402,7 @@ public class MMovement extends X_M_Movement implements DocAction * Complete Document * @return new status (Complete, In Progress, Invalid, Waiting ..) */ + @Override public String completeIt() { // Re-Check @@ -628,7 +636,7 @@ public class MMovement extends X_M_Movement implements DocAction } // completeIt /** - * Outstanding (not processed) Incoming Confirmations ? + * Outstanding (not processed) movement Confirmations ? * @return true if there are pending Confirmations */ public boolean pendingConfirmations() { @@ -658,8 +666,9 @@ public class MMovement extends X_M_Movement implements DocAction } /** - * Check Material Policy - * Sets line ASI + * Check Material Policy. Create MMovementLineMA records (if line M_AttributeSetInstance_ID is 0). + * @param line + * @param qtyToDeliver */ protected void checkMaterialPolicy(MMovementLine line,BigDecimal qtyToDeliver) { @@ -727,6 +736,7 @@ public class MMovement extends X_M_Movement implements DocAction * Void Document. * @return true if success */ + @Override public boolean voidIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -796,6 +806,7 @@ public class MMovement extends X_M_Movement implements DocAction * Close Document. * @return true if success */ + @Override public boolean closeIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -818,6 +829,7 @@ public class MMovement extends X_M_Movement implements DocAction * Reverse Correction * @return false */ + @Override public boolean reverseCorrectIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -840,6 +852,11 @@ public class MMovement extends X_M_Movement implements DocAction return true; } // reverseCorrectionIt + /** + * Reverse this movement document + * @param accrual true to use current date, false to use movement date of this document + * @return reversal movement document + */ protected MMovement reverse(boolean accrual) { Timestamp reversalDate = accrual ? Env.getContextAsDate(getCtx(), Env.DATE) : getMovementDate(); @@ -882,7 +899,6 @@ public class MMovement extends X_M_Movement implements DocAction MMovementLine rLine = new MMovementLine(getCtx(), 0, get_TrxName()); copyValues(oLine, rLine, oLine.getAD_Client_ID(), oLine.getAD_Org_ID()); rLine.setM_Movement_ID(reversal.getM_Movement_ID()); - //AZ Goodwill // store original (voided/reversed) document line rLine.setReversalLine_ID(oLine.getM_MovementLine_ID()); // @@ -935,9 +951,10 @@ public class MMovement extends X_M_Movement implements DocAction } /** - * Reverse Accrual - none + * Reverse Accrual - use current date * @return false */ + @Override public boolean reverseAccrualIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -964,6 +981,7 @@ public class MMovement extends X_M_Movement implements DocAction * Re-activate * @return false */ + @Override public boolean reActivateIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -979,12 +997,12 @@ public class MMovement extends X_M_Movement implements DocAction return false; } // reActivateIt - - - /************************************************************************* + + /** * Get Summary * @return Summary of Document */ + @Override public String getSummary() { StringBuilder sb = new StringBuilder(); @@ -1003,6 +1021,7 @@ public class MMovement extends X_M_Movement implements DocAction * Get Process Message * @return clear text error message */ + @Override public String getProcessMsg() { return m_processMsg; @@ -1012,6 +1031,7 @@ public class MMovement extends X_M_Movement implements DocAction * Get Document Owner (Responsible) * @return AD_User_ID */ + @Override public int getDoc_User_ID() { return getCreatedBy(); @@ -1021,6 +1041,7 @@ public class MMovement extends X_M_Movement implements DocAction * Get Document Currency * @return C_Currency_ID */ + @Override public int getC_Currency_ID() { return 0; @@ -1030,7 +1051,7 @@ public class MMovement extends X_M_Movement implements DocAction protected boolean m_reversal = false; /** - * Set Reversal + * Set Reversal state (in memory flag) * @param reversal reversal */ protected void setReversal(boolean reversal) @@ -1039,7 +1060,7 @@ public class MMovement extends X_M_Movement implements DocAction } // setReversal /** * Is Reversal - * @return reversal + * @return reversal state (in memory flag) */ protected boolean isReversal() { diff --git a/org.adempiere.base/src/org/compiere/model/MMovementConfirm.java b/org.adempiere.base/src/org/compiere/model/MMovementConfirm.java index 75c535350b..e57bc60893 100644 --- a/org.adempiere.base/src/org/compiere/model/MMovementConfirm.java +++ b/org.adempiere.base/src/org/compiere/model/MMovementConfirm.java @@ -36,7 +36,6 @@ import org.compiere.util.Util; import org.compiere.util.ValueNamePair; import org.compiere.wf.MWorkflow; - /** * Inventory Movement Confirmation * @@ -50,7 +49,7 @@ import org.compiere.wf.MWorkflow; public class MMovementConfirm extends X_M_MovementConfirm implements DocAction { /** - * + * generated serial id */ private static final long serialVersionUID = -3617284116557414217L; @@ -84,21 +83,20 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction } return confirm; } // create - /** - * UUID based Constructor - * @param ctx Context - * @param M_MovementConfirm_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_MovementConfirm_UU UUID key + * @param trxName Transaction + */ public MMovementConfirm(Properties ctx, String M_MovementConfirm_UU, String trxName) { super(ctx, M_MovementConfirm_UU, trxName); if (Util.isEmpty(M_MovementConfirm_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param M_MovementConfirm_ID id @@ -156,7 +154,7 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction /** * Get Lines - * @param requery requery + * @param requery true to requery from DB * @return array of lines */ public MMovementLineConfirm[] getLines (boolean requery) @@ -205,12 +203,12 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction else setDescription(desc + " | " + description); } // addDescription - - + /** * Set Approved * @param IsApproved approval */ + @Override public void setIsApproved (boolean IsApproved) { if (IsApproved && !isApproved()) @@ -225,12 +223,12 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction } super.setIsApproved (IsApproved); } // setIsApproved - - + /** * Get Document Info * @return document info (untranslated) */ + @Override public String getDocumentInfo() { return Msg.getElement(getCtx(), "M_MovementConfirm_ID") + " " + getDocumentNo(); @@ -240,6 +238,7 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction * Create PDF * @return File or null */ + @Override public File createPDF () { try @@ -257,19 +256,19 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction /** * Create PDF file * @param file output file - * @return file if success + * @return not implemented, always return null */ public File createPDF (File file) { return null; } // createPDF - - /************************************************************************** + /** * Process document * @param processAction document action * @return true if performed */ + @Override public boolean processIt (String processAction) { m_processMsg = null; @@ -286,6 +285,7 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction * Unlock Document. * @return true if success */ + @Override public boolean unlockIt() { if (log.isLoggable(Level.INFO)) log.info("unlockIt - " + toString()); @@ -297,6 +297,7 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction * Invalidate Document * @return true if success */ + @Override public boolean invalidateIt() { if (log.isLoggable(Level.INFO)) log.info("invalidateIt - " + toString()); @@ -308,6 +309,7 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction * Prepare Document * @return new status (In Progress or Invalid) */ + @Override public String prepareIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -351,6 +353,7 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction * Approve Document * @return true if success */ + @Override public boolean approveIt() { if (log.isLoggable(Level.INFO)) log.info("approveIt - " + toString()); @@ -362,6 +365,7 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction * Reject Approval * @return true if success */ + @Override public boolean rejectIt() { if (log.isLoggable(Level.INFO)) log.info("rejectIt - " + toString()); @@ -373,6 +377,7 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction * Complete Document * @return new status (Complete, In Progress, Invalid, Waiting ..) */ + @Override public String completeIt() { // Re-Check @@ -476,8 +481,9 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction } // completeIt /** - * Create Difference Document. - * Creates one or two inventory lines + * Create inventory movement line for difference and scrap quantity.
        + * Difference - add line to source movement document.
        + * Scrap - add line to target movement document. * @param move movement * @param confirm confirm line * @return true if created @@ -577,9 +583,9 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction return true; } // createDifferenceDoc - /** - * + * add msg to process message. + * @param msg */ protected void updateProcessMsg(String msg) { if (m_processMsg != null) @@ -591,8 +597,8 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction m_processMsg = m_processMsg + ": " + Msg.getMsg(Env.getCtx(), error.getValue()) + " " + error.getName(); } - /** + * Set physical inventory doc type id * @param inventory */ protected void setInventoryDocType(MInventory inventory) { @@ -609,8 +615,9 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction /** * Void Document. - * @return false + * @return true if success */ + @Override public boolean voidIt() { if (log.isLoggable(Level.INFO)) log.info("voidIt - " + toString()); @@ -655,9 +662,10 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction /** * Close Document. - * Cancel not delivered Qunatities + * Cancel not delivered Quantities. * @return true if success */ + @Override public boolean closeIt() { if (log.isLoggable(Level.INFO)) log.info("closeIt - " + toString()); @@ -678,8 +686,9 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction /** * Reverse Correction - * @return false + * @return not implemented, always return false */ + @Override public boolean reverseCorrectIt() { if (log.isLoggable(Level.INFO)) log.info("reverseCorrectIt - " + toString()); @@ -697,9 +706,10 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction } // reverseCorrectionIt /** - * Reverse Accrual - none - * @return false + * Reverse Accrual + * @return not implemented, always return false */ + @Override public boolean reverseAccrualIt() { if (log.isLoggable(Level.INFO)) log.info("reverseAccrualIt - " + toString()); @@ -718,8 +728,9 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction /** * Re-activate - * @return false + * @return not implemented, always return false */ + @Override public boolean reActivateIt() { if (log.isLoggable(Level.INFO)) log.info("reActivateIt - " + toString()); @@ -735,12 +746,12 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction return false; } // reActivateIt - - - /************************************************************************* + + /** * Get Summary * @return Summary of Document */ + @Override public String getSummary() { StringBuilder sb = new StringBuilder(); @@ -759,6 +770,7 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction * Get Process Message * @return clear text error message */ + @Override public String getProcessMsg() { return m_processMsg; @@ -768,6 +780,7 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction * Get Document Owner (Responsible) * @return AD_User_ID */ + @Override public int getDoc_User_ID() { return getUpdatedBy(); @@ -775,8 +788,9 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction /** * Get Document Currency - * @return C_Currency_ID + * @return 0 */ + @Override public int getC_Currency_ID() { return 0; diff --git a/org.adempiere.base/src/org/compiere/model/MMovementLine.java b/org.adempiere.base/src/org/compiere/model/MMovementLine.java index 9f282325e2..f4ee0cddac 100644 --- a/org.adempiere.base/src/org/compiere/model/MMovementLine.java +++ b/org.adempiere.base/src/org/compiere/model/MMovementLine.java @@ -30,7 +30,7 @@ import org.compiere.util.Util; import org.eevolution.model.MDDOrderLine; /** - * Inventory Move Line Model + * Inventory Movement Line Model * * @author Jorg Janke * @version $Id: MMovementLine.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $ @@ -38,16 +38,16 @@ import org.eevolution.model.MDDOrderLine; public class MMovementLine extends X_M_MovementLine { /** - * + * generated serial id */ private static final long serialVersionUID = -5614562023263896756L; /** - * UUID based Constructor - * @param ctx Context - * @param M_MovementLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_MovementLine_UU UUID key + * @param trxName Transaction + */ public MMovementLine(Properties ctx, String M_MovementLine_UU, String trxName) { super(ctx, M_MovementLine_UU, trxName); if (Util.isEmpty(M_MovementLine_UU)) @@ -55,7 +55,7 @@ public class MMovementLine extends X_M_MovementLine } /** - * Standard Cosntructor + * Standard Constructor * @param ctx context * @param M_MovementLine_ID id * @param trxName transaction @@ -139,7 +139,7 @@ public class MMovementLine extends X_M_MovementLine } // getProduct /** - * Set Movement Qty - enforce UOM precision + * Set Movement Qty - enforce product UOM precision * @param MovementQty qty */ @Override @@ -170,7 +170,6 @@ public class MMovementLine extends X_M_MovementLine m_parent = new MMovement (getCtx(), getM_Movement_ID(), get_TrxName()); return m_parent; } // getParent - /** * Before Save @@ -264,12 +263,14 @@ public class MMovementLine extends X_M_MovementLine } /** - * Set Distribution Order Line. - * Does not set Quantity! - * @param oLine order line - * @param Qty used only to find suitable locator - * @param isReceipt + * Set Distribution Order Line. + * Does not set Quantity! + * @param oLine order line + * @param Qty used only to find suitable locator + * @param isReceipt + * @deprecated not fully implemented */ + @Deprecated public void setOrderLine (MDDOrderLine oLine, BigDecimal Qty, boolean isReceipt) { setDD_OrderLine_ID(oLine.getDD_OrderLine_ID()); @@ -322,8 +323,8 @@ public class MMovementLine extends X_M_MovementLine } // setOrderLine /** - * Set M_Locator_ID - * @param M_Locator_ID id + * Set M_Locator_ID. Throw exception if M_Locator_ID < 0. + * @param M_Locator_ID id */ @Override public void setM_Locator_ID (int M_Locator_ID) @@ -335,8 +336,8 @@ public class MMovementLine extends X_M_MovementLine } // setM_Locator_ID /** - * Set M_LocatorTo_ID - * @param M_LocatorTo_ID id + * Set M_LocatorTo_ID. Throw exception if M_LocatorTo_ID < 0. + * @param M_LocatorTo_ID id */ @Override public void setM_LocatorTo_ID (int M_LocatorTo_ID) @@ -353,8 +354,10 @@ public class MMovementLine extends X_M_MovementLine * @param DD_OrderLine_ID line * @param where optional addition where clause * @param trxName transaction - * @return array of receipt lines + * @return array of receipt lines + * @deprecated not fully implemented */ + @Deprecated public static MMovementLine[] getOfOrderLine (Properties ctx, int DD_OrderLine_ID, String where, String trxName) { @@ -368,6 +371,7 @@ public class MMovementLine extends X_M_MovementLine return list.toArray(new MMovementLine[list.size()]); } // getOfOrderLine + @Override public String toString() { return Table_Name + "[" + get_ID() diff --git a/org.adempiere.base/src/org/compiere/model/MMovementLineConfirm.java b/org.adempiere.base/src/org/compiere/model/MMovementLineConfirm.java index 4b7ad01ec1..a79a45e87b 100644 --- a/org.adempiere.base/src/org/compiere/model/MMovementLineConfirm.java +++ b/org.adempiere.base/src/org/compiere/model/MMovementLineConfirm.java @@ -32,18 +32,17 @@ import org.compiere.util.Util; */ public class MMovementLineConfirm extends X_M_MovementLineConfirm { - /** - * + * generated serial id */ private static final long serialVersionUID = -5447921784818655144L; /** - * UUID based Constructor - * @param ctx Context - * @param M_MovementLineConfirm_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_MovementLineConfirm_UU UUID key + * @param trxName Transaction + */ public MMovementLineConfirm(Properties ctx, String M_MovementLineConfirm_UU, String trxName) { super(ctx, M_MovementLineConfirm_UU, trxName); if (Util.isEmpty(M_MovementLineConfirm_UU)) @@ -75,7 +74,6 @@ public class MMovementLineConfirm extends X_M_MovementLineConfirm } /** - * M_MovementLineConfirm * @param ctx context * @param rs result set * @param trxName transaction @@ -121,12 +119,13 @@ public class MMovementLineConfirm extends X_M_MovementLineConfirm m_line = new MMovementLine (getCtx(), getM_MovementLine_ID(), get_TrxName()); return m_line; } // getLine - - + /** - * Process Confirmation Line. - * - Update Movement Line - * @return success + *
        +	 *  Process Confirmation Line.
        +	 *  - Update Movement Line.
        +	 *  
        + * @return true if success */ public boolean processLine () { @@ -148,12 +147,12 @@ public class MMovementLineConfirm extends X_M_MovementLineConfirm { return getTargetQty().compareTo(getConfirmedQty()) == 0; } // isFullyConfirmed - - + /** - * Before Delete - do not delete + * Before Delete - do not allow delete * @return false */ + @Override protected boolean beforeDelete () { return false; @@ -164,6 +163,7 @@ public class MMovementLineConfirm extends X_M_MovementLineConfirm * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { MMovementConfirm parent = new MMovementConfirm(getCtx(), getM_MovementConfirm_ID(), get_TrxName()); @@ -177,7 +177,5 @@ public class MMovementLineConfirm extends X_M_MovementLineConfirm setDifferenceQty(difference); // return true; - } // beforeSave - - + } // beforeSave } // M_MovementLineConfirm diff --git a/org.adempiere.base/src/org/compiere/model/MMovementLineMA.java b/org.adempiere.base/src/org/compiere/model/MMovementLineMA.java index 510563cf2a..4d39ee5bf2 100644 --- a/org.adempiere.base/src/org/compiere/model/MMovementLineMA.java +++ b/org.adempiere.base/src/org/compiere/model/MMovementLineMA.java @@ -30,9 +30,8 @@ import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.Util; - /** - * Movement Material Allocation + * Movement Line Material Allocation * * @author Jorg Janke * @version $Id: MMovementLineMA.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $ @@ -40,11 +39,10 @@ import org.compiere.util.Util; public class MMovementLineMA extends X_M_MovementLineMA { /** - * + * generated serial id */ private static final long serialVersionUID = -155379485409000271L; - /** * Get Material Allocations for Line * @param ctx context @@ -112,19 +110,18 @@ public class MMovementLineMA extends X_M_MovementLineMA /** Logger */ private static CLogger s_log = CLogger.getCLogger (MMovementLineMA.class); - /** - * UUID based Constructor - * @param ctx Context - * @param M_MovementLineMA_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_MovementLineMA_UU UUID key + * @param trxName Transaction + */ public MMovementLineMA(Properties ctx, String M_MovementLineMA_UU, String trxName) { super(ctx, M_MovementLineMA_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param M_MovementLineMA_ID ignored @@ -201,6 +198,7 @@ public class MMovementLineMA extends X_M_MovementLineMA * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MMovementLineMA["); @@ -211,12 +209,28 @@ public class MMovementLineMA extends X_M_MovementLineMA return sb.toString (); } // toString - + /** + * Add movement quantity to existing MMovementLineMA or create new MMovementLineMA record. + * @param line + * @param M_AttributeSetInstance_ID + * @param MovementQty + * @param DateMaterialPolicy + * @return MMovementLineMA instance + */ public static MMovementLineMA addOrCreate(MMovementLine line, int M_AttributeSetInstance_ID, BigDecimal MovementQty, Timestamp DateMaterialPolicy) { return addOrCreate(line,M_AttributeSetInstance_ID,MovementQty,DateMaterialPolicy,true); } + /** + * Add movement quantity to existing MMovementLineMA or create new MMovementLineMA record. + * @param line + * @param M_AttributeSetInstance_ID + * @param MovementQty + * @param DateMaterialPolicy + * @param isAutoGenerated true if created by application instead of created by user manually + * @return MMovementLineMA instance + */ public static MMovementLineMA addOrCreate(MMovementLine line, int M_AttributeSetInstance_ID, BigDecimal MovementQty, Timestamp DateMaterialPolicy,boolean isAutoGenerated) { Query query = new Query(Env.getCtx(), I_M_MovementLineMA.Table_Name, "M_MovementLine_ID=? AND M_AttributeSetInstance_ID=? AND DateMaterialPolicy=trunc(cast(? as date))", @@ -230,25 +244,24 @@ public class MMovementLineMA extends X_M_MovementLineMA } /** - * + * Get total movement qty for LineMA created manually by user * @param M_MovementLine_ID * @param trxName - * @return + * @return total movement qty from MMovementLineMA created by user */ public static BigDecimal getManualQty (int M_MovementLine_ID, String trxName) { String sql = "SELECT SUM(movementqty) FROM M_MovementLineMA ma WHERE ma.M_MovementLine_ID=? AND ma.IsAutoGenerated='N'"; BigDecimal totalQty = DB.getSQLValueBD(trxName, sql, M_MovementLine_ID); return totalQty==null?Env.ZERO:totalQty; - } //totalLineQty - - - - /************************************************************************** + } //getManualQty + + /** * Before Save * @param newRecord new * @return save */ + @Override protected boolean beforeSave (boolean newRecord) { MMovementLine parentline = new MMovementLine(getCtx(), getM_MovementLine_ID(), get_TrxName()); diff --git a/org.adempiere.base/src/org/compiere/model/MNote.java b/org.adempiere.base/src/org/compiere/model/MNote.java index e382ab2282..9bc2c1a39b 100644 --- a/org.adempiere.base/src/org/compiere/model/MNote.java +++ b/org.adempiere.base/src/org/compiere/model/MNote.java @@ -23,7 +23,6 @@ import java.util.logging.Level; import org.compiere.util.DB; import org.compiere.util.Util; - /** * Note Model * @@ -33,17 +32,16 @@ import org.compiere.util.Util; public class MNote extends X_AD_Note { /** - * + * generated serial id */ private static final long serialVersionUID = -422120961441035731L; - /** - * UUID based Constructor - * @param ctx Context - * @param AD_Note_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Note_UU UUID key + * @param trxName Transaction + */ public MNote(Properties ctx, String AD_Note_UU, String trxName) { super(ctx, AD_Note_UU, trxName); if (Util.isEmpty(AD_Note_UU)) @@ -144,10 +142,8 @@ public class MNote extends X_AD_Note setClientOrg(AD_Client_ID, AD_Org_ID); } // MNote - - /************************************************************************** - * Set Record. - * (Ss Button and defaults to String) + /** + * Set AD_Message_ID via Value * @param AD_Message AD_Message */ public void setAD_Message_ID (String AD_Message) @@ -165,9 +161,10 @@ public class MNote extends X_AD_Note /** * Set AD_Message_ID. - * Looks up No Message Found if 0 + * Looks up NoMessageFound if argument is 0. * @param AD_Message_ID id */ + @Override public void setAD_Message_ID (int AD_Message_ID) { if (AD_Message_ID == 0) @@ -178,7 +175,7 @@ public class MNote extends X_AD_Note /** * Get Message - * @return message + * @return message text */ public String getMessage() { @@ -192,6 +189,7 @@ public class MNote extends X_AD_Note * @param AD_Client_ID client * @param AD_Org_ID org */ + @Override public void setClientOrg(int AD_Client_ID, int AD_Org_ID) { super.setClientOrg(AD_Client_ID, AD_Org_ID); @@ -208,11 +206,11 @@ public class MNote extends X_AD_Note setRecord_ID(Record_ID); } // setRecord - /** * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder ("MNote[") diff --git a/org.adempiere.base/src/org/compiere/model/MOnlineTrxHistory.java b/org.adempiere.base/src/org/compiere/model/MOnlineTrxHistory.java index e9c4b5f2b2..7794c12d43 100644 --- a/org.adempiere.base/src/org/compiere/model/MOnlineTrxHistory.java +++ b/org.adempiere.base/src/org/compiere/model/MOnlineTrxHistory.java @@ -18,32 +18,41 @@ import java.sql.ResultSet; import java.util.Properties; /** - * + * Online transaction history model * @author Elaine * */ public class MOnlineTrxHistory extends X_C_OnlineTrxHistory { - /** - * + * generated serial id */ private static final long serialVersionUID = 2160888813932490117L; /** - * UUID based Constructor - * @param ctx Context - * @param C_OnlineTrxHistory_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_OnlineTrxHistory_UU UUID key + * @param trxName Transaction + */ public MOnlineTrxHistory(Properties ctx, String C_OnlineTrxHistory_UU, String trxName) { super(ctx, C_OnlineTrxHistory_UU, trxName); } - + + /** + * @param ctx + * @param C_OnlineTrxHistory_ID + * @param trxName + */ public MOnlineTrxHistory(Properties ctx, int C_OnlineTrxHistory_ID, String trxName) { super(ctx, C_OnlineTrxHistory_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MOnlineTrxHistory(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); diff --git a/org.adempiere.base/src/org/compiere/model/MOpportunity.java b/org.adempiere.base/src/org/compiere/model/MOpportunity.java index 08317d4b24..afd63b4a72 100644 --- a/org.adempiere.base/src/org/compiere/model/MOpportunity.java +++ b/org.adempiere.base/src/org/compiere/model/MOpportunity.java @@ -14,37 +14,54 @@ * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * * or via info@compiere.org or http://www.compiere.org/license.html * *****************************************************************************/ - package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; +/** + * Business Opportunity model + */ public class MOpportunity extends X_C_Opportunity { - /** - * + * generated serial id */ private static final long serialVersionUID = 9052544341602655427L; /** - * UUID based Constructor - * @param ctx Context - * @param C_Opportunity_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Opportunity_UU UUID key + * @param trxName Transaction + */ public MOpportunity(Properties ctx, String C_Opportunity_UU, String trxName) { super(ctx, C_Opportunity_UU, trxName); } + /** + * @param ctx + * @param C_Opportunity_ID + * @param trxName + */ public MOpportunity(Properties ctx, int C_Opportunity_ID, String trxName) { super(ctx, C_Opportunity_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MOpportunity(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } + /** + * @param ctx + * @param C_Opportunity_ID + * @param trxName + * @param virtualColumns + */ public MOpportunity(Properties ctx, int C_Opportunity_ID, String trxName, String... virtualColumns) { super(ctx, C_Opportunity_ID, trxName, virtualColumns); } diff --git a/org.adempiere.base/src/org/compiere/model/MOrder.java b/org.adempiere.base/src/org/compiere/model/MOrder.java index febe737099..f4249fed14 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrder.java +++ b/org.adempiere.base/src/org/compiere/model/MOrder.java @@ -56,12 +56,8 @@ import org.compiere.util.Util; import org.eevolution.model.MPPProductBOM; import org.eevolution.model.MPPProductBOMLine; - /** * Order Model. - * Please do not set DocStatus and C_DocType_ID directly. - * They are set in the process() method. - * Use DocAction and C_DocTypeTarget_ID instead. * * @author Jorg Janke * @@ -70,11 +66,11 @@ import org.eevolution.model.MPPProductBOMLine; * @see https://sourceforge.net/p/adempiere/feature-requests/631/ * @version $Id: MOrder.java,v 1.5 2006/10/06 00:42:24 jjanke Exp $ * - * @author Teo Sarca, www.arhipac.ro + * @author Teo Sarca, www.arhipac.ro *
      • BF [ 2419978 ] Voiding PO, requisition don't set on NULL *
      • BF [ 2892578 ] Order should autoset only active price lists * https://sourceforge.net/p/adempiere/feature-requests/873/ - * @author Michael Judd, www.akunagroup.com + * @author Michael Judd, www.akunagroup.com *
      • BF [ 2804888 ] Incorrect reservation of products with attributes */ public class MOrder extends X_C_Order implements DocAction @@ -84,6 +80,7 @@ public class MOrder extends X_C_Order implements DocAction */ private static final long serialVersionUID = 9095740800513665542L; + /** Matching SELECT SQL template */ private static final String BASE_MATCHING_SQL = """ SELECT hdr.C_Order_ID, hdr.DocumentNo, hdr.DateOrdered, bp.Name, hdr.C_BPartner_ID, @@ -102,6 +99,7 @@ public class MOrder extends X_C_Order implements DocAction AND hdr.DocStatus IN ('CO','CL') """; + /** Matching GROUP BY template */ private static final String BASE_MATCHING_GROUP_BY_SQL = """ GROUP BY hdr.C_Order_ID,hdr.DocumentNo,hdr.DateOrdered,bp.Name,hdr.C_BPartner_ID, @@ -404,22 +402,20 @@ public class MOrder extends X_C_Order implements DocAction return to; } // copyFrom - - + /** - * UUID based Constructor - * @param ctx Context - * @param C_Order_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Order_UU UUID key + * @param trxName Transaction + */ public MOrder(Properties ctx, String C_Order_UU, String trxName) { super(ctx, C_Order_UU, trxName); if (Util.isEmpty(C_Order_UU)) setInitialDefaults(); } - /************************************************************************** - * Default Constructor + /** * @param ctx context * @param C_Order_ID order to load, (0 create new order) * @param trxName trx name @@ -429,6 +425,12 @@ public class MOrder extends X_C_Order implements DocAction this (ctx, C_Order_ID, trxName, (String[]) null); } // MOrder + /** + * @param ctx + * @param C_Order_ID + * @param trxName + * @param virtualColumns + */ public MOrder(Properties ctx, int C_Order_ID, String trxName, String... virtualColumns) { super(ctx, C_Order_ID, trxName, virtualColumns); // New @@ -479,7 +481,7 @@ public class MOrder extends X_C_Order implements DocAction setGrandTotal (Env.ZERO); } - /************************************************************************** + /** * Project Constructor * @param project Project to create Order from * @param IsSOTrx sales order @@ -545,12 +547,12 @@ public class MOrder extends X_C_Order implements DocAction * @param AD_Client_ID client * @param AD_Org_ID org */ + @Override public void setClientOrg (int AD_Client_ID, int AD_Org_ID) { super.setClientOrg(AD_Client_ID, AD_Org_ID); } // setClientOrg - /** * Add to Description * @param description text @@ -586,7 +588,7 @@ public class MOrder extends X_C_Order implements DocAction /** * Set Business Partner Contact (Ship+Bill) - * @param AD_User_ID user + * @param AD_User_ID contact */ public void setAD_User_ID (int AD_User_ID) { @@ -614,14 +616,13 @@ public class MOrder extends X_C_Order implements DocAction /** * Set Ship Business Partner Contact - * @param AD_User_ID user + * @param AD_User_ID contact */ public void setShip_User_ID (int AD_User_ID) { super.setAD_User_ID (AD_User_ID); } // setShip_User_ID - - + /** * Set Warehouse * @param M_Warehouse_ID warehouse @@ -640,8 +641,6 @@ public class MOrder extends X_C_Order implements DocAction super.setIsDropShip (IsDropShip); } // setIsDropShip - /*************************************************************************/ - /** Sales Order Sub Type - SO */ public static final String DocSubTypeSO_Standard = "SO"; /** Sales Order Sub Type - OB */ @@ -684,7 +683,7 @@ public class MOrder extends X_C_Order implements DocAction /** * Set Target Document Type. - * Standard Order or PO + * Standard Order or PO. */ public void setC_DocTypeTarget_ID () { @@ -708,10 +707,9 @@ public class MOrder extends X_C_Order implements DocAction } } // setC_DocTypeTarget_ID - /** * Set Business Partner Defaults and Details. - * SOTrx should be set. + * SOTrx should be set prior to this call. * @param bp business partner */ public void setBPartner (MBPartner bp) @@ -757,7 +755,6 @@ public class MOrder extends X_C_Order implements DocAction if (ii != 0) setSalesRep_ID(ii); - // Set Locations MBPartnerLocation[] locs = bp.getLocations(false); if (locs != null) @@ -791,12 +788,11 @@ public class MOrder extends X_C_Order implements DocAction setAD_User_ID(contacts[0].getAD_User_ID()); } // setBPartner - /** * Copy Lines From other Order * @param otherOrder order * @param counter set counter info - * @param copyASI copy line attributes Attribute Set Instance, Resaouce Assignment + * @param copyASI true to copy line Attribute Set Instance and Resource Assignment * @return number of lines copied */ public int copyLinesFrom (MOrder otherOrder, boolean counter, boolean copyASI) @@ -854,12 +850,12 @@ public class MOrder extends X_C_Order implements DocAction log.log(Level.SEVERE, "Line difference - From=" + fromLines.length + " <> Saved=" + count); return count; } // copyLinesFrom - - /************************************************************************** + /** * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MOrder[") @@ -875,6 +871,7 @@ public class MOrder extends X_C_Order implements DocAction * Get Document Info * @return document info (untranslated) */ + @Override public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID() > 0 ? getC_DocType_ID() : getC_DocTypeTarget_ID()); @@ -885,6 +882,7 @@ public class MOrder extends X_C_Order implements DocAction * Create PDF * @return File or null */ + @Override public File createPDF () { try @@ -931,6 +929,7 @@ public class MOrder extends X_C_Order implements DocAction * Set Price List (and Currency, TaxIncluded) when valid * @param M_PriceList_ID price list */ + @Override public void setM_PriceList_ID (int M_PriceList_ID) { MPriceList pl = MPriceList.get(getCtx(), M_PriceList_ID, null); @@ -941,11 +940,10 @@ public class MOrder extends X_C_Order implements DocAction setIsTaxIncluded(pl.isTaxIncluded()); } } // setM_PriceList_ID - - /************************************************************************** + /** * Get Lines of Order - * @param whereClause where clause or null (starting with AND) + * @param whereClause where clause or null (must start with AND) * @param orderClause order clause or null * @return lines */ @@ -971,8 +969,8 @@ public class MOrder extends X_C_Order implements DocAction /** * Get Lines of Order - * @param requery requery - * @param orderBy optional order by column + * @param requery true to re-query from DB + * @param orderBy optional order by columns * @return lines */ public MOrderLine[] getLines (boolean requery, String orderBy) @@ -993,7 +991,6 @@ public class MOrder extends X_C_Order implements DocAction /** * Get Lines of Order. - * (used by web store) * @return lines */ public MOrderLine[] getLines() @@ -1036,7 +1033,7 @@ public class MOrder extends X_C_Order implements DocAction /** * Get Taxes of Order - * @param requery requery + * @param requery true to re-query from DB * @return array of taxes */ public MOrderTax[] getTaxes(boolean requery) @@ -1050,8 +1047,7 @@ public class MOrder extends X_C_Order implements DocAction m_taxes = list.toArray(new MOrderTax[list.size()]); return m_taxes; } // getTaxes - - + /** * Get Invoices of Order * @return invoices @@ -1082,7 +1078,6 @@ public class MOrder extends X_C_Order implements DocAction return C_Invoice_ID; } // getC_Invoice_ID - /** * Get Shipments of Order * @return shipments @@ -1119,8 +1114,8 @@ public class MOrder extends X_C_Order implements DocAction } // getPrecision /** - * Get Document Status - * @return Document Status Clear Text + * Get Document Status Name + * @return Document Status Name */ public String getDocStatusName() { @@ -1129,8 +1124,9 @@ public class MOrder extends X_C_Order implements DocAction /** * Set DocAction - * @param DocAction doc action + * @param DocAction DocAction.ACTION_* */ + @Override public void setDocAction (String DocAction) { setDocAction (DocAction, false); @@ -1138,7 +1134,7 @@ public class MOrder extends X_C_Order implements DocAction /** * Set DocAction - * @param DocAction doc action + * @param DocAction DocAction.ACTION_* * @param forceCreation force creation */ public void setDocAction (String DocAction, boolean forceCreation) @@ -1152,6 +1148,7 @@ public class MOrder extends X_C_Order implements DocAction * Propagate to Lines/Taxes * @param processed processed */ + @Override public void setProcessed (boolean processed) { super.setProcessed (processed); @@ -1167,8 +1164,6 @@ public class MOrder extends X_C_Order implements DocAction if (log.isLoggable(Level.FINE)) log.fine("setProcessed - " + processed + " - Lines=" + noLine + ", Tax=" + noTax); } // setProcessed - - /** * Validate Order Pay Schedule * @return pay schedule is valid @@ -1206,14 +1201,15 @@ public class MOrder extends X_C_Order implements DocAction } return valid; } // validatePaySchedule - private volatile static boolean recursiveCall = false; - /************************************************************************** + + /** * Before Save * @param newRecord new * @return save */ + @Override protected boolean beforeSave (boolean newRecord) { // Client/Org Check @@ -1394,14 +1390,14 @@ public class MOrder extends X_C_Order implements DocAction return true; } // beforeSave - - + /** * After Save * @param newRecord new * @param success success * @return true if can be saved */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success || newRecord) @@ -1480,6 +1476,7 @@ public class MOrder extends X_C_Order implements DocAction * Before Delete * @return true of it can be deleted */ + @Override protected boolean beforeDelete () { if (isProcessed()) @@ -1488,11 +1485,12 @@ public class MOrder extends X_C_Order implements DocAction return true; } // beforeDelete - /************************************************************************** + /** * Process document * @param processAction document action * @return true if performed */ + @Override public boolean processIt (String processAction) { m_processMsg = null; @@ -1509,6 +1507,7 @@ public class MOrder extends X_C_Order implements DocAction * Unlock Document. * @return true if success */ + @Override public boolean unlockIt() { if (log.isLoggable(Level.INFO)) log.info("unlockIt - " + toString()); @@ -1520,18 +1519,19 @@ public class MOrder extends X_C_Order implements DocAction * Invalidate Document * @return true if success */ + @Override public boolean invalidateIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); setDocAction(DOCACTION_Prepare); return true; } // invalidateIt - - - /************************************************************************** + + /** * Prepare Document * @return new status (In Progress or Invalid) */ + @Override public String prepareIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -1700,6 +1700,10 @@ public class MOrder extends X_C_Order implements DocAction return DocAction.STATUS_InProgress; } // prepareIt + /** + * Calculate freight charge and create order line for freight charge (if needed). + * @return true if no error + */ protected boolean calculateFreightCharge() { MClientInfo ci = MClientInfo.get(getCtx(), getAD_Client_ID(), get_TrxName()); @@ -1839,7 +1843,7 @@ public class MOrder extends X_C_Order implements DocAction } /** - * Explode non stocked BOM. + * Explode non stocked BOM (i.e IsBOM=Y and IsStocked=N). * @return true if bom exploded */ protected boolean explodeBOM() @@ -1906,10 +1910,9 @@ public class MOrder extends X_C_Order implements DocAction return retValue; } // explodeBOM - /** * Reserve Inventory. - * Counterpart: MInOut.completeIt() + * Release of reservation: MInOut.completeIt(). * @param dt document type or null * @param lines order lines (ordered by M_Product_ID for deadlock prevention) * @return true if (un) reserved @@ -2016,12 +2019,12 @@ public class MOrder extends X_C_Order implements DocAction } // reserveStock /** - * Calculate Tax and Total - * @return true if tax total calculated + * Calculate Tax and Total (delete and re-create C_OrderTax records). + * @return true if no error */ public boolean calculateTaxTotal() { - log.fine(""); + if (log.isLoggable(Level.FINE)) log.fine(""); // Delete Taxes DB.executeUpdateEx("DELETE FROM C_OrderTax WHERE C_Order_ID=" + getC_Order_ID(), get_TrxName()); m_taxes = null; @@ -2038,8 +2041,7 @@ public class MOrder extends X_C_Order implements DocAction } return true; } // calculateTaxTotal - - + /** * (Re) Create Pay Schedule * @return true if valid schedule @@ -2068,12 +2070,12 @@ public class MOrder extends X_C_Order implements DocAction return isValid; } } // createPaySchedule - - + /** * Approve Document * @return true if success */ + @Override public boolean approveIt() { if (log.isLoggable(Level.INFO)) log.info("approveIt - " + toString()); @@ -2085,18 +2087,19 @@ public class MOrder extends X_C_Order implements DocAction * Reject Approval * @return true if success */ + @Override public boolean rejectIt() { if (log.isLoggable(Level.INFO)) log.info("rejectIt - " + toString()); setIsApproved(false); return true; } // rejectIt - - - /************************************************************************** + + /** * Complete Document * @return new status (Complete, In Progress, Invalid, Waiting ..) */ + @Override public String completeIt() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); @@ -2240,6 +2243,9 @@ public class MOrder extends X_C_Order implements DocAction return DocAction.STATUS_Completed; } // completeIt + /** + * Update QtyOverReceipt of M_InOutLine + */ private void updateOverReceipt() { for(MOrderLine line : m_lines) { if (line.getM_Product_ID() <= 0) continue; @@ -2250,6 +2256,10 @@ public class MOrder extends X_C_Order implements DocAction } } + /** + * distribute landed cost. + * @return error message or empty string + */ protected String landedCostAllocation() { MOrderLandedCost[] landedCosts = MOrderLandedCost.getOfOrder(getC_Order_ID(), get_TrxName()); for(MOrderLandedCost landedCost : landedCosts) { @@ -2260,7 +2270,9 @@ public class MOrder extends X_C_Order implements DocAction return ""; } - + /** + * @return error message or null + */ protected String createPOSPayments() { // Just for POS order with payment rule mixed @@ -2649,6 +2661,7 @@ public class MOrder extends X_C_Order implements DocAction * Set Qtys to 0 - Sales: reverse all documents * @return true if success */ + @Override public boolean voidIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2683,7 +2696,6 @@ public class MOrder extends X_C_Order implements DocAction line.setLineNetAmt(Env.ZERO); line.saveEx(get_TrxName()); } - //AZ Goodwill if (!isSOTrx()) { deleteMatchPOCostDetail(line); @@ -2845,12 +2857,12 @@ public class MOrder extends X_C_Order implements DocAction return true; } - /** * Close Document. - * Cancel not delivered Quantities + * Cancel not delivered Quantities. * @return true if success */ + @Override public boolean closeIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2929,6 +2941,7 @@ public class MOrder extends X_C_Order implements DocAction * @author: phib * re-open a closed order * (reverse steps of close()) + * @return error message or null */ public String reopenIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2967,8 +2980,9 @@ public class MOrder extends X_C_Order implements DocAction else return ""; } // reopenIt + /** - * Reverse Correction - same void + * Reverse Correction - same as void * @return true if success */ public boolean reverseCorrectIt() @@ -2988,8 +3002,8 @@ public class MOrder extends X_C_Order implements DocAction } // reverseCorrectionIt /** - * Reverse Accrual - none - * @return false + * Reverse Accrual + * @return not implemented, always return false */ public boolean reverseAccrualIt() { @@ -3011,6 +3025,7 @@ public class MOrder extends X_C_Order implements DocAction * Re-activate. * @return true if success */ + @Override public boolean reActivateIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -3054,12 +3069,12 @@ public class MOrder extends X_C_Order implements DocAction setProcessed(false); return true; } // reActivateIt - - - /************************************************************************* + + /** * Get Summary * @return Summary of Document */ + @Override public String getSummary() { StringBuilder sb = new StringBuilder(); @@ -3079,6 +3094,7 @@ public class MOrder extends X_C_Order implements DocAction * Get Process Message * @return clear text error message */ + @Override public String getProcessMsg() { return m_processMsg; @@ -3088,6 +3104,7 @@ public class MOrder extends X_C_Order implements DocAction * Get Document Owner (Responsible) * @return AD_User_ID */ + @Override public int getDoc_User_ID() { return getSalesRep_ID(); @@ -3097,12 +3114,17 @@ public class MOrder extends X_C_Order implements DocAction * Get Document Approval Amount * @return amount */ + @Override public BigDecimal getApprovalAmt() { return getGrandTotal(); } // getApprovalAmt - //AZ Goodwill + /** + * Delete cost detail for order line + * @param line + * @return error message or null + */ protected String deleteMatchPOCostDetail(MOrderLine line) { // Get Account Schemas to delete MCostDetail diff --git a/org.adempiere.base/src/org/compiere/model/MOrderLandedCost.java b/org.adempiere.base/src/org/compiere/model/MOrderLandedCost.java index 4d2b931b80..f2bcb0cd45 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrderLandedCost.java +++ b/org.adempiere.base/src/org/compiere/model/MOrderLandedCost.java @@ -28,8 +28,8 @@ import org.compiere.util.Env; import org.compiere.util.Util; /** + * Landed cost for order * @author hengsin - * */ public class MOrderLandedCost extends X_C_OrderLandedCost { @@ -39,11 +39,11 @@ public class MOrderLandedCost extends X_C_OrderLandedCost { private static final long serialVersionUID = 2629138678703667123L; /** - * UUID based Constructor - * @param ctx Context - * @param C_OrderLandedCost_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_OrderLandedCost_UU UUID key + * @param trxName Transaction + */ public MOrderLandedCost(Properties ctx, String C_OrderLandedCost_UU, String trxName) { super(ctx, C_OrderLandedCost_UU, trxName); } @@ -67,23 +67,23 @@ public class MOrderLandedCost extends X_C_OrderLandedCost { } /** - * Get allocation + * Get landed cost lines * @param C_Order_ID - * @return lines + * @return array of MOrderLandedCost */ public static MOrderLandedCost[] getOfOrder (int C_Order_ID, String trxName) { StringBuilder whereClause = new StringBuilder(COLUMNNAME_C_Order_ID).append("=?"); - List list = new Query(Env.getCtx(), I_C_OrderLandedCost.Table_Name, whereClause.toString(), trxName) + List list = new Query(Env.getCtx(), I_C_OrderLandedCost.Table_Name, whereClause.toString(), trxName) .setParameters(C_Order_ID) .list(); return list.toArray(new MOrderLandedCost[list.size()]); - } // getLines + } // getOfOrder /** * Get Lines of allocation * @param whereClause starting with AND - * @return lines + * @return landed cost allocation lines */ public MOrderLandedCostAllocation[] getLines (String whereClause) { @@ -96,6 +96,10 @@ public class MOrderLandedCost extends X_C_OrderLandedCost { return list.toArray(new MOrderLandedCostAllocation[list.size()]); } // getLines + /** + * create landed cost allocations + * @return error message or null + */ public String distributeLandedCost() { MOrderLandedCostAllocation[] lines = getLines(""); if (lines.length == 0) { @@ -167,7 +171,8 @@ public class MOrderLandedCost extends X_C_OrderLandedCost { } /** - * Allocate Landed Cost - Enforce Rounding + * If there are difference between landed cost amount (getAmt()) and total landed cost allocation (MOrderLandedCostAllocation) amount, + * add the difference to the largest landed cost allocation line. * @param lines */ private void allocateLandedCostRounding(MOrderLandedCostAllocation[] lines) diff --git a/org.adempiere.base/src/org/compiere/model/MOrderLandedCostAllocation.java b/org.adempiere.base/src/org/compiere/model/MOrderLandedCostAllocation.java index d9124469a3..ac206bbb97 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrderLandedCostAllocation.java +++ b/org.adempiere.base/src/org/compiere/model/MOrderLandedCostAllocation.java @@ -25,22 +25,21 @@ import java.util.Properties; import org.compiere.util.Env; /** + * Landed Cost Allocation Line * @author hengsin - * */ public class MOrderLandedCostAllocation extends X_C_OrderLandedCostAllocation { - /** * generated serial id */ private static final long serialVersionUID = -3876186097908624583L; /** - * UUID based Constructor - * @param ctx Context - * @param C_OrderLandedCostAllocation_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_OrderLandedCostAllocation_UU UUID key + * @param trxName Transaction + */ public MOrderLandedCostAllocation(Properties ctx, String C_OrderLandedCostAllocation_UU, String trxName) { super(ctx, C_OrderLandedCostAllocation_UU, trxName); } @@ -78,10 +77,10 @@ public class MOrderLandedCostAllocation extends X_C_OrderLandedCostAllocation { } // setAmt /** - * Get Lines of allocation + * Get landed cost allocation lines of an order line * @param C_OrderLine_ID * @param trxName - * @return lines + * @return landed cost allocation lines */ public static MOrderLandedCostAllocation[] getOfOrderLine(int C_OrderLine_ID, String trxName) { diff --git a/org.adempiere.base/src/org/compiere/model/MOrderLine.java b/org.adempiere.base/src/org/compiere/model/MOrderLine.java index fa09435c3a..670562b4a6 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrderLine.java +++ b/org.adempiere.base/src/org/compiere/model/MOrderLine.java @@ -38,37 +38,36 @@ import org.compiere.util.Util; /** * Order Line Model. - * - * MOrderLine ol = new MOrderLine(m_order); - ol.setM_Product_ID(wbl.getM_Product_ID()); - ol.setQtyOrdered(wbl.getQuantity()); - ol.setPrice(); - ol.setPriceActual(wbl.getPrice()); - ol.setTax(); - ol.saveEx(); - - * + *
        + * 		MOrderLine ol = new MOrderLine(m_order);
        +		ol.setM_Product_ID(wbl.getM_Product_ID());
        +		ol.setQtyOrdered(wbl.getQuantity());
        +		ol.setPrice();
        +		ol.setPriceActual(wbl.getPrice());
        +		ol.setTax();
        +		ol.saveEx();
        + *	
        * @author Jorg Janke * @version $Id: MOrderLine.java,v 1.6 2006/10/02 05:18:39 jjanke Exp $ * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL + * @author Teo Sarca, SC ARHIPAC SERVICE SRL *
      • BF [ 2588043 ] Insufficient message ProductNotOnPriceList */ public class MOrderLine extends X_C_OrderLine { /** - * + * generated serial id */ private static final long serialVersionUID = 7994694334621222461L; /** - * Get Order Unreserved Qty + * Get Order Qty that have not been reserved * @param ctx context * @param M_Warehouse_ID wh * @param M_Product_ID product * @param M_AttributeSetInstance_ID asi * @param excludeC_OrderLine_ID exclude C_OrderLine_ID - * @return Unreserved Qty + * @return Order Qty that have not been reserved */ public static BigDecimal getNotReserved (Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, int excludeC_OrderLine_ID) @@ -120,18 +119,18 @@ public class MOrderLine extends X_C_OrderLine protected static CLogger s_log = CLogger.getCLogger (MOrderLine.class); /** - * UUID based Constructor - * @param ctx Context - * @param C_OrderLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_OrderLine_UU UUID key + * @param trxName Transaction + */ public MOrderLine(Properties ctx, String C_OrderLine_UU, String trxName) { super(ctx, C_OrderLine_UU, trxName); if (Util.isEmpty(C_OrderLine_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Default Constructor * @param ctx context * @param C_OrderLine_ID order line to load @@ -142,6 +141,12 @@ public class MOrderLine extends X_C_OrderLine this (ctx, C_OrderLine_ID, trxName, (String[]) null); } // MOrderLine + /** + * @param ctx + * @param C_OrderLine_ID + * @param trxName + * @param virtualColumns + */ public MOrderLine(Properties ctx, int C_OrderLine_ID, String trxName, String... virtualColumns) { super(ctx, C_OrderLine_ID, trxName, virtualColumns); if (C_OrderLine_ID == 0) @@ -175,12 +180,6 @@ public class MOrderLine extends X_C_OrderLine /** * Parent Constructor. - ol.setM_Product_ID(wbl.getM_Product_ID()); - ol.setQtyOrdered(wbl.getQuantity()); - ol.setPrice(); - ol.setPriceActual(wbl.getPrice()); - ol.setTax(); - ol.saveEx(); * @param order parent order */ public MOrderLine (MOrder order) @@ -223,7 +222,6 @@ public class MOrderLine extends X_C_OrderLine /** * Set Defaults from Order. - * Does not set Parent !! * @param order order */ public void setOrder (MOrder order) @@ -265,7 +263,7 @@ public class MOrderLine extends X_C_OrderLine /** * Set Price Entered/Actual. - * Use this Method if the Line UOM is the Product UOM + * Use this Method if the Line UOM is the Product UOM. * @param PriceActual price */ public void setPrice (BigDecimal PriceActual) @@ -288,8 +286,6 @@ public class MOrderLine extends X_C_OrderLine /** * Set Price for Product and PriceList. - * Use only if newly created. - * Uses standard price list of not set by order constructor */ public void setPrice() { @@ -319,7 +315,7 @@ public class MOrderLine extends X_C_OrderLine setPriceEntered(getPriceActual()); else setPriceEntered(getPriceActual().multiply(getQtyOrdered() - .divide(getQtyEntered(), 12, RoundingMode.HALF_UP))); // recision + .divide(getQtyEntered(), 12, RoundingMode.HALF_UP))); // precision // Calculate Discount setDiscount(m_productPrice.getDiscount()); @@ -341,7 +337,7 @@ public class MOrderLine extends X_C_OrderLine // m_productPrice.calculatePrice(); return m_productPrice; - } // getProductPrice + } // getProductPricing /** * Set Tax @@ -364,7 +360,7 @@ public class MOrderLine extends X_C_OrderLine /** * Calculate Extended Amt. - * May or may not include tax + * May or may not include tax. */ public void setLineNetAmt () { @@ -377,7 +373,7 @@ public class MOrderLine extends X_C_OrderLine /** * Get Charge - * @return product or null + * @return charge or null */ public MCharge getCharge() { @@ -448,12 +444,11 @@ public class MOrderLine extends X_C_OrderLine } setM_AttributeSetInstance_ID(0); } // setProduct - /** * Set M_Product_ID * @param M_Product_ID product - * @param setUOM set also UOM + * @param setUOM true to set also UOM */ public void setM_Product_ID (int M_Product_ID, boolean setUOM) { @@ -476,8 +471,7 @@ public class MOrderLine extends X_C_OrderLine super.setC_UOM_ID(C_UOM_ID); setM_AttributeSetInstance_ID(0); } // setM_Product_ID - - + /** * Get Product * @return product or null @@ -542,7 +536,7 @@ public class MOrderLine extends X_C_OrderLine /** * Get C_Project_ID - * @return project + * @return C_Project_ID */ public int getC_Project_ID() { @@ -554,7 +548,7 @@ public class MOrderLine extends X_C_OrderLine /** * Get C_Activity_ID - * @return Activity + * @return C_Activity_ID */ public int getC_Activity_ID() { @@ -566,7 +560,7 @@ public class MOrderLine extends X_C_OrderLine /** * Get C_Campaign_ID - * @return Campaign + * @return C_Campaign_ID */ public int getC_Campaign_ID() { @@ -577,8 +571,8 @@ public class MOrderLine extends X_C_OrderLine } // getC_Campaign_ID /** - * Get User2_ID - * @return User2 + * Get User1_ID + * @return User1_ID */ public int getUser1_ID () { @@ -590,7 +584,7 @@ public class MOrderLine extends X_C_OrderLine /** * Get User2_ID - * @return User2 + * @return User2_ID */ public int getUser2_ID () { @@ -602,7 +596,7 @@ public class MOrderLine extends X_C_OrderLine /** * Get AD_OrgTrx_ID - * @return trx org + * @return AD_OrgTrx_ID */ public int getAD_OrgTrx_ID() { @@ -612,10 +606,11 @@ public class MOrderLine extends X_C_OrderLine return ii; } // getAD_OrgTrx_ID - /************************************************************************** + /** * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MOrderLine[") @@ -645,7 +640,6 @@ public class MOrderLine extends X_C_OrderLine /** * Get Description Text. - * For jsp access (vs. isDescription) * @return description */ public String getDescriptionText() @@ -655,7 +649,7 @@ public class MOrderLine extends X_C_OrderLine /** * Get Name - * @return get the name of the line (from Product) + * @return get the name of the line (from Product or Charge) */ public String getName() { @@ -680,8 +674,9 @@ public class MOrderLine extends X_C_OrderLine if (C_Charge_ID > 0) set_ValueNoCheck ("C_UOM_ID", null); } // setC_Charge_ID + /** - * Set Discount + * Calculate discount percentage (actual vs list) */ public void setDiscount() { @@ -710,11 +705,10 @@ public class MOrderLine extends X_C_OrderLine MPriceList pl = MPriceList.get(getCtx(), m_M_PriceList_ID, get_TrxName()); return pl.isTaxIncluded(); } // isTaxIncluded - /** * Set Qty Entered/Ordered. - * Use this Method if the Line UOM is the Product UOM + * Use this Method if the Line UOM is the Product UOM. * @param Qty QtyOrdered/Entered */ public void setQty (BigDecimal Qty) @@ -724,7 +718,7 @@ public class MOrderLine extends X_C_OrderLine } // setQty /** - * Set Qty Entered - enforce entered UOM + * Set Qty Entered - enforce entered UOM precision. * @param QtyEntered */ public void setQtyEntered (BigDecimal QtyEntered) @@ -738,7 +732,7 @@ public class MOrderLine extends X_C_OrderLine } // setQtyEntered /** - * Set Qty Ordered - enforce Product UOM + * Set Qty Ordered - enforce Product UOM precision. * @param QtyOrdered */ public void setQtyOrdered (BigDecimal QtyOrdered) @@ -754,7 +748,7 @@ public class MOrderLine extends X_C_OrderLine /** * Get Base value for Cost Distribution - * @param CostDistribution cost Distribution + * @param CostDistribution cost Distribution (MLandedCost.LANDEDCOSTDISTRIBUTION_*) * @return base number */ public BigDecimal getBase (String CostDistribution) @@ -792,11 +786,12 @@ public class MOrderLine extends X_C_OrderLine return Env.ZERO; } // getBase - /************************************************************************** + /** * Before Save * @param newRecord * @return true if it can be saved */ + @Override protected boolean beforeSave (boolean newRecord) { if (newRecord && getParent().isProcessed()) { @@ -810,7 +805,6 @@ public class MOrderLine extends X_C_OrderLine setOrder (getParent()); if (m_M_PriceList_ID == 0) setHeaderInfo(getParent()); - // R/O Check - Product/Warehouse Change if (!newRecord @@ -916,9 +910,9 @@ public class MOrderLine extends X_C_OrderLine } // beforeSave /*** - * Sets the default unit of measure - * If there's a product, it sets the UOM of the product - * If not, it sets the default UOM of the client + * Set default unit of measurement.
        + * If there's a product, it sets the UOM of the product.
        + * If not, it sets the default UOM of the client. */ private void setDefaultC_UOM_ID() { int C_UOM_ID = 0; @@ -937,6 +931,7 @@ public class MOrderLine extends X_C_OrderLine * Before Delete * @return true if it can be deleted */ + @Override protected boolean beforeDelete () { // R/O Check - Something delivered. etc. @@ -969,6 +964,7 @@ public class MOrderLine extends X_C_OrderLine * @param success success * @return saved */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -993,6 +989,7 @@ public class MOrderLine extends X_C_OrderLine * @param success success * @return deleted */ + @Override protected boolean afterDelete (boolean success) { if (!success) @@ -1011,7 +1008,7 @@ public class MOrderLine extends X_C_OrderLine * @param oldTax true if the old C_Tax_ID should be used * @return true if success, false otherwise * - * author teo_sarca [ 1583825 ] + * @author teo_sarca [ 1583825 ] */ public boolean updateOrderTax(boolean oldTax) { int C_Tax_ID = getC_Tax_ID(); @@ -1093,6 +1090,9 @@ public class MOrderLine extends X_C_OrderLine } // updateHeaderTax + /** + * Reset {@link #m_parent} to null + */ public void clearParent() { this.m_parent = null; @@ -1100,7 +1100,7 @@ public class MOrderLine extends X_C_OrderLine /** * Get the description stripping the Close tag that was created when closing the order - * @return + * @return stripped description text */ public String getDescriptionStrippingCloseTag() { String description = getDescription(); diff --git a/org.adempiere.base/src/org/compiere/model/MOrderPaySchedule.java b/org.adempiere.base/src/org/compiere/model/MOrderPaySchedule.java index a2ee5ce221..8ea161dd0c 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrderPaySchedule.java +++ b/org.adempiere.base/src/org/compiere/model/MOrderPaySchedule.java @@ -40,7 +40,7 @@ import org.compiere.util.Util; public class MOrderPaySchedule extends X_C_OrderPaySchedule { /** - * + * generated serial id */ private static final long serialVersionUID = 2158181283878369676L; @@ -50,7 +50,7 @@ public class MOrderPaySchedule extends X_C_OrderPaySchedule * @param C_Order_ID order id (direct) * @param C_OrderPaySchedule_ID id (indirect) * @param trxName transaction - * @return array of schedule + * @return array of payment schedule */ public static MOrderPaySchedule[] getOrderPaySchedule(Properties ctx, int C_Order_ID, int C_OrderPaySchedule_ID, String trxName) @@ -99,18 +99,18 @@ public class MOrderPaySchedule extends X_C_OrderPaySchedule private static CLogger s_log = CLogger.getCLogger (MOrderPaySchedule.class); /** - * UUID based Constructor - * @param ctx Context - * @param C_OrderPaySchedule_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_OrderPaySchedule_UU UUID key + * @param trxName Transaction + */ public MOrderPaySchedule(Properties ctx, String C_OrderPaySchedule_UU, String trxName) { super(ctx, C_OrderPaySchedule_UU, trxName); if (Util.isEmpty(C_OrderPaySchedule_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_OrderPaySchedule_ID id @@ -183,10 +183,9 @@ public class MOrderPaySchedule extends X_C_OrderPaySchedule /** Parent */ private MOrder m_parent = null; - /** - * @return Returns the parent. + * @return parent */ public MOrder getParent () { @@ -207,6 +206,7 @@ public class MOrderPaySchedule extends X_C_OrderPaySchedule * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder("MOrderPaySchedule["); @@ -215,19 +215,18 @@ public class MOrderPaySchedule extends X_C_OrderPaySchedule .append("]"); return sb.toString(); } // toString - - - + /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (is_ValueChanged("DueAmt")) { - log.fine("beforeSave"); + if (log.isLoggable(Level.FINE)) log.fine("beforeSave"); setIsValid(false); } return true; @@ -239,13 +238,14 @@ public class MOrderPaySchedule extends X_C_OrderPaySchedule * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) return success; if (is_ValueChanged("DueAmt") || is_ValueChanged("IsActive")) { - log.fine("afterSave"); + if (log.isLoggable(Level.FINE)) log.fine("afterSave"); getParent(); m_parent.validatePaySchedule(); m_parent.saveEx(); @@ -257,7 +257,7 @@ public class MOrderPaySchedule extends X_C_OrderPaySchedule protected boolean afterDelete(boolean success) { if (!success) return success; - log.fine("afterDelete"); + if (log.isLoggable(Level.FINE)) log.fine("afterDelete"); getParent(); m_parent.validatePaySchedule(); m_parent.saveEx(); diff --git a/org.adempiere.base/src/org/compiere/model/MOrderTax.java b/org.adempiere.base/src/org/compiere/model/MOrderTax.java index 4d4e420378..361a9f4cb7 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrderTax.java +++ b/org.adempiere.base/src/org/compiere/model/MOrderTax.java @@ -38,7 +38,7 @@ import org.compiere.util.Util; public class MOrderTax extends X_C_OrderTax { /** - * + * generated serial id */ private static final long serialVersionUID = -6776007249310373908L; @@ -47,8 +47,8 @@ public class MOrderTax extends X_C_OrderTax * Get Tax Line for Order Line * @param line Order line * @param precision currency precision - * @param oldTax get old tax - * @param trxName transaction + * @param oldTax true to get old tax + * @param trxName transaction name * @return existing or new tax */ public static MOrderTax get (MOrderLine line, int precision, @@ -131,9 +131,9 @@ public class MOrderTax extends X_C_OrderTax * Get Child Tax Line for Order Line * @param line Order line * @param precision currency precision - * @param oldTax get old tax - * @param trxName transaction - * @return existing or new tax + * @param oldTax true to get old tax + * @param trxName transaction name + * @return existing or new child tax lines */ public static MOrderTax[] getChildTaxes(MOrderLine line, int precision, boolean oldTax, String trxName) @@ -222,22 +222,20 @@ public class MOrderTax extends X_C_OrderTax /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MOrderTax.class); - - + /** - * UUID based Constructor - * @param ctx Context - * @param C_OrderTax_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_OrderTax_UU UUID key + * @param trxName Transaction + */ public MOrderTax(Properties ctx, String C_OrderTax_UU, String trxName) { super(ctx, C_OrderTax_UU, trxName); if (Util.isEmpty(C_OrderTax_UU)) setInitialDefaults(); } - /************************************************************************** - * Persistence Constructor + /** * @param ctx context * @param ignored ignored * @param trxName transaction @@ -278,7 +276,7 @@ public class MOrderTax extends X_C_OrderTax /** * Get Precision - * @return Returns the precision or 2 + * @return Returns the set precision or 2 */ private int getPrecision () { @@ -306,9 +304,8 @@ public class MOrderTax extends X_C_OrderTax m_tax = MTax.get(getCtx(), getC_Tax_ID()); return m_tax; } // getTax - - /************************************************************************** + /** * Calculate/Set Tax Amt from Order Lines * @return true if calculated */ @@ -378,6 +375,7 @@ public class MOrderTax extends X_C_OrderTax * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MOrderTax[") diff --git a/org.adempiere.base/src/org/compiere/model/MOrg.java b/org.adempiere.base/src/org/compiere/model/MOrg.java index 62d63a5230..df91acf6cd 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrg.java +++ b/org.adempiere.base/src/org/compiere/model/MOrg.java @@ -38,14 +38,14 @@ import org.idempiere.cache.ImmutablePOSupport; public class MOrg extends X_AD_Org implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -8501438599288536080L; /** * Get Active Organizations Of Client - * @param po persistent object - * @return array of orgs + * @param po PO to get AD_Client_ID value + * @return array of organization */ public static MOrg[] getOfClient (PO po) { @@ -54,7 +54,7 @@ public class MOrg extends X_AD_Org implements ImmutablePOSupport /** * Get Active Organizations Of current Client - * @return array of orgs + * @return array of organization */ public static MOrg[] getOfClient () { @@ -64,8 +64,8 @@ public class MOrg extends X_AD_Org implements ImmutablePOSupport /** * Get Active Organizations Of Client * @param ctx context - * @param int clientID - * @return array of orgs + * @param clientID AD_Client_ID + * @return array of organization */ public static MOrg[] getOfClient (int clientID) { @@ -112,21 +112,20 @@ public class MOrg extends X_AD_Org implements ImmutablePOSupport /** Cache */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 50); - - + /** - * UUID based Constructor - * @param ctx Context - * @param AD_Org_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Org_UU UUID key + * @param trxName Transaction + */ public MOrg(Properties ctx, String AD_Org_UU, String trxName) { super(ctx, AD_Org_UU, trxName); if (Util.isEmpty(AD_Org_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param AD_Org_ID id @@ -173,7 +172,7 @@ public class MOrg extends X_AD_Org implements ImmutablePOSupport } // MOrg /** - * + * Copy constructor * @param copy */ public MOrg(MOrg copy) @@ -182,7 +181,7 @@ public class MOrg extends X_AD_Org implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -192,7 +191,7 @@ public class MOrg extends X_AD_Org implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -217,14 +216,13 @@ public class MOrg extends X_AD_Org implements ImmutablePOSupport return orgInfo; } // getMOrgInfo - - /** * After Save * @param newRecord new Record * @param success save success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -276,6 +274,7 @@ public class MOrg extends X_AD_Org implements ImmutablePOSupport * @param success * @return deleted */ + @Override protected boolean afterDelete (boolean success) { if (success) diff --git a/org.adempiere.base/src/org/compiere/model/MOrgInfo.java b/org.adempiere.base/src/org/compiere/model/MOrgInfo.java index baafac70fc..6040e6936c 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrgInfo.java +++ b/org.adempiere.base/src/org/compiere/model/MOrgInfo.java @@ -35,14 +35,14 @@ import org.idempiere.cache.ImmutablePOSupport; public class MOrgInfo extends X_AD_OrgInfo implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -6257741576762100779L; /** * Get MOrgInfo from cache (immutable) * @param AD_Org_ID id - * @return Org Info + * @return MOrgInfo */ public static MOrgInfo get (Properties ctx, int AD_Org_ID) { @@ -112,19 +112,18 @@ public class MOrgInfo extends X_AD_OrgInfo implements ImmutablePOSupport /** Cache */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 50); - /** - * UUID based Constructor - * @param ctx Context - * @param AD_OrgInfo_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_OrgInfo_UU UUID key + * @param trxName Transaction + */ public MOrgInfo(Properties ctx, String AD_OrgInfo_UU, String trxName) { super(ctx, AD_OrgInfo_UU, trxName); } - /************************************************************************** + /** * Load Constructor * @param ctx context * @param rs result set @@ -148,7 +147,7 @@ public class MOrgInfo extends X_AD_OrgInfo implements ImmutablePOSupport } // MOrgInfo /** - * + * Copy constructor * @param copy */ public MOrgInfo(MOrgInfo copy) @@ -157,7 +156,7 @@ public class MOrgInfo extends X_AD_OrgInfo implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -167,7 +166,7 @@ public class MOrgInfo extends X_AD_OrgInfo implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MPAttributeLookup.java b/org.adempiere.base/src/org/compiere/model/MPAttributeLookup.java index 012c06db9a..14cfb7dff4 100644 --- a/org.adempiere.base/src/org/compiere/model/MPAttributeLookup.java +++ b/org.adempiere.base/src/org/compiere/model/MPAttributeLookup.java @@ -30,19 +30,19 @@ import org.compiere.util.KeyNamePair; import org.compiere.util.NamePair; /** - * Product Attribute Lookup Model (not Cached) + * Product Attribute Lookup Model (no local lookup cache) * * @author Jorg Janke * @version $Id: MPAttributeLookup.java,v 1.2 2006/07/30 00:58:38 jjanke Exp $ * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL + * @author Teo Sarca, SC ARHIPAC SERVICE SRL *
      • BF [ 1885260 ] MPAttributeLookup: throws SQLException sometimes */ public class MPAttributeLookup extends Lookup implements Serializable { /** - * + * generated serial id */ private static final long serialVersionUID = 1877125428249819248L; @@ -60,56 +60,62 @@ public class MPAttributeLookup extends Lookup private static KeyNamePair NO_INSTANCE = new KeyNamePair (0,""); /** - * Get Display for Value (not cached) - * @param value Location_ID - * @return String Value + * Get display text for key value (direct from DB) + * @param key Location_ID + * @return Display text */ - public String getDisplay (Object value) + @Override + public String getDisplay (Object key) { - if (value == null) + if (key == null) return ""; - NamePair pp = get (value); + NamePair pp = get (key); if (pp == null) - return "<" + value.toString() + ">"; + return "<" + key.toString() + ">"; return pp.getName(); } // getDisplay /** - * The Lookup contains the key (not cached) + * The Lookup contains the key (direct check against DB) * @param key Location_ID - * @return true if key known + * @return true if key exists */ + @Override public boolean containsKey (Object key) { return get(key) != null; } // containsKey + /** + * Same as {@link #containsKey(Object)} in this lookup implementation + */ + @Override public boolean containsKeyNoDirect (Object key) { return containsKey(key); } /** - * Get Object of Key Value - * @param value value - * @return Object or null + * Get KeyNamePair(M_AttributeSetInstance_ID, Description) of Key Value + * @param key key value (M_AttributeSetInstance_ID) + * @return KeyNamePair(M_AttributeSetInstance_ID, Description) or null */ - public NamePair get (Object value) + public NamePair get (Object key) { - if (value == null) + if (key == null) return null; int M_AttributeSetInstance_ID = 0; - if (value instanceof Integer) - M_AttributeSetInstance_ID = ((Integer)value).intValue(); + if (key instanceof Integer) + M_AttributeSetInstance_ID = ((Integer)key).intValue(); else { try { - M_AttributeSetInstance_ID = Integer.parseInt(value.toString()); + M_AttributeSetInstance_ID = Integer.parseInt(key.toString()); } catch (Exception e) { - log.log(Level.SEVERE, "Value=" + value, e); + log.log(Level.SEVERE, "Value=" + key, e); } } if (M_AttributeSetInstance_ID == 0) @@ -157,17 +163,17 @@ public class MPAttributeLookup extends Lookup */ public void dispose() { - log.fine(""); + if (log.isLoggable(Level.FINE)) log.fine(""); super.dispose(); } // dispose /** - * Return data as sorted Array - not implemented + * Get list of lookup data - not implemented * @param mandatory mandatory * @param onlyValidated only validated * @param onlyActive only active * @param temporary force load for temporary display - * @return null + * @return not implemented, always return null */ public ArrayList getData (boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary, boolean shortlist) // IDEMPIERE 90 { @@ -176,9 +182,7 @@ public class MPAttributeLookup extends Lookup } // getArray /** - * Get underlying fully qualified Table.Column Name. - * Used for VLookup.actionButton (Zoom) - * @return column name + * @return "M_AttributeSetInstance_ID" */ public String getColumnName() { diff --git a/org.adempiere.base/src/org/compiere/model/MPInstance.java b/org.adempiere.base/src/org/compiere/model/MPInstance.java index 5a647ddbbf..6e09ffbe12 100644 --- a/org.adempiere.base/src/org/compiere/model/MPInstance.java +++ b/org.adempiere.base/src/org/compiere/model/MPInstance.java @@ -54,7 +54,7 @@ import org.osgi.service.event.Event; public class MPInstance extends X_AD_PInstance { /** - * + * generated serial id */ private static final long serialVersionUID = -6414730734415159480L; @@ -63,11 +63,11 @@ public class MPInstance extends X_AD_PInstance private static CLogger s_log = CLogger.getCLogger (MPInstance.class); /** - * UUID based Constructor - * @param ctx Context - * @param AD_PInstance_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_PInstance_UU UUID key + * @param trxName Transaction + */ public MPInstance(Properties ctx, String AD_PInstance_UU, String trxName) { super(ctx, AD_PInstance_UU, trxName); if (Util.isEmpty(AD_PInstance_UU)) @@ -112,17 +112,18 @@ public class MPInstance extends X_AD_PInstance * @param Record_ID Record * @deprecated Please use {@link #MPInstance(MProcess, int, int, String)} */ + @Deprecated public MPInstance (MProcess process, int Record_ID) { this(process, -1, Record_ID, null); } /** - * Create Process Instance from Process and create parameters + * Create and save new Process Instance from Process and record parameters * @param process process * @param Table_ID - * @param Record_ID Record - * @param Record_UU + * @param Record_ID Record id + * @param Record_UU Record uuid */ public MPInstance (MProcess process, int Table_ID, int Record_ID, String Record_UU) { @@ -152,6 +153,7 @@ public class MPInstance extends X_AD_PInstance * @param Record_ID record * @deprecated Please use {@link #MPInstance(Properties, int, int, int, String)} */ + @Deprecated public MPInstance (Properties ctx, int AD_Process_ID, int Record_ID) { this(ctx, AD_Process_ID, -1, Record_ID, null); @@ -161,7 +163,9 @@ public class MPInstance extends X_AD_PInstance * New Constructor * @param ctx context * @param AD_Process_ID Process ID - * @param Record_ID record + * @param Table_ID + * @param Record_ID record id + * @param Record_UU record uuid */ public MPInstance (Properties ctx, int AD_Process_ID, int Table_ID, int Record_ID, String Record_UU) { @@ -174,13 +178,12 @@ public class MPInstance extends X_AD_PInstance setIsProcessing (false); } // MPInstance - /** Parameters */ private MPInstancePara[] m_parameters = null; /** - * Get Parameters - * @return parameter array + * Get Instance Parameters + * @return instance parameter array */ public MPInstancePara[] getParameters() { @@ -201,7 +204,7 @@ public class MPInstance extends X_AD_PInstance /** * Get Process Parameters - * @return processParameters array + * @return process parameters array */ public MProcessPara[] getProcessParameters() { @@ -219,10 +222,10 @@ public class MPInstance extends X_AD_PInstance } // getParameters /** - * Validate that a set of process instance parameters are equal or not - * to the current instance parameter - * @param params array of parameters to compare - * @return true if the process instance parameters are the same as the array ones + * Check whether a set of process instance parameters are equal + * to the current instance parameters. + * @param params array of instance parameters to compare + * @return true if the process instance parameters equals to this instance's instance parameters */ public boolean equalParameters(MPInstancePara[] params) { @@ -250,12 +253,12 @@ public class MPInstance extends X_AD_PInstance return comparedParams == getParameters().length; //all the compared parameters have the same name and value } - /** Log Entries */ + /** Instance Log Entries */ private ArrayList m_log = new ArrayList(); /** - * Get Logs - * @return array of logs + * Get Instance Logs + * @return array of instance logs */ public MPInstanceLog[] getLog() { @@ -290,10 +293,12 @@ public class MPInstance extends X_AD_PInstance } // getLog /** + * Add instance log * @param P_Date date * @param P_ID id * @param P_Number number * @param P_Msg msg + * @return added instance log */ public MPInstanceLog addLog (Timestamp P_Date, int P_ID, BigDecimal P_Number, String P_Msg) { @@ -301,13 +306,14 @@ public class MPInstance extends X_AD_PInstance } // addLog /** + * Add instance log * @param P_Date date * @param P_ID id * @param P_Number number * @param P_Msg msg * @param AD_Table_ID tableID * @param Record_ID recordID - * @return + * @return added instance log */ public MPInstanceLog addLog (Timestamp P_Date, int P_ID, BigDecimal P_Number, String P_Msg, int AD_Table_ID, int Record_ID) { @@ -320,7 +326,7 @@ public class MPInstance extends X_AD_PInstance /** * Set AD_Process_ID. - * Check Role if process can be performed + * Throw exception if current role has no permission to run the process. * @param AD_Process_ID process */ public void setAD_Process_ID (int AD_Process_ID) @@ -345,7 +351,6 @@ public class MPInstance extends X_AD_PInstance /** * Set Record ID. - * direct internal record ID * @param Record_ID record **/ public void setRecord_ID (int Record_ID) @@ -363,6 +368,7 @@ public class MPInstance extends X_AD_PInstance * @see java.lang.Object#toString() * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MPInstance[") @@ -376,7 +382,7 @@ public class MPInstance extends X_AD_PInstance } // toString /** - * Dump Log + * Dump Instance Logs to server log */ public void log() { @@ -395,7 +401,7 @@ public class MPInstance extends X_AD_PInstance /** * Is it OK - * @return Result == OK + * @return true if Result == OK */ public boolean isOK() { @@ -417,6 +423,7 @@ public class MPInstance extends X_AD_PInstance * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -446,7 +453,7 @@ public class MPInstance extends X_AD_PInstance * @param seqNo parameter sequence# * @param parameterName parameter name * @param value parameter value - * @return + * @return instance parameter */ public MPInstancePara createParameter(int seqNo, String parameterName, Object value) { @@ -486,6 +493,11 @@ public class MPInstance extends X_AD_PInstance return MProcess.get(getAD_Process_ID()); } + /** + * Publish ON_RUNNING_JOB_CHANGED_TOPIC message to message service.
        + * If message service is not available, post as OSGi event instead. + * @param AD_User_ID + */ public static void publishChangedEvent(int AD_User_ID) { IMessageService service = Core.getMessageService(); if (service != null) { @@ -496,6 +508,10 @@ public class MPInstance extends X_AD_PInstance } } + /** + * Post ON_RUNNING_JOB_CHANGED_TOPIC OSGi event. + * @param AD_User_ID + */ public static void postOnChangedEvent(int AD_User_ID) { Map properties = new HashMap(); properties.put("AD_User_ID", AD_User_ID); @@ -503,6 +519,13 @@ public class MPInstance extends X_AD_PInstance EventManager.getInstance().postEvent(event); } + /** + * Get list of process instance via AD_Process_ID and AD_User_ID + * @param ctx + * @param AD_Process_ID + * @param AD_User_ID + * @return process instance list + */ public static List get(Properties ctx, int AD_Process_ID, int AD_User_ID) { List list = new ArrayList(); List paramsStrAdded = new ArrayList(); @@ -564,6 +587,9 @@ public class MPInstance extends X_AD_PInstance return list; } + /** + * @return String concatenate all instance parameter values + */ private String getParamsStr() { StringBuilder cksum = new StringBuilder(); for (MPInstancePara ip : getParameters()) { @@ -590,7 +616,7 @@ public class MPInstance extends X_AD_PInstance } /** - * + * Get instance info * @param AD_PInstance_ID * @return {@link PInstanceInfo} * @throws SQLException @@ -660,9 +686,8 @@ public class MPInstance extends X_AD_PInstance } /** - * Record class with fields from AD_PInstance+AD_Process + * Instance info record class with fields from AD_PInstance+AD_Process * @author hengsin - * */ public static class PInstanceInfo { public int AD_Process_ID; @@ -684,6 +709,7 @@ public class MPInstance extends X_AD_PInstance * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (newRecord) { diff --git a/org.adempiere.base/src/org/compiere/model/MPInstanceLog.java b/org.adempiere.base/src/org/compiere/model/MPInstanceLog.java index bab8a4fad4..74951c05f9 100644 --- a/org.adempiere.base/src/org/compiere/model/MPInstanceLog.java +++ b/org.adempiere.base/src/org/compiere/model/MPInstanceLog.java @@ -29,7 +29,7 @@ import org.compiere.util.Util; /** * Process Instance Log Model. - * (not standard table) + * (not standard table and not using PO) * * @author Jorg Janke * @version $Id: MPInstanceLog.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $ @@ -37,7 +37,6 @@ import org.compiere.util.Util; public class MPInstanceLog { /** - * Constructor without Table/Record * @param AD_PInstance_ID instance * @param Log_ID log sequence * @param P_Date date @@ -52,7 +51,6 @@ public class MPInstanceLog } // MPInstance_Log /** - * Constructor without PInstanceLogType * @param AD_PInstance_ID * @param Log_ID * @param P_Date @@ -69,7 +67,6 @@ public class MPInstanceLog } // MPInstance_Log /** - * Constructor without AD_PInstance_Log_UU * @param AD_PInstance_ID * @param Log_ID * @param P_Date @@ -78,7 +75,7 @@ public class MPInstanceLog * @param P_Msg * @param AD_Table_ID * @param Record_ID - * @param PInstanceLogType Log Type + * @param PInstanceLogType Log Type X_AD_PInstance_Log.PINSTANCELOGTYPE_* */ public MPInstanceLog (int AD_PInstance_ID, int Log_ID, Timestamp P_Date, int P_ID, BigDecimal P_Number, String P_Msg, int AD_Table_ID, int Record_ID, String PInstanceLogType) @@ -97,7 +94,7 @@ public class MPInstanceLog * @param P_Msg * @param AD_Table_ID * @param Record_ID - * @param PInstanceLogType Log Type + * @param PInstanceLogType Log Type X_AD_PInstance_Log.PINSTANCELOGTYPE_* */ public MPInstanceLog (String AD_PInstance_Log_UU, int AD_PInstance_ID, int Log_ID, Timestamp P_Date, int P_ID, BigDecimal P_Number, String P_Msg, int AD_Table_ID, int Record_ID, String PInstanceLogType) @@ -130,7 +127,6 @@ public class MPInstanceLog setP_Msg(rs.getString("P_Msg")); } // MPInstance_Log - private int m_AD_PInstance_ID; private int m_Log_ID; private Timestamp m_P_Date; @@ -142,11 +138,11 @@ public class MPInstanceLog private String m_PInstanceLogType; private String m_AD_PInstance_Log_UU; - /** * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder("PPInstance_Log["); @@ -163,7 +159,6 @@ public class MPInstanceLog return sb.toString(); } // toString - private final static String insertSql = "INSERT INTO AD_PInstance_Log " + "(AD_PInstance_ID, Log_ID, P_Date, P_ID, P_Number, P_Msg, AD_Table_ID, Record_ID, AD_PInstance_Log_UU, PInstanceLogType)" + " VALUES (?,?,?,?,?,?,?,?,?,?) "; @@ -189,7 +184,7 @@ public class MPInstanceLog } // save /** - * Save to Database throwing Exception + * Save to Database, throw Exception if there are errors. */ public void saveEx () { @@ -207,7 +202,7 @@ public class MPInstanceLog } // update /** - * Update record in Database, throwing Exception + * Update record in Database, throw Exception if there are errors. */ public void updateEx () { @@ -223,8 +218,7 @@ public class MPInstanceLog MColumn colMsg = MColumn.get(Env.getCtx(), I_AD_PInstance_Log.Table_Name, I_AD_PInstance_Log.COLUMNNAME_P_Msg); int maxMsgLength = colMsg.getFieldLength(); ArrayList params = new ArrayList (); - - + if(isInsert) { params.add(m_AD_PInstance_ID); params.add(m_Log_ID); @@ -259,7 +253,7 @@ public class MPInstanceLog /** * Get AD_PInstance_ID - * @return Instance id + * @return AD_PInstance_ID */ public int getAD_PInstance_ID () { @@ -277,7 +271,7 @@ public class MPInstanceLog /** * Get Log_ID - * @return log id + * @return Log_ID */ public int getLog_ID () { @@ -295,7 +289,7 @@ public class MPInstanceLog /** * Get P_Date - * @return date + * @return P_Date */ public Timestamp getP_Date () { @@ -313,7 +307,7 @@ public class MPInstanceLog /** * Get P_ID - * @return id + * @return P_ID */ public int getP_ID () { @@ -331,7 +325,7 @@ public class MPInstanceLog /** * Get P_Number - * @return number + * @return P_Number */ public BigDecimal getP_Number () { @@ -349,7 +343,7 @@ public class MPInstanceLog /** * Get P_Msg - * @return Mag + * @return P_Msg */ public String getP_Msg () { @@ -367,7 +361,7 @@ public class MPInstanceLog /** * Get Table ID - * @return Table ID + * @return AD_Table_ID */ public int getAD_Table_ID() { @@ -385,7 +379,7 @@ public class MPInstanceLog /** * Get Record ID - * @return Record ID + * @return Record_ID */ public int getRecord_ID() { @@ -403,7 +397,7 @@ public class MPInstanceLog /** * Get Log Type - * @return Log Type + * @return Instance Log Type (X_AD_PInstance_Log.PINSTANCELOGTYPE_*) */ public String getPInstanceLogType() { return m_PInstanceLogType; @@ -411,7 +405,7 @@ public class MPInstanceLog /** * Set Log Type - * @param m_PInstanceLogType + * @param m_PInstanceLogType X_AD_PInstance_Log.PINSTANCELOGTYPE_* */ public void setPInstanceLogType(String m_PInstanceLogType) { this.m_PInstanceLogType = m_PInstanceLogType; diff --git a/org.adempiere.base/src/org/compiere/model/MPInstancePara.java b/org.adempiere.base/src/org/compiere/model/MPInstancePara.java index a664b89411..e335e542b9 100644 --- a/org.adempiere.base/src/org/compiere/model/MPInstancePara.java +++ b/org.adempiere.base/src/org/compiere/model/MPInstancePara.java @@ -29,25 +29,23 @@ import java.util.Properties; * @version $Id: MPInstancePara.java,v 1.3 2006/07/30 00:58:05 jjanke Exp $ */ public class MPInstancePara extends X_AD_PInstance_Para -{ - +{ /** - * + * generated serial id */ private static final long serialVersionUID = -8407658637240252680L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_PInstance_Para_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_PInstance_Para_UU UUID key + * @param trxName Transaction + */ public MPInstancePara(Properties ctx, String AD_PInstance_Para_UU, String trxName) { super(ctx, AD_PInstance_Para_UU, trxName); } /** - * Persistence Constructor * @param ctx context * @param ignored ignored * @param trxName transaction @@ -84,8 +82,6 @@ public class MPInstancePara extends X_AD_PInstance_Para setSeqNo (SeqNo); } // MPInstance_Para - - /** * Load Constructor * @param ctx context @@ -101,6 +97,7 @@ public class MPInstancePara extends X_AD_PInstance_Para * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MPInstancePara[") @@ -244,6 +241,10 @@ public class MPInstancePara extends X_AD_PInstance_Para return -1; } + /** + * @param param + * @return true if param is equal to this instance parameter record + */ public boolean equalParameter(MPInstancePara param) { if (param == null) @@ -278,6 +279,7 @@ public class MPInstancePara extends X_AD_PInstance_Para * @param ctx * @param AD_PInstance_ID * @param SeqNo + * @return MPInstancePara */ public static MPInstancePara getOrCreate(Properties ctx, int AD_PInstance_ID, int SeqNo) { diff --git a/org.adempiere.base/src/org/compiere/model/MPOS.java b/org.adempiere.base/src/org/compiere/model/MPOS.java index 2566a577fe..b2f1c7948e 100644 --- a/org.adempiere.base/src/org/compiere/model/MPOS.java +++ b/org.adempiere.base/src/org/compiere/model/MPOS.java @@ -27,7 +27,6 @@ import org.compiere.util.Util; import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; - /** * POS Terminal definition * @@ -37,7 +36,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MPOS extends X_C_POS implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 2499679269059812831L; @@ -73,11 +72,11 @@ public class MPOS extends X_C_POS implements ImmutablePOSupport } // get /** - * Get POSes for passed argument + * Get POS records for passed argument * @param ctx context - * @param field - * @param ID - * @return POSes + * @param field column name + * @param ID id value for field + * @return array of MPOS */ public static MPOS[] getAll (Properties ctx, String field, int ID) { @@ -94,11 +93,11 @@ public class MPOS extends X_C_POS implements ImmutablePOSupport private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 20); /** - * UUID based Constructor - * @param ctx Context - * @param C_POS_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_POS_UU UUID key + * @param trxName Transaction + */ public MPOS(Properties ctx, String C_POS_UU, String trxName) { super(ctx, C_POS_UU, trxName); if (Util.isEmpty(C_POS_UU)) @@ -137,7 +136,7 @@ public class MPOS extends X_C_POS implements ImmutablePOSupport } // MPOS /** - * + * Copy constructor * @param copy */ public MPOS(MPOS copy) @@ -146,7 +145,7 @@ public class MPOS extends X_C_POS implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -156,7 +155,7 @@ public class MPOS extends X_C_POS implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -170,14 +169,13 @@ public class MPOS extends X_C_POS implements ImmutablePOSupport /** Cash Business Partner */ private MBPartner m_template = null; - - - + /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { // Org Consistency @@ -201,10 +199,9 @@ public class MPOS extends X_C_POS implements ImmutablePOSupport } return true; } // beforeSave - /** - * Get default Cash BPartner + * Get template Cash BPartner * @return BPartner */ public MBPartner getBPartner() diff --git a/org.adempiere.base/src/org/compiere/model/MPOSKey.java b/org.adempiere.base/src/org/compiere/model/MPOSKey.java index 2a382218eb..c58b4c5ebb 100644 --- a/org.adempiere.base/src/org/compiere/model/MPOSKey.java +++ b/org.adempiere.base/src/org/compiere/model/MPOSKey.java @@ -22,7 +22,6 @@ import java.util.Properties; import org.compiere.util.Env; import org.idempiere.cache.ImmutablePOSupport; - /** * POS Function Key Model * @@ -32,16 +31,16 @@ import org.idempiere.cache.ImmutablePOSupport; public class MPOSKey extends X_C_POSKey implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -5138032789563975514L; /** - * UUID based Constructor - * @param ctx Context - * @param C_POSKey_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_POSKey_UU UUID key + * @param trxName Transaction + */ public MPOSKey(Properties ctx, String C_POSKey_UU, String trxName) { super(ctx, C_POSKey_UU, trxName); } @@ -69,7 +68,7 @@ public class MPOSKey extends X_C_POSKey implements ImmutablePOSupport } // MPOSKey /** - * + * Copy constructor * @param copy */ public MPOSKey(MPOSKey copy) @@ -78,7 +77,7 @@ public class MPOSKey extends X_C_POSKey implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -88,7 +87,7 @@ public class MPOSKey extends X_C_POSKey implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MPOSKeyLayout.java b/org.adempiere.base/src/org/compiere/model/MPOSKeyLayout.java index ddf49f046e..3ebf195799 100644 --- a/org.adempiere.base/src/org/compiere/model/MPOSKeyLayout.java +++ b/org.adempiere.base/src/org/compiere/model/MPOSKeyLayout.java @@ -37,7 +37,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MPOSKeyLayout extends X_C_POSKeyLayout implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 8100247902607470888L; @@ -76,11 +76,11 @@ public class MPOSKeyLayout extends X_C_POSKeyLayout implements ImmutablePOSuppor private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 3); /** - * UUID based Constructor - * @param ctx Context - * @param C_POSKeyLayout_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_POSKeyLayout_UU UUID key + * @param trxName Transaction + */ public MPOSKeyLayout(Properties ctx, String C_POSKeyLayout_UU, String trxName) { super(ctx, C_POSKeyLayout_UU, trxName); } @@ -108,7 +108,7 @@ public class MPOSKeyLayout extends X_C_POSKeyLayout implements ImmutablePOSuppor } // MPOSKeyLayout /** - * + * Copy constructor * @param copy */ public MPOSKeyLayout(MPOSKeyLayout copy) @@ -117,7 +117,7 @@ public class MPOSKeyLayout extends X_C_POSKeyLayout implements ImmutablePOSuppor } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -127,7 +127,7 @@ public class MPOSKeyLayout extends X_C_POSKeyLayout implements ImmutablePOSuppor } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -143,9 +143,9 @@ public class MPOSKeyLayout extends X_C_POSKeyLayout implements ImmutablePOSuppor private MPOSKey[] m_keys = null; /** - * Get Keys + * Get POS Keys * @param requery requery - * @return keys + * @return array of MPOSKey */ public MPOSKey[] getKeys (boolean requery) { diff --git a/org.adempiere.base/src/org/compiere/model/MPOSPayment.java b/org.adempiere.base/src/org/compiere/model/MPOSPayment.java index 9b06b5853b..091663328e 100644 --- a/org.adempiere.base/src/org/compiere/model/MPOSPayment.java +++ b/org.adempiere.base/src/org/compiere/model/MPOSPayment.java @@ -22,7 +22,6 @@ * Contributors: * * - Carlos Ruiz - globalqss - bxservice * **********************************************************************/ - package org.compiere.model; import java.sql.ResultSet; @@ -32,14 +31,13 @@ import org.compiere.util.CLogger; import org.compiere.util.Msg; /** -* -* @author Carlos Ruiz - globalqss - bxservice -* -*/ + * POS Payment + * @author Carlos Ruiz - globalqss - bxservice + */ public class MPOSPayment extends X_C_POSPayment { /** - * + * generated serial id */ private static final long serialVersionUID = -4889347016616915128L; @@ -47,16 +45,16 @@ public class MPOSPayment extends X_C_POSPayment protected static CLogger s_log = CLogger.getCLogger (MPOSPayment.class); /** - * UUID based Constructor - * @param ctx Context - * @param C_POSPayment_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_POSPayment_UU UUID key + * @param trxName Transaction + */ public MPOSPayment(Properties ctx, String C_POSPayment_UU, String trxName) { super(ctx, C_POSPayment_UU, trxName); } - /************************************************************************** + /** * Default Constructor * @param ctx context * @param C_POSPayment_ID order line to load @@ -78,11 +76,12 @@ public class MPOSPayment extends X_C_POSPayment super(ctx, rs, trxName); } // MPOSPayment - /************************************************************************** + /** * Before Save * @param newRecord * @return true if it can be saved */ + @Override protected boolean beforeSave (boolean newRecord) { MOrder parent = new MOrder(getCtx(), getC_Order_ID(), get_TrxName()); diff --git a/org.adempiere.base/src/org/compiere/model/MPOSTerminal.java b/org.adempiere.base/src/org/compiere/model/MPOSTerminal.java index d88bc53bee..915d5d2098 100644 --- a/org.adempiere.base/src/org/compiere/model/MPOSTerminal.java +++ b/org.adempiere.base/src/org/compiere/model/MPOSTerminal.java @@ -27,12 +27,11 @@ import org.compiere.util.Env; /** * @author Ashley G Ramdass - * */ public class MPOSTerminal extends X_U_POSTerminal { /** - * + * generated serial id */ private static final long serialVersionUID = 6972567212871993024L; @@ -47,11 +46,11 @@ public class MPOSTerminal extends X_U_POSTerminal } /** - * UUID based Constructor - * @param ctx Context - * @param U_POSTerminal_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param U_POSTerminal_UU UUID key + * @param trxName Transaction + */ public MPOSTerminal(Properties ctx, String U_POSTerminal_UU, String trxName) { super(ctx, U_POSTerminal_UU, trxName); } @@ -67,7 +66,7 @@ public class MPOSTerminal extends X_U_POSTerminal } /** - * + * Copy constructor * @param copy */ public MPOSTerminal(MPOSTerminal copy) @@ -76,7 +75,7 @@ public class MPOSTerminal extends X_U_POSTerminal } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -86,7 +85,7 @@ public class MPOSTerminal extends X_U_POSTerminal } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -123,6 +122,7 @@ public class MPOSTerminal extends X_U_POSTerminal return retValue; } + @Override protected void loadComplete(boolean success) { if (success) @@ -131,6 +131,9 @@ public class MPOSTerminal extends X_U_POSTerminal } } + /** + * @param terminal + */ public static void checkLock(MPOSTerminal terminal) { if (terminal.isLocked()) @@ -156,6 +159,7 @@ public class MPOSTerminal extends X_U_POSTerminal /** * @see org.compiere.model.PO#beforeSave(boolean) */ + @Override protected boolean beforeSave(boolean newRecord) { if (is_ValueChanged(COLUMNNAME_Locked) && isLocked()) diff --git a/org.adempiere.base/src/org/compiere/model/MPackage.java b/org.adempiere.base/src/org/compiere/model/MPackage.java index 347dcfd921..a327c5594c 100644 --- a/org.adempiere.base/src/org/compiere/model/MPackage.java +++ b/org.adempiere.base/src/org/compiere/model/MPackage.java @@ -31,9 +31,8 @@ import org.compiere.util.Util; import org.eevolution.model.MPPProductBOM; import org.eevolution.model.MPPProductBOMLine; - /** - * Package Model + * Shipment Package Model * * @author Jorg Janke * @version $Id: MPackage.java,v 1.3 2006/07/30 00:51:04 jjanke Exp $ @@ -41,12 +40,12 @@ import org.eevolution.model.MPPProductBOMLine; public class MPackage extends X_M_Package { /** - * + * generated serial id */ private static final long serialVersionUID = 6082002551560148518L; /** - * Create one Package for Shipment + * Create Package with one MPackageMPS for Shipment * @param shipment shipment * @param shipper shipper * @param shipDate null for today @@ -102,7 +101,13 @@ public class MPackage extends X_M_Package return retValue; } // create - + /** + * Create shipment package + * @param shipment + * @param shipper + * @param shipDate + * @return + */ public static MPackage createPackage (MInOut shipment, MShipper shipper, Timestamp shipDate) { MPackage retValue = new MPackage (shipment, shipper); @@ -115,19 +120,18 @@ public class MPackage extends X_M_Package } /** - * UUID based Constructor - * @param ctx Context - * @param M_Package_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_Package_UU UUID key + * @param trxName Transaction + */ public MPackage(Properties ctx, String M_Package_UU, String trxName) { super(ctx, M_Package_UU, trxName); if (Util.isEmpty(M_Package_UU)) setInitialDefaults(ctx); } - /************************************************************************** - * MPackage + /** * @param ctx context * @param M_Package_ID id * @param trxName transaction @@ -236,6 +240,7 @@ public class MPackage extends X_M_Package } } // MPackage + @Override protected boolean beforeSave(boolean newRecord) { if (getWeight() == null || getWeight().compareTo(BigDecimal.ZERO) == 0) @@ -250,6 +255,7 @@ public class MPackage extends X_M_Package return true; } + @Override protected boolean afterSave(boolean newRecord, boolean success) { if (!success) @@ -272,7 +278,8 @@ public class MPackage extends X_M_Package return success; } - + + @Override protected boolean beforeDelete() { String sql = "DELETE FROM M_PackageLine WHERE M_PackageMPS_ID IN (SELECT M_PackageMPS_ID FROM M_PackageMPS WHERE M_Package_ID = ?)"; @@ -286,16 +293,28 @@ public class MPackage extends X_M_Package /** Error Message */ private String m_errorMessage = null; + /** + * @param errorMessage + */ public void setErrorMessage(String errorMessage) { m_errorMessage = errorMessage; } + /** + * @return error message + */ public String getErrorMessage() { return m_errorMessage; } + /** + * Execute online processing of shipment package + * @param action MShippingTransaction.ACTION_* + * @param isPriviledgedRate + * @return true if success + */ public boolean processOnline(String action, boolean isPriviledgedRate) { setErrorMessage(null); @@ -406,6 +425,13 @@ public class MPackage extends X_M_Package return ok; } + /** + * Create online shipping transaction + * @param action MShippingTransaction.ACTION_* + * @param isPriviledgedRate + * @param trxName + * @return MShippingTransaction + */ public MShippingTransaction createShippingTransaction(String action, boolean isPriviledgedRate, String trxName) { MInOut ioOut = null; diff --git a/org.adempiere.base/src/org/compiere/model/MPackageMPS.java b/org.adempiere.base/src/org/compiere/model/MPackageMPS.java index 8004541c35..67f2b787a8 100644 --- a/org.adempiere.base/src/org/compiere/model/MPackageMPS.java +++ b/org.adempiere.base/src/org/compiere/model/MPackageMPS.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.math.BigDecimal; @@ -7,25 +28,33 @@ import java.util.Properties; import org.compiere.util.DB; import org.compiere.util.Util; +/** + * Multiple Package Shipment (for e.g Fedex MPS) for Shipment Package (MPackage) + */ public class MPackageMPS extends X_M_PackageMPS { /** - * + * generated serial id */ private static final long serialVersionUID = 2426722699419960060L; /** - * UUID based Constructor - * @param ctx Context - * @param M_PackageMPS_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_PackageMPS_UU UUID key + * @param trxName Transaction + */ public MPackageMPS(Properties ctx, String M_PackageMPS_UU, String trxName) { super(ctx, M_PackageMPS_UU, trxName); if (Util.isEmpty(M_PackageMPS_UU)) setInitialDefaults(ctx); } - + + /** + * @param ctx + * @param M_PackageMPS_ID + * @param trxName + */ public MPackageMPS(Properties ctx, int M_PackageMPS_ID, String trxName) { super(ctx, M_PackageMPS_ID, trxName); @@ -42,11 +71,17 @@ public class MPackageMPS extends X_M_PackageMPS setC_UOM_Length_ID(clientInfo.getC_UOM_Length_ID()); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MPackageMPS(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } + @Override protected boolean beforeSave(boolean newRecord) { if (getSeqNo() == 0) @@ -68,6 +103,7 @@ public class MPackageMPS extends X_M_PackageMPS return true; } + @Override protected boolean beforeDelete() { String sql = "DELETE FROM M_PackageLine WHERE M_PackageMPS_ID = ?"; diff --git a/org.adempiere.base/src/org/compiere/model/MPasswordHistory.java b/org.adempiere.base/src/org/compiere/model/MPasswordHistory.java index 31897ba2e8..f958bcbfb9 100644 --- a/org.adempiere.base/src/org/compiere/model/MPasswordHistory.java +++ b/org.adempiere.base/src/org/compiere/model/MPasswordHistory.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.sql.ResultSet; @@ -9,28 +30,42 @@ import org.compiere.util.Env; public class MPasswordHistory extends X_AD_Password_History { /** - * + * generated serial id */ private static final long serialVersionUID = -5199700193821111847L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Password_History_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Password_History_UU UUID key + * @param trxName Transaction + */ public MPasswordHistory(Properties ctx, String AD_Password_History_UU, String trxName) { super(ctx, AD_Password_History_UU, trxName); } + /** + * @param ctx + * @param AD_Password_History_ID + * @param trxName + */ public MPasswordHistory(Properties ctx, int AD_Password_History_ID, String trxName) { super(ctx, AD_Password_History_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MPasswordHistory(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } + /** + * @param salt + * @param password + */ public MPasswordHistory(String salt, String password) { super(Env.getCtx(), 0, null); this.setSalt(salt); @@ -38,10 +73,10 @@ public class MPasswordHistory extends X_AD_Password_History { } /** - * get list password history has age <= passwordMaxDay + daysReuse + * get password history records with age <= passwordMaxDay + daysReuse * @param daysReuse max day can't reuse password, get from password rule - * @param userId - * @return + * @param userId AD_User_ID + * @return list of password history record */ public static List getPasswordHistoryForCheck (int daysReuse, int userId){ if (daysReuse <= 0) { diff --git a/org.adempiere.base/src/org/compiere/model/MPasswordRule.java b/org.adempiere.base/src/org/compiere/model/MPasswordRule.java index 356ef3e20e..bc394d2d6e 100644 --- a/org.adempiere.base/src/org/compiere/model/MPasswordRule.java +++ b/org.adempiere.base/src/org/compiere/model/MPasswordRule.java @@ -55,25 +55,23 @@ import org.passay.dictionary.WordListDictionary; import org.passay.dictionary.WordLists; import org.passay.dictionary.sort.ArraysSort; - /** * @author juliana - * */ public class MPasswordRule extends X_AD_PasswordRule { /** - * + * generated serial id */ private static final long serialVersionUID = 6778305268023192107L; private static final String passay_prefix = "PASSAY_"; /** - * UUID based Constructor - * @param ctx Context - * @param AD_PasswordRule_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_PasswordRule_UU UUID key + * @param trxName Transaction + */ public MPasswordRule(Properties ctx, String AD_PasswordRule_UU, String trxName) { super(ctx, AD_PasswordRule_UU, trxName); } @@ -96,6 +94,11 @@ public class MPasswordRule extends X_AD_PasswordRule { super(ctx, rs, trxName); } + /** + * @param ctx + * @param trxName + * @return password rule + */ public static MPasswordRule getRules(Properties ctx, String trxName) { MClient system = MClient.get(ctx, 0); int pwdruleID = system.getAD_PasswordRule_ID(); @@ -122,6 +125,13 @@ public class MPasswordRule extends X_AD_PasswordRule { return true; } + /** + * Validate newPassword against system password rule. + * @param username + * @param newPassword + * @param passwordHistorys + * @throws AdempiereException if newPassword fail password rule validation + */ public void validate(String username, String newPassword, List passwordHistorys) throws AdempiereException { ArrayList ruleList = new ArrayList(); @@ -260,6 +270,9 @@ public class MPasswordRule extends X_AD_PasswordRule { return format; } + /** + * @return MessageResolver + */ private MessageResolver getCustomResolver() { Properties props = null; InputStream in = null; @@ -288,6 +301,10 @@ public class MPasswordRule extends X_AD_PasswordRule { return new PropertiesMessageResolver(props); } + /** + * Generate new password + * @return new password generated + */ public String generate() { CharacterCharacteristicsRule charRule = new CharacterCharacteristicsRule(); int numValidations = 0; diff --git a/org.adempiere.base/src/org/compiere/model/MPaySchedule.java b/org.adempiere.base/src/org/compiere/model/MPaySchedule.java index d3d4da2a60..5e6857dfbd 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaySchedule.java +++ b/org.adempiere.base/src/org/compiere/model/MPaySchedule.java @@ -31,16 +31,16 @@ import org.compiere.util.Util; public class MPaySchedule extends X_C_PaySchedule { /** - * + * generated serial id */ private static final long serialVersionUID = 7773501661681911294L; /** - * UUID based Constructor - * @param ctx Context - * @param C_PaySchedule_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_PaySchedule_UU UUID key + * @param trxName Transaction + */ public MPaySchedule(Properties ctx, String C_PaySchedule_UU, String trxName) { super(ctx, C_PaySchedule_UU, trxName); if (Util.isEmpty(C_PaySchedule_UU)) @@ -87,7 +87,7 @@ public class MPaySchedule extends X_C_PaySchedule public MPaymentTerm m_parent = null; /** - * @return Returns the parent. + * @return MPaymentTerm */ public MPaymentTerm getParent () { @@ -109,6 +109,7 @@ public class MPaySchedule extends X_C_PaySchedule * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (is_ValueChanged("Percentage") || is_ValueChanged("IsActive")) @@ -125,6 +126,7 @@ public class MPaySchedule extends X_C_PaySchedule * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -148,6 +150,5 @@ public class MPaySchedule extends X_C_PaySchedule m_parent.saveEx(); return true; } - - + } // MPaySchedule diff --git a/org.adempiere.base/src/org/compiere/model/MPaySelection.java b/org.adempiere.base/src/org/compiere/model/MPaySelection.java index aa5cd2d7c9..3eec02271b 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaySelection.java +++ b/org.adempiere.base/src/org/compiere/model/MPaySelection.java @@ -32,18 +32,17 @@ import org.compiere.util.Util; */ public class MPaySelection extends X_C_PaySelection { - /** - * + * generated serial id */ private static final long serialVersionUID = -6521282913549455131L; /** - * UUID based Constructor - * @param ctx Context - * @param C_PaySelection_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_PaySelection_UU UUID key + * @param trxName Transaction + */ public MPaySelection(Properties ctx, String C_PaySelection_UU, String trxName) { super(ctx, C_PaySelection_UU, trxName); if (Util.isEmpty(C_PaySelection_UU)) @@ -91,8 +90,8 @@ public class MPaySelection extends X_C_PaySelection /** * Get Lines - * @param requery requery - * @return lines + * @param requery true to re-query from DB + * @return payment selection lines */ public MPaySelectionLine[] getLines(boolean requery) { @@ -127,12 +126,12 @@ public class MPaySelection extends X_C_PaySelection } return m_C_Currency_ID; } // getC_Currency_ID - - + /** * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder("MPaySelection["); @@ -140,7 +139,5 @@ public class MPaySelection extends X_C_PaySelection .append("]"); return sb.toString(); } // toString - - - + } // MPaySelection diff --git a/org.adempiere.base/src/org/compiere/model/MPaySelectionCheck.java b/org.adempiere.base/src/org/compiere/model/MPaySelectionCheck.java index d88cc55dd1..28cbf380d1 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaySelectionCheck.java +++ b/org.adempiere.base/src/org/compiere/model/MPaySelectionCheck.java @@ -45,12 +45,12 @@ import org.compiere.util.Util; public class MPaySelectionCheck extends X_C_PaySelectionCheck { /** - * + * generated serial id */ private static final long serialVersionUID = 2130445794890189020L; /** - * Get Check for Payment + * Get Pay Selection Check for Payment * @param ctx context * @param C_Payment_ID id * @param trxName transaction @@ -94,11 +94,11 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck } // getOfPayment /** - * Create Check for Payment + * Create Pay Selection and Pay Selection Check for Payment * @param ctx context * @param C_Payment_ID id * @param trxName transaction - * @return pay selection check for payment or null + * @return MPaySelectionCheck for payment or null */ public static MPaySelectionCheck createForPayment (Properties ctx, int C_Payment_ID, String trxName) { @@ -197,13 +197,13 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck return psc; } // createForPayment - /************************************************************************** - * Get Checks of Payment Selection without check no assignment + /** + * Get Pay Selection Check records * * @param C_PaySelection_ID Payment Selection * @param PaymentRule Payment Rule * @param trxName transaction - * @return array of checks + * @return array of MPaySelectionCheck */ public static MPaySelectionCheck[] get (int C_PaySelection_ID, String PaymentRule, String trxName) { @@ -243,16 +243,15 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck list.toArray(retValue); return retValue; } // get - - /************************************************************************** - * Get Checks of Payment Selection + /** + * Get Payment Selection Check records and set new Check Document No. * * @param C_PaySelection_ID Payment Selection * @param PaymentRule Payment Rule - * @param startDocumentNo start document no + * @param startDocumentNo starting document no * @param trxName transaction - * @return array of checks + * @return array of MPaySelectionCheck */ static public MPaySelectionCheck[] get (int C_PaySelection_ID, String PaymentRule, int startDocumentNo, String trxName) @@ -268,9 +267,9 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck return checks; } // get - /************************************************************************** - * Confirm Print for a payment selection check - * Create Payment the first time + /** + * Confirm Print for a payment selection check record. + * Create Payment if not created yet (i.e check.getC_Payment_ID() == 0). * @param check check * @param batch batch */ @@ -384,9 +383,9 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck } } // confirmPrint - /************************************************************************** - * Confirm Print. - * Create Payments the first time + /** + * Confirm Print for payment selection check records.
        + * For each payment selection check record, call {@link #confirmPrint(MPaySelectionCheck, MPaymentBatch)}. * @param checks checks * @param batch batch * @param createDepositBatch create deposit batch @@ -497,9 +496,8 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck return lastDocumentNo; } // confirmPrint - /************************************************************************** - * Confirm Print. - * Create Payments the first time + /** + * Call {@link #confirmPrint(MPaySelectionCheck[], MPaymentBatch, boolean)}. * @param checks checks * @param batch batch * @return last Document number or 0 if nothing printed @@ -514,19 +512,18 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck static private CLogger s_log = CLogger.getCLogger (MPaySelectionCheck.class); /** - * UUID based Constructor - * @param ctx Context - * @param C_PaySelectionCheck_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_PaySelectionCheck_UU UUID key + * @param trxName Transaction + */ public MPaySelectionCheck(Properties ctx, String C_PaySelectionCheck_UU, String trxName) { super(ctx, C_PaySelectionCheck_UU, trxName); if (Util.isEmpty(C_PaySelectionCheck_UU)) setInitialDefaults(); } - /************************************************************************** - * Constructor + /** * @param ctx context * @param C_PaySelectionCheck_ID C_PaySelectionCheck_ID * @param trxName transaction @@ -562,9 +559,9 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck } // MPaySelectionCheck /** - * Create from Line - * @param line payment selection - * @param PaymentRule payment rule + * Create from Payment Selection Line + * @param line payment selection line + * @param PaymentRule payment rule (PAYMENTRULE_*) */ public MPaySelectionCheck (MPaySelectionLine line, String PaymentRule) { @@ -612,7 +609,7 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck /** * Create from Pay Selection * @param ps payment selection - * @param PaymentRule payment rule + * @param PaymentRule payment rule (PAYMENTRULE_*) */ public MPaySelectionCheck (MPaySelection ps, String PaymentRule) { @@ -621,17 +618,15 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck setC_PaySelection_ID (ps.getC_PaySelection_ID()); setPaymentRule (PaymentRule); } // MPaySelectionCheck - - + /** Parent */ private MPaySelection m_parent = null; /** Payment Selection lines of this check */ private MPaySelectionLine[] m_lines = null; - /** * Add Payment Selection Line - * @param line line + * @param line Payment Selection Line */ public void addLine (MPaySelectionLine line) { @@ -655,7 +650,7 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck /** * Get Parent - * @return parent + * @return parent MPaySelection record */ public MPaySelection getParent() { @@ -676,8 +671,8 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck } // isValid /** - * Is this a direct Debit or Deposit - * @return true if direct + * Is this with Direct Debit or Direct Deposit payment rule + * @return true if is with Direct Debit or Direct Deposit payment rule */ public boolean isDirect() { @@ -689,6 +684,7 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder("MPaymentCheck["); @@ -701,8 +697,8 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck } // toString /** - * Get Payment Selection Lines of this check - * @param requery requery + * Get Payment Selection Lines + * @param requery true to re-query from DB * @return array of payment selection lines */ public MPaySelectionLine[] getPaySelectionLines (boolean requery) @@ -738,18 +734,16 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck list.toArray (m_lines); return m_lines; } // getPaySelectionLines - /** - * Delete Payment Selection when generated as Draft (Print Preview) + * Delete Payment Selection records that are generated as Draft (Print Preview) * @param ctx context * @param C_Payment_ID id * @param trxName transaction - * @return + * @return false if there are errors */ public static boolean deleteGeneratedDraft(Properties ctx, int C_Payment_ID, String trxName) - { - + { MPaySelectionCheck mpsc = MPaySelectionCheck.getOfPayment (ctx, C_Payment_ID, trxName); if (mpsc != null && mpsc.isGeneratedDraft()) @@ -771,7 +765,7 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck if (!mps.delete(true, trxName)) return false; } - return true; + return true; } } // MPaySelectionCheck diff --git a/org.adempiere.base/src/org/compiere/model/MPaySelectionLine.java b/org.adempiere.base/src/org/compiere/model/MPaySelectionLine.java index edfade74c3..b43d5f94ff 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaySelectionLine.java +++ b/org.adempiere.base/src/org/compiere/model/MPaySelectionLine.java @@ -34,16 +34,16 @@ import org.compiere.util.Util; public class MPaySelectionLine extends X_C_PaySelectionLine { /** - * + * generated serial id */ private static final long serialVersionUID = -1880961891234637133L; /** - * UUID based Constructor - * @param ctx Context - * @param C_PaySelectionLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_PaySelectionLine_UU UUID key + * @param trxName Transaction + */ public MPaySelectionLine(Properties ctx, String C_PaySelectionLine_UU, String trxName) { super(ctx, C_PaySelectionLine_UU, trxName); if (Util.isEmpty(C_PaySelectionLine_UU)) @@ -112,7 +112,9 @@ public class MPaySelectionLine extends X_C_PaySelectionLine * @param PayAmt payment * @param OpenAmt open * @param DiscountAmt discount + * @deprecated */ + @Deprecated(forRemoval = true, since = "11") public void xsetInvoice (int C_Invoice_ID, boolean isSOTrx, BigDecimal OpenAmt, BigDecimal PayAmt, BigDecimal DiscountAmt) { @@ -122,11 +124,11 @@ public class MPaySelectionLine extends X_C_PaySelectionLine /** * Set Invoice Info * @param C_Invoice_ID invoice - * @param isSOTrx sales trx - * @param PayAmt payment - * @param OpenAmt open - * @param DiscountAmt discount - * @param WriteOffAmt writeoff + * @param isSOTrx sales trx flag + * @param PayAmt payment amount + * @param OpenAmt open amount + * @param DiscountAmt discount amount + * @param WriteOffAmt writeoff amount */ public void setInvoice (int C_Invoice_ID, boolean isSOTrx, BigDecimal OpenAmt, BigDecimal PayAmt, BigDecimal DiscountAmt, BigDecimal WriteOffAmt) @@ -156,6 +158,7 @@ public class MPaySelectionLine extends X_C_PaySelectionLine * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { MPaySelection parent = new MPaySelection(getCtx(), getC_PaySelection_ID(), get_TrxName()); @@ -173,6 +176,7 @@ public class MPaySelectionLine extends X_C_PaySelectionLine * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -186,6 +190,7 @@ public class MPaySelectionLine extends X_C_PaySelectionLine * @param success success * @return sucess */ + @Override protected boolean afterDelete (boolean success) { if (!success) @@ -195,7 +200,7 @@ public class MPaySelectionLine extends X_C_PaySelectionLine } // afterDelete /** - * Recalculate Header Sum + * Update Header Total */ private void setHeader() { @@ -205,13 +210,14 @@ public class MPaySelectionLine extends X_C_PaySelectionLine + "FROM C_PaySelectionLine psl " + "WHERE ps.C_PaySelection_ID=psl.C_PaySelection_ID AND psl.IsActive='Y') " + "WHERE C_PaySelection_ID=" + getC_PaySelection_ID(); - DB.executeUpdate(sql, get_TrxName()); + DB.executeUpdateEx(sql, get_TrxName()); } // setHeader /** * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder("MPaySelectionLine["); diff --git a/org.adempiere.base/src/org/compiere/model/MPayment.java b/org.adempiere.base/src/org/compiere/model/MPayment.java index 3141c9957b..92f6f783df 100644 --- a/org.adempiere.base/src/org/compiere/model/MPayment.java +++ b/org.adempiere.base/src/org/compiere/model/MPayment.java @@ -54,27 +54,6 @@ import org.compiere.util.ValueNamePair; /** * Payment Model. - * - retrieve and create payments for invoice - *
        - *  Event chain
        - *  - Payment inserted
        - *      C_Payment_Trg fires
        - *          update DocumentNo with payment summary
        - *  - Payment posted (C_Payment_Post)
        - *      create allocation line
        - *          C_Allocation_Trg fires
        - *              Update C_BPartner Open Item Amount
        - *      update invoice (IsPaid)
        - *      link invoice-payment if batch
        - *
        - *  Lifeline:
        - *  -   Created by VPayment or directly
        - *  -   When changed in VPayment
        - *      - old payment is reversed
        - *      - new payment created
        - *
        - *  When Payment is posed, the Allocation is made
        - *  
        * @author Jorg Janke * @author victor.perez@e-evolution.com, e-Evolution http://www.e-evolution.com *
      • FR [ 1948157 ] Is necessary the reference for document reverse @@ -91,7 +70,7 @@ public class MPayment extends X_C_Payment implements DocAction, ProcessCall, PaymentInterface, IDocsPostProcess { /** - * + * generated serial id */ private static final long serialVersionUID = -1581098289090430363L; @@ -100,7 +79,7 @@ public class MPayment extends X_C_Payment * @param ctx context * @param C_BPartner_ID id * @param trxName transaction - * @return array + * @return array of payment */ public static MPayment[] getOfBPartner (Properties ctx, int C_BPartner_ID, String trxName) { @@ -121,7 +100,7 @@ public class MPayment extends X_C_Payment * @param ctx context * @param C_BankTransfer_ID id * @param trxName transaction - * @return array + * @return array of payment */ public static MPayment[] getOfBankTransfer (Properties ctx, int C_BankTransfer_ID, String trxName) { @@ -136,18 +115,18 @@ public class MPayment extends X_C_Payment } // getOfBankTransfer /** - * UUID based Constructor - * @param ctx Context - * @param C_Payment_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Payment_UU UUID key + * @param trxName Transaction + */ public MPayment(Properties ctx, String C_Payment_UU, String trxName) { super(ctx, C_Payment_UU, trxName); if (Util.isEmpty(C_Payment_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Default Constructor * @param ctx context * @param C_Payment_ID payment to load, (0 create new payment) @@ -258,9 +237,9 @@ public class MPayment extends X_C_Payment return isCashTrx() && !MSysConfig.getBooleanValue(MSysConfig.CASH_AS_PAYMENT, true , getAD_Client_ID()); } - /************************************************************************** - * Set Credit Card. - * Need to set PatmentProcessor after Amount/Currency Set + /** + * Set Credit Card details. + * Need to set PatmentProcessor after Amount/Currency Set. * * @param TrxType Transaction Type see TRX_ * @param creditCardType CC type @@ -290,14 +269,14 @@ public class MPayment extends X_C_Payment } // setCreditCard /** - * Set Credit Card - Exp. - * Need to set PatmentProcessor after Amount/Currency Set + * Set Credit Card details. + * Need to set PatmentProcessor after Amount/Currency Set. * * @param TrxType Transaction Type see TRX_ * @param creditCardType CC type * @param creditCardNumber CC number * @param creditCardVV CC verification - * @param creditCardExp CC Exp + * @param creditCardExp CC Exp (include both year and month) * @return true if valid */ public boolean setCreditCard (String TrxType, String creditCardType, String creditCardNumber, @@ -369,6 +348,7 @@ public class MPayment extends X_C_Payment + MPaymentValidate.validateAccountNo(accountNo).length(); return check == 0; } // setBankACH + /** * Set Cash BankAccount Info * @@ -412,7 +392,7 @@ public class MPayment extends X_C_Payment * @param isReceipt true if receipt * @param routingNo routing no * @param accountNo account no - * @param checkNo chack no + * @param checkNo check no * @return true if valid */ public boolean setBankCheck (int C_BankAccount_ID, boolean isReceipt, @@ -501,10 +481,9 @@ public class MPayment extends X_C_Payment setA_Zip (zip); setA_Country(country); } // setAccountAddress - - /************************************************************************** - * Process Payment + /** + * Execute online processing of payment * @return true if approved */ public boolean processOnline() @@ -662,9 +641,7 @@ public class MPayment extends X_C_Payment } // processOnline /** - * Process Online Payment. - * implements ProcessCall after standard constructor - * Called when pressing the Process_Online button in C_Payment + * Execute online processing of payment (delegate to {@link #processOnline()}). * * @param ctx Context * @param pi Process Info @@ -686,13 +663,13 @@ public class MPayment extends X_C_Payment saveEx(); return retValue; // Payment processed } // startProcess - /** * Before Save * @param newRecord new * @return save */ + @Override protected boolean beforeSave (boolean newRecord) { if (isProcessed() && @@ -934,7 +911,7 @@ public class MPayment extends X_C_Payment /** * Get Allocated Amt in Payment Currency - * @return amount or null + * @return allocated amount or null */ public BigDecimal getAllocatedAmt () { @@ -974,7 +951,7 @@ public class MPayment extends X_C_Payment /** * Test Allocation (and set allocated flag) - * @return true if updated + * @return true if IsAllocated updated */ public boolean testAllocation() { @@ -1038,7 +1015,7 @@ public class MPayment extends X_C_Payment if (s_log.isLoggable(Level.CONFIG)) s_log.config("#" + counter); } // setIsAllocated - /************************************************************************** + /** * Set Error Message * @param errorMessage error message */ @@ -1056,7 +1033,6 @@ public class MPayment extends X_C_Payment return m_errorMessage; } // getErrorMessage - /** * Set Bank Account for Payment. * @param C_BankAccount_ID C_BankAccount_ID @@ -1083,7 +1059,7 @@ public class MPayment extends X_C_Payment } // setPaymentProcessor /** - * Set BankAccount and PaymentProcessor + * Find and Set BankAccount and PaymentProcessor * @param tender TenderType see TENDER_ * @param CCType CC Type see CC_ * @return true if found @@ -1183,36 +1159,38 @@ public class MPayment extends X_C_Payment /** * Get Type and name pair * @param CreditCardType credit card Type - * @return pair + * @return ValueNamePair (CreditCardType, Name) */ protected ValueNamePair getCreditCardPair (String CreditCardType) { return new ValueNamePair (CreditCardType, getCreditCardName(CreditCardType)); } // getCreditCardPair - - /************************************************************************** - * Credit Card Number + /** + * Set Credit Card Number. * @param CreditCardNumber CreditCard Number */ + @Override public void setCreditCardNumber (String CreditCardNumber) { super.setCreditCardNumber (MPaymentValidate.checkNumeric(CreditCardNumber)); } // setCreditCardNumber /** - * Verification Code + * Set Verification Code * @param newCreditCardVV CC verification */ + @Override public void setCreditCardVV(String newCreditCardVV) { super.setCreditCardVV (MPaymentValidate.checkNumeric(newCreditCardVV)); } // setCreditCardVV /** - * Two Digit CreditCard MM + * Set Two Digit CreditCard MM * @param CreditCardExpMM Exp month */ + @Override public void setCreditCardExpMM (int CreditCardExpMM) { if (CreditCardExpMM < 1 || CreditCardExpMM > 12) @@ -1222,9 +1200,10 @@ public class MPayment extends X_C_Payment } // setCreditCardExpMM /** - * Two digit CreditCard YY (til 2020) + * Set Two digit CreditCard YY (til 2020) * @param newCreditCardExpYY 2 or 4 digit year */ + @Override public void setCreditCardExpYY (int newCreditCardExpYY) { int CreditCardExpYY = newCreditCardExpYY; @@ -1234,7 +1213,7 @@ public class MPayment extends X_C_Payment } // setCreditCardExpYY /** - * CreditCard Exp MMYY + * Set CreditCard Exp MMYY * @param mmyy Exp in form of mmyy * @return true if valid */ @@ -1255,7 +1234,7 @@ public class MPayment extends X_C_Payment /** * CreditCard Exp MMYY * @param delimiter / - or null - * @return Exp + * @return Exp (mm + delimiter + yy) */ public String getCreditCardExp(String delimiter) { @@ -1281,6 +1260,7 @@ public class MPayment extends X_C_Payment * MICR * @param MICR MICR */ + @Override public void setMicr (String MICR) { super.setMicr (MPaymentValidate.checkNumeric(MICR)); @@ -1290,27 +1270,27 @@ public class MPayment extends X_C_Payment * Routing No * @param RoutingNo Routing No */ + @Override public void setRoutingNo(String RoutingNo) { - // super.setRoutingNo (MPaymentValidate.checkNumeric(RoutingNo)); super.setRoutingNo (RoutingNo); } // setBankRoutingNo - /** * Bank Account No * @param AccountNo AccountNo */ + @Override public void setAccountNo (String AccountNo) { super.setAccountNo (MPaymentValidate.checkNumeric(AccountNo)); } // setBankAccountNo - /** * Check No * @param CheckNo Check No */ + @Override public void setCheckNo(String CheckNo) { super.setCheckNo(MPaymentValidate.checkNumeric(CheckNo)); @@ -1318,8 +1298,8 @@ public class MPayment extends X_C_Payment /** - * Set DocumentNo to Payment info. - * If there is a R_PnRef that is set automatically + * Derive DocumentNo from Payment info. + * If there is a R_PnRef, take R_PnRef as DocumentNo. */ protected void setDocumentNo() { @@ -1387,9 +1367,10 @@ public class MPayment extends X_C_Payment } // setDocumentNo /** - * Set Refernce No (and Document No) + * Set Reference No (and Document No) * @param R_PnRef reference */ + @Override public void setR_PnRef (String R_PnRef) { super.setR_PnRef (R_PnRef); @@ -1397,19 +1378,18 @@ public class MPayment extends X_C_Payment setDocumentNo (R_PnRef); } // setR_PnRef - // --------------- - /** * Set Payment Amount * @param PayAmt Pay Amt */ + @Override public void setPayAmt (BigDecimal PayAmt) { super.setPayAmt(PayAmt == null ? Env.ZERO : PayAmt); } // setPayAmt /** - * Set Payment Amount + * Set Payment Amount and Currency * * @param C_Currency_ID currency * @param payAmt amount @@ -1426,6 +1406,7 @@ public class MPayment extends X_C_Payment * Discount Amt * @param DiscountAmt Discount */ + @Override public void setDiscountAmt (BigDecimal DiscountAmt) { super.setDiscountAmt (DiscountAmt == null ? Env.ZERO : DiscountAmt); @@ -1435,6 +1416,7 @@ public class MPayment extends X_C_Payment * WriteOff Amt * @param WriteOffAmt WriteOff */ + @Override public void setWriteOffAmt (BigDecimal WriteOffAmt) { super.setWriteOffAmt (WriteOffAmt == null ? Env.ZERO : WriteOffAmt); @@ -1444,6 +1426,7 @@ public class MPayment extends X_C_Payment * OverUnder Amt * @param OverUnderAmt OverUnder */ + @Override public void setOverUnderAmt (BigDecimal OverUnderAmt) { super.setOverUnderAmt (OverUnderAmt == null ? Env.ZERO : OverUnderAmt); @@ -1454,6 +1437,7 @@ public class MPayment extends X_C_Payment * Tax Amt * @param TaxAmt Tax */ + @Override public void setTaxAmt (BigDecimal TaxAmt) { super.setTaxAmt (TaxAmt == null ? Env.ZERO : TaxAmt); @@ -1497,7 +1481,7 @@ public class MPayment extends X_C_Payment } // setBP_BankAccount /** - * Save Info from BP Bank Account + * Save Info to BP Bank Account * @param ba BP bank account * @return true if saved */ @@ -1546,7 +1530,7 @@ public class MPayment extends X_C_Payment /** * Set Doc Type - * @param isReceipt is receipt + * @param isReceipt true for receipt, false for payment */ public void setC_DocType_ID (boolean isReceipt) { @@ -1592,7 +1576,7 @@ public class MPayment extends X_C_Payment /** * Verify Document Type with Invoice - * @param pAllocs + * @param pAllocs * @return true if ok */ protected boolean verifyDocType(MPaymentAllocate[] pAllocs) @@ -1738,9 +1722,9 @@ public class MPayment extends X_C_Payment } // verifyDocType /** - * Verify Payment Allocate is ignored (must not exists) if the payment header has charge/invoice/order - * @param pAllocs - * @return true if ok + * Verify that payment has no Payment Allocate records if the payment header has charge/invoice/order. + * @param pAllocs + * @return true if pAllocs is empty */ protected boolean verifyPaymentAllocateVsHeader(MPaymentAllocate[] pAllocs) { if (pAllocs.length > 0) { @@ -1752,7 +1736,7 @@ public class MPayment extends X_C_Payment /** * Verify Payment Allocate Sum must be equal to the Payment Amount - * @param pAllocs + * @param pAllocs * @return true if ok */ protected boolean verifyPaymentAllocateSum(MPaymentAllocate[] pAllocs) { @@ -1774,7 +1758,7 @@ public class MPayment extends X_C_Payment /** * Get ISO Code of Currency - * @return Currency ISO + * @return Currency ISO code */ public String getCurrencyISO() { @@ -1782,8 +1766,8 @@ public class MPayment extends X_C_Payment } // getCurrencyISO /** - * Get Document Status - * @return Document Status Clear Text + * Get Document Status Name + * @return Document Status Name */ public String getDocStatusName() { @@ -1791,8 +1775,8 @@ public class MPayment extends X_C_Payment } // getDocStatusName /** - * Get Name of Credit Card - * @return Name + * Get Name of Credit Card Type + * @return Name of Credit Card Type (Master, Visa, etc) */ public String getCreditCardName() { @@ -1800,9 +1784,9 @@ public class MPayment extends X_C_Payment } // getCreditCardName /** - * Get Name of Credit Card + * Get Name of Credit Card Type * @param CreditCardType credit card type - * @return Name + * @return Name of Credit Card Type (Master, Visa, etc) */ public String getCreditCardName(String CreditCardType) { @@ -1837,12 +1821,11 @@ public class MPayment extends X_C_Payment else setDescription(desc + " | " + description); } // addDescription - - + /** * Get Pay Amt - * @param absolute if true the absolute amount (i.e. negative if payment) - * @return amount + * @param absolute ignore + * @return pay amt if this is receipt, otherwise it return the negate of pay amt */ public BigDecimal getPayAmt (boolean absolute) { @@ -1853,7 +1836,7 @@ public class MPayment extends X_C_Payment /** * Get Pay Amt in cents - * @return amount in cents + * @return amount in cents (multiply by 100 and truncate to integer) */ public int getPayAmtInCents () { @@ -1861,11 +1844,12 @@ public class MPayment extends X_C_Payment return bd.intValue(); } // getPayAmtInCents - /************************************************************************** + /** * Process document * @param processAction document action * @return true if performed */ + @Override public boolean processIt (String processAction) { m_processMsg = null; @@ -1883,6 +1867,7 @@ public class MPayment extends X_C_Payment * Unlock Document. * @return true if success */ + @Override public boolean unlockIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -1894,6 +1879,7 @@ public class MPayment extends X_C_Payment * Invalidate Document * @return true if success */ + @Override public boolean invalidateIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -1901,11 +1887,11 @@ public class MPayment extends X_C_Payment return true; } // invalidateIt - - /************************************************************************** + /** * Prepare Document * @return new status (In Progress or Invalid) */ + @Override public String prepareIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2013,6 +1999,7 @@ public class MPayment extends X_C_Payment * Approve Document * @return true if success */ + @Override public boolean approveIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2024,18 +2011,19 @@ public class MPayment extends X_C_Payment * Reject Approval * @return true if success */ + @Override public boolean rejectIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); setIsApproved(false); return true; } // rejectIt - - /************************************************************************** + /** * Complete Document * @return new status (Complete, In Progress, Invalid, Waiting ..) */ + @Override public String completeIt() { // Re-Check @@ -2155,8 +2143,12 @@ public class MPayment extends X_C_Payment } // completeIt /* Save array of documents to process AFTER completing this one */ - ArrayList docsPostProcess = new ArrayList(); + protected ArrayList docsPostProcess = new ArrayList(); + /** + * Add document for processing after document action + * @param doc + */ protected void addDocsPostProcess(PO doc) { docsPostProcess.add(doc); } @@ -2283,18 +2275,17 @@ public class MPayment extends X_C_Payment } // createCounterDoc /** - * Allocate It. - * Only call when there is NO allocation as it will create duplicates. - * If an invoice exists, it allocates that - * otherwise it allocates Payment Selection. + * Allocate this payment.
        + * Only call this when there is NO allocations (MAllocationHdr and MAllocationLine) as it will create duplicates.
        + * If an invoice exists, it will allocates that, otherwise it will allocates to Payment Selection. * @return true if allocated */ public boolean allocateIt() { - // Create invoice Allocation - See also MCash.completeIt + // Create invoice Allocation if (getC_Invoice_ID() != 0) { - return allocateInvoice(); + return allocateInvoice(); } // Invoices of a AP Payment Selection if (allocatePaySelection()) @@ -2357,7 +2348,7 @@ public class MPayment extends X_C_Payment } // allocateIt /** - * Allocate single AP/AR Invoice + * Allocate to single AP/AR Invoice * @return true if allocated */ protected boolean allocateInvoice() @@ -2410,7 +2401,7 @@ public class MPayment extends X_C_Payment } // allocateInvoice /** - * Allocate Payment Selection + * Allocate to Payment Selection * @return true if allocated */ protected boolean allocatePaySelection() @@ -2502,9 +2493,9 @@ public class MPayment extends X_C_Payment } // allocatePaySelection /** - * De-allocate Payment. - * Unkink Invoices and Orders and delete Allocations - * @param accrual + * Deallocate Payment. + * Unlink Invoices and Orders and delete Allocations. + * @param accrual */ protected void deAllocate(boolean accrual) { @@ -2565,6 +2556,7 @@ public class MPayment extends X_C_Payment * Void Document. * @return true if success */ + @Override public boolean voidIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2638,6 +2630,7 @@ public class MPayment extends X_C_Payment * Close Document. * @return true if success */ + @Override public boolean closeIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2659,6 +2652,7 @@ public class MPayment extends X_C_Payment * Reverse Correction * @return true if success */ + @Override public boolean reverseCorrectIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2681,6 +2675,11 @@ public class MPayment extends X_C_Payment return true; } // reverseCorrectionIt + /** + * Reverse this payment + * @param accrual true to use current date, false to use this document's accounting date + * @return process message or null if there's error + */ protected StringBuilder reverse(boolean accrual) { if (!voidOnlinePayment()) return null; @@ -2802,10 +2801,9 @@ public class MPayment extends X_C_Payment return info; } - /** * Get Bank Statement Line of payment or 0 - * @return id or 0 + * @return C_BankStatementLine_ID or 0 */ protected int getC_BankStatementLine_ID() { @@ -2817,9 +2815,10 @@ public class MPayment extends X_C_Payment } // getC_BankStatementLine_ID /** - * Reverse Accrual - none + * Reverse Accrual * @return true if success */ + @Override public boolean reverseAccrualIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2847,6 +2846,7 @@ public class MPayment extends X_C_Payment * Re-activate * @return true if success */ + @Override public boolean reActivateIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -2870,6 +2870,7 @@ public class MPayment extends X_C_Payment * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MPayment["); @@ -2886,6 +2887,7 @@ public class MPayment extends X_C_Payment * Get Document Info * @return document info (untranslated) */ + @Override public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); @@ -2896,6 +2898,7 @@ public class MPayment extends X_C_Payment * Create PDF * @return File or null */ + @Override public File createPDF () { try @@ -2913,18 +2916,18 @@ public class MPayment extends X_C_Payment /** * Create PDF file * @param file output file - * @return file if success + * @return not implemented, always return null */ public File createPDF (File file) { return null; } // createPDF - - /************************************************************************* + /** * Get Summary * @return Summary of Document */ + @Override public String getSummary() { StringBuilder sb = new StringBuilder(); @@ -2943,6 +2946,7 @@ public class MPayment extends X_C_Payment * Get Process Message * @return clear text error message */ + @Override public String getProcessMsg() { return m_processMsg; @@ -2952,6 +2956,7 @@ public class MPayment extends X_C_Payment * Get Document Owner (Responsible) * @return AD_User_ID */ + @Override public int getDoc_User_ID() { return getCreatedBy(); @@ -2961,6 +2966,7 @@ public class MPayment extends X_C_Payment * Get Document Approval Amount * @return amount payment(AP) or write-off(AR) */ + @Override public BigDecimal getApprovalAmt() { if (isReceipt()) @@ -2974,6 +2980,11 @@ public class MPayment extends X_C_Payment m_processUI = processMonitor; } + /** + * Create online payment transaction + * @param trxName + * @return MPaymentTransaction + */ public MPaymentTransaction createPaymentTransaction(String trxName) { MPaymentTransaction paymentTransaction = new MPaymentTransaction(getCtx(), 0, trxName); @@ -3040,6 +3051,9 @@ public class MPayment extends X_C_Payment return paymentTransaction; } + /** + * @return true if success + */ protected boolean voidOnlinePayment() { if (getTenderType().equals(TENDERTYPE_CreditCard) && isOnline()) @@ -3079,6 +3093,13 @@ public class MPayment extends X_C_Payment return this; } + /** + * Get ids of completed credit card payment + * @param C_Order_ID + * @param C_Invoice_ID + * @param trxName + * @return array of C_Payment_ID + */ public static int[] getCompletedPaymentIDs(int C_Order_ID, int C_Invoice_ID, String trxName) { StringBuilder whereClause = new StringBuilder(); @@ -3100,6 +3121,10 @@ public class MPayment extends X_C_Payment // IDEMPIERE-2588 protected MAllocationHdr m_justCreatedAllocInv = null; + + /** + * @return just created invoice allocation (inside {@link #allocateInvoice()}) + */ public MAllocationHdr getJustCreatedAllocInv() { return m_justCreatedAllocInv; } @@ -3140,7 +3165,9 @@ public class MPayment extends X_C_Payment * @param date payment allocation as at date * @param AD_Org_ID 0 for all org * @param trxName optional transaction name - * @return list of unallocated payment records + * @return list of unallocated payment records.
        + * - Payment record: Boolean.False, DateTrx, KeyNamePair(C_Payment_ID,DocumentNo), Currency ISO_Code, PayAmt, Converted Amt,Open Amt, 0
        + * - Without Currency ISO_Code and PayAmt if isMultiCurrency is false. */ public static Vector> getUnAllocatedPaymentData(int C_BPartner_ID, int C_Currency_ID, boolean isMultiCurrency, Timestamp date, int AD_Org_ID, String trxName) diff --git a/org.adempiere.base/src/org/compiere/model/MPaymentAllocate.java b/org.adempiere.base/src/org/compiere/model/MPaymentAllocate.java index e662f10b1a..f07df3d803 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaymentAllocate.java +++ b/org.adempiere.base/src/org/compiere/model/MPaymentAllocate.java @@ -26,7 +26,8 @@ import org.compiere.util.Msg; import org.compiere.util.Util; /** - * Payment Allocate Model + * Payment Allocate Model. + * Process to create allocation records (C_AllocationHdr and C_AllocationLine) * * @author Jorg Janke * @version $Id: MPaymentAllocate.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $ @@ -34,14 +35,14 @@ import org.compiere.util.Util; public class MPaymentAllocate extends X_C_PaymentAllocate { /** - * + * generated serial id */ private static final long serialVersionUID = 2894385378672375131L; /** * Get active Payment Allocation of Payment * @param parent payment - * @return array of allocations + * @return array of payment allocations */ public static MPaymentAllocate[] get (MPayment parent) { @@ -53,18 +54,18 @@ public class MPaymentAllocate extends X_C_PaymentAllocate } // get /** - * UUID based Constructor - * @param ctx Context - * @param C_PaymentAllocate_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_PaymentAllocate_UU UUID key + * @param trxName Transaction + */ public MPaymentAllocate(Properties ctx, String C_PaymentAllocate_UU, String trxName) { super(ctx, C_PaymentAllocate_UU, trxName); if (Util.isEmpty(C_PaymentAllocate_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_PaymentAllocate_ID id @@ -135,13 +136,13 @@ public class MPaymentAllocate extends X_C_PaymentAllocate return 0; return m_invoice.getC_BPartner_ID(); } // getC_BPartner_ID - - + /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { MPayment payment = new MPayment (getCtx(), getC_Payment_ID(), get_TrxName()); diff --git a/org.adempiere.base/src/org/compiere/model/MPaymentBatch.java b/org.adempiere.base/src/org/compiere/model/MPaymentBatch.java index 78cf305301..cc01ffe260 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaymentBatch.java +++ b/org.adempiere.base/src/org/compiere/model/MPaymentBatch.java @@ -30,7 +30,7 @@ import org.compiere.util.Util; public class MPaymentBatch extends X_C_PaymentBatch { /** - * + * generated serial id */ private static final long serialVersionUID = 779975501904633495L; @@ -49,11 +49,11 @@ public class MPaymentBatch extends X_C_PaymentBatch } // getForPaySelection /** - * UUID based Constructor - * @param ctx Context - * @param C_PaymentBatch_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_PaymentBatch_UU UUID key + * @param trxName Transaction + */ public MPaymentBatch(Properties ctx, String C_PaymentBatch_UU, String trxName) { super(ctx, C_PaymentBatch_UU, trxName); if (Util.isEmpty(C_PaymentBatch_UU)) @@ -92,19 +92,6 @@ public class MPaymentBatch extends X_C_PaymentBatch super(ctx, rs, trxName); } // MPaymentBatch - /* Old Constructor that sets the name replaced by UUID constructor in version 11 */ - // /** - // * New Constructor - // * @param ctx context - // * @param Name name - // * @param trxName trx - // */ - // public MPaymentBatch (Properties ctx, String Name, String trxName) - // { - // this (ctx, 0, trxName); - // setName (Name); - // } // MPaymentBatch - /** * Parent Constructor * @param ps Pay Selection diff --git a/org.adempiere.base/src/org/compiere/model/MPaymentLookup.java b/org.adempiere.base/src/org/compiere/model/MPaymentLookup.java index 1c46867bbf..bb478a65b6 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaymentLookup.java +++ b/org.adempiere.base/src/org/compiere/model/MPaymentLookup.java @@ -31,13 +31,12 @@ import org.compiere.util.Util; import org.compiere.util.ValueNamePair; /** - * + * Payment rules lookup * @author Elaine - * */ public class MPaymentLookup extends Lookup implements Serializable { /** - * + * generated serial id */ private static final long serialVersionUID = 2876345457828980720L; @@ -48,6 +47,11 @@ public class MPaymentLookup extends Lookup implements Serializable { /** Validation Code */ private String m_validationCode; + /** + * @param ctx + * @param windowNo + * @param validationCode + */ public MPaymentLookup(Properties ctx, int windowNo, String validationCode) { super(DisplayType.TableDir, windowNo); m_ctx = ctx; @@ -97,6 +101,10 @@ public class MPaymentLookup extends Lookup implements Serializable { return false; } + /** + * Same as {@link #containsKey(Object)} in this lookup implementation. + */ + @Override public boolean containsKeyNoDirect (Object key) { return containsKey(key); @@ -107,6 +115,10 @@ public class MPaymentLookup extends Lookup implements Serializable { return "PaymentRule"; } + /** + * Get active payment rules + * @return array of ValueNamePair(Value, Name) + */ private ValueNamePair[] getData() { String ad_language = Env.getAD_Language(m_ctx); @@ -162,6 +174,7 @@ public class MPaymentLookup extends Lookup implements Serializable { return retValue; } + @Override public String getValidation() { if (Util.isEmpty(m_validationCode, true)) @@ -169,6 +182,10 @@ public class MPaymentLookup extends Lookup implements Serializable { return m_validationCode.trim(); } + /** + * Parse validation code + * @return where clause (parsed validation code) + */ private String getWhereClause() { String whereClause = ""; diff --git a/org.adempiere.base/src/org/compiere/model/MPaymentProcessor.java b/org.adempiere.base/src/org/compiere/model/MPaymentProcessor.java index 38c39cad4e..227d7ba27c 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaymentProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MPaymentProcessor.java @@ -22,7 +22,6 @@ import java.util.Properties; import org.compiere.util.Env; import org.compiere.util.Util; - /** * Payment Processor Model * @@ -32,23 +31,23 @@ import org.compiere.util.Util; public class MPaymentProcessor extends X_C_PaymentProcessor { /** - * + * generated serial id */ private static final long serialVersionUID = 8514876566904723695L; /** - * UUID based Constructor - * @param ctx Context - * @param C_PaymentProcessor_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_PaymentProcessor_UU UUID key + * @param trxName Transaction + */ public MPaymentProcessor(Properties ctx, String C_PaymentProcessor_UU, String trxName) { super(ctx, C_PaymentProcessor_UU, trxName); if (Util.isEmpty(C_PaymentProcessor_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Payment Processor Model * @param ctx context * @param C_PaymentProcessor_ID payment processor @@ -95,6 +94,7 @@ public class MPaymentProcessor extends X_C_PaymentProcessor * String representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MPaymentProcessor[") @@ -107,6 +107,7 @@ public class MPaymentProcessor extends X_C_PaymentProcessor * @deprecated Use C_BankAccount.C_PaymentProcessor_ID */ @Override + @Deprecated public I_C_BankAccount getC_BankAccount() throws RuntimeException { return super.getC_BankAccount(); } @@ -115,6 +116,7 @@ public class MPaymentProcessor extends X_C_PaymentProcessor * @deprecated Use C_BankAccount.C_PaymentProcessor_ID */ @Override + @Deprecated public void setC_BankAccount_ID(int C_BankAccount_ID) { super.setC_BankAccount_ID(C_BankAccount_ID); } @@ -123,6 +125,7 @@ public class MPaymentProcessor extends X_C_PaymentProcessor * @deprecated Use C_BankAccount.C_PaymentProcessor_ID */ @Override + @Deprecated public int getC_BankAccount_ID() { return super.getC_BankAccount_ID(); } diff --git a/org.adempiere.base/src/org/compiere/model/MPaymentTerm.java b/org.adempiere.base/src/org/compiere/model/MPaymentTerm.java index c75cb8ff30..9ab14b4e01 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaymentTerm.java +++ b/org.adempiere.base/src/org/compiere/model/MPaymentTerm.java @@ -30,7 +30,6 @@ import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.Util; - /** * Payment Term Model * @@ -43,16 +42,16 @@ import org.compiere.util.Util; public class MPaymentTerm extends X_C_PaymentTerm { /** - * + * generated serial id */ private static final long serialVersionUID = -4506224598566445450L; /** - * UUID based Constructor - * @param ctx Context - * @param C_PaymentTerm_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_PaymentTerm_UU UUID key + * @param trxName Transaction + */ public MPaymentTerm(Properties ctx, String C_PaymentTerm_UU, String trxName) { super(ctx, C_PaymentTerm_UU, trxName); if (Util.isEmpty(C_PaymentTerm_UU)) @@ -104,7 +103,7 @@ public class MPaymentTerm extends X_C_PaymentTerm /** * Get Payment Schedule * @param requery if true re-query - * @return array of schedule + * @return array of pay schedule */ public MPaySchedule[] getSchedule (boolean requery) { @@ -143,7 +142,7 @@ public class MPaymentTerm extends X_C_PaymentTerm } // getSchedule /** - * Validate Payment Term and Schedule + * Validate Payment Term and Schedule. Update IsValid flag with validation result. * @return Validation Message @OK@ or error */ public String validate() @@ -181,8 +180,7 @@ public class MPaymentTerm extends X_C_PaymentTerm return "@Total@ = " + total + " - @Difference@ = " + Env.ONEHUNDRED.subtract(total); } // validate - - /************************************************************************* + /** * Apply Payment Term to Invoice - * @param C_Invoice_ID invoice * @return true if payment schedule is valid @@ -289,9 +287,8 @@ public class MPaymentTerm extends X_C_PaymentTerm } if (log.isLoggable(Level.FINE)) log.fine("C_Invoice_ID=" + C_Invoice_ID + " - #" + ipsList.size()); } // deleteInvoicePaySchedule - - /************************************************************************* + /** * Apply Payment Term to Order - * @param C_Order_ID order * @return true if payment schedule is valid @@ -398,12 +395,12 @@ public class MPaymentTerm extends X_C_PaymentTerm } if (log.isLoggable(Level.FINE)) log.fine("C_Order_ID=" + C_Order_ID + " - #" + opsList.size()); } // deleteOrderPaySchedule - - /************************************************************************** + /** * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MPaymentTerm["); @@ -418,6 +415,7 @@ public class MPaymentTerm extends X_C_PaymentTerm * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (isDueFixed()) diff --git a/org.adempiere.base/src/org/compiere/model/MPaymentTransaction.java b/org.adempiere.base/src/org/compiere/model/MPaymentTransaction.java index 129b5d778a..467c29e3ee 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaymentTransaction.java +++ b/org.adempiere.base/src/org/compiere/model/MPaymentTransaction.java @@ -32,29 +32,33 @@ import org.compiere.util.Trx; import org.compiere.util.Util; /** - * + * Online payment transaction * @author Elaine * */ public class MPaymentTransaction extends X_C_PaymentTransaction implements ProcessCall, PaymentInterface { - /** - * + * generated serial id */ private static final long serialVersionUID = 8722189788479132158L; /** - * UUID based Constructor - * @param ctx Context - * @param C_PaymentTransaction_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_PaymentTransaction_UU UUID key + * @param trxName Transaction + */ public MPaymentTransaction(Properties ctx, String C_PaymentTransaction_UU, String trxName) { super(ctx, C_PaymentTransaction_UU, trxName); if (Util.isEmpty(C_PaymentTransaction_UU)) setInitialDefaults(); } - + + /** + * @param ctx + * @param C_PaymentTransaction_ID + * @param trxName + */ public MPaymentTransaction(Properties ctx, int C_PaymentTransaction_ID, String trxName) { super(ctx, C_PaymentTransaction_ID, trxName); @@ -86,6 +90,11 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce setTenderType(TENDERTYPE_Check); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MPaymentTransaction(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } @@ -113,6 +122,11 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce return true; } + /** + * Set payment amount and currency + * @param C_Currency_ID + * @param payAmt + */ public void setAmount (int C_Currency_ID, BigDecimal payAmt) { if (C_Currency_ID == 0) @@ -121,6 +135,16 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce setPayAmt(payAmt); } + /** + * Set credit card details + * @param TrxType + * @param creditCardType + * @param creditCardNumber + * @param creditCardVV + * @param creditCardExpMM + * @param creditCardExpYY + * @return true if credit detail is valid + */ public boolean setCreditCard (String TrxType, String creditCardType, String creditCardNumber, String creditCardVV, int creditCardExpMM, int creditCardExpYY) { @@ -140,6 +164,15 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce return check == 0; } + /** + * Set credit card details + * @param TrxType + * @param creditCardType + * @param creditCardNumber + * @param creditCardVV + * @param creditCardExp + * @return true if credit card detail is valid + */ public boolean setCreditCard (String TrxType, String creditCardType, String creditCardNumber, String creditCardVV, String creditCardExp) { @@ -148,6 +181,10 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce MPaymentValidate.getCreditCardExpYY(creditCardExp)); } + /** + * Find and set bank account payment processor (C_BankAccount_Processor) + * @return true if success + */ public boolean setPaymentProcessor () { return setPaymentProcessor (getTenderType(), getCreditCardType(), getC_PaymentProcessor_ID()); @@ -158,6 +195,13 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce /** Temporary Bank Account Processor */ private MBankAccountProcessor m_mBankAccountProcessor = null; + /** + * Find and set bank account payment processor (C_BankAccount_Processor) + * @param tender + * @param CCType + * @param C_PaymentProcessor_ID + * @return true if success + */ public boolean setPaymentProcessor (String tender, String CCType, int C_PaymentProcessor_ID) { m_mBankAccountProcessor = null; @@ -194,8 +238,8 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce return m_mBankAccountProcessor != null; } - /************************************************************************** - * Process Payment + /** + * Execute online payment processing * @return true if approved */ public boolean processOnline() @@ -343,6 +387,10 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce return approved && processed; } + /** + * Void online authorization (TRXTYPE_Authorization) of payment + * @return true if success + */ public boolean voidOnlineAuthorizationPaymentTransaction() { if (getTenderType().equals(TENDERTYPE_CreditCard) && isOnline() && getTrxType().equals(TRXTYPE_Authorization) && !isVoided() && !isDelayedCapture()) @@ -379,6 +427,11 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce return true; } + /** + * Perform online delay capture (TRXTYPE_DelayedCapture) of authorized (TRXTYPE_Authorization) payment. + * @param C_Invoice_ID + * @return true if success + */ public boolean delayCaptureOnlineAuthorizationPaymentTransaction(int C_Invoice_ID) { if (getTenderType().equals(TENDERTYPE_CreditCard) && isOnline() && getTrxType().equals(TRXTYPE_Authorization) && !isVoided() && !isDelayedCapture()) @@ -420,11 +473,18 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce return true; } + /** + * @return credit card type name (master card, visa, etc) + */ public String getCreditCardName() { return getCreditCardName(getCreditCardType()); } + /** + * @param CreditCardType + * @return name of credit card type + */ public String getCreditCardName(String CreditCardType) { if (CreditCardType == null) @@ -449,16 +509,27 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce /** Error Message */ private String m_errorMessage = null; + /** + * @param errorMessage + */ public void setErrorMessage(String errorMessage) { m_errorMessage = errorMessage; } + /** + * @return error message + */ public String getErrorMessage() { return m_errorMessage; } + /** + * Create payment using details from this record + * @param trxName + * @return MPayment + */ public MPayment createPayment(String trxName) { MPayment payment = new MPayment(getCtx(), 0, trxName); @@ -528,14 +599,12 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce } /** - * Process Online Payment. - * implements ProcessCall after standard constructor - * Called when pressing the Process_Online button in C_Payment + * Process Online Payment. Call {@link #processOnline()} and save changes make to this record. * * @param ctx Context * @param pi Process Info * @param trx transaction - * @return true if the next process should be performed + * @return true if success */ @Override public boolean startProcess(Properties ctx, ProcessInfo pi, Trx trx) { @@ -566,6 +635,15 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce return this; } + /** + * Create new payment transaction from existing payment transaction record + * @param from source payment transaction to copy from + * @param dateTrx + * @param trxType + * @param orig_TrxID + * @param trxName + * @return MPaymentTransaction created + */ public static MPaymentTransaction copyFrom(MPaymentTransaction from, Timestamp dateTrx, String trxType, String orig_TrxID, String trxName) { MPaymentTransaction to = new MPaymentTransaction(from.getCtx(), 0, trxName); to.set_TrxName(trxName); @@ -638,6 +716,13 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce return to; } + /** + * Get authorized credit card payment transactions that are pending delay capture + * @param C_Order_ID + * @param C_Invoice_ID + * @param trxName + * @return array of C_PaymentTransaction_ID + */ public static int[] getAuthorizationPaymentTransactionIDs(int C_Order_ID, int C_Invoice_ID, String trxName) { StringBuilder whereClause = new StringBuilder(); @@ -655,6 +740,13 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce return MPaymentTransaction.getAllIDs(Table_Name, whereClause.toString(), trxName); } + /** + * Get authorized credit card payment transactions that are pending delay capture + * @param orderIDList + * @param C_Invoice_ID + * @param trxName + * @return array of C_PaymentTransaction_ID + */ public static int[] getAuthorizationPaymentTransactionIDs(int[] orderIDList, int C_Invoice_ID, String trxName) { StringBuilder sb = new StringBuilder(); @@ -687,6 +779,7 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MPaymentTransaction["); diff --git a/org.adempiere.base/src/org/compiere/model/MPaymentValidate.java b/org.adempiere.base/src/org/compiere/model/MPaymentValidate.java index d4854827d7..2232bf1afe 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaymentValidate.java +++ b/org.adempiere.base/src/org/compiere/model/MPaymentValidate.java @@ -24,9 +24,8 @@ import org.compiere.util.CLogger; import org.compiere.util.Env; import org.compiere.util.Msg; - /** - * Payment Validion Routines + * Payment Validation Routines * * @author Jorg Janke * @version $Id: MPaymentValidate.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $ @@ -35,11 +34,10 @@ public class MPaymentValidate { /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MPaymentValidate.class); - /** - * Is this a valid Credit Card Exp Date? - * @param mmyy Exp in form of mmyy + * Is this a valid Credit Card Expire Date? + * @param mmyy Expire in form of mmyy * @return "" or Error AD_Message */ public static String validateCreditCardExp (String mmyy) @@ -66,8 +64,8 @@ public class MPaymentValidate } // validateCreditCardExp /** - * Return Month of Exp - * @param mmyy Exp in form of mmyy + * Return Month of Expire + * @param mmyy Expire in form of mmyy * @return month */ public static int getCreditCardExpMM (String mmyy) @@ -85,8 +83,8 @@ public class MPaymentValidate } // getCreditCardExpMM /** - * Return Year of Exp - * @param mmyy Exp in form of mmyy + * Return Year of Expire + * @param mmyy Expire in form of mmyy * @return year */ public static int getCreditCardExpYY (String mmyy) @@ -104,7 +102,7 @@ public class MPaymentValidate } // getCreditCardExpYY /** - * Is this a valid Credit Card Exp Date? + * Is this a valid Credit Card Expire Date? * @param mm month * @param yy year * @return "" or Error AD_Message @@ -125,10 +123,9 @@ public class MPaymentValidate return Msg.getMsg(Env.getCtx(), "CreditCardExpired"); return ""; } // validateCreditCardExp - /** - * Validate Credit Card Number. + * Validate Credit Card Number.
        * - Based on LUHN formula * @param creditCardNumber credit card number * @return "" or Error AD_Message @@ -192,7 +189,7 @@ public class MPaymentValidate } // validateCreditCardNumber /** - * Validate Credit Card Number. + * Validate Credit Card Number.
        * - Check Card Type and Length * @param creditCardNumber CC Number * @param creditCardType CC Type @@ -291,10 +288,9 @@ public class MPaymentValidate return Msg.getMsg(Env.getCtx(), "CreditCardNumberProblem?"); return ""; } // validateCreditCardNumber - - + /** - * Validate Validation Code + * Validate Verification Code * @param creditCardVV CC Verification Code * @return "" or Error AD_Message */ @@ -319,7 +315,7 @@ public class MPaymentValidate } // validateCreditCardVV /** - * Validate Validation Code + * Validate Verification Code * @param creditCardVV CC Verification Code * @param creditCardType CC Type see CC_ * @return "" or Error AD_Message @@ -374,9 +370,8 @@ public class MPaymentValidate // Other return ""; } // validateCreditCardVV - - - /************************************************************************** + + /** * Validate Routing Number * @param routingNo Routing No * @return "" or Error AD_Message @@ -421,7 +416,7 @@ public class MPaymentValidate } // validateBankCheckNo /** - * Check Numeric + * Remove all non Digit characters * @param data input * @return the digits of the data - ignore the rest */ @@ -438,6 +433,5 @@ public class MPaymentValidate } return sb.toString(); } // checkNumeric - } // MPaymentValidate diff --git a/org.adempiere.base/src/org/compiere/model/MPeriod.java b/org.adempiere.base/src/org/compiere/model/MPeriod.java index f622fb0d9a..271251b2ed 100644 --- a/org.adempiere.base/src/org/compiere/model/MPeriod.java +++ b/org.adempiere.base/src/org/compiere/model/MPeriod.java @@ -55,7 +55,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MPeriod extends X_C_Period implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -2625074973303489939L; @@ -101,6 +101,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport * @return active Period or null * @deprecated */ + @Deprecated public static MPeriod get (Properties ctx, Timestamp DateAcct) { return get(ctx, DateAcct, 0, null); @@ -146,24 +147,24 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport } /** - * * @param ctx * @param DateAcct * @param C_Calendar_ID * @return MPeriod * @deprecated */ + @Deprecated public static MPeriod findByCalendar(Properties ctx, Timestamp DateAcct, int C_Calendar_ID) { return findByCalendar(ctx, DateAcct, C_Calendar_ID, null); } /** - * + * Find standard Period of DateAcct * @param ctx * @param DateAcct * @param C_Calendar_ID * @param trxName - * @return MPeriod + * @return MPeriod or null */ public static MPeriod findByCalendar(Properties ctx, Timestamp DateAcct, int C_Calendar_ID, String trxName) { @@ -227,6 +228,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport * @return C_Period_ID or 0 * @deprecated */ + @Deprecated public static int getC_Period_ID (Properties ctx, Timestamp DateAcct) { MPeriod period = get (ctx, DateAcct, 0, null); @@ -238,8 +240,8 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport /** * Find valid standard Period of DateAcct based on Client Calendar * @param ctx context - * @param DateAcct date - * @param AD_Org_ID Organization + * @param DateAcct date + * @param AD_Org_ID Organization * @return C_Period_ID or 0 */ public static int getC_Period_ID (Properties ctx, Timestamp DateAcct, int AD_Org_ID) @@ -258,6 +260,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport * @return true if open * @deprecated */ + @Deprecated public static boolean isOpen (Properties ctx, Timestamp DateAcct, String DocBaseType) { return isOpen(ctx, DateAcct,DocBaseType, 0 ); @@ -266,9 +269,9 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport /** * Is standard Period Open for Document Base Type * @param ctx context - * @param DateAcct date - * @param DocBaseType base type - * @param AD_Org_ID Organization + * @param DateAcct date + * @param DocBaseType base type (X_C_DocType.DOCBASETYPE_*) + * @param AD_Org_ID Organization * @return true if open */ public static boolean isOpen(Properties ctx, Timestamp DateAcct, String DocBaseType, int AD_Org_ID) @@ -279,10 +282,10 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport /** * Is standard Period Open for Document Base Type * @param ctx context - * @param DateAcct date - * @param DocBaseType base type - * @param AD_Org_ID Organization - * @param forPosting - check if the period is open for posting, false is for DocAction + * @param DateAcct date + * @param DocBaseType base type (X_C_DocType.DOCBASETYPE_*) + * @param AD_Org_ID Organization + * @param forPosting - true to check if the period is open for posting, false is for DocAction * @return true if open */ public static boolean isOpen (Properties ctx, Timestamp DateAcct, String DocBaseType, int AD_Org_ID, boolean forPosting) @@ -328,7 +331,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport * @param tableID * @param recordID * @param trxName - * @param forPosting - check if the period is open for posting, false is for DocAction + * @param forPosting - true to check if the period is open for posting, false is for DocAction * @return true if open */ public static boolean isOpen (Properties ctx, int tableID, int recordID, String trxName, boolean forPosting) { @@ -446,6 +449,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport * @return active first Period * @deprecated */ + @Deprecated public static MPeriod getFirstInYear (Properties ctx, Timestamp DateAcct) { return getFirstInYear(ctx , DateAcct, 0); @@ -454,8 +458,8 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport /** * Find first Year Period of DateAcct based on Client Calendar * @param ctx context - * @param DateAcct date - * @param AD_Org_ID TODO + * @param DateAcct date + * @param AD_Org_ID organization * @return active first Period */ public static MPeriod getFirstInYear (Properties ctx, Timestamp DateAcct, int AD_Org_ID) @@ -507,21 +511,20 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport /** Calendar */ private int m_C_Calendar_ID = 0; - - + /** - * UUID based Constructor - * @param ctx Context - * @param C_Period_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Period_UU UUID key + * @param trxName Transaction + */ public MPeriod(Properties ctx, String C_Period_UU, String trxName) { super(ctx, C_Period_UU, trxName); if (Util.isEmpty(C_Period_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_Period_ID id @@ -573,7 +576,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport } // MPeriod /** - * + * Copy constructor * @param copy */ public MPeriod(MPeriod copy) @@ -582,7 +585,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -592,7 +595,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -610,7 +613,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport /** * Get Period Control - * @param requery requery + * @param requery true to re-query from DB * @return period controls */ public MPeriodControl[] getPeriodControls (boolean requery) @@ -650,7 +653,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport /** * Get Period Control - * @param DocBaseType Document Base Type + * @param DocBaseType Document Base Type (X_C_DocType.DOCBASETYPE_*) * @return period control or null */ public MPeriodControl getPeriodControl (String DocBaseType) @@ -667,9 +670,9 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport } // getPeriodControl /** - * Date In Period + * Is Date In this Period * @param date date - * @return true if in period + * @return true if date is in this period */ public boolean isInPeriod (Timestamp date) { @@ -691,6 +694,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport * @return true if open * @deprecated since 3.3.1b; use {@link #isOpen(String, Timestamp)} instead */ + @Deprecated public boolean isOpen (String DocBaseType) { return isOpen(DocBaseType, null); @@ -698,7 +702,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport /** * Is Period Open for Doc Base Type - * @param DocBaseType document base type + * @param DocBaseType document base type (X_C_DocType.DOCBASETYPE_*) * @param dateAcct date; * Applies only for "Auto Period Control": *
      • if not null, date should be in auto period range (today - OpenHistory, today+OpenHistory) @@ -718,7 +722,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport * Applies only for "Auto Period Control": *
      • if not null, date should be in auto period range (today - OpenHistory, today+OpenHistory) *
      • if null, this period should be in auto period range - * @param forPosting - check if the period is open for posting, false is for DocAction + * @param forPosting - true to check if the period is open for posting, false is for DocAction * @return true if open */ public boolean isOpen (String DocBaseType, Timestamp dateAcct, boolean forPosting) @@ -786,7 +790,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport /** * Standard Period - * @return true if standard calendar periods + * @return true if this is of standard calendar periods type (PERIODTYPE_StandardCalendarPeriod) */ public boolean isStandardPeriod() { @@ -800,6 +804,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { // Truncate Dates @@ -854,6 +859,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -879,12 +885,12 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport } return success; } // afterSave - - + /** * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MPeriod["); @@ -904,6 +910,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport * @see #isOpen(Properties, Timestamp, String) * @deprecated */ + @Deprecated public static void testPeriodOpen(Properties ctx, Timestamp dateAcct, String docBaseType) throws PeriodClosedException { @@ -916,7 +923,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport * Convenient method for testing if a period is open * @param ctx * @param dateAcct - * @param docBaseType + * @param docBaseType X_C_DocType.DOCBASETYPE_* * @param AD_Org_ID Organization * @throws PeriodClosedException if period is closed * @see #isOpen(Properties, Timestamp, String, int) @@ -929,7 +936,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport } } - /** + /** * Convenient method for testing if a period is open * @param ctx * @param dateAcct @@ -938,6 +945,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport * @see {@link #isOpen(Properties, Timestamp, String)} * @deprecated */ + @Deprecated public static void testPeriodOpen(Properties ctx, Timestamp dateAcct, int C_DocType_ID) throws PeriodClosedException { @@ -963,7 +971,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport /** * Get Calendar of Period - * @return calendar + * @return C_Calendar_ID */ public int getC_Calendar_ID() { @@ -982,7 +990,7 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport * Get Calendar for Organization * @param ctx Context * @param AD_Org_ID Organization - * @return + * @return C_Calendar_ID */ public static int getC_Calendar_ID(Properties ctx,int AD_Org_ID) { @@ -1015,17 +1023,17 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport } /** - * Has the period un-posted documents - * @return boolean - true if there is at least 1 un-posted document in the period + * Is the period has un-posted documents + * @return boolean - true if there is at least 1 un-posted document in this period */ public boolean hasUnpostedDocs() { return hasUnpostedDocs(0); } /** - * Has the period control un-posted documents - * @param periodControlID - * @return boolean - true if there is at least 1 un-posted document in the period control + * Is this period has un-posted documents + * @param periodControlID C_PeriodControl_ID. If > 0, check only documents with the period control's DocBaseType + * @return boolean - true if there is at least 1 un-posted document in this period */ public boolean hasUnpostedDocs(int periodControlID) { @@ -1051,8 +1059,8 @@ public class MPeriod extends X_C_Period implements ImmutablePOSupport pstmt.setTimestamp(idx++, getStartDate()); pstmt.setTimestamp(idx++, getEndDate()); pstmt.setInt(idx++, Env.getAD_Client_ID(Env.getCtx())); - pstmt.setInt(idx++, getC_Calendar_ID()); - if (periodControlID > 0) { + pstmt.setInt(idx++, getC_Calendar_ID()); + if (periodControlID > 0) { MPeriodControl pc = new MPeriodControl(getCtx(), periodControlID, get_TrxName()); pstmt.setString(idx++, pc.getDocBaseType()); } diff --git a/org.adempiere.base/src/org/compiere/model/MPeriodControl.java b/org.adempiere.base/src/org/compiere/model/MPeriodControl.java index 44a437e47f..993b9227fd 100644 --- a/org.adempiere.base/src/org/compiere/model/MPeriodControl.java +++ b/org.adempiere.base/src/org/compiere/model/MPeriodControl.java @@ -24,7 +24,7 @@ import org.compiere.util.Util; import org.idempiere.cache.ImmutablePOSupport; /** - * Period Control Model + * Period Control Model * * @author Jorg Janke * @version $Id: MPeriodControl.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $ @@ -32,16 +32,16 @@ import org.idempiere.cache.ImmutablePOSupport; public class MPeriodControl extends X_C_PeriodControl implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -7818843756246170549L; /** - * UUID based Constructor - * @param ctx Context - * @param C_PeriodControl_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_PeriodControl_UU UUID key + * @param trxName Transaction + */ public MPeriodControl(Properties ctx, String C_PeriodControl_UU, String trxName) { super(ctx, C_PeriodControl_UU, trxName); if (Util.isEmpty(C_PeriodControl_UU)) @@ -110,7 +110,7 @@ public class MPeriodControl extends X_C_PeriodControl implements ImmutablePOSupp } // MPeriodControl /** - * + * Copy constructor * @param copy */ public MPeriodControl(MPeriodControl copy) @@ -119,7 +119,7 @@ public class MPeriodControl extends X_C_PeriodControl implements ImmutablePOSupp } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -129,7 +129,7 @@ public class MPeriodControl extends X_C_PeriodControl implements ImmutablePOSupp } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -141,7 +141,7 @@ public class MPeriodControl extends X_C_PeriodControl implements ImmutablePOSupp } /** - * Is Period Open + * Is Open * @return true if open */ public boolean isOpen() @@ -150,8 +150,8 @@ public class MPeriodControl extends X_C_PeriodControl implements ImmutablePOSupp } // isOpen /** - * Is Period Open - * @param forPosting - check if the period is open for posting, false is for DocAction + * Is Open + * @param forPosting - true to check if the period is open for posting, false is for DocAction * @return true if open */ public boolean isOpen(boolean forPosting) @@ -167,6 +167,7 @@ public class MPeriodControl extends X_C_PeriodControl implements ImmutablePOSupp * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MPeriodControl["); diff --git a/org.adempiere.base/src/org/compiere/model/MPostIt.java b/org.adempiere.base/src/org/compiere/model/MPostIt.java index eaf3506514..8170009ff6 100644 --- a/org.adempiere.base/src/org/compiere/model/MPostIt.java +++ b/org.adempiere.base/src/org/compiere/model/MPostIt.java @@ -25,7 +25,7 @@ import org.compiere.util.Msg; import org.compiere.util.Util; /** - * PostIt Model + * PostIt Note Model * * @author Nicolas Micoud * @version $Id: MPostIt.java @@ -33,21 +33,21 @@ import org.compiere.util.Util; public class MPostIt extends X_AD_PostIt { /** - * + * generated serial id */ private static final long serialVersionUID = 7817778632231317976L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_PostIt_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_PostIt_UU UUID key + * @param trxName Transaction + */ public MPostIt(Properties ctx, String AD_PostIt_UU, String trxName) { super(ctx, AD_PostIt_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param XXA_PostIt_ID id @@ -59,7 +59,6 @@ public class MPostIt extends X_AD_PostIt } // MPostIt /** - * Full Constructor * @param ctx context * @param AD_Table_ID table * @param Record_ID record @@ -73,7 +72,6 @@ public class MPostIt extends X_AD_PostIt } // MPostIt /** - * Full Constructor * @param ctx context * @param AD_Table_ID table * @param Record_ID record @@ -98,7 +96,9 @@ public class MPostIt extends X_AD_PostIt super (ctx, rs, trxName); } // MPostIt - + /** + * @return created text + */ public String getCreatedString() { MUser user = MUser.get(getCtx(), getCreatedBy()); @@ -107,7 +107,9 @@ public class MPostIt extends X_AD_PostIt return Msg.getMsg(getCtx(), "PostItCreated", args); } // getCreated - + /** + * @return updated text + */ public String getUpdatedString() { String retValue = ""; @@ -125,9 +127,10 @@ public class MPostIt extends X_AD_PostIt /** * @param Table_ID * @param Record_ID - * @return + * @return AD_PostIt_ID * @deprecated Use {@link MPostIt#getID(int, String)} instead */ + @Deprecated public static int getID(int Table_ID, int Record_ID) { String sql="SELECT AD_PostIt_ID FROM AD_PostIt WHERE AD_Table_ID=? AND Record_ID=?"; int postItID = DB.getSQLValueEx(null, sql, Table_ID, Record_ID); @@ -137,7 +140,7 @@ public class MPostIt extends X_AD_PostIt /** * @param Table_ID * @param Record_UU - * @return + * @return AD_PostIt_ID */ public static int getID(int Table_ID, String Record_UU) { String sql="SELECT AD_PostIt_ID FROM AD_PostIt WHERE AD_Table_ID=? AND Record_UU=?"; diff --git a/org.adempiere.base/src/org/compiere/model/MPreference.java b/org.adempiere.base/src/org/compiere/model/MPreference.java index 1f4be5d1ae..ef055a426c 100644 --- a/org.adempiere.base/src/org/compiere/model/MPreference.java +++ b/org.adempiere.base/src/org/compiere/model/MPreference.java @@ -28,7 +28,7 @@ import java.util.Properties; public class MPreference extends X_AD_Preference { /** - * + * generated serial id */ private static final long serialVersionUID = -3831004323199130018L; @@ -36,17 +36,16 @@ public class MPreference extends X_AD_Preference public static String NULL = "null"; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Preference_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Preference_UU UUID key + * @param trxName Transaction + */ public MPreference(Properties ctx, String AD_Preference_UU, String trxName) { super(ctx, AD_Preference_UU, trxName); } /** - * Standatrd Constructor * @param ctx ctx * @param AD_Preference_ID id * @param trxName transaction @@ -57,7 +56,6 @@ public class MPreference extends X_AD_Preference } // MPreference /** - * Load Contsructor * @param ctx context * @param rs result set * @param trxName transaction @@ -68,7 +66,6 @@ public class MPreference extends X_AD_Preference } // MPreference /** - * Full Constructor * @param ctx context * @param Attribute attribute * @param Value value @@ -86,6 +83,7 @@ public class MPreference extends X_AD_Preference * @param newRecord * @return true if can be saved */ + @Override protected boolean beforeSave (boolean newRecord) { String value = getValue(); @@ -100,6 +98,7 @@ public class MPreference extends X_AD_Preference * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MPreference["); diff --git a/org.adempiere.base/src/org/compiere/model/MPriceList.java b/org.adempiere.base/src/org/compiere/model/MPriceList.java index 8181fc3abe..b673af78b7 100644 --- a/org.adempiere.base/src/org/compiere/model/MPriceList.java +++ b/org.adempiere.base/src/org/compiere/model/MPriceList.java @@ -38,11 +38,10 @@ import org.idempiere.cache.ImmutablePOSupport; public class MPriceList extends X_M_PriceList implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 7128840936482927934L; - /** * Get Price List (cached) (immutable) * @param M_PriceList_ID id @@ -187,7 +186,7 @@ public class MPriceList extends X_M_PriceList implements ImmutablePOSupport } /** - * Get Standard Currency Precision + * Get Standard Currency Precision from price list * @param ctx context * @param M_PriceList_ID price list * @return precision @@ -199,7 +198,7 @@ public class MPriceList extends X_M_PriceList implements ImmutablePOSupport } // getStandardPrecision /** - * Get Price Precision + * Get Price Precision from price list * @param ctx context * @param M_PriceList_ID price list * @return precision @@ -212,21 +211,20 @@ public class MPriceList extends X_M_PriceList implements ImmutablePOSupport /** Cache of Price Lists */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 5, 5); - - + /** - * UUID based Constructor - * @param ctx Context - * @param M_PriceList_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_PriceList_UU UUID key + * @param trxName Transaction + */ public MPriceList(Properties ctx, String M_PriceList_UU, String trxName) { super(ctx, M_PriceList_UU, trxName); if (Util.isEmpty(M_PriceList_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param M_PriceList_ID id @@ -281,7 +279,7 @@ public class MPriceList extends X_M_PriceList implements ImmutablePOSupport } // MPriceList /** - * + * Copy constructor * @param copy */ public MPriceList(MPriceList copy) @@ -290,7 +288,7 @@ public class MPriceList extends X_M_PriceList implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -300,7 +298,7 @@ public class MPriceList extends X_M_PriceList implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -329,7 +327,7 @@ public class MPriceList extends X_M_PriceList implements ImmutablePOSupport /** * Get Price List Version * @param valid date where PLV must be valid or today if null - * @return PLV + * @return MPriceListVersion */ public MPriceListVersion getPriceListVersion (Timestamp valid) { diff --git a/org.adempiere.base/src/org/compiere/model/MPriceListVersion.java b/org.adempiere.base/src/org/compiere/model/MPriceListVersion.java index f0f065e53a..ac4d93a434 100644 --- a/org.adempiere.base/src/org/compiere/model/MPriceListVersion.java +++ b/org.adempiere.base/src/org/compiere/model/MPriceListVersion.java @@ -35,16 +35,16 @@ import org.idempiere.cache.ImmutablePOSupport; public class MPriceListVersion extends X_M_PriceList_Version implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 1625884461739604147L; /** - * UUID based Constructor - * @param ctx Context - * @param M_PriceList_Version_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_PriceList_Version_UU UUID key + * @param trxName Transaction + */ public MPriceListVersion(Properties ctx, String M_PriceList_Version_UU, String trxName) { super(ctx, M_PriceList_Version_UU, trxName); } @@ -83,7 +83,7 @@ public class MPriceListVersion extends X_M_PriceList_Version implements Immutabl } // MPriceListVersion /** - * + * Copy constructor * @param copy */ public MPriceListVersion(MPriceListVersion copy) @@ -92,7 +92,7 @@ public class MPriceListVersion extends X_M_PriceList_Version implements Immutabl } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -102,7 +102,7 @@ public class MPriceListVersion extends X_M_PriceList_Version implements Immutabl } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -172,7 +172,7 @@ public class MPriceListVersion extends X_M_PriceList_Version implements Immutabl /** * Set Name to Valid From Date. - * If valid from not set, use today + * If valid from not set, use today. */ public void setName() { @@ -191,6 +191,7 @@ public class MPriceListVersion extends X_M_PriceList_Version implements Immutabl * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { setName(); diff --git a/org.adempiere.base/src/org/compiere/model/MPrivateAccess.java b/org.adempiere.base/src/org/compiere/model/MPrivateAccess.java index 02e297ab8a..7575aba94a 100644 --- a/org.adempiere.base/src/org/compiere/model/MPrivateAccess.java +++ b/org.adempiere.base/src/org/compiere/model/MPrivateAccess.java @@ -33,17 +33,17 @@ import org.compiere.util.DB; public class MPrivateAccess extends X_AD_Private_Access { /** - * + * generated serial id */ private static final long serialVersionUID = -5649529789751432279L; /** - * Load Pricate Access + * Get Private Access * @param ctx context * @param AD_User_ID user * @param AD_Table_ID table * @param Record_ID record - * @return access or null if not found + * @return private access instance or null if not found */ public static MPrivateAccess get (Properties ctx, int AD_User_ID, int AD_Table_ID, int Record_ID) { @@ -75,10 +75,10 @@ public class MPrivateAccess extends X_AD_Private_Access } // get /** - * Get Where Clause of Locked Records for Table + * Get Where Clause of Locked Records for Table. * @param AD_Table_ID table - * @param AD_User_ID user requesting info - * @return "<>1" or " NOT IN (1,2)" or null + * @param AD_User_ID user requesting access + * @return not in private access clause */ public static String getLockedRecordWhere (int AD_Table_ID, int AD_User_ID) { @@ -86,23 +86,21 @@ public class MPrivateAccess extends X_AD_Private_Access +AD_Table_ID+" AND AD_User_ID <> "+AD_User_ID+" AND IsActive = 'Y' )"; return whereClause; } // get - /** Logger */ private static CLogger s_log = CLogger.getCLogger(MPrivateAccess.class); /** - * UUID based Constructor - * @param ctx Context - * @param AD_Private_Access_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Private_Access_UU UUID key + * @param trxName Transaction + */ public MPrivateAccess(Properties ctx, String AD_Private_Access_UU, String trxName) { super(ctx, AD_Private_Access_UU, trxName); } /** - * Persistency Constructor * @param ctx context * @param ignored ignored * @param trxName transaction diff --git a/org.adempiere.base/src/org/compiere/model/MProcess.java b/org.adempiere.base/src/org/compiere/model/MProcess.java index fb45c5ccd9..cdbb1cfea2 100644 --- a/org.adempiere.base/src/org/compiere/model/MProcess.java +++ b/org.adempiere.base/src/org/compiere/model/MProcess.java @@ -48,15 +48,10 @@ import org.idempiere.cache.ImmutablePOCache; public class MProcess extends X_AD_Process implements ImmutablePOSupport { /** - * - */ - - /** - * + * generated serial id */ private static final long serialVersionUID = -2068744950300991237L; - /** * Get MProcess from Cache (immutable) * @param AD_Process_ID id @@ -157,26 +152,24 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport return p; } // getFromMenu - /** Cache ID */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 20); /** Cache UUID */ private static ImmutablePOCache s_cacheUU = new ImmutablePOCache(Table_Name, Table_Name+"|AD_Process_UU", 20); - /** - * UUID based Constructor - * @param ctx Context - * @param AD_Process_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Process_UU UUID key + * @param trxName Transaction + */ public MProcess(Properties ctx, String AD_Process_UU, String trxName) { super(ctx, AD_Process_UU, trxName); if (Util.isEmpty(AD_Process_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param AD_Process_ID process @@ -211,7 +204,7 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport } // MProcess /** - * + * Copy constructor * @param copy */ public MProcess(MProcess copy) @@ -220,7 +213,7 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -230,7 +223,7 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -246,8 +239,8 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport private MProcessPara[] m_parameters = null; /** - * Get Parameters - * @return parameters + * Get Process Parameters + * @return process parameters */ public MProcessPara[] getParameters() { @@ -269,9 +262,9 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport } // getParameters /** - * Get Parameter with ColumnName + * Get Process Parameter with ColumnName * @param name column name - * @return parameter or null + * @return process parameter or null */ public MProcessPara getParameter(String name) { @@ -284,12 +277,11 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport return null; } // getParameter - - /** * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MProcess[") @@ -298,9 +290,8 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport .append ("]"); return sb.toString (); } // toString - - /************************************************************************** + /** * Process w/o parameter * @param Record_ID record * @param trx transaction @@ -312,7 +303,7 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport return processIt(Record_ID, trx, true); } - /************************************************************************** + /** * Process w/o parameter * @param Record_ID record * @param trx transaction @@ -344,7 +335,7 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport } // process /** - * Process It (sync) + * Call {@link #processIt(ProcessInfo, Trx, boolean)}. * @param pi Process Info * @param trx transaction * @return true if OK @@ -355,9 +346,10 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport } /** - * Process It (sync) + * Execute the process * @param pi Process Info * @param trx transaction + * @param managedTrx true to manage commit and rollback * @return true if OK */ public boolean processIt (ProcessInfo pi, Trx trx, boolean managedTrx) @@ -417,8 +409,8 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport } // process /** - * Is this a Java Process - * @return true if java process + * Is this using Java Process + * @return true if this is using java process */ public boolean isJavaProcess() { @@ -426,8 +418,8 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport } // is JavaProcess /** - * Is this a db procedure - * @return true if db procedure + * Is this using DB procedure + * @return true if this is using DB procedure */ public boolean isDatabaseProcedure() { @@ -435,8 +427,8 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport } /** - * Is Force Background - * @return true if force background + * Is Force running in Background + * @return true if force to run in background */ public boolean isForceBackground() { @@ -444,8 +436,8 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport } /** - * Is Force Foreground - * @return true if force foreground + * Is Force running Foreground + * @return true if force to run in foreground */ public boolean isForceForeground() { @@ -453,11 +445,10 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport } /** - * Start Database Process + * Run Database Process * @param ProcedureName PL/SQL procedure name - * @param pInstance process instance + * @param processInfo process info * @param managedTrx false if trx is managed by caller - * see ProcessCtl.startProcess * @return true if success */ private boolean startProcess (String ProcedureName, ProcessInfo processInfo, Trx trx, boolean managedTrx) @@ -469,13 +460,8 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport return ProcessUtil.startDatabaseProcedure(processInfo, ProcedureName, trx, managedTrx); } // startProcess - /** - * Start Java Class (sync). - * instanciate the class implementing the interface ProcessCall. - * The class can be a Server/Client class (when in Package - * org adempiere.process or org.compiere.model) or a client only class - * (e.g. in org.compiere.report) + * Run Java Class process * * @param Classname name of the class to call * @param pi process info @@ -494,36 +480,35 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport return ProcessUtil.startJavaProcess(getCtx(), pi, trx, managedTrx); } } // startClass - /** - * Is it a Workflow - * @return true if Workflow + * Is it a Workflow process + * @return true if this is a Workflow process */ public boolean isWorkflow() { return getAD_Workflow_ID() > 0; } // isWorkflow - - + /** * Update Statistics * @param seconds sec * @deprecated - use UPDATE instead */ + @Deprecated public void addStatistics (int seconds) { setStatistic_Count(getStatistic_Count() + 1); setStatistic_Seconds(getStatistic_Seconds() + seconds); } // addStatistics - - + /** * After Save * @param newRecord new * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -574,10 +559,10 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport } // afterSave /** - * Grant independence to GenerateModel from AD_Process_ID - * @param value + * Get AD_Process_ID via Value (Search key) + * @param value AD_Process.Value * @param trxName - * @return + * @return AD_Process_ID */ public static int getProcess_ID(String value, String trxName) { @@ -586,16 +571,13 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport } /** - * Copy settings from another process - * overwrites existing data - * (including translations) + * Copy values and parameters from another process * and saves. - * Not overwritten: name, value, entitytype + * Not overwritten: name, value, entitytype. * @param source */ public void copyFrom (MProcess source) { - if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Copying from:" + source + ", to: " + this); setAccessLevel(source.getAccessLevel()); setAD_Form_ID(source.getAD_Form_ID()); @@ -625,7 +607,7 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport } /** - * Process It without closing the given transaction - used from workflow engine. + * Execute process without closing the given transaction - used from workflow engine. * @param pi Process Info * @param trx transaction * @return true if OK diff --git a/org.adempiere.base/src/org/compiere/model/MProcessAccess.java b/org.adempiere.base/src/org/compiere/model/MProcessAccess.java index 0637836c54..2da41d4c43 100644 --- a/org.adempiere.base/src/org/compiere/model/MProcessAccess.java +++ b/org.adempiere.base/src/org/compiere/model/MProcessAccess.java @@ -21,7 +21,6 @@ import java.util.Properties; import org.compiere.util.Util; - /** * Process Access Model * @@ -30,27 +29,24 @@ import org.compiere.util.Util; */ public class MProcessAccess extends X_AD_Process_Access { - - - /** - * + * generated serial id */ private static final long serialVersionUID = -2468108979800832171L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Process_Access_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Process_Access_UU UUID key + * @param trxName Transaction + */ public MProcessAccess(Properties ctx, String AD_Process_Access_UU, String trxName) { super(ctx, AD_Process_Access_UU, trxName); if (Util.isEmpty(AD_Process_Access_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param ignored ignored diff --git a/org.adempiere.base/src/org/compiere/model/MProcessDrillRule.java b/org.adempiere.base/src/org/compiere/model/MProcessDrillRule.java index 701d2e2a6e..1835cd1fc4 100644 --- a/org.adempiere.base/src/org/compiere/model/MProcessDrillRule.java +++ b/org.adempiere.base/src/org/compiere/model/MProcessDrillRule.java @@ -35,7 +35,7 @@ import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; /** - * + * Process drill rule model * @author Igor Pojzl, Cloudempiere * @author Peter Takacs, Cloudempiere */ @@ -45,7 +45,7 @@ public class MProcessDrillRule extends X_AD_Process_DrillRule implements Immutab private MProcessDrillRulePara[] m_parameter = null; /** - * + * generated serial id */ private static final long serialVersionUID = -6543978637922025586L; @@ -56,18 +56,18 @@ public class MProcessDrillRule extends X_AD_Process_DrillRule implements Immutab * Get MProcessDrillRule Cached(Immutable) * @param ctx * @param AD_Process_DrillRule_ID - * @return + * @return MProcessDrillRule or null */ public static MProcessDrillRule get(Properties ctx, int AD_Process_DrillRule_ID) { return get(ctx, AD_Process_DrillRule_ID, null); } /** - * + * Get MProcessDrillRule Cached(Immutable) * @param ctx * @param AD_Process_DrillRule_ID * @param trxName - * @return + * @return MProcessDrillRule or null */ public static MProcessDrillRule get(Properties ctx, int AD_Process_DrillRule_ID, String trxName) { Integer ii = Integer.valueOf(AD_Process_DrillRule_ID); @@ -85,29 +85,45 @@ public class MProcessDrillRule extends X_AD_Process_DrillRule implements Immutab /** - * UUID based Constructor - * @param ctx Context - * @param AD_Process_DrillRule_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Process_DrillRule_UU UUID key + * @param trxName Transaction + */ public MProcessDrillRule(Properties ctx, String AD_Process_DrillRule_UU, String trxName) { super(ctx, AD_Process_DrillRule_UU, trxName); } + /** + * @param ctx + * @param AD_Process_DrillRule_ID + * @param trxName + */ public MProcessDrillRule(Properties ctx, int AD_Process_DrillRule_ID, String trxName) { super(ctx, AD_Process_DrillRule_ID, trxName); } + /** + * @param ctx + * @param AD_Process_DrillRule_ID + * @param trxName + * @param virtualColumns + */ public MProcessDrillRule(Properties ctx, int AD_Process_DrillRule_ID, String trxName, String[] virtualColumns) { super(ctx, AD_Process_DrillRule_ID, trxName, virtualColumns); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MProcessDrillRule(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } /** - * + * Copy constructor * @param copy */ public MProcessDrillRule(MProcessDrillRule copy) @@ -116,7 +132,7 @@ public class MProcessDrillRule extends X_AD_Process_DrillRule implements Immutab } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -126,7 +142,7 @@ public class MProcessDrillRule extends X_AD_Process_DrillRule implements Immutab } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -142,7 +158,7 @@ public class MProcessDrillRule extends X_AD_Process_DrillRule implements Immutab * @param ctx * @param AD_Table_ID * @param trxName - * @return + * @return array of MProcessDrillRule */ public static MProcessDrillRule[] getByTable(Properties ctx, int AD_Table_ID, String trxName) { @@ -160,7 +176,7 @@ public class MProcessDrillRule extends X_AD_Process_DrillRule implements Immutab * @param ctx * @param columnName * @param trxName - * @return + * @return array of MProcessDrillRule */ public static MProcessDrillRule[] getByColumnName(Properties ctx, String columnName, String trxName) { @@ -192,9 +208,9 @@ public class MProcessDrillRule extends X_AD_Process_DrillRule implements Immutab } /** - * Get Parameters - * @param reload reload - * @return parameter + * Get Process Drill Rule Parameters + * @param reload true to reload from DB + * @return process drill rule parameters */ public MProcessDrillRulePara[] getParameters (boolean reload) { @@ -223,7 +239,6 @@ public class MProcessDrillRule extends X_AD_Process_DrillRule implements Immutab } /** - * Are all mandatory parameters defined among the Drill Rule Parameters * @return true - all mandatory parameters are set; false - at least one mandatory parameter is not set */ private boolean allMandatoryParaSet() { @@ -249,8 +264,8 @@ public class MProcessDrillRule extends X_AD_Process_DrillRule implements Immutab } /** - * Has any Drill Rule Parameters with a mandatory Process Parameter - * @return boolean true if has at least one Drill Rule Parameter with a mandatory Process Parameter + * Is associated process (AD_Process_ID) has at least one mandatory process parameter + * @return boolean true if associated process (AD_Process_ID) has at least one mandatory process parameter */ public boolean hasMandatoryProcessPara() { MProcess process = new MProcess(Env.getCtx(), getAD_Process_ID(), null); diff --git a/org.adempiere.base/src/org/compiere/model/MProcessDrillRulePara.java b/org.adempiere.base/src/org/compiere/model/MProcessDrillRulePara.java index 32154d3525..6543c0e5e2 100644 --- a/org.adempiere.base/src/org/compiere/model/MProcessDrillRulePara.java +++ b/org.adempiere.base/src/org/compiere/model/MProcessDrillRulePara.java @@ -32,36 +32,51 @@ import org.idempiere.cache.ImmutablePOSupport; import org.idempiere.model.IProcessParameter; /** - * + * Process drill rule parameter model * @author Igor Pojzl, Cloudempiere * @author Peter Takacs, Cloudempiere */ public class MProcessDrillRulePara extends X_AD_Process_DrillRule_Para implements ImmutablePOSupport, IProcessParameter { - /** - * + * generated serial id */ private static final long serialVersionUID = 1460684182951511710L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Process_DrillRule_Para_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Process_DrillRule_Para_UU UUID key + * @param trxName Transaction + */ public MProcessDrillRulePara(Properties ctx, String AD_Process_DrillRule_Para_UU, String trxName) { super(ctx, AD_Process_DrillRule_Para_UU, trxName); } + /** + * @param ctx + * @param AD_Process_DrillRule_Para_ID + * @param trxName + */ public MProcessDrillRulePara(Properties ctx, int AD_Process_DrillRule_Para_ID, String trxName) { super(ctx, AD_Process_DrillRule_Para_ID, trxName); } + /** + * @param ctx + * @param AD_Process_DrillRule_Para_ID + * @param trxName + * @param virtualColumns + */ public MProcessDrillRulePara(Properties ctx, int AD_Process_DrillRule_Para_ID, String trxName, String[] virtualColumns) { super(ctx, AD_Process_DrillRule_Para_ID, trxName, virtualColumns); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MProcessDrillRulePara(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } @@ -71,7 +86,6 @@ public class MProcessDrillRulePara extends X_AD_Process_DrillRule_Para implement /** Parent */ private MProcessDrillRule m_parent = null; - /** * Get Parameter Column Name * @return column name diff --git a/org.adempiere.base/src/org/compiere/model/MProcessPara.java b/org.adempiere.base/src/org/compiere/model/MProcessPara.java index 98c3c883b4..6df69ed8ae 100644 --- a/org.adempiere.base/src/org/compiere/model/MProcessPara.java +++ b/org.adempiere.base/src/org/compiere/model/MProcessPara.java @@ -35,7 +35,6 @@ import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; import org.idempiere.expression.logic.LogicEvaluator; - /** * Process Parameter Model * @@ -45,13 +44,10 @@ import org.idempiere.expression.logic.LogicEvaluator; public class MProcessPara extends X_AD_Process_Para implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -1116840975434565353L; - /** - * - */ /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MProcessPara.class); @@ -89,21 +85,20 @@ public class MProcessPara extends X_AD_Process_Para implements ImmutablePOSuppor /** Cache */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache (Table_Name, 20); - - + /** - * UUID based Constructor - * @param ctx Context - * @param AD_Process_Para_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Process_Para_UU UUID key + * @param trxName Transaction + */ public MProcessPara(Properties ctx, String AD_Process_Para_UU, String trxName) { super(ctx, AD_Process_Para_UU, trxName); if (Util.isEmpty(AD_Process_Para_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Constructor * @param ctx context * @param AD_Process_Para_ID id @@ -152,7 +147,7 @@ public class MProcessPara extends X_AD_Process_Para implements ImmutablePOSuppor } /** - * + * Copy constructor * @param copy */ public MProcessPara(MProcessPara copy) @@ -161,7 +156,7 @@ public class MProcessPara extends X_AD_Process_Para implements ImmutablePOSuppor } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -171,7 +166,7 @@ public class MProcessPara extends X_AD_Process_Para implements ImmutablePOSuppor } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -190,7 +185,6 @@ public class MProcessPara extends X_AD_Process_Para implements ImmutablePOSuppor /** The Lookup */ private Lookup m_lookup = null; - /** * Is this field a Lookup?. * @return true if lookup field @@ -210,7 +204,7 @@ public class MProcessPara extends X_AD_Process_Para implements ImmutablePOSuppor } // isLookup /** - * Set Lookup for columns with lookup + * Load Lookup for column with lookup */ public void loadLookup() { @@ -280,6 +274,7 @@ public class MProcessPara extends X_AD_Process_Para implements ImmutablePOSuppor * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MProcessPara[") @@ -289,15 +284,11 @@ public class MProcessPara extends X_AD_Process_Para implements ImmutablePOSuppor } // toString /** - * Copy settings from another process parameter - * overwrites existing data - * (including translations) - * and saves + * Copy settings from another process parameter and save * @param source */ public void copyFrom (MProcessPara source) { - if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Copying from:" + source + ", to: " + this); setAD_Element_ID(source.getAD_Element_ID()); setAD_Reference_ID(source.getAD_Reference_ID()); @@ -343,11 +334,12 @@ public class MProcessPara extends X_AD_Process_Para implements ImmutablePOSuppor } - /************************************************************************** + /** * Before Save * @param newRecord * @return save */ + @Override protected boolean beforeSave (boolean newRecord) { if (isCentrallyMaintained() && getAD_Element_ID() == 0) @@ -411,6 +403,10 @@ public class MProcessPara extends X_AD_Process_Para implements ImmutablePOSuppor return true; } // beforeSave + /** + * Get reference table name for lookup and list field + * @return reference table name or null + */ public String getReferenceTableName() { String foreignTable = null; int refid = getAD_Reference_ID(); @@ -440,9 +436,9 @@ public class MProcessPara extends X_AD_Process_Para implements ImmutablePOSuppor } /** - * Write in log when an unexpected parameter is processed - * If the parameter is defined in dictionary log at INFO level as a custom parameter - * Otherwise log at SEVERE level as unknown parameter + * Write in server log when an unexpected parameter is processed.
        + * If the parameter is defined in dictionary log at INFO level as a custom parameter.
        + * Otherwise log at SEVERE level as unknown parameter. * @param processId * @param para */ diff --git a/org.adempiere.base/src/org/compiere/model/MProduct.java b/org.adempiere.base/src/org/compiere/model/MProduct.java index 18fb36d140..3016e121a3 100644 --- a/org.adempiere.base/src/org/compiere/model/MProduct.java +++ b/org.adempiere.base/src/org/compiere/model/MProduct.java @@ -39,7 +39,7 @@ import org.idempiere.cache.ImmutablePOSupport; * @author Jorg Janke * @version $Id: MProduct.java,v 1.5 2006/07/30 00:51:05 jjanke Exp $ * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL + * @author Teo Sarca, SC ARHIPAC SERVICE SRL *
      • FR [ 1885153 ] Refactor: getMMPolicy code *
      • BF [ 1885414 ] ASI should be always mandatory if CostingLevel is Batch/Lot *
      • FR [ 2093551 ] Refactor/Add org.compiere.model.MProduct.getCostingLevel @@ -47,13 +47,13 @@ import org.idempiere.cache.ImmutablePOSupport; *
      • BF [ 2824795 ] Deleting Resource product should be forbidden * https://sourceforge.net/p/adempiere/bugs/1988/ * - * @author Mark Ostermann (mark_o), metas consult GmbH + * @author Mark Ostermann (mark_o), metas consult GmbH *
      • BF [ 2814628 ] Wrong evaluation of Product inactive in beforeSave() */ public class MProduct extends X_M_Product implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 6847265056758898333L; @@ -121,11 +121,11 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport } /** - * Get MProducts from db + * Get MProducts from DB * @param ctx context * @param whereClause sql where clause * @param trxName trx - * @return MProducts + * @return array of MProduct */ public static MProduct[] get (Properties ctx, String whereClause, String trxName) { @@ -135,7 +135,6 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport return list.toArray(new MProduct[list.size()]); } // get - /** * Get MProduct using UPC/EAN (case sensitive) * @param ctx Context @@ -157,6 +156,7 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport * @return MProduct or null if not found * @deprecated Since 3.5.3a. Please use {@link #forS_Resource_ID(Properties, int, String)} */ + @Deprecated public static MProduct forS_Resource_ID(Properties ctx, int S_Resource_ID) { return forS_Resource_ID(ctx, S_Resource_ID, null); @@ -198,8 +198,7 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport } return p; } - - + /** * Is Product Stocked * @param ctx context @@ -216,18 +215,18 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 40, 5); // 5 minutes /** - * UUID based Constructor - * @param ctx Context - * @param M_Product_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_Product_UU UUID key + * @param trxName Transaction + */ public MProduct(Properties ctx, String M_Product_UU, String trxName) { super(ctx, M_Product_UU, trxName); if (Util.isEmpty(M_Product_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param M_Product_ID id @@ -238,6 +237,12 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport this (ctx, M_Product_ID, trxName, (String[]) null); } // MProduct + /** + * @param ctx + * @param M_Product_ID + * @param trxName + * @param virtualColumns + */ public MProduct(Properties ctx, int M_Product_ID, String trxName, String... virtualColumns) { super(ctx, M_Product_ID, trxName, virtualColumns); if (M_Product_ID == 0) @@ -331,7 +336,7 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport } // MProduct /** - * + * Copy constructor * @param copy */ public MProduct(MProduct copy) @@ -340,7 +345,7 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -350,7 +355,7 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -501,8 +506,7 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport // return changed; } // setResource - - + /** UOM Precision */ private Integer m_precision = null; @@ -521,11 +525,10 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport } return m_precision.intValue(); } // getUOMPrecision - - + /** - * Create Asset Group for this product - * @return asset group id + * Get asset group id + * @return A_Asset_Group_ID */ public int getA_Asset_Group_ID() { @@ -545,7 +548,7 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport /** * Get Attribute Set - * @return set or null + * @return MAttributeSet or null */ public MAttributeSet getAttributeSet() { @@ -555,8 +558,8 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport } // getAttributeSet /** - * Has the Product Instance Attribute - * @return true if instance attributes + * Is the Product has Instance Attribute + * @return true if product has instance attributes */ public boolean isInstanceAttribute() { @@ -567,8 +570,8 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport } // isInstanceAttribute /** - * Create One Asset Per UOM - * @return individual asset + * Is One Asset Per UOM + * @return true if it is one asset per UOM */ public boolean isOneAssetPerUOM() { @@ -580,8 +583,8 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport } // isOneAssetPerUOM /** - * Product is Item - * @return true if item + * Is Product of Item type + * @return true if product is of item type (PRODUCTTYPE_Item) */ public boolean isItem() { @@ -589,8 +592,8 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport } // isItem /** - * Product is an Item and Stocked - * @return true if stocked and item + * Product is an Item and is Stocked + * @return true if stocked and is item */ @Override public boolean isStocked () @@ -621,9 +624,9 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport } // getUOMSymbol /** - * Get Active(!) Product Downloads - * @param requery requery - * @return array of downloads + * Get Active Product Downloads + * @param requery true to re-query from DB + * @return array of product downloads */ public MProductDownload[] getProductDownloads (boolean requery) { @@ -642,7 +645,7 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport } // getProductDownloads /** - * Does the product have downloads + * Is product have downloads * @return true if downloads exists */ public boolean hasDownloads() @@ -735,6 +738,10 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport return true; } // beforeSave + /** + * Verify that product has no on hand, ordered and reserved quantity. + * @return error message or empty string + */ private String verifyStorage() { BigDecimal qtyOnHand = Env.ZERO; BigDecimal qtyOrdered = Env.ZERO; @@ -761,6 +768,10 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport return errMsg.toString(); } + /** + * Delete storage on hand and reservation records.
        + * For product that's using Lot or Serial, on hand is update to zero instead of delete. + */ private void removeStorageRecords() { int cnt = 0; //safe to remove if not using lot or serial @@ -788,6 +799,10 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport } } + /** + * Verify product not in any active BOM. + * @return error message or null + */ private String verifyBOM() { Query query = new Query(getCtx(), MPPProductBOMLine.Table_Name, MPPProductBOMLine.COLUMNNAME_M_Product_ID+"=?", get_TrxName()); List list = query.setOnlyActiveRecords(true) @@ -814,8 +829,7 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport } /** - * HasInventoryOrCost - * @return true if it has Inventory or Cost + * @return true if product has inventory transaction (MTransaction) or cost detail (MCostDetail) records. */ protected boolean hasInventoryOrCost () { @@ -944,7 +958,7 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport * Get attribute instance for this product by attribute name * @param name * @param trxName - * @return + * @return MAttributeInstance or null */ public MAttributeInstance getAttributeInstance(String name, String trxName) { MAttributeInstance instance = null; @@ -963,8 +977,8 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport /** * Gets Material Management Policy. - * Tries: Product Category, Client (in this order) - * @return Material Management Policy + * Tries: Product Category, Client (in this order). + * @return Material Management Policy (Fifo, Lifo) */ public String getMMPolicy() { MProductCategory pc = MProductCategory.get(getCtx(), getM_Product_Category_ID()); @@ -975,8 +989,8 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport } /** - * Check if use GuaranteeDate for Material Policy - * @return + * Check if product use GuaranteeDate for Material Policy + * @return true if product uses GuaranteeDate for Material Policy */ public boolean isUseGuaranteeDateForMPolicy(){ MAttributeSet as = getAttributeSet(); @@ -1000,7 +1014,7 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport /** * Check if ASI is mandatory according to mandatory type - * @param mandatoryType + * @param mandatoryType X_M_AttributeSet.MANDATORYTYPE_* * @param isSOTrx * @return true if ASI is mandatory, false otherwise */ @@ -1038,7 +1052,7 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport /** * Get Product Costing Level * @param as accounting schema - * @return product costing level + * @return product costing level (X_C_AcctSchema.COSTINGLEVEL_*) */ public String getCostingLevel(MAcctSchema as) { @@ -1054,7 +1068,7 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport /** * Get Product Costing Method * @param as accounting schema - * @return product costing method + * @return product costing method (X_C_AcctSchema.COSTINGMETHOD_*) */ public String getCostingMethod(MAcctSchema as) { @@ -1067,11 +1081,24 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport return costingMethod; } + /** + * @param as + * @param AD_Org_ID + * @param M_ASI_ID + * @return MCost or null + */ public MCost getCostingRecord(MAcctSchema as, int AD_Org_ID, int M_ASI_ID) { return getCostingRecord(as, AD_Org_ID, M_ASI_ID, getCostingMethod(as)); } + /** + * @param as + * @param AD_Org_ID + * @param M_ASI_ID + * @param costingMethod + * @return MCost or null + */ public MCost getCostingRecord(MAcctSchema as, int AD_Org_ID, int M_ASI_ID, String costingMethod) { @@ -1124,7 +1151,6 @@ public class MProduct extends X_M_Product implements ImmutablePOSupport } /** - * * @return true if instance of product is managed with lot */ public boolean isLot() { diff --git a/org.adempiere.base/src/org/compiere/model/MProductBOM.java b/org.adempiere.base/src/org/compiere/model/MProductBOM.java index c54cbc01b1..7d28acd737 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductBOM.java +++ b/org.adempiere.base/src/org/compiere/model/MProductBOM.java @@ -35,6 +35,7 @@ import org.compiere.util.Env; * @author Jorg Janke * @version $Id: MProductBOM.java,v 1.5 2006/07/30 00:51:02 jjanke Exp $ */ +@Deprecated public class MProductBOM extends X_M_Product_BOM { /** diff --git a/org.adempiere.base/src/org/compiere/model/MProductCategory.java b/org.adempiere.base/src/org/compiere/model/MProductCategory.java index 602c6ef651..96e1205510 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductCategory.java +++ b/org.adempiere.base/src/org/compiere/model/MProductCategory.java @@ -42,7 +42,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MProductCategory extends X_M_Product_Category implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 6444388652482234582L; @@ -81,7 +81,7 @@ public class MProductCategory extends X_M_Product_Category implements ImmutableP * Is Product in Category * @param M_Product_Category_ID category * @param M_Product_ID product - * @return true if product has category + * @return true if product is with M_Product_Category_ID */ public static boolean isCategory (int M_Product_Category_ID, int M_Product_ID) { @@ -128,27 +128,26 @@ public class MProductCategory extends X_M_Product_Category implements ImmutableP return false; } // isCategory - /** Categopry Cache */ + /** Category Cache */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 20); /** Product Cache */ private static CCache s_products = new CCache(I_M_Product.Table_Name, Table_Name + "|M_Product", 100); /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MProductCategory.class); - /** - * UUID based Constructor - * @param ctx Context - * @param M_Product_Category_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_Product_Category_UU UUID key + * @param trxName Transaction + */ public MProductCategory(Properties ctx, String M_Product_Category_UU, String trxName) { super(ctx, M_Product_Category_UU, trxName); if (Util.isEmpty(M_Product_Category_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Default Constructor * @param ctx context * @param M_Product_Category_ID id @@ -183,7 +182,7 @@ public class MProductCategory extends X_M_Product_Category implements ImmutableP } // MProductCategory /** - * + * Copy constructor * @param copy */ public MProductCategory(MProductCategory copy) @@ -192,7 +191,7 @@ public class MProductCategory extends X_M_Product_Category implements ImmutableP } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -202,7 +201,7 @@ public class MProductCategory extends X_M_Product_Category implements ImmutableP } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -218,6 +217,7 @@ public class MProductCategory extends X_M_Product_Category implements ImmutableP * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (hasLoopInTree()) { @@ -234,6 +234,7 @@ public class MProductCategory extends X_M_Product_Category implements ImmutableP * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (newRecord && success) @@ -250,11 +251,10 @@ public class MProductCategory extends X_M_Product_Category implements ImmutableP { return MMPOLICY_FiFo.equals(getMMPolicy()); } // isFiFo - - + /** * Loop detection of product category tree. - * @return boolean + * @return true if loop detected */ public boolean hasLoopInTree () { @@ -287,14 +287,13 @@ public class MProductCategory extends X_M_Product_Category implements ImmutableP return false; } // hasLoopInTree - /** - * Recursive search for parent nodes - climbs the to the root. - * If there is a circle there is no root but it comes back to the start node. + * Recursive search for parent nodes - climbs to the root.
        + * If there is a circle, it will comes back to the start node. * @param parentCategoryId * @param categories * @param loopIndicatorId - * @return + * @return true if loop detected */ private boolean hasLoop(int parentCategoryId, Vector categories, int loopIndicatorId) { final Iterator iter = categories.iterator(); @@ -326,7 +325,7 @@ public class MProductCategory extends X_M_Product_Category implements ImmutableP } /** - * Simple class for tree nodes. + * Value object class for tree nodes. * @author Karsten Thiemann, kthiemann@adempiere.org * */ diff --git a/org.adempiere.base/src/org/compiere/model/MProductCategoryAcct.java b/org.adempiere.base/src/org/compiere/model/MProductCategoryAcct.java index c578d2e42d..7ca492b56a 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductCategoryAcct.java +++ b/org.adempiere.base/src/org/compiere/model/MProductCategoryAcct.java @@ -35,7 +35,7 @@ import org.idempiere.cache.ImmutablePOCache; public class MProductCategoryAcct extends X_M_Product_Category_Acct implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -7990259665379770596L; /** Static cache */ @@ -93,16 +93,16 @@ public class MProductCategoryAcct extends X_M_Product_Category_Acct implements I } // get /** - * UUID based Constructor - * @param ctx Context - * @param M_Product_Category_Acct_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_Product_Category_Acct_UU UUID key + * @param trxName Transaction + */ public MProductCategoryAcct(Properties ctx, String M_Product_Category_Acct_UU, String trxName) { super(ctx, M_Product_Category_Acct_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param ignored ignored @@ -127,7 +127,7 @@ public class MProductCategoryAcct extends X_M_Product_Category_Acct implements I } // MProductCategoryAcct /** - * + * Copy constructor * @param copy */ public MProductCategoryAcct(MProductCategoryAcct copy) @@ -136,7 +136,7 @@ public class MProductCategoryAcct extends X_M_Product_Category_Acct implements I } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -146,7 +146,7 @@ public class MProductCategoryAcct extends X_M_Product_Category_Acct implements I } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -173,6 +173,7 @@ public class MProductCategoryAcct extends X_M_Product_Category_Acct implements I * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -194,6 +195,7 @@ public class MProductCategoryAcct extends X_M_Product_Category_Acct implements I * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder ("MProductCategoryAcct["); @@ -227,6 +229,9 @@ public class MProductCategoryAcct extends X_M_Product_Category_Acct implements I return true; } + /** + * @return CSV list of product Value for product that has cost detail record. + */ private String getProductsWithCost() { StringBuilder products = new StringBuilder(); StringBuilder sql = new StringBuilder("SELECT DISTINCT p.Value FROM M_Product p JOIN M_CostDetail d ON p.M_Product_ID=d.M_Product_ID"); diff --git a/org.adempiere.base/src/org/compiere/model/MProductDownload.java b/org.adempiere.base/src/org/compiere/model/MProductDownload.java index ea83b2348d..b79bddeb76 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductDownload.java +++ b/org.adempiere.base/src/org/compiere/model/MProductDownload.java @@ -30,7 +30,6 @@ import org.compiere.util.DB; import org.compiere.util.Env; import org.idempiere.cache.ImmutablePOSupport; - /** * Product Download Model * @author Jorg Janke @@ -40,14 +39,16 @@ import org.idempiere.cache.ImmutablePOSupport; public class MProductDownload extends X_M_ProductDownload implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 6930118119436114158L; /** * Migrate Download URLs (2.5.2c) * @param ctx context + * @deprecated */ + @Deprecated public static void migrateDownloads (Properties ctx) { String sql = "SELECT COUNT(*) FROM M_ProductDownload"; @@ -107,16 +108,16 @@ public class MProductDownload extends X_M_ProductDownload implements ImmutablePO private static CLogger s_log = CLogger.getCLogger (MProductDownload.class); /** - * UUID based Constructor - * @param ctx Context - * @param M_ProductDownload_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_ProductDownload_UU UUID key + * @param trxName Transaction + */ public MProductDownload(Properties ctx, String M_ProductDownload_UU, String trxName) { super(ctx, M_ProductDownload_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param M_ProductDownload_ID id @@ -139,7 +140,7 @@ public class MProductDownload extends X_M_ProductDownload implements ImmutablePO } // MProductDownload /** - * + * Copy constructor * @param copy */ public MProductDownload(MProductDownload copy) @@ -148,7 +149,7 @@ public class MProductDownload extends X_M_ProductDownload implements ImmutablePO } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -158,7 +159,7 @@ public class MProductDownload extends X_M_ProductDownload implements ImmutablePO } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -173,6 +174,7 @@ public class MProductDownload extends X_M_ProductDownload implements ImmutablePO * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MProductDownload[") @@ -182,8 +184,7 @@ public class MProductDownload extends X_M_ProductDownload implements ImmutablePO .append ("]"); return sb.toString (); } // toString - - + /** * Get Download Name * @return download name (last part of name) @@ -199,7 +200,6 @@ public class MProductDownload extends X_M_ProductDownload implements ImmutablePO return url; } // getDownloadName - /** * Get Download URL * @param directory optional directory @@ -230,7 +230,6 @@ public class MProductDownload extends X_M_ProductDownload implements ImmutablePO } return url; } // getDownloadURL - /** * Find download url @@ -262,7 +261,7 @@ public class MProductDownload extends X_M_ProductDownload implements ImmutablePO /** * Get Download Stream * @param directory optional directory - * @return input stream + * @return input stream or null */ public InputStream getDownloadStream (String directory) { diff --git a/org.adempiere.base/src/org/compiere/model/MProductPO.java b/org.adempiere.base/src/org/compiere/model/MProductPO.java index 111c0be5fe..92764702e7 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductPO.java +++ b/org.adempiere.base/src/org/compiere/model/MProductPO.java @@ -26,7 +26,7 @@ import org.compiere.util.Msg; import org.compiere.util.Util; /** - * Product PO Model + * Product Purchasing Model * * @author Jorg Janke * @version $Id: MProductPO.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $ @@ -34,16 +34,16 @@ import org.compiere.util.Util; public class MProductPO extends X_M_Product_PO { /** - * + * generated serial id */ private static final long serialVersionUID = -1883198806060209516L; /** - * Get current PO of Product + * Get current MProductPO of Product * @param ctx context * @param M_Product_ID product * @param trxName transaction - * @return PO - current vendor first + * @return array of MProductPO - current vendor first */ public static MProductPO[] getOfProduct (Properties ctx, int M_Product_ID, String trxName) { @@ -57,11 +57,11 @@ public class MProductPO extends X_M_Product_PO } // getOfProduct /** - * UUID based Constructor - * @param ctx Context - * @param M_Product_PO_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_Product_PO_UU UUID key + * @param trxName Transaction + */ public MProductPO(Properties ctx, String M_Product_PO_UU, String trxName) { super(ctx, M_Product_PO_UU, trxName); if (Util.isEmpty(M_Product_PO_UU)) diff --git a/org.adempiere.base/src/org/compiere/model/MProductPrice.java b/org.adempiere.base/src/org/compiere/model/MProductPrice.java index 7a33a49d2d..062c2c6670 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductPrice.java +++ b/org.adempiere.base/src/org/compiere/model/MProductPrice.java @@ -34,16 +34,16 @@ import org.idempiere.cache.ImmutablePOSupport; public class MProductPrice extends X_M_ProductPrice implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 6052691522260506413L; /** * Get Product Price * @param ctx ctx - * @param M_PriceList_Version_ID id - * @param M_Product_ID id - * @param trxName trx + * @param M_PriceList_Version_ID price list version id + * @param M_Product_ID product id + * @param trxName transaction name * @return product price or null */ public static MProductPrice get (Properties ctx, int M_PriceList_Version_ID, int M_Product_ID, @@ -61,20 +61,19 @@ public class MProductPrice extends X_M_ProductPrice implements ImmutablePOSuppor private static CLogger s_log = CLogger.getCLogger (MProductPrice.class); /** - * UUID based Constructor - * @param ctx Context - * @param M_ProductPrice_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_ProductPrice_UU UUID key + * @param trxName Transaction + */ public MProductPrice(Properties ctx, String M_ProductPrice_UU, String trxName) { super(ctx, M_ProductPrice_UU, trxName); } /** - * Persistency Constructor * @param ctx context - * @param M_ProductPrice_ID key - * @param trxName transaction + * @param M_ProductPrice_ID id + * @param trxName transaction name */ public MProductPrice (Properties ctx, int M_ProductPrice_ID, String trxName) { @@ -93,7 +92,7 @@ public class MProductPrice extends X_M_ProductPrice implements ImmutablePOSuppor } // MProductPrice /** - * New Constructor + * New record Constructor * @param ctx context * @param M_PriceList_Version_ID Price List Version * @param M_Product_ID product @@ -107,7 +106,7 @@ public class MProductPrice extends X_M_ProductPrice implements ImmutablePOSuppor } // MProductPrice /** - * New Constructor + * New record Constructor * @param ctx context * @param M_PriceList_Version_ID Price List Version * @param M_Product_ID product @@ -142,7 +141,7 @@ public class MProductPrice extends X_M_ProductPrice implements ImmutablePOSuppor } // MProductPrice /** - * + * Copy constructor * @param copy */ public MProductPrice(MProductPrice copy) @@ -151,7 +150,7 @@ public class MProductPrice extends X_M_ProductPrice implements ImmutablePOSuppor } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -161,7 +160,7 @@ public class MProductPrice extends X_M_ProductPrice implements ImmutablePOSuppor } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -189,6 +188,7 @@ public class MProductPrice extends X_M_ProductPrice implements ImmutablePOSuppor * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder ("MProductPrice["); diff --git a/org.adempiere.base/src/org/compiere/model/MProductPricing.java b/org.adempiere.base/src/org/compiere/model/MProductPricing.java index ad4ae081ce..273eb2a54d 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductPricing.java +++ b/org.adempiere.base/src/org/compiere/model/MProductPricing.java @@ -24,13 +24,14 @@ import java.sql.Timestamp; import java.util.logging.Level; import org.adempiere.base.AbstractProductPricing; +import org.adempiere.base.IProductPricingFactory; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.Trace; /** - * Product Price Calculations + * Product Pricing * * @author Jorg Janke * @version $Id: MProductPricing.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $ @@ -38,13 +39,12 @@ import org.compiere.util.Trace; public class MProductPricing extends AbstractProductPricing { /** - * New constructor to be used with the ProductPriceFactories + * New constructor to be used with {@link IProductPricingFactory} */ public MProductPricing() {} /** - * Old Constructor to keep backward - * compatibility + * Old Constructor to keep backward compatibility * @param M_Product_ID product * @param C_BPartner_ID partner * @param Qty quantity @@ -57,7 +57,6 @@ public class MProductPricing extends AbstractProductPricing setInitialValues(M_Product_ID, C_BPartner_ID, Qty, isSOTrx, trxName); } - /** * Constructor * @param M_Product_ID product @@ -66,6 +65,7 @@ public class MProductPricing extends AbstractProductPricing * @param isSOTrx SO or PO * @deprecated Use constructor with explicit trxName parameter */ + @Deprecated public MProductPricing (int M_Product_ID, int C_BPartner_ID, BigDecimal Qty, boolean isSOTrx) { @@ -78,6 +78,9 @@ public class MProductPricing extends AbstractProductPricing checkVendorBreak(); } + /** + * Update {@link #m_vendorbreak} flag + */ private void checkVendorBreak() { int thereAreVendorBreakRecords = DB.getSQLValue(trxName, "SELECT COUNT(M_Product_ID) FROM M_ProductPriceVendorBreak WHERE IsActive='Y' AND M_Product_ID=? AND (C_BPartner_ID=? OR C_BPartner_ID IS NULL)", @@ -87,8 +90,7 @@ public class MProductPricing extends AbstractProductPricing /** Precision -1 = no rounding */ private int m_precision = -1; - - + private boolean m_calculated = false; private boolean m_vendorbreak = false; private boolean m_useVendorBreak; @@ -106,8 +108,7 @@ public class MProductPricing extends AbstractProductPricing /** Logger */ protected CLogger log = CLogger.getCLogger(getClass()); - - + /** * Calculate Price * @return true if calculated @@ -161,7 +162,7 @@ public class MProductPricing extends AbstractProductPricing } // calculatePrice /** - * Calculate Price based on Price List Version + * Calculate Price based on Price List Version (if {@link #m_M_PriceList_Version_ID} have been set). * @return true if calculated */ private boolean calculatePLV() @@ -229,7 +230,7 @@ public class MProductPricing extends AbstractProductPricing } // calculatePLV /** - * Calculate Price based on Price List + * Calculate Price based on Price List (if {@link m_M_PriceList_ID} have been set) * @return true if calculated */ private boolean calculatePL() @@ -316,7 +317,7 @@ public class MProductPricing extends AbstractProductPricing } // calculatePL /** - * Calculate Price based on Base Price List + * Calculate Price based on Base Price List (base price list of set {@link m_M_PriceList_ID}). * @return true if calculated */ private boolean calculateBPL() @@ -398,7 +399,7 @@ public class MProductPricing extends AbstractProductPricing } // calculateBPL /** - * Calculate Price based on Price List Version and Vendor Break + * Calculate Price based on Price List Version and Vendor Break (product price vendor break of set {@link m_M_PriceList_Version_ID}) * @return true if calculated */ private boolean calculatePLV_VB() @@ -471,7 +472,7 @@ public class MProductPricing extends AbstractProductPricing } // calculatePLV_VB /** - * Calculate Price based on P rice List and Vendor break + * Calculate Price based on Price List and Vendor break (product price vendor break of set {@link m_M_PriceList_ID}) * @return true if calculated */ private boolean calculatePL_VB() @@ -562,7 +563,7 @@ public class MProductPricing extends AbstractProductPricing } // calculatePL_VB /** - * Calculate Price based on Base Price List and Vendor Break + * Calculate Price based on Base Price List and Vendor Break (product price vendor break of base price list of set {@link m_M_PriceList_ID}) * @return true if calculated */ private boolean calculateBPL_VB() @@ -648,7 +649,7 @@ public class MProductPricing extends AbstractProductPricing } // calculateBPL_VB /** - * Set Base Info (UOM) + * Update {@link #m_C_UOM_ID} and {@link #m_M_Product_Category_ID} from product. */ private void setBaseInfo() { @@ -665,15 +666,14 @@ public class MProductPricing extends AbstractProductPricing /** * Is Tax Included - * @return tax included + * @return true if tax included */ public boolean isTaxIncluded() { return m_isTaxIncluded; } // isTaxIncluded - - - /************************************************************************** + + /** * Calculate (Business Partner) Discount */ private void calculateDiscount() @@ -727,9 +727,8 @@ public class MProductPricing extends AbstractProductPricing m_M_Product_Category_ID, FlatDiscount); } // calculateDiscount - - /************************************************************************** + /** * Calculate Discount Percentage based on Standard/List Price * @return Discount */ @@ -758,7 +757,7 @@ public class MProductPricing extends AbstractProductPricing /** * Get PriceList Version - * @return plv + * @return M_PriceList_Version_ID */ public int getM_PriceList_Version_ID() { @@ -796,7 +795,7 @@ public class MProductPricing extends AbstractProductPricing /** * Get Precision - * @return precision - -1 = no rounding + * @return precision, -1 = no rounding */ public int getPrecision() { @@ -804,7 +803,7 @@ public class MProductPricing extends AbstractProductPricing } // getPrecision /** - * Round + * Round using set precision * @param bd number * @return rounded number */ @@ -816,9 +815,9 @@ public class MProductPricing extends AbstractProductPricing return bd; } // round - /************************************************************************** + /** * Get C_UOM_ID - * @return uom + * @return C_UOM_ID */ public int getC_UOM_ID() { @@ -828,8 +827,8 @@ public class MProductPricing extends AbstractProductPricing } /** - * Get Price List - * @return list + * Get List Price + * @return list price */ public BigDecimal getPriceList() { @@ -838,8 +837,8 @@ public class MProductPricing extends AbstractProductPricing return round(m_PriceList); } /** - * Get Price Std - * @return std + * Get standard price + * @return standard price */ public BigDecimal getPriceStd() { @@ -848,8 +847,8 @@ public class MProductPricing extends AbstractProductPricing return round(m_PriceStd); } /** - * Get Price Limit - * @return limit + * Get Limit Price + * @return limit price */ public BigDecimal getPriceLimit() { @@ -859,7 +858,7 @@ public class MProductPricing extends AbstractProductPricing } /** * Get Price List Currency - * @return currency + * @return C_Currency_ID */ public int getC_Currency_ID() { @@ -868,8 +867,8 @@ public class MProductPricing extends AbstractProductPricing return m_C_Currency_ID; } /** - * Is Price List enforded? - * @return enforce limit + * Is Price Limit enforce? + * @return true if price limit should be enforced */ public boolean isEnforcePriceLimit() { @@ -879,8 +878,8 @@ public class MProductPricing extends AbstractProductPricing } // isEnforcePriceLimit /** - * Is a DiscountSchema active? - * @return active Discount Schema + * Is using discount schema or vendor break? + * @return true if using discount schema or vendor break */ public boolean isDiscountSchema() { @@ -889,7 +888,7 @@ public class MProductPricing extends AbstractProductPricing /** * Is the Price Calculated (i.e. found)? - * @return calculated + * @return true if calculated */ public boolean isCalculated() { diff --git a/org.adempiere.base/src/org/compiere/model/MProduction.java b/org.adempiere.base/src/org/compiere/model/MProduction.java index 377aa10273..4b0b4efaa2 100644 --- a/org.adempiere.base/src/org/compiere/model/MProduction.java +++ b/org.adempiere.base/src/org/compiere/model/MProduction.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.io.File; @@ -24,7 +45,7 @@ import org.compiere.util.Util; public class MProduction extends X_M_Production implements DocAction { /** - * + * generated serial id */ private static final long serialVersionUID = -1185737281702437745L; @@ -34,21 +55,32 @@ public class MProduction extends X_M_Production implements DocAction { protected int count; /** - * UUID based Constructor - * @param ctx Context - * @param M_Production_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_Production_UU UUID key + * @param trxName Transaction + */ public MProduction(Properties ctx, String M_Production_UU, String trxName) { super(ctx, M_Production_UU, trxName); if (Util.isEmpty(M_Production_UU)) setInitialDefaults(); } - + + /** + * @param ctx + * @param M_Production_ID + * @param trxName + */ public MProduction(Properties ctx, int M_Production_ID, String trxName) { this (ctx, M_Production_ID, trxName, (String[]) null); } + /** + * @param ctx + * @param M_Production_ID + * @param trxName + * @param virtualColumns + */ public MProduction(Properties ctx, int M_Production_ID, String trxName, String... virtualColumns) { super(ctx, M_Production_ID, trxName, virtualColumns); if (M_Production_ID == 0) @@ -63,10 +95,19 @@ public class MProduction extends X_M_Production implements DocAction { setDocAction (DOCACTION_Prepare); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MProduction(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } + /** + * Create new production with client, organization and date promised (as movement date) from order line. + * @param line order line + */ public MProduction( MOrderLine line ) { super( line.getCtx(), 0, line.get_TrxName()); setAD_Client_ID(line.getAD_Client_ID()); @@ -74,6 +115,10 @@ public class MProduction extends X_M_Production implements DocAction { setMovementDate( line.getDatePromised() ); } + /** + * Create new production for project line + * @param line project line + */ public MProduction( MProjectLine line ) { super( line.getCtx(), 0, line.get_TrxName()); MProject project = new MProject(line.getCtx(), line.getC_Project_ID(), line.get_TrxName()); @@ -196,6 +241,10 @@ public class MProduction extends X_M_Production implements DocAction { } } + /** + * @param lines + * @return true if one of the production is an end product line (IsEndProduct=Y). + */ private boolean isHaveEndProduct(MProductionLine[] lines) { for(MProductionLine line : lines) { @@ -205,6 +254,11 @@ public class MProduction extends X_M_Production implements DocAction { return false; } + /** + * Process production lines - create material transaction + * @param lines + * @return error message or empty string + */ protected Object processLines(MProductionLine[] lines) { StringBuilder errors = new StringBuilder(); for ( int i = 0; i list = new ArrayList(); @@ -255,6 +312,10 @@ public class MProduction extends X_M_Production implements DocAction { return retValue; } + /** + * Delete all production lines + * @param trxName + */ public void deleteLines(String trxName) { for (MProductionLine line : getLines()) @@ -264,10 +325,21 @@ public class MProduction extends X_M_Production implements DocAction { }// deleteLines + /** + * Create production lines + * @param mustBeStocked true to verify BOM component has sufficient on hand + * @return number of line created + */ public int createLines(boolean mustBeStocked) { return createLines(mustBeStocked, 0); } + /** + * Create production line + * @param mustBeStocked true to verify BOM component has sufficient on hand + * @param PP_Product_BOM_ID optional BOM ID. 0 to use default product BOM + * @return number of line created + */ public int createLines(boolean mustBeStocked, int PP_Product_BOM_ID) { lineno = 100; @@ -277,7 +349,6 @@ public class MProduction extends X_M_Production implements DocAction { // product to be produced MProduct finishedProduct = new MProduct(getCtx(), getM_Product_ID(), get_TrxName()); - MProductionLine line = new MProductionLine( this ); line.setLine( lineno ); line.setM_Product_ID( finishedProduct.get_ID() ); @@ -297,6 +368,14 @@ public class MProduction extends X_M_Production implements DocAction { return count; } + /** + * Create production line + * @param mustBeStocked true to verify BOM component has sufficient on hand + * @param finishedProduct end product + * @param requiredQty + * @param PP_Product_BOM_ID optional BOM ID. 0 to use default product BOM + * @return number of line created + */ protected int createLines(boolean mustBeStocked, MProduct finishedProduct, BigDecimal requiredQty, int PP_Product_BOM_ID) { int defaultLocator = 0; @@ -553,9 +632,8 @@ public class MProduction extends X_M_Production implements DocAction { } /** - * * @param M_Product_ID - * @return error message (if any) + * @return error message (if any) or null */ public String validateEndProduct(int M_Product_ID) { String msg = isBom(M_Product_ID); @@ -574,6 +652,11 @@ public class MProduction extends X_M_Production implements DocAction { return null; } + /** + * Validate product has valid BOM + * @param M_Product_ID + * @return error message or null + */ protected String isBom(int M_Product_ID) { String bom = DB.getSQLValueString(get_TrxName(), "SELECT isbom FROM M_Product WHERE M_Product_ID = ?", M_Product_ID); @@ -590,6 +673,14 @@ public class MProduction extends X_M_Production implements DocAction { return null; } + /** + * Cost validation for BOM product using standard costing method.
        + * - has cost
        + * - difference between current product cost and sum of component cost is less than 0.005. + * @param M_Product_ID + * @return true if cost is ok + * @throws AdempiereUserError + */ protected boolean costsOK(int M_Product_ID) throws AdempiereUserError { MProduct product = MProduct.get(getCtx(), M_Product_ID, get_TrxName()); String costingMethod=product.getCostingMethod(MClient.get(getCtx()).getAcctSchema()); @@ -751,6 +842,11 @@ public class MProduction extends X_M_Production implements DocAction { return true; } + /** + * Reverse this production document + * @param accrual true to use current date, false to use this production's movement date + * @return reversal production record + */ protected MProduction reverse(boolean accrual) { Timestamp reversalDate = accrual ? Env.getContextAsDate(getCtx(), Env.DATE) : getMovementDate(); if (reversalDate == null) { @@ -811,6 +907,11 @@ public class MProduction extends X_M_Production implements DocAction { return reversal; } + /** + * Create new production from this production (including lines) + * @param reversalDate movement date + * @return new production record + */ protected MProduction copyFrom(Timestamp reversalDate) { MProduction to = new MProduction(getCtx(), 0, get_TrxName()); PO.copyValues (this, to, getAD_Client_ID(), getAD_Org_ID()); @@ -971,7 +1072,7 @@ public class MProduction extends X_M_Production implements DocAction { } /** - * Document Status is Complete or Closed + * Document Status is Complete, Closed or Reversed * @return true if CO, CL or RE */ public boolean isStatusComplete() diff --git a/org.adempiere.base/src/org/compiere/model/MProductionLine.java b/org.adempiere.base/src/org/compiere/model/MProductionLine.java index 7157539abc..f6f728620c 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductionLine.java +++ b/org.adempiere.base/src/org/compiere/model/MProductionLine.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.math.BigDecimal; @@ -16,22 +37,23 @@ import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.Util; - +/** + * Production line model + */ public class MProductionLine extends X_M_ProductionLine { /** - * + * generated serial id */ private static final long serialVersionUID = 3720901152312853611L; protected MProduction productionParent; - /** - * UUID based Constructor - * @param ctx Context - * @param M_ProductionLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_ProductionLine_UU UUID key + * @param trxName Transaction + */ public MProductionLine(Properties ctx, String M_ProductionLine_UU, String trxName) { super(ctx, M_ProductionLine_UU, trxName); if (Util.isEmpty(M_ProductionLine_UU)) @@ -48,6 +70,12 @@ public class MProductionLine extends X_M_ProductionLine { this (ctx, M_ProductionLine_ID, trxName, (String[]) null); } // MProductionLine + /** + * @param ctx + * @param M_ProductionLine_ID + * @param trxName + * @param virtualColumns + */ public MProductionLine(Properties ctx, int M_ProductionLine_ID, String trxName, String... virtualColumns) { super(ctx, M_ProductionLine_ID, trxName, virtualColumns); if (M_ProductionLine_ID == 0) @@ -66,6 +94,11 @@ public class MProductionLine extends X_M_ProductionLine { setProcessed (false); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MProductionLine (Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); @@ -83,6 +116,9 @@ public class MProductionLine extends X_M_ProductionLine { productionParent = header; } + /** + * @param header + */ public MProductionLine( MProductionPlan header ) { super( header.getCtx(), 0, header.get_TrxName() ); setM_ProductionPlan_ID( header.get_ID()); @@ -90,11 +126,11 @@ public class MProductionLine extends X_M_ProductionLine { setAD_Org_ID(header.getAD_Org_ID()); } - /** - * + * Create material transactions * @param date - * @return "" for success, error string if failed + * @param mustBeStocked true to verify on hand quantity + * @return "" for success, error message if failed */ public String createTransactions(Timestamp date, boolean mustBeStocked) { int reversalId = getProductionReversalId (); @@ -277,8 +313,7 @@ public class MProductionLine extends X_M_ProductionLine { } } - - + if ( !( qtyToMove.signum() == 0) ) { if (mustBeStocked && qtyToMove.signum() > 0) { @@ -340,6 +375,9 @@ public class MProductionLine extends X_M_ProductionLine { } + /** + * @return end product id (from production or production plan) + */ protected int getEndProduct_ID() { if (productionParent != null) { return productionParent.getM_Product_ID(); @@ -350,12 +388,17 @@ public class MProductionLine extends X_M_ProductionLine { } } + /** + * Delete M_ProductionLineMA records + * @return number of records deleted + */ protected int deleteMA() { String sql = "DELETE FROM M_ProductionLineMA WHERE M_ProductionLine_ID = " + get_ID(); int count = DB.executeUpdateEx( sql, get_TrxName() ); return count; } + @Override public String toString() { if ( getM_Product_ID() == 0 ) return ("No product defined for production line " + getLine()); @@ -437,8 +480,7 @@ public class MProductionLine extends X_M_ProductionLine { } /** - * - * @return + * @return array of MProductionLineMA */ public MProductionLineMA[] getLineMAs() { ArrayList list = new ArrayList(); diff --git a/org.adempiere.base/src/org/compiere/model/MProductionLineMA.java b/org.adempiere.base/src/org/compiere/model/MProductionLineMA.java index 696496845c..561347e4a6 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductionLineMA.java +++ b/org.adempiere.base/src/org/compiere/model/MProductionLineMA.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.math.BigDecimal; @@ -13,24 +34,34 @@ import org.compiere.util.Util; public class MProductionLineMA extends X_M_ProductionLineMA { /** - * + * generated serial id */ private static final long serialVersionUID = -2633782218494352620L; /** - * UUID based Constructor - * @param ctx Context - * @param M_ProductionLineMA_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_ProductionLineMA_UU UUID key + * @param trxName Transaction + */ public MProductionLineMA(Properties ctx, String M_ProductionLineMA_UU, String trxName) { super(ctx, M_ProductionLineMA_UU, trxName); } - + + /** + * @param ctx + * @param M_ProductionLineMA_ID + * @param trxName + */ public MProductionLineMA(Properties ctx, int M_ProductionLineMA_ID, String trxName) { super(ctx, M_ProductionLineMA_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MProductionLineMA(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } @@ -69,6 +100,13 @@ public class MProductionLineMA extends X_M_ProductionLineMA { super.setDateMaterialPolicy(DateMaterialPolicy); } + /** + * Get or create new MProductionLineMA record + * @param parent + * @param asi + * @param dateMPolicy + * @return MProductionLineMA + */ public static MProductionLineMA get( MProductionLine parent, int asi, Timestamp dateMPolicy ) { String where = " M_ProductionLine_ID = ? AND M_AttributeSetInstance_ID = ? "; if(dateMPolicy==null){ @@ -92,11 +130,10 @@ public class MProductionLineMA extends X_M_ProductionLineMA { * @param ctx context * @param M_ProductionLine_ID line * @param trxName trx - * @return allocations + * @return array of MProductionLineMA */ public static MProductionLineMA[] get (Properties ctx, int M_ProductionLine_ID, String trxName) - { - + { Query query = MTable.get(ctx, MProductionLineMA.Table_Name) .createQuery(I_M_ProductionLineMA.COLUMNNAME_M_ProductionLine_ID+"=?", trxName); query.setParameters(M_ProductionLine_ID); diff --git a/org.adempiere.base/src/org/compiere/model/MProductionPlan.java b/org.adempiere.base/src/org/compiere/model/MProductionPlan.java index 1617f49751..f2c5fd1263 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductionPlan.java +++ b/org.adempiere.base/src/org/compiere/model/MProductionPlan.java @@ -1,6 +1,24 @@ -/** - * - */ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.math.BigDecimal; @@ -18,20 +36,19 @@ import org.compiere.util.Msg; /** * @author hengsin - * */ public class MProductionPlan extends X_M_ProductionPlan { /** - * + * generated serial id */ private static final long serialVersionUID = 1830027775110768396L; /** - * UUID based Constructor - * @param ctx Context - * @param M_ProductionPlan_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_ProductionPlan_UU UUID key + * @param trxName Transaction + */ public MProductionPlan(Properties ctx, String M_ProductionPlan_UU, String trxName) { super(ctx, M_ProductionPlan_UU, trxName); } @@ -54,6 +71,9 @@ public class MProductionPlan extends X_M_ProductionPlan { super(ctx, rs, trxName); } + /** + * @return array of MProductionLine + */ public MProductionLine[] getLines() { ArrayList list = new ArrayList(); @@ -88,6 +108,10 @@ public class MProductionPlan extends X_M_ProductionPlan { return retValue; } + /** + * Delete production lines + * @param trxName + */ public void deleteLines(String trxName) { for (MProductionLine line : getLines()) @@ -97,6 +121,11 @@ public class MProductionPlan extends X_M_ProductionPlan { }// deleteLines + /** + * Create production lines + * @param mustBeStocked true to check on hand quantity of components + * @return number of lines created + */ public int createLines(boolean mustBeStocked) { int lineno = 100; @@ -122,6 +151,14 @@ public class MProductionPlan extends X_M_ProductionPlan { return count; } + /** + * Create production lines + * @param mustBeStocked true to check on hand quantity of components + * @param finishedProduct end product + * @param requiredQty + * @param lineno + * @return number of line created + */ private int createLines(boolean mustBeStocked, MProduct finishedProduct, BigDecimal requiredQty, int lineno) { int count = 0; diff --git a/org.adempiere.base/src/org/compiere/model/MProject.java b/org.adempiere.base/src/org/compiere/model/MProject.java index b0a3bc069b..b4ac80aa87 100644 --- a/org.adempiere.base/src/org/compiere/model/MProject.java +++ b/org.adempiere.base/src/org/compiere/model/MProject.java @@ -35,17 +35,17 @@ import org.compiere.util.Util; public class MProject extends X_C_Project { /** - * + * generated serial id */ private static final long serialVersionUID = 8631795136761641303L; /** - * Create new Project by copying + * Create new project by copying from another project * @param ctx context - * @param C_Project_ID project + * @param C_Project_ID project to copy from * @param dateDoc date of the document date * @param trxName transaction - * @return Project + * @return new Project instance */ public static MProject copyFrom (Properties ctx, int C_Project_ID, Timestamp dateDoc, String trxName) { @@ -77,21 +77,20 @@ public class MProject extends X_C_Project return to; } // copyFrom - /** - * UUID based Constructor - * @param ctx Context - * @param C_Project_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Project_UU UUID key + * @param trxName Transaction + */ public MProject(Properties ctx, String C_Project_UU, String trxName) { super(ctx, C_Project_UU, trxName); if (Util.isEmpty(C_Project_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_Project_ID id @@ -143,6 +142,7 @@ public class MProject extends X_C_Project * @return C_ProjectType_ID id * @deprecated */ + @Deprecated public int getC_ProjectType_ID_Int() { return getC_ProjectType_ID(); @@ -152,6 +152,7 @@ public class MProject extends X_C_Project * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder ("MProject[").append(get_ID()) @@ -162,7 +163,7 @@ public class MProject extends X_C_Project /** * Get Price List from Price List Version - * @return price list or 0 + * @return M_PriceList_ID or 0 */ public int getM_PriceList_ID() { @@ -186,8 +187,7 @@ public class MProject extends X_C_Project m_M_PriceList_ID = 0; // reset } // setM_PriceList_Version_ID - - /************************************************************************** + /** * Get Project Lines * @return Array of lines */ @@ -205,9 +205,10 @@ public class MProject extends X_C_Project return retValue; } // getLines - /************************************************************************** - * Get Project Lines from a Phase - * @return Array of lines from a Phase + /** + * Get Project Lines of a Phase + * @param phase C_ProjectPhase_ID + * @return Array of lines of a Phase */ public MProjectLine[] getPhaseLines(int phase) { @@ -223,8 +224,8 @@ public class MProject extends X_C_Project } // getPhaseLines /** - * Get Project Issues - * @return Array of issues + * Get Project Issue records + * @return Array of project issue */ public MProjectIssue[] getIssues() { @@ -241,8 +242,8 @@ public class MProject extends X_C_Project } // getIssues /** - * Get Project Phases - * @return Array of phases + * Get Project Phase records + * @return Array of project phase */ public MProjectPhase[] getPhases() { @@ -257,12 +258,11 @@ public class MProject extends X_C_Project list.toArray(retValue); return retValue; } // getPhases - - /************************************************************************** + /** * Copy Lines/Phase/Task from other Project * @param project project - * @return number of total lines copied + * @return number of lines copied */ public int copyDetailsFrom (MProject project) { @@ -274,9 +274,9 @@ public class MProject extends X_C_Project } // copyDetailsFrom /** - * Copy Lines From other Project + * Copy Project Lines From other Project * @param project project - * @return number of lines copied + * @return number of project lines copied */ public int copyLinesFrom (MProject project) { @@ -309,8 +309,8 @@ public class MProject extends X_C_Project /** * Copy Phases/Tasks from other Project - * @param fromProject project - * @return number of items copied + * @param fromProject project to copy from + * @return number of phase/task line copied */ public int copyPhasesFrom (MProject fromProject) { @@ -362,10 +362,9 @@ public class MProject extends X_C_Project return count + taskCount + lineCount; } // copyPhasesFrom - /** - * Set Project Type and Category. - * If Service Project copy Projet Type Phase/Tasks + * Set Project Type and Category.
        + * If project type is Service Project (PROJECTCATEGORY_ServiceChargeProject), copy project Phase/Tasks from project type. * @param type project type */ public void setProjectType (MProjectType type) @@ -379,9 +378,9 @@ public class MProject extends X_C_Project } // setProjectType /** - * Copy Phases from Type + * Copy Phases from Project Type * @param type Project Type - * @return count + * @return number of line copy */ public int copyPhasesFrom (MProjectType type) { @@ -410,6 +409,7 @@ public class MProject extends X_C_Project * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getAD_User_ID() == -1) // Summary Project in Dimensions @@ -432,6 +432,7 @@ public class MProject extends X_C_Project * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -457,6 +458,7 @@ public class MProject extends X_C_Project * @param success * @return deleted */ + @Override protected boolean afterDelete (boolean success) { if (success) @@ -465,9 +467,9 @@ public class MProject extends X_C_Project } // afterDelete /** - * Return the Invoices Generated for this Project - * @return invoices - * author monhate + * Get Invoices Generated for this Project + * @return array of invoice + * @author monhate */ public MInvoice[] getMInvoices(){ StringBuilder sb = new StringBuilder(); diff --git a/org.adempiere.base/src/org/compiere/model/MProjectIssue.java b/org.adempiere.base/src/org/compiere/model/MProjectIssue.java index b19ae0c24f..eaeb441558 100644 --- a/org.adempiere.base/src/org/compiere/model/MProjectIssue.java +++ b/org.adempiere.base/src/org/compiere/model/MProjectIssue.java @@ -43,18 +43,18 @@ import org.compiere.util.Util; public class MProjectIssue extends X_C_ProjectIssue implements DocAction, DocOptions { /** - * + * generated serial id */ private static final long serialVersionUID = 1653681817205265764L; private DocActionDelegate docActionDelegate = null; /** - * UUID based Constructor - * @param ctx Context - * @param C_ProjectIssue_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_ProjectIssue_UU UUID key + * @param trxName Transaction + */ public MProjectIssue(Properties ctx, String C_ProjectIssue_UU, String trxName) { super(ctx, C_ProjectIssue_UU, trxName); if (Util.isEmpty(C_ProjectIssue_UU)) @@ -116,6 +116,9 @@ public class MProjectIssue extends X_C_ProjectIssue implements DocAction, DocOpt init(); } // MProjectIssue + /** + * Initialize document action delegate ({@link DocActionDelegate}) for this model class + */ private void init() { docActionDelegate = new DocActionDelegate<>(this); docActionDelegate.setActionCallable(DocAction.ACTION_Complete, () -> { return doComplete(); }); @@ -127,7 +130,7 @@ public class MProjectIssue extends X_C_ProjectIssue implements DocAction, DocOpt private MProject m_parent = null; /** - * Get the next Line No + * Get next Line No * @return next line no */ private int getNextLine() @@ -137,7 +140,7 @@ public class MProjectIssue extends X_C_ProjectIssue implements DocAction, DocOpt } // getLineFromProject /** - * Set Mandatory Values + * Set value of mandatory fields * @param M_Locator_ID locator * @param M_Product_ID product * @param MovementQty qty @@ -160,11 +163,12 @@ public class MProjectIssue extends X_C_ProjectIssue implements DocAction, DocOpt return m_parent; } // getParent - /************************************************************************** + /** * Process Issue * @deprecated * @return true if processed */ + @Deprecated public boolean process() { saveEx(); @@ -172,6 +176,10 @@ public class MProjectIssue extends X_C_ProjectIssue implements DocAction, DocOpt return doComplete() == null; } // process + /** + * Handle CompleteIt document action + * @return error message or null + */ private String doComplete() { if (getM_Product_ID() == 0) @@ -268,6 +276,11 @@ public class MProjectIssue extends X_C_ProjectIssue implements DocAction, DocOpt return null; } + /** + * Handle reverse accrual and reverse correct document action + * @param accrual true to use current date, false to use this record's movement date + * @return error message or null + */ private String doReverse(boolean accrual) { MProject project = getParent(); MProjectIssue reversal = new MProjectIssue (project); @@ -311,7 +324,6 @@ public class MProjectIssue extends X_C_ProjectIssue implements DocAction, DocOpt } /** - * * @return true if this is a reversal document created to reverse another document */ public boolean isReversal() { @@ -383,6 +395,9 @@ public class MProjectIssue extends X_C_ProjectIssue implements DocAction, DocOpt return docActionDelegate.reverseAccrualIt(); } + /** + * Not implemented, always return false + */ @Override public boolean reActivateIt() { return false; diff --git a/org.adempiere.base/src/org/compiere/model/MProjectLine.java b/org.adempiere.base/src/org/compiere/model/MProjectLine.java index d4b7656c9a..b7a9017e19 100644 --- a/org.adempiere.base/src/org/compiere/model/MProjectLine.java +++ b/org.adempiere.base/src/org/compiere/model/MProjectLine.java @@ -36,16 +36,16 @@ import org.compiere.util.Util; public class MProjectLine extends X_C_ProjectLine { /** - * + * generated serial id */ private static final long serialVersionUID = 2668549463273628848L; /** - * UUID based Constructor - * @param ctx Context - * @param C_ProjectLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_ProjectLine_UU UUID key + * @param trxName Transaction + */ public MProjectLine(Properties ctx, String C_ProjectLine_UU, String trxName) { super(ctx, C_ProjectLine_UU, trxName); if (Util.isEmpty(C_ProjectLine_UU)) @@ -63,6 +63,12 @@ public class MProjectLine extends X_C_ProjectLine this (ctx, C_ProjectLine_ID, trxName, (String[]) null); } // MProjectLine + /** + * @param ctx + * @param C_ProjectLine_ID + * @param trxName + * @param virtualColumns + */ public MProjectLine(Properties ctx, int C_ProjectLine_ID, String trxName, String... virtualColumns) { super(ctx, C_ProjectLine_ID, trxName, virtualColumns); if (C_ProjectLine_ID == 0) @@ -112,7 +118,7 @@ public class MProjectLine extends X_C_ProjectLine private MProject m_parent = null; /** - * Get the next Line No + * Get and set next Line No */ private void setLine() { @@ -134,8 +140,8 @@ public class MProjectLine extends X_C_ProjectLine } // setMProjectIssue /** - * Set PO - * @param C_OrderPO_ID po id + * Set purchase order + * @param C_OrderPO_ID purchase order id */ public void setC_OrderPO_ID (int C_OrderPO_ID) { @@ -159,7 +165,7 @@ public class MProjectLine extends X_C_ProjectLine /** * Get Limit Price if exists - * @return limit + * @return limit price (limit price of product or planned price of this record) */ public BigDecimal getLimitPrice() { @@ -180,6 +186,7 @@ public class MProjectLine extends X_C_ProjectLine * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MProjectLine["); @@ -200,6 +207,7 @@ public class MProjectLine extends X_C_ProjectLine * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getLine() == 0) @@ -250,8 +258,7 @@ public class MProjectLine extends X_C_ProjectLine } return true; - } // beforeSave - + } // beforeSave /** * After Save @@ -259,6 +266,7 @@ public class MProjectLine extends X_C_ProjectLine * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -266,13 +274,13 @@ public class MProjectLine extends X_C_ProjectLine updateHeader(); return success; } // afterSave - - + /** * After Delete * @param success success * @return success */ + @Override protected boolean afterDelete (boolean success) { if (!success) @@ -282,7 +290,7 @@ public class MProjectLine extends X_C_ProjectLine } // afterDelete /** - * Update Header + * Update Header (C_Project, C_ProjectPhase and C_ProjectTask) */ private void updateHeader() { @@ -332,7 +340,6 @@ public class MProjectLine extends X_C_ProjectLine if (no != 1) log.log(Level.SEVERE, "updateHeader project task - #" + no); } - /*onhate + globalqss BF 3060367*/ } // updateHeader } // MProjectLine diff --git a/org.adempiere.base/src/org/compiere/model/MProjectPhase.java b/org.adempiere.base/src/org/compiere/model/MProjectPhase.java index 4203aba27b..fd66caa918 100644 --- a/org.adempiere.base/src/org/compiere/model/MProjectPhase.java +++ b/org.adempiere.base/src/org/compiere/model/MProjectPhase.java @@ -37,16 +37,16 @@ import org.compiere.util.Util; public class MProjectPhase extends X_C_ProjectPhase { /** - * + * generated serial id */ private static final long serialVersionUID = 5824045445920353065L; /** - * UUID based Constructor - * @param ctx Context - * @param C_ProjectPhase_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_ProjectPhase_UU UUID key + * @param trxName Transaction + */ public MProjectPhase(Properties ctx, String C_ProjectPhase_UU, String trxName) { super(ctx, C_ProjectPhase_UU, trxName); if (Util.isEmpty(C_ProjectPhase_UU)) @@ -153,10 +153,9 @@ public class MProjectPhase extends X_C_ProjectPhase } // getTasks /** - * Copy Lines from other Phase - * BF 3067850 - monhate - * @param fromPhase from phase - * @return number of tasks copied + * Copy project lines from other Phase + * @param fromPhase phase to copy from + * @return number of project line copied */ public int copyLinesFrom (MProjectPhase fromPhase) { @@ -181,12 +180,10 @@ public class MProjectPhase extends X_C_ProjectPhase return count; } - - + /** * Copy Tasks from other Phase - * BF 3067850 - monhate - * @param fromPhase from phase + * @param fromPhase phase to copy from * @return number of tasks copied */ public int copyTasksFrom (MProjectPhase fromPhase) @@ -236,8 +233,8 @@ public class MProjectPhase extends X_C_ProjectPhase } // copyTasksFrom /** - * Copy Tasks from other Phase - * @param fromPhase from phase + * Copy Tasks from other MProjectTypePhase + * @param fromPhase MProjectTypePhase to copy from * @return number of tasks copied */ public int copyTasksFrom (MProjectTypePhase fromPhase) @@ -260,9 +257,8 @@ public class MProjectPhase extends X_C_ProjectPhase return count; } // copyTasksFrom - /************************************************************************** + /** * Get Project Lines - * BF 3067850 - monhate * @return Array of lines */ public MProjectLine[] getLines() { @@ -281,6 +277,7 @@ public class MProjectPhase extends X_C_ProjectPhase * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MProjectPhase["); diff --git a/org.adempiere.base/src/org/compiere/model/MProjectTask.java b/org.adempiere.base/src/org/compiere/model/MProjectTask.java index 4d2bd8bf92..d9a9f4282b 100644 --- a/org.adempiere.base/src/org/compiere/model/MProjectTask.java +++ b/org.adempiere.base/src/org/compiere/model/MProjectTask.java @@ -32,16 +32,16 @@ import org.compiere.util.Util; public class MProjectTask extends X_C_ProjectTask { /** - * + * generated serial id */ private static final long serialVersionUID = 6714520156233475723L; /** - * UUID based Constructor - * @param ctx Context - * @param C_ProjectTask_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_ProjectTask_UU UUID key + * @param trxName Transaction + */ public MProjectTask(Properties ctx, String C_ProjectTask_UU, String trxName) { super(ctx, C_ProjectTask_UU, trxName); if (Util.isEmpty(C_ProjectTask_UU)) @@ -59,6 +59,12 @@ public class MProjectTask extends X_C_ProjectTask this (ctx, C_ProjectTask_ID, trxName, (String[]) null); } // MProjectTask + /** + * @param ctx + * @param C_ProjectTask_ID + * @param trxName + * @param virtualColumns + */ public MProjectTask(Properties ctx, int C_ProjectTask_ID, String trxName, String... virtualColumns) { super(ctx, C_ProjectTask_ID, trxName, virtualColumns); if (C_ProjectTask_ID == 0) @@ -114,10 +120,9 @@ public class MProjectTask extends X_C_ProjectTask setQty(task.getStandardQty()); } // MProjectTask - /************************************************************************** + /** * Get Project Lines - * BF 3067850 - monhate - * @return Array of lines + * @return Array of project lines */ public MProjectLine[] getLines() { final String whereClause = "C_ProjectPhase_ID=? and C_ProjectTask_ID=? "; @@ -132,10 +137,9 @@ public class MProjectTask extends X_C_ProjectTask } /** - * Copy Lines from other Task - * BF 3067850 - monhate - * @param fromTask from Task - * @return number of lines copied + * Copy project lines from other Task + * @param fromTask Project Task to copy from + * @return number of project lines copied */ public int copyLinesFrom (MProjectTask fromTask) { @@ -163,16 +167,21 @@ public class MProjectTask extends X_C_ProjectTask private int C_Project_ID = 0; + /** + * @param reQuery true to re-query from DB + * @return C_Project_ID + */ private int getC_Project_ID(boolean reQuery) { - if (C_Project_ID==0 || reQuery) - C_Project_ID = getC_ProjectPhase().getC_Project_ID(); - return C_Project_ID; + if (C_Project_ID==0 || reQuery) + C_Project_ID = getC_ProjectPhase().getC_Project_ID(); + return C_Project_ID; } /** * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MProjectTask["); diff --git a/org.adempiere.base/src/org/compiere/model/MProjectType.java b/org.adempiere.base/src/org/compiere/model/MProjectType.java index 16bbfab818..0bb9297772 100644 --- a/org.adempiere.base/src/org/compiere/model/MProjectType.java +++ b/org.adempiere.base/src/org/compiere/model/MProjectType.java @@ -38,7 +38,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MProjectType extends X_C_ProjectType implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 2378841146277294989L; @@ -76,19 +76,18 @@ public class MProjectType extends X_C_ProjectType implements ImmutablePOSupport /** Cache */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache (Table_Name, 20); - - + /** - * UUID based Constructor - * @param ctx Context - * @param C_ProjectType_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_ProjectType_UU UUID key + * @param trxName Transaction + */ public MProjectType(Properties ctx, String C_ProjectType_UU, String trxName) { super(ctx, C_ProjectType_UU, trxName); } - /************************************************************************** + /** * Standrad Constructor * @param ctx context * @param C_ProjectType_ID id @@ -111,7 +110,7 @@ public class MProjectType extends X_C_ProjectType implements ImmutablePOSupport } // MProjectType /** - * + * Copy constructor * @param copy */ public MProjectType(MProjectType copy) @@ -120,7 +119,7 @@ public class MProjectType extends X_C_ProjectType implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -130,7 +129,7 @@ public class MProjectType extends X_C_ProjectType implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -145,6 +144,7 @@ public class MProjectType extends X_C_ProjectType implements ImmutablePOSupport * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder ("MProjectType[") @@ -153,11 +153,10 @@ public class MProjectType extends X_C_ProjectType implements ImmutablePOSupport .append("]"); return sb.toString(); } // toString - - /************************************************************************** + /** * Get Project Type Phases - * @return Array of phases + * @return Array of MProjectTypePhase */ public MProjectTypePhase[] getPhases() { @@ -190,13 +189,13 @@ public class MProjectType extends X_C_ProjectType implements ImmutablePOSupport } // getPhases /** - * Get Sql to return single value for the Performance Indicator + * Get SQL for Performance Indicator * @param restrictions array of goal restrictions - * @param MeasureScope scope of this value - * @param MeasureDataType data type - * @param reportDate optional report date + * @param MeasureScope measurement display scope (MGoal.MEASUREDISPLAY_*) + * @param MeasureDataType measurement data type (MMeasure.MEASUREDATATYPE_*) + * @param reportDate optional report date, null to use current date * @param role role - * @return sql for performance indicator + * @return SQL for performance indicator */ public String getSqlPI (MGoalRestriction[] restrictions, String MeasureScope, String MeasureDataType, Timestamp reportDate, MRole role) @@ -227,8 +226,6 @@ public class MProjectType extends X_C_ProjectType implements ImmutablePOSupport trunc = "MM"; else if (MGoal.MEASUREDISPLAY_Week.equals(MeasureScope)) trunc = "W"; - // else if (MGoal.MEASUREDISPLAY_Day.equals(MeasureDisplay)) - // ; sb.append(" AND TRUNC(") .append(dateColumn).append(",'").append(trunc).append("')=TRUNC(") .append(DB.TO_DATE(reportDate)).append(",'").append(trunc).append("')"); @@ -242,13 +239,13 @@ public class MProjectType extends X_C_ProjectType implements ImmutablePOSupport } // getSql /** - * Get Sql to value for the bar chart + * Get SQL for bar chart * @param restrictions array of goal restrictions - * @param MeasureDisplay scope of this value - * @param MeasureDataType data type + * @param MeasureDisplay measurement display scope (MGoal.MEASUREDISPLAY_*) + * @param MeasureDataType measurement data type (MMeasure.MEASUREDATATYPE_*) * @param startDate optional report start date * @param role role - * @return sql for Bar Chart + * @return SQL for Bar Chart */ public String getSqlBarChart (MGoalRestriction[] restrictions, String MeasureDisplay, String MeasureDataType, diff --git a/org.adempiere.base/src/org/compiere/model/MProjectTypePhase.java b/org.adempiere.base/src/org/compiere/model/MProjectTypePhase.java index 6800832ff6..b4fc35b5b9 100644 --- a/org.adempiere.base/src/org/compiere/model/MProjectTypePhase.java +++ b/org.adempiere.base/src/org/compiere/model/MProjectTypePhase.java @@ -36,16 +36,16 @@ import org.compiere.util.Util; public class MProjectTypePhase extends X_C_Phase { /** - * + * generated serial id */ private static final long serialVersionUID = -5111329904215151458L; /** - * UUID based Constructor - * @param ctx Context - * @param C_Phase_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Phase_UU UUID key + * @param trxName Transaction + */ public MProjectTypePhase(Properties ctx, String C_Phase_UU, String trxName) { super(ctx, C_Phase_UU, trxName); if (Util.isEmpty(C_Phase_UU)) @@ -85,8 +85,8 @@ public class MProjectTypePhase extends X_C_Phase } // MProjectTypePhase /** - * Get Project Type Phases - * @return Array of phases + * Get Project Type Tasks + * @return Array of MProjectTypeTask */ public MProjectTypeTask[] getTasks() { @@ -116,6 +116,6 @@ public class MProjectTypePhase extends X_C_Phase MProjectTypeTask[] retValue = new MProjectTypeTask[list.size()]; list.toArray(retValue); return retValue; - } // getPhases + } // getTasks } // MProjectTypePhase diff --git a/org.adempiere.base/src/org/compiere/model/MProjectTypeTask.java b/org.adempiere.base/src/org/compiere/model/MProjectTypeTask.java index 6b8f162fd6..74e2041c90 100644 --- a/org.adempiere.base/src/org/compiere/model/MProjectTypeTask.java +++ b/org.adempiere.base/src/org/compiere/model/MProjectTypeTask.java @@ -23,7 +23,7 @@ import org.compiere.util.Env; import org.compiere.util.Util; /** - * Project Type Phase Task Model + * Project Type Task Model * * @author Jorg Janke * @version $Id: MProjectTypeTask.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $ @@ -31,22 +31,27 @@ import org.compiere.util.Util; public class MProjectTypeTask extends X_C_Task { /** - * + * generated serial id */ private static final long serialVersionUID = -5649262800489348606L; /** - * UUID based Constructor - * @param ctx Context - * @param C_Task_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Task_UU UUID key + * @param trxName Transaction + */ public MProjectTypeTask(Properties ctx, String C_Task_UU, String trxName) { super(ctx, C_Task_UU, trxName); if (Util.isEmpty(C_Task_UU)) setInitialDefaults(); } - + + /** + * @param ctx + * @param C_Task_ID + * @param trxName + */ public MProjectTypeTask (Properties ctx, int C_Task_ID, String trxName) { super (ctx, C_Task_ID, trxName); @@ -62,6 +67,11 @@ public class MProjectTypeTask extends X_C_Task setStandardQty (Env.ZERO); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MProjectTypeTask (Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); diff --git a/org.adempiere.base/src/org/compiere/model/MQualityTest.java b/org.adempiere.base/src/org/compiere/model/MQualityTest.java index 28420529a6..8fce3666b2 100644 --- a/org.adempiere.base/src/org/compiere/model/MQualityTest.java +++ b/org.adempiere.base/src/org/compiere/model/MQualityTest.java @@ -1,33 +1,68 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; public class MQualityTest extends X_M_QualityTest { - /** - * + * generated serial id */ private static final long serialVersionUID = -8585270006299484402L; /** - * UUID based Constructor - * @param ctx Context - * @param M_QualityTest_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_QualityTest_UU UUID key + * @param trxName Transaction + */ public MQualityTest(Properties ctx, String M_QualityTest_UU, String trxName) { super(ctx, M_QualityTest_UU, trxName); } - + + /** + * @param ctx + * @param M_QualityTest_ID + * @param trxName + */ public MQualityTest(Properties ctx, int M_QualityTest_ID, String trxName) { super(ctx, M_QualityTest_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MQualityTest(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } + /** + * Create and save new quality test result + * @param m_attributesetinstance_id + * @return new saved MQualityTestResult instance + */ public MQualityTestResult createResult(int m_attributesetinstance_id) { MQualityTestResult result = new MQualityTestResult(getCtx(),0, get_TrxName()); diff --git a/org.adempiere.base/src/org/compiere/model/MQualityTestResult.java b/org.adempiere.base/src/org/compiere/model/MQualityTestResult.java index 9d37b904cf..db158f5a29 100644 --- a/org.adempiere.base/src/org/compiere/model/MQualityTestResult.java +++ b/org.adempiere.base/src/org/compiere/model/MQualityTestResult.java @@ -1,29 +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. * + **********************************************************************/ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; public class MQualityTestResult extends X_M_QualityTestResult { - /** - * + * generated serial id */ private static final long serialVersionUID = -5529865718027582930L; /** - * UUID based Constructor - * @param ctx Context - * @param M_QualityTestResult_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_QualityTestResult_UU UUID key + * @param trxName Transaction + */ public MQualityTestResult(Properties ctx, String M_QualityTestResult_UU, String trxName) { super(ctx, M_QualityTestResult_UU, trxName); } - + + /** + * @param ctx + * @param M_QualityTestResult_ID + * @param trxName + */ public MQualityTestResult(Properties ctx, int M_QualityTestResult_ID, String trxName) { super(ctx, M_QualityTestResult_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MQualityTestResult(Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); diff --git a/org.adempiere.base/src/org/compiere/model/MQuery.java b/org.adempiere.base/src/org/compiere/model/MQuery.java index 32e0c28d67..ed684e73e5 100644 --- a/org.adempiere.base/src/org/compiere/model/MQuery.java +++ b/org.adempiere.base/src/org/compiere/model/MQuery.java @@ -41,28 +41,28 @@ import org.compiere.util.ValueNamePair; /** * Query Descriptor. - * Maintains restrictions (WHERE clause) + * Maintains restrictions (WHERE clause). * * @author Jorg Janke * @version $Id: MQuery.java,v 1.4 2006/07/30 00:58:04 jjanke Exp $ * - * @author Teo Sarca + * @author Teo Sarca *
      • BF [ 2860022 ] MQuery.get() is generating restrictions for non-existent column * https://sourceforge.net/p/adempiere/bugs/2099/ */ public class MQuery implements Serializable, Cloneable { /** - * + * generated serial id */ private static final long serialVersionUID = -8671209250739719461L; /** - * Get Query from Parameter - * @param ctx context (to determine language) - * @param AD_PInstance_ID instance + * Create new Query for report + * @param ctx context + * @param AD_PInstance_ID process instance for report * @param TableName table name - * @return where clause + * @return MQuery */ static public MQuery get (Properties ctx, int AD_PInstance_ID, String TableName) { @@ -312,6 +312,13 @@ public class MQuery implements Serializable, Cloneable return reportQuery; } // get + /** + * Parse expression with variable + * @param evaluatee Resolver for variables in expression + * @param expression expression to parse + * @param ignoreUnparseable if true and there are variables that can't be resolved, return empty string + * @return parsed expression + */ private static String parseVariable(Evaluatee evaluatee, String expression, boolean ignoreUnparseable) { if (expression == null || expression.length() == 0) return ""; @@ -364,10 +371,10 @@ public class MQuery implements Serializable, Cloneable } /** - * Get Zoom Column Name. - * Converts Synonyms like SalesRep_ID to AD_User_ID + * Get Zoom Column Name.
        + * Convert well known synonyms like SalesRep_ID to AD_User_ID. * @param columnName column name - * @return column name + * @return zoom column name */ public static String getZoomColumnName (String columnName) { @@ -398,8 +405,7 @@ public class MQuery implements Serializable, Cloneable } // getZoomColumnName /** - * Derive Zoom Table Name from column name. - * (e.g. drop _ID) + * Derive Zoom Table Name from column name (drop _ID or _UU). * @param columnName column name * @return table name */ @@ -414,14 +420,13 @@ public class MQuery implements Serializable, Cloneable return tableName.substring(0, index); return tableName; } // getZoomTableName - - /************************************************************************* - * Create simple Equal Query. - * Creates columnName=value or columnName='value' + /** + * Create simple Equal Query.
        + * Create restriction of columnName=value or columnName='value' * @param columnName columnName * @param value value - * @return quary + * @return query */ public static MQuery getEqualQuery (String columnName, Object value) { @@ -433,7 +438,7 @@ public class MQuery implements Serializable, Cloneable /** * Create simple Equal Query. - * Creates columnName=value + * Create restriction of columnName=value. * @param columnName columnName * @param value value * @return query @@ -451,7 +456,7 @@ public class MQuery implements Serializable, Cloneable /** * Create No Record query. * @param tableName table name - * @param newRecord new Record Indicator (2=3) + * @param newRecord new Record Indicator. if true, add restriction of "2=3", otherwise add restriction of "1-2" * @return query */ public static MQuery getNoRecordQuery (String tableName, boolean newRecord) @@ -467,9 +472,8 @@ public class MQuery implements Serializable, Cloneable /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MQuery.class); - - - /************************************************************************** + + /** * Constructor w/o table name */ public MQuery () @@ -486,8 +490,8 @@ public class MQuery implements Serializable, Cloneable } // MQuery /** - * Constructor get TableNAme from Table - * @param AD_Table_ID Table_ID + * Constructor get TableName from table id + * @param AD_Table_ID */ public MQuery (int AD_Table_ID) { // Use Client Context as r/o @@ -517,17 +521,20 @@ public class MQuery implements Serializable, Cloneable private MQuery m_reportProcessQuery; - + /** + * @return zoom AD_Window_ID + */ public int getZoomWindowID() { return m_zoomWindow_ID; } - + /** + * @param m_zoomWindow_ID AD_Window_ID for zoom + */ public void setZoomWindowID(int m_zoomWindow_ID) { this.m_zoomWindow_ID = m_zoomWindow_ID; } - /** * Get Record Count * @return count - default 999999 @@ -545,8 +552,7 @@ public class MQuery implements Serializable, Cloneable { m_recordCount = count; } // setRecordCount - - + /** Equal */ public static final String EQUAL = "="; public static final String MSG_EQUAL = "OPERATOR_EQUAL"; @@ -587,7 +593,7 @@ public class MQuery implements Serializable, Cloneable public static final String NULL = " IS NULL "; public static final String MSG_NULL = "OPERATOR_NULL"; - /* NOTE: Value is the SQL operator, and Name is the message that appears in Find window and reports */ + /** NOTE: Value is the SQL operator, and Name is the message that appears in find window and reports */ /** All the Operators */ public static final ValueNamePair[] OPERATORS = new ValueNamePair[] { new ValueNamePair (EQUAL, MSG_EQUAL), // 0 - EQUAL_INDEX @@ -655,15 +661,15 @@ public class MQuery implements Serializable, Cloneable new ValueNamePair (NOT_NULL, MSG_NOT_NULL) }; - /************************************************************************* + /** * Add Restriction * @param ColumnName ColumnName * @param Operator Operator, e.g. = != .. - * @param Code Code, e.g 0, All% + * @param Code query value, e.g 0, All% * @param InfoName Display Name * @param InfoDisplay Display of Code (Lookup) * @param andCondition true=and, false=or - * @param depth ( = no open brackets ) + * @param depth number of parenthesis */ public void addRestriction (String ColumnName, String Operator, Object Code, String InfoName, String InfoDisplay, boolean andCondition, int depth) @@ -673,16 +679,16 @@ public class MQuery implements Serializable, Cloneable m_list.add(r); } // addRestriction - /************************************************************************* + /** * Add Restriction * @param ColumnName ColumnName * @param Operator Operator, e.g. = != .. - * @param Code Code, e.g 0, All% + * @param Code query value, e.g 0, All% * @param InfoName Display Name * @param InfoDisplay Display of Code (Lookup) * @param andCondition true=and, false=or - * @param notCondition true=not, false=empty - * @param depth ( = no open brackets ) + * @param notCondition true=not + * @param depth number of parenthesis */ public void addRestriction (String ColumnName, String Operator, Object Code, String InfoName, String InfoDisplay, boolean andCondition, boolean notCondition, int depth) @@ -695,14 +701,14 @@ public class MQuery implements Serializable, Cloneable /** * Add Range Restriction (BETWEEN) * @param ColumnName ColumnName - * @param Code Code, e.g 0, All% - * @param Code_to Code, e.g 0, All% + * @param Code from value, e.g 0, All% + * @param Code_to to value, e.g 0, All% * @param InfoName Display Name * @param InfoDisplay Display of Code (Lookup) - * @param InfoDisplay_to Display of Code (Lookup) + * @param InfoDisplay_to Display of Code_to (Lookup) * @param andCondition true=and, false=or - * @param notCondition true=not, false=empty - * @param depth ( = no open brackets ) + * @param notCondition true=not + * @param depth number of parenthesis */ public void addRangeRestriction (String ColumnName, Object Code, Object Code_to, @@ -713,15 +719,15 @@ public class MQuery implements Serializable, Cloneable m_list.add(r); } - /************************************************************************* + /** * Add Restriction * @param ColumnName ColumnName * @param Operator Operator, e.g. = != .. - * @param Code Code, e.g 0, All% + * @param Code query value, e.g 0, All% * @param InfoName Display Name * @param InfoDisplay Display of Code (Lookup) * @param andOrCondition AND/OR/AND NOT/OR NOT - concatenation of parenthesis - * @param depth ( = no open brackets ) + * @param depth number of parenthesis */ public void addRestriction (String ColumnName, String Operator, Object Code, String InfoName, String InfoDisplay, String andOrCondition, int depth) @@ -731,11 +737,11 @@ public class MQuery implements Serializable, Cloneable m_list.add(r); } // addRestriction - /************************************************************************* + /** * Add Restriction * @param ColumnName ColumnName * @param Operator Operator, e.g. = != .. - * @param Code Code, e.g 0, All% + * @param Code query value, e.g 0, All% * @param InfoName Display Name * @param InfoDisplay Display of Code (Lookup) */ @@ -751,7 +757,7 @@ public class MQuery implements Serializable, Cloneable * Add Restriction * @param ColumnName ColumnName * @param Operator Operator, e.g. = != .. - * @param Code Code, e.g 0, All% + * @param Code query value, e.g 0, All% */ public void addRestriction (String ColumnName, String Operator, Object Code) @@ -765,7 +771,7 @@ public class MQuery implements Serializable, Cloneable * Add Restriction * @param ColumnName ColumnName * @param Operator Operator, e.g. = != .. - * @param Code Code, e.g 0 + * @param Code query value, e.g 0 */ public void addRestriction (String ColumnName, String Operator, int Code) @@ -778,13 +784,13 @@ public class MQuery implements Serializable, Cloneable /** * Add Range Restriction (BETWEEN) * @param ColumnName ColumnName - * @param Code Code, e.g 0, All% - * @param Code_to Code, e.g 0, All% + * @param Code from value, e.g 0, All% + * @param Code_to to value, e.g 0, All% * @param InfoName Display Name * @param InfoDisplay Display of Code (Lookup) - * @param InfoDisplay_to Display of Code (Lookup) + * @param InfoDisplay_to Display of Code_to (Lookup) * @param andCondition true=and, false=or - * @param depth ( = no open brackets ) + * @param depth number of parenthesis */ public void addRangeRestriction (String ColumnName, Object Code, Object Code_to, @@ -798,13 +804,13 @@ public class MQuery implements Serializable, Cloneable /** * Add Range Restriction (BETWEEN) * @param ColumnName ColumnName - * @param Code Code, e.g 0, All% - * @param Code_to Code, e.g 0, All% + * @param Code from value, e.g 0, All% + * @param Code_to to value, e.g 0, All% * @param InfoName Display Name * @param InfoDisplay Display of Code (Lookup) - * @param InfoDisplay_to Display of Code (Lookup) + * @param InfoDisplay_to Display of Code_to (Lookup) * @param andOrCondition AND/OR/AND NOT/OR NOT - concatenation of parenthesis - * @param depth ( = no open brackets ) + * @param depth number of parenthesis */ public void addRangeRestriction (String ColumnName, Object Code, Object Code_to, @@ -818,11 +824,11 @@ public class MQuery implements Serializable, Cloneable /** * Add Range Restriction (BETWEEN) * @param ColumnName ColumnName - * @param Code Code, e.g 0, All% - * @param Code_to Code, e.g 0, All% + * @param Code from value, e.g 0, All% + * @param Code_to to value, e.g 0, All% * @param InfoName Display Name * @param InfoDisplay Display of Code (Lookup) - * @param InfoDisplay_to Display of Code (Lookup) + * @param InfoDisplay_to Display of Code_to (Lookup) */ public void addRangeRestriction (String ColumnName, Object Code, Object Code_to, @@ -836,8 +842,8 @@ public class MQuery implements Serializable, Cloneable /** * Add Range Restriction (BETWEEN) * @param ColumnName ColumnName - * @param Code Code, e.g 0, All% - * @param Code_to Code, e.g 0, All% + * @param Code from value, e.g 0, All% + * @param Code_to to value, e.g 0, All% */ public void addRangeRestriction (String ColumnName, Object Code, Object Code_to) @@ -859,8 +865,8 @@ public class MQuery implements Serializable, Cloneable /** * Add Restriction * @param whereClause SQL WHERE clause - * @param andCondition - * @param joinDepth + * @param andCondition true=and, false=or + * @param joinDepth number of parenthesis */ public void addRestriction (String whereClause, boolean andCondition, int joinDepth) { @@ -874,6 +880,9 @@ public class MQuery implements Serializable, Cloneable /** * Add Restriction * @param whereClause SQL WHERE clause + * @param andCondition true=and, false=or + * @param notCondition true=not + * @param joinDepth number of parenthesis */ public void addRestriction (String whereClause, boolean andCondition, boolean notCondition, int joinDepth) { @@ -887,6 +896,10 @@ public class MQuery implements Serializable, Cloneable /** * Add Restriction * @param whereClause SQL WHERE clause + * @param andCondition true=and, false=or + * @param notCondition true=not + * @param existsCondition true=exists + * @param joinDepth number of parenthesis */ public void addRestriction (String whereClause, boolean andCondition, boolean notCondition, boolean existsCondition, int joinDepth) { @@ -900,7 +913,7 @@ public class MQuery implements Serializable, Cloneable /** * Add Restriction * @param whereClause SQL WHERE clause - * @param joinDepth + * @param joinDepth number of parenthesis * @param andOrCondition */ public void addRestriction (String whereClause, int joinDepth, String andOrCondition) @@ -925,6 +938,13 @@ public class MQuery implements Serializable, Cloneable m_newRecord = whereClause.equals(NEWRECORD); } // addRestriction + /** + * Add restriction + * @param whereClause + * @param Operator + * @param InfoName + * @param InfoDisplay + */ public void addRestriction (String whereClause, String Operator, String InfoName, String InfoDisplay) { if (whereClause == null || whereClause.trim().length() == 0) @@ -948,7 +968,7 @@ public class MQuery implements Serializable, Cloneable return m_newRecord; } // isNewRecord - /************************************************************************* + /** * Create the resulting Query WHERE Clause * @return Where Clause */ @@ -1054,7 +1074,7 @@ public class MQuery implements Serializable, Cloneable /** * Create Query WHERE Clause. - * Not fully qualified + * Not fully qualified. * @param index restriction index * @return Where Clause or "" if not valid */ @@ -1104,12 +1124,11 @@ public class MQuery implements Serializable, Cloneable { m_TableName = TableName; } // setTableName - - /************************************************************************* + /** * Get ColumnName of index * @param index index - * @return ColumnName + * @return ColumnName or null */ public String getColumnName (int index) { @@ -1135,7 +1154,7 @@ public class MQuery implements Serializable, Cloneable /** * Get Operator of index * @param index index - * @return Operator + * @return Operator or null */ public String getOperator (int index) { @@ -1148,7 +1167,7 @@ public class MQuery implements Serializable, Cloneable /** * Get Operator of index * @param index index - * @return Operator + * @return Operator or null */ public Object getCode (int index) { @@ -1161,7 +1180,7 @@ public class MQuery implements Serializable, Cloneable /** * Get Operator of index * @param index index - * @return Operator + * @return Operator or null */ public Object getCode_to (int index) { @@ -1172,9 +1191,9 @@ public class MQuery implements Serializable, Cloneable } // getCode /** - * Get Restriction Display of index + * Get display text of index * @param index index - * @return Restriction Display + * @return Display Text */ public String getInfoDisplay (int index) { @@ -1185,9 +1204,9 @@ public class MQuery implements Serializable, Cloneable } // getOperator /** - * Get TO Restriction Display of index - * @param index index - * @return Restriction Display + * Get display text of to restriction + * @param index index of restriction + * @return Display Text */ public String getInfoDisplay_to (int index) { @@ -1240,6 +1259,7 @@ public class MQuery implements Serializable, Cloneable * String representation * @return info */ + @Override public String toString() { if (isActive()) @@ -1285,7 +1305,6 @@ public class MQuery implements Serializable, Cloneable } /** - * * @param tableName */ public void setZoomTableName(String tableName) { @@ -1293,7 +1312,6 @@ public class MQuery implements Serializable, Cloneable } /** - * * @return zoom table name */ public String getZoomTableName() { @@ -1301,7 +1319,6 @@ public class MQuery implements Serializable, Cloneable } /** - * * @param column */ public void setZoomColumnName(String column) { @@ -1309,7 +1326,6 @@ public class MQuery implements Serializable, Cloneable } /** - * * @return zoom column name */ public String getZoomColumnName() { @@ -1317,7 +1333,6 @@ public class MQuery implements Serializable, Cloneable } /** - * * @param value */ public void setZoomValue(Object value) { @@ -1325,31 +1340,35 @@ public class MQuery implements Serializable, Cloneable } /** - * * @return zoom value, usually an integer */ public Object getZoomValue() { return m_zoomValue; } + /** + * @param query + */ public void setReportProcessQuery(MQuery query) { m_reportProcessQuery = query; } + /** + * @return query + */ public MQuery getReportProcessQuery() { return m_reportProcessQuery; } /** - * * @param ColumnName * @param Operator - * @param Code + * @param Code query value * @param InfoName - * @param InfoDisplay - * @param andCondition - * @param depth - * @return + * @param InfoDisplay display text of code + * @param andCondition true=and, false=or + * @param depth number of parenthesis + * @return SQL */ public String getRestrictionSQL (String ColumnName, String Operator, Object Code, String InfoName, String InfoDisplay, boolean andCondition, int depth) @@ -1361,14 +1380,14 @@ public class MQuery implements Serializable, Cloneable /** * @param ColumnName - * @param Code - * @param Code_To + * @param Code from value + * @param Code_To to value * @param InfoName - * @param InfoDisplay - * @param InfoDisplay_To - * @param andCondition - * @param depth - * @return + * @param InfoDisplay display text of from value + * @param InfoDisplay_To display text of to value + * @param andCondition true=and, false=or + * @param depth number of parenthesis + * @return SQL */ public String getRestrictionSQL (String ColumnName, Object Code, Object Code_To, String InfoName, String InfoDisplay, String InfoDisplay_To, boolean andCondition, int depth) @@ -1392,13 +1411,13 @@ public class MQuery implements Serializable, Cloneable } } // MQuery -/***************************************************************************** +/** * Query Restriction */ class Restriction implements Serializable { /** - * + * generated serial id */ private static final long serialVersionUID = -4521978087587321243L; @@ -1406,7 +1425,7 @@ class Restriction implements Serializable * Restriction * @param columnName ColumnName * @param operator Operator, e.g. = != .. - * @param code Code, e.g 0, All% + * @param code query value, e.g 0, All% * @param infoName Display Name * @param infoDisplay Display of Code (Lookup) * @param andCondition true->AND false->OR @@ -1424,7 +1443,7 @@ class Restriction implements Serializable * Restriction * @param columnName ColumnName * @param operator Operator, e.g. = != .. - * @param code Code, e.g 0, All% + * @param code query value, e.g 0, All% * @param infoName Display Name * @param infoDisplay Display of Code (Lookup) * @param andOrCondition AND/OR/AND NOT/OR NOT - concatenation of parenthesis @@ -1438,7 +1457,6 @@ class Restriction implements Serializable InfoName = infoName; else InfoName = ColumnName; - this.andOrCondition = andOrCondition; this.joinDepth = depth < 0 ? 0 : depth; @@ -1491,11 +1509,11 @@ class Restriction implements Serializable /** * Range Restriction (BETWEEN) * @param columnName ColumnName - * @param code Code, e.g 0, All% - * @param code_to Code, e.g 0, All% + * @param code from value, e.g 0, All% + * @param code_to to value, e.g 0, All% * @param infoName Display Name * @param infoDisplay Display of Code (Lookup) - * @param infoDisplay_to Display of Code (Lookup) + * @param infoDisplay_to Display of Code_To (Lookup) * @param andCondition true->AND false->OR * @param depth number of parenthesis */ @@ -1510,11 +1528,11 @@ class Restriction implements Serializable /** * Range Restriction (BETWEEN) * @param columnName ColumnName - * @param code Code, e.g 0, All% - * @param code_to Code, e.g 0, All% + * @param code from value, e.g 0, All% + * @param code_to to value, e.g 0, All% * @param infoName Display Name * @param infoDisplay Display of Code (Lookup) - * @param infoDisplay_to Display of Code (Lookup) + * @param infoDisplay_to Display of Code_To (Lookup) * @param andOrCondition AND/OR/AND NOT/OR NOT - concatenation of parenthesis * @param depth number of parenthesis */ @@ -1543,11 +1561,11 @@ class Restriction implements Serializable /** * Range Restriction (BETWEEN) * @param columnName ColumnName - * @param code Code, e.g 0, All% - * @param code_to Code, e.g 0, All% + * @param code from value, e.g 0, All% + * @param code_to to value, e.g 0, All% * @param infoName Display Name * @param infoDisplay Display of Code (Lookup) - * @param infoDisplay_to Display of Code (Lookup) + * @param infoDisplay_to Display of Code_To (Lookup) */ Restriction (String columnName, Object code, Object code_to, @@ -1600,6 +1618,10 @@ class Restriction implements Serializable /** * Create Restriction with direct WHERE clause * @param whereClause SQL WHERE Clause + * @param andCondition true=and, false=or + * @param notCondition true=not + * @param existsCondition true=exists + * @param depth number of parenthesis */ Restriction (String whereClause, boolean andCondition, boolean notCondition, boolean existsCondition, int depth) { @@ -1614,7 +1636,7 @@ class Restriction implements Serializable * * @param ColumnName * @param ExistsClause - * @param Code + * @param Code query value */ Restriction (String ExistsClause, Object Code) { @@ -1650,16 +1672,15 @@ class Restriction implements Serializable protected boolean existsCondition = false; /** - * Return SQL construct for this restriction + * Get SQL build from this restriction * @param tableName optional table name - * @return SQL WHERE construct + * @return SQL WHERE clause */ public String getSQL (String tableName) { if (DirectWhereClause != null) return DirectWhereClause; - if(ExistsClause != null){ StringBuilder sb = new StringBuilder(); sb.append(ExistsClause); @@ -1754,6 +1775,7 @@ class Restriction implements Serializable * Get String Representation * @return info */ + @Override public String toString() { return getSQL(null); @@ -1800,6 +1822,9 @@ class Restriction implements Serializable class QueryEvaluatee implements Evaluatee { private Map parameterMap; + /** + * @param parameterMap + */ public QueryEvaluatee(Map parameterMap) { this.parameterMap = parameterMap; } diff --git a/org.adempiere.base/src/org/compiere/model/MRMA.java b/org.adempiere.base/src/org/compiere/model/MRMA.java index 1923f76b9d..9a0c36c8e4 100644 --- a/org.adempiere.base/src/org/compiere/model/MRMA.java +++ b/org.adempiere.base/src/org/compiere/model/MRMA.java @@ -46,16 +46,16 @@ import org.compiere.util.Util; public class MRMA extends X_M_RMA implements DocAction { /** - * + * generated serial id */ private static final long serialVersionUID = -8352164928046804628L; /** - * UUID based Constructor - * @param ctx Context - * @param M_RMA_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_RMA_UU UUID key + * @param trxName Transaction + */ public MRMA(Properties ctx, String M_RMA_UU, String trxName) { super(ctx, M_RMA_UU, trxName); if (Util.isEmpty(M_RMA_UU)) @@ -104,9 +104,9 @@ public class MRMA extends X_M_RMA implements DocAction protected MInOut m_inout = null; /** - * Get Lines - * @param requery requery - * @return lines + * Get RMA Lines + * @param requery true to re-query from DB + * @return RMA lines */ public MRMALine[] getLines (boolean requery) { @@ -126,9 +126,9 @@ public class MRMA extends X_M_RMA implements DocAction } // getLines /** - * Get Taxes of RMA - * @param requery requery - * @return array of taxes + * Get RMA Tax Lines + * @param requery true to re-query from DB + * @return array of RMA tax lines */ public MRMATax[] getTaxes(boolean requery) { @@ -212,11 +212,11 @@ public class MRMA extends X_M_RMA implements DocAction m_inout = null; } // setM_InOut_ID - /** * Get Document Info * @return document info (untranslated) */ + @Override public String getDocumentInfo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); @@ -225,8 +225,9 @@ public class MRMA extends X_M_RMA implements DocAction /** * Create PDF - * @return File or null + * @return not implemented, always return null */ + @Override public File createPDF () { try @@ -244,20 +245,20 @@ public class MRMA extends X_M_RMA implements DocAction /** * Create PDF file * @param file output file - * @return file if success + * @return not implemented, always return null */ public File createPDF (File file) { return null; } // createPDF - /** * Before Save * Set BPartner, Currency * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (newRecord) @@ -301,12 +302,12 @@ public class MRMA extends X_M_RMA implements DocAction return true; } // beforeSave - - /************************************************************************** + /** * Process document * @param processAction document action * @return true if performed */ + @Override public boolean processIt (String processAction) { m_processMsg = null; @@ -323,6 +324,7 @@ public class MRMA extends X_M_RMA implements DocAction * Unlock Document. * @return true if success */ + @Override public boolean unlockIt() { if (log.isLoggable(Level.INFO)) log.info("unlockIt - " + toString()); @@ -334,6 +336,7 @@ public class MRMA extends X_M_RMA implements DocAction * Invalidate Document * @return true if success */ + @Override public boolean invalidateIt() { if (log.isLoggable(Level.INFO)) log.info("invalidateIt - " + toString()); @@ -344,6 +347,7 @@ public class MRMA extends X_M_RMA implements DocAction * Prepare Document * @return new status (In Progress or Invalid) */ + @Override public String prepareIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -413,6 +417,7 @@ public class MRMA extends X_M_RMA implements DocAction * Approve Document * @return true if success */ + @Override public boolean approveIt() { if (log.isLoggable(Level.INFO)) log.info("approveIt - " + toString()); @@ -424,6 +429,7 @@ public class MRMA extends X_M_RMA implements DocAction * Reject Approval * @return true if success */ + @Override public boolean rejectIt() { if (log.isLoggable(Level.INFO)) log.info("rejectIt - " + toString()); @@ -435,6 +441,7 @@ public class MRMA extends X_M_RMA implements DocAction * Complete Document * @return new status (Complete, In Progress, Invalid, Waiting ..) */ + @Override public String completeIt() { // Re-Check @@ -489,9 +496,9 @@ public class MRMA extends X_M_RMA implements DocAction } } - /************************************************************************** + /** * Create Counter Document - * @return InOut + * @return MRMA */ protected MRMA createCounterDoc() { @@ -565,13 +572,13 @@ public class MRMA extends X_M_RMA implements DocAction } // createCounterDoc /** - * Create new RMA by copying - * @param from RMA + * Create and save new RMA by copying from another RMA document + * @param from RMA to copy from * @param C_DocType_ID doc type - * @param isSOTrx sales order + * @param isSOTrx sales trx flag * @param counter create counter links * @param trxName trx - * @return MRMA + * @return new MRMA */ public static MRMA copyFrom (MRMA from, int C_DocType_ID, boolean isSOTrx, boolean counter, String trxName) { @@ -623,7 +630,7 @@ public class MRMA extends X_M_RMA implements DocAction /** * Copy Lines From other RMA - * @param otherRMA + * @param otherRMA RMA to copy lines from * @param counter set counter info * @return number of lines copied */ @@ -674,6 +681,7 @@ public class MRMA extends X_M_RMA implements DocAction * Void Document. * @return true if success */ + @Override public boolean voidIt() { if (log.isLoggable(Level.INFO)) log.info("voidIt - " + toString()); @@ -729,9 +737,10 @@ public class MRMA extends X_M_RMA implements DocAction /** * Close Document. - * Cancel not delivered Qunatities + * Cancel not delivered Quantities. * @return true if success */ + @Override public boolean closeIt() { if (log.isLoggable(Level.INFO)) log.info("closeIt - " + toString()); @@ -749,8 +758,9 @@ public class MRMA extends X_M_RMA implements DocAction /** * Reverse Correction - * @return true if success + * @return not implemented, always return false */ + @Override public boolean reverseCorrectIt() { if (log.isLoggable(Level.INFO)) log.info("reverseCorrectIt - " + toString()); @@ -768,9 +778,10 @@ public class MRMA extends X_M_RMA implements DocAction } // reverseCorrectionIt /** - * Reverse Accrual - none - * @return true if success + * Reverse Accrual + * @return not implemented, always return false */ + @Override public boolean reverseAccrualIt() { if (log.isLoggable(Level.INFO)) log.info("reverseAccrualIt - " + toString()); @@ -789,8 +800,9 @@ public class MRMA extends X_M_RMA implements DocAction /** * Re-activate - * @return true if success + * @return not implemented, always return false */ + @Override public boolean reActivateIt() { if (log.isLoggable(Level.INFO)) log.info("reActivateIt - " + toString()); @@ -818,9 +830,10 @@ public class MRMA extends X_M_RMA implements DocAction /** * Set Processed. - * Propagate to Lines + * Propagate to Lines. * @param processed processed */ + @Override public void setProcessed (boolean processed) { super.setProcessed (processed); @@ -846,10 +859,11 @@ public class MRMA extends X_M_RMA implements DocAction setDescription(desc + " | " + description); } // addDescription - /************************************************************************* + /** * Get Summary * @return Summary of Document */ + @Override public String getSummary() { StringBuilder sb = new StringBuilder(); @@ -866,7 +880,7 @@ public class MRMA extends X_M_RMA implements DocAction /** * Retrieves all the charge lines that is present on the document - * @return Charge Lines + * @return RMA Lines with Charge */ public MRMALine[] getChargeLines() { @@ -911,6 +925,7 @@ public class MRMA extends X_M_RMA implements DocAction * Get Process Message * @return clear text error message */ + @Override public String getProcessMsg() { return m_processMsg; @@ -920,6 +935,7 @@ public class MRMA extends X_M_RMA implements DocAction * Get Document Owner (Responsible) * @return AD_User_ID */ + @Override public int getDoc_User_ID() { return getSalesRep_ID(); @@ -929,13 +945,14 @@ public class MRMA extends X_M_RMA implements DocAction * Get Document Approval Amount * @return amount */ + @Override public BigDecimal getApprovalAmt() { return getAmt(); } // getApprovalAmt /** - * Document Status is Complete or Closed + * Document Status is Complete, Closed or Reverse * @return true if CO, CL or RE */ public boolean isComplete() @@ -977,7 +994,7 @@ public class MRMA extends X_M_RMA implements DocAction } /** - * Create Line from inoutline + * Create and save RMA Line from inout line * @param M_InOutLine_ID * @param MovementQty * @param Description diff --git a/org.adempiere.base/src/org/compiere/model/MRMALine.java b/org.adempiere.base/src/org/compiere/model/MRMALine.java index 5d55932ea4..947d957db5 100644 --- a/org.adempiere.base/src/org/compiere/model/MRMALine.java +++ b/org.adempiere.base/src/org/compiere/model/MRMALine.java @@ -30,7 +30,6 @@ import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.Util; - /** * RMA Line Model * @@ -40,16 +39,16 @@ import org.compiere.util.Util; public class MRMALine extends X_M_RMALine { /** - * + * generated serial id */ private static final long serialVersionUID = 3088864372141663734L; /** - * UUID based Constructor - * @param ctx Context - * @param M_RMALine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_RMALine_UU UUID key + * @param trxName Transaction + */ public MRMALine(Properties ctx, String M_RMALine_UU, String trxName) { super(ctx, M_RMALine_UU, trxName); if (Util.isEmpty(M_RMALine_UU)) @@ -68,6 +67,12 @@ public class MRMALine extends X_M_RMALine this (ctx, M_RMALine_ID, trxName, (String[]) null); } // MRMALine + /** + * @param ctx + * @param M_RMALine_ID + * @param trxName + * @param virtualColumns + */ public MRMALine(Properties ctx, int M_RMALine_ID, String trxName, String... virtualColumns) { super(ctx, M_RMALine_ID, trxName, virtualColumns); if (M_RMALine_ID == 0) @@ -112,7 +117,7 @@ public class MRMALine extends X_M_RMALine protected int taxId = 0; /** - * Initialise parameters that are required + * Initialise instance variables */ protected void init() { @@ -236,8 +241,8 @@ public class MRMALine extends X_M_RMALine } // setM_InOutLine_ID /** - * Get Ship Line - * @return ship line + * Get Shipment Line + * @return shipment line */ public MInOutLine getShipLine() { @@ -259,7 +264,7 @@ public class MRMALine extends X_M_RMALine } /** - * Calculates the unit amount for the product/charge + * Get unit amount for product/charge * @return Unit Amount */ public BigDecimal getUnitAmt() @@ -268,8 +273,8 @@ public class MRMALine extends X_M_RMALine } /** - * Get Total Amt for the line including tax - * @return amt + * Get Total Amount for the line including tax + * @return total amount */ public BigDecimal getTotalAmt() { @@ -379,6 +384,10 @@ public class MRMALine extends X_M_RMALine return true; } + /** + * Validate that line quantity is <= MInOutLine quantity + * @return true if pass validation + */ public boolean checkQty() { if (m_ioLine.getMovementQty().compareTo(getQty()) < 0) @@ -397,7 +406,7 @@ public class MRMALine extends X_M_RMALine } /** - * + * Update RMA tax * @param oldTax true if the old C_Tax_ID should be used * @return true if success, false otherwise */ @@ -520,8 +529,8 @@ public class MRMALine extends X_M_RMALine } // addDescription /** - * Get precision - * Based on Invoice if the shipment was invoiced, on Order otherwise + * Get precision. + * Based on Invoice if the shipment was invoiced, on Order otherwise. */ public int getPrecision() { @@ -530,9 +539,9 @@ public class MRMALine extends X_M_RMALine /** * Get UOM - * Based on Shipment line if present - * Default to Each (100) for charge - * @return UOM if based on shipment line and 100 for charge based + * @return C_UOM_ID
        + * - if shipment line exists, from shipment line
        + * - otherwise return 100 (Each) for charge line or product UOM for product line */ public int getC_UOM_ID() { @@ -559,7 +568,7 @@ public class MRMALine extends X_M_RMALine /** * Get Charge - * @return product or null + * @return charge or null */ public MCharge getCharge() { @@ -581,7 +590,7 @@ public class MRMALine extends X_M_RMALine /** * Get Project - * @return project if based on shipment line and 0 for charge based + * @return If based on shipment line, return C_Project_ID from shipment line. Otherwise, return 0 */ public int getC_Project_ID() { @@ -592,7 +601,7 @@ public class MRMALine extends X_M_RMALine /** * Get Project Phase - * @return project phase if based on shipment line and 0 for charge based + * @return If based on shipment line, return C_ProjectPhase_ID from shipment line. Otherwise, return 0 */ public int getC_ProjectPhase_ID() { @@ -603,7 +612,7 @@ public class MRMALine extends X_M_RMALine /** * Get Project Task - * @return project task if based on shipment line and 0 for charge based + * @return If based on shipment line, return C_ProjectTask_ID from shipment line. Otherwise, return 0 */ public int getC_ProjectTask_ID() { @@ -614,7 +623,7 @@ public class MRMALine extends X_M_RMALine /** * Get Activity - * @return project phase if based on shipment line and 0 for charge based + * @return If based on shipment line, return C_Activity_ID from shipment line. Otherwise, return 0 */ public int getC_Activity_ID() { @@ -625,7 +634,7 @@ public class MRMALine extends X_M_RMALine /** * Get Campaign - * @return campaign if based on shipment line and 0 for charge based + * @return If based on shipment line, return C_Campaign_ID from shipment line. Otherwise, return 0 */ public int getC_Campaign_ID() { @@ -636,7 +645,7 @@ public class MRMALine extends X_M_RMALine /** * Get Org Trx - * @return Org Trx if based on shipment line and 0 for charge based + * @return If based on shipment line, return AD_OrgTrx_ID from shipment line. Otherwise, return 0 */ public int getAD_OrgTrx_ID() { @@ -647,7 +656,7 @@ public class MRMALine extends X_M_RMALine /** * Get User1 - * @return user1 if based on shipment line and 0 for charge based + * @return If based on shipment line, return User1_ID from shipment line. Otherwise, return 0 */ public int getUser1_ID() { @@ -658,7 +667,7 @@ public class MRMALine extends X_M_RMALine /** * Get User2 - * @return user2 if based on shipment line and 0 for charge based + * @return If based on shipment line, return User2_ID from shipment line. Otherwise, return 0 */ public int getUser2_ID() { @@ -669,7 +678,7 @@ public class MRMALine extends X_M_RMALine /** * Get Attribute Set Instance - * @return ASI if based on shipment line and 0 for charge based + * @return If based on shipment line, return M_AttributeSetInstance_ID from shipment line. Otherwise, return 0 */ public int getM_AttributeSetInstance_ID() { @@ -680,7 +689,9 @@ public class MRMALine extends X_M_RMALine /** * Get Locator - * @return locator if based on shipment line and 0 for charge based + * @return M_Locator_ID
        + * - if based on shipment line, return M_Locator_ID from shipment line
        + * - otherwise, return 0 for charge line or default locator for product line */ public int getM_Locator_ID() { @@ -696,6 +707,9 @@ public class MRMALine extends X_M_RMALine return m_ioLine.getM_Locator_ID(); } + /** + * Reset {@link #m_parent} to null + */ public void clearParent() { this.m_parent = null; diff --git a/org.adempiere.base/src/org/compiere/model/MRMATax.java b/org.adempiere.base/src/org/compiere/model/MRMATax.java index c7227a842c..1fa0f86e9c 100644 --- a/org.adempiere.base/src/org/compiere/model/MRMATax.java +++ b/org.adempiere.base/src/org/compiere/model/MRMATax.java @@ -34,7 +34,7 @@ import org.compiere.util.Util; public class MRMATax extends X_M_RMATax { /** - * + * generated serial id */ private static final long serialVersionUID = -8702466449639865049L; @@ -42,9 +42,9 @@ public class MRMATax extends X_M_RMATax * Get Tax Line for RMA Line * @param line RMA line * @param precision currency precision - * @param oldTax get old tax + * @param oldTax true to use old tax (get_ValueOld("C_Tax_ID")) * @param trxName transaction - * @return existing or new tax + * @return existing or new MRMATax record */ public static MRMATax get (MRMALine line, int precision, boolean oldTax, String trxName) @@ -125,9 +125,9 @@ public class MRMATax extends X_M_RMATax * Get Child Tax Lines for RMA Line * @param line RMA line * @param precision currency precision - * @param oldTax get old tax + * @param oldTax true to use old tax (get_ValueOld("C_Tax_ID")) * @param trxName transaction - * @return existing or new tax + * @return existing or new MRMATax record or empty MRMATax array if line MTax has no child taxes */ public static MRMATax[] getChildTaxes(MRMALine line, int precision, boolean oldTax, String trxName) @@ -215,19 +215,18 @@ public class MRMATax extends X_M_RMATax private static CLogger s_log = CLogger.getCLogger (MRMATax.class); /** - * UUID based Constructor - * @param ctx Context - * @param M_RMATax_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_RMATax_UU UUID key + * @param trxName Transaction + */ public MRMATax(Properties ctx, String M_RMATax_UU, String trxName) { super(ctx, M_RMATax_UU, trxName); if (Util.isEmpty(M_RMATax_UU)) setInitialDefaults(); } - /************************************************************************** - * Persistence Constructor + /** * @param ctx context * @param ignored ignored * @param trxName transaction @@ -251,7 +250,6 @@ public class MRMATax extends X_M_RMATax /** * Load Constructor. - * Set Precision and TaxIncluded for tax calculations! * @param ctx context * @param rs result set * @param trxName transaction @@ -268,7 +266,7 @@ public class MRMATax extends X_M_RMATax /** * Get Precision - * @return Returns the precision or 2 + * @return Returns set precision or 2 */ private int getPrecision () { @@ -297,8 +295,8 @@ public class MRMATax extends X_M_RMATax return m_tax; } // getTax - /************************************************************************** - * Calculate/Set Tax Amt from Order Lines + /** + * Calculate/Set Tax Amt from RMA Lines * @return true if calculated */ public boolean calculateTaxFromLines () @@ -367,6 +365,7 @@ public class MRMATax extends X_M_RMATax * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MRMATax[") diff --git a/org.adempiere.base/src/org/compiere/model/MRecentItem.java b/org.adempiere.base/src/org/compiere/model/MRecentItem.java index f6a8529f86..eec3ae7421 100644 --- a/org.adempiere.base/src/org/compiere/model/MRecentItem.java +++ b/org.adempiere.base/src/org/compiere/model/MRecentItem.java @@ -42,7 +42,7 @@ import org.osgi.service.event.Event; public class MRecentItem extends X_AD_RecentItem implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 4298877865937943663L; @@ -57,16 +57,16 @@ public class MRecentItem extends X_AD_RecentItem implements ImmutablePOSupport private String m_label; /** - * UUID based Constructor - * @param ctx Context - * @param AD_RecentItem_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_RecentItem_UU UUID key + * @param trxName Transaction + */ public MRecentItem(Properties ctx, String AD_RecentItem_UU, String trxName) { super(ctx, AD_RecentItem_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param AD_RecentItem_ID id @@ -81,7 +81,7 @@ public class MRecentItem extends X_AD_RecentItem implements ImmutablePOSupport * Get the cache key AD_RecentItem_ID|Language * @param AD_RecentItem_ID * @param ctx - * @return + * @return cache key */ private static String getCacheKey(int AD_RecentItem_ID, Properties ctx) { return AD_RecentItem_ID + "|" + Env.getAD_Language(ctx); @@ -99,7 +99,7 @@ public class MRecentItem extends X_AD_RecentItem implements ImmutablePOSupport } // MRecentItem /** - * + * Copy constructor * @param copy */ public MRecentItem(MRecentItem copy) @@ -108,7 +108,7 @@ public class MRecentItem extends X_AD_RecentItem implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -118,7 +118,7 @@ public class MRecentItem extends X_AD_RecentItem implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -204,8 +204,8 @@ public class MRecentItem extends X_AD_RecentItem implements ImmutablePOSupport } // get /** - * addModifiedField / method to be called when first field is modified on a window - * it adds a record in recent item, or touches the record if it was added before + * addModifiedField / method to be called when a field is modified on a window.
        + * It adds a record in recent item, or touches the record if it was added before. * @param ctx * @param AD_Table_ID * @param Record_ID @@ -247,6 +247,8 @@ public class MRecentItem extends X_AD_RecentItem implements ImmutablePOSupport } /** + * Publish {@link #ON_RECENT_ITEM_CHANGED_TOPIC} message to message service.
        + * If message service is not available, fall back to {@link #postOnChangedEvent(int)}. * @param AD_User_ID */ public static void publishChangedEvent(int AD_User_ID) { @@ -260,6 +262,7 @@ public class MRecentItem extends X_AD_RecentItem implements ImmutablePOSupport } /** + * Post {@link #ON_RECENT_ITEM_CHANGED_TOPIC} OSGi event. * @param AD_User_ID */ public static void postOnChangedEvent(int AD_User_ID) { @@ -270,9 +273,9 @@ public class MRecentItem extends X_AD_RecentItem implements ImmutablePOSupport } /** - * touchUpdatedRecord / method to be called when a record is saved or updated in database - * it touches the record added before - * also delete recent items beyond the number of records allowed per user + * touchUpdatedRecord / method to be called when a record is saved or updated in database.
        + * It touches the record added before.
        + * Also delete recent items beyond the number of records allowed per user. * @param ctx * @param AD_Table_ID * @param Record_UU @@ -321,7 +324,7 @@ public class MRecentItem extends X_AD_RecentItem implements ImmutablePOSupport * Get the recent items from user - for performance obtain the ids and then get the MRecentItem from cache * @param ctx * @param AD_User_ID - * @return + * @return list of recent item record */ public static List getFromUser(Properties ctx, int AD_User_ID) { int[] ids = new Query(ctx, MRecentItem.Table_Name, "AD_User_ID=?", null) @@ -337,6 +340,10 @@ public class MRecentItem extends X_AD_RecentItem implements ImmutablePOSupport return ris; } + /** + * Build label for this item from window name and title logic. Fall back to record identifier if title logic is not available. + * @return label + */ public String getLabel() { if (m_label != null) { return m_label; @@ -389,7 +396,7 @@ public class MRecentItem extends X_AD_RecentItem implements ImmutablePOSupport } /** - * Clear the label (to display) in a recent item + * Clear the label (to display) cache in a recent item instance. * @param AD_Table_ID * @param Record_ID */ @@ -404,7 +411,7 @@ public class MRecentItem extends X_AD_RecentItem implements ImmutablePOSupport } /** - * Clear the label (to display) + * Clear the label (to display) cache */ private void clearLabel() { m_label = null; diff --git a/org.adempiere.base/src/org/compiere/model/MRecordAccess.java b/org.adempiere.base/src/org/compiere/model/MRecordAccess.java index 4a48f6667b..94188f42ba 100644 --- a/org.adempiere.base/src/org/compiere/model/MRecordAccess.java +++ b/org.adempiere.base/src/org/compiere/model/MRecordAccess.java @@ -33,22 +33,21 @@ import org.compiere.util.Msg; public class MRecordAccess extends X_AD_Record_Access { /** - * + * generated serial id */ private static final long serialVersionUID = -5115765616266528435L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Record_Access_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Record_Access_UU UUID key + * @param trxName Transaction + */ public MRecordAccess(Properties ctx, String AD_Record_Access_UU, String trxName) { super(ctx, AD_Record_Access_UU, trxName); } /** - * Persistency Constructor * @param ctx context * @param ignored ignored * @param trxName transaction @@ -139,8 +138,10 @@ public class MRecordAccess extends X_AD_Record_Access } // getKeyColumnName /** - * Get Synonym of Column - * @return Synonym Column Name + * Get predefined synonym of column.
        + * SalesRep_ID is synonym of AD_User_ID.
        + * Account_ID is synonym of C_ElementValue_ID. + * @return Synonym of Column Name or null */ public String getSynonym() { @@ -153,8 +154,9 @@ public class MRecordAccess extends X_AD_Record_Access } // getSynonym /** - * Key Column has a Synonym + * Key Column has a Synonym. * @return true if Key Column has Synonym + * @see #getSynonym() */ public boolean isSynonym() { @@ -163,7 +165,7 @@ public class MRecordAccess extends X_AD_Record_Access /** * Is Read Write - * @return rw - false if exclude + * @return false if exclude or readonly */ public boolean isReadWrite() { @@ -176,6 +178,7 @@ public class MRecordAccess extends X_AD_Record_Access * Get Key Column Name with consideration of Synonym * @param tableInfo * @return key column name + * @see #getSynonym() */ public String getKeyColumnName (AccessSqlParser.TableInfo[] tableInfo) { @@ -205,6 +208,7 @@ public class MRecordAccess extends X_AD_Record_Access * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder("MRecordAccess[AD_Role_ID=") diff --git a/org.adempiere.base/src/org/compiere/model/MRecurring.java b/org.adempiere.base/src/org/compiere/model/MRecurring.java index 61838d3b78..17bc6072ff 100644 --- a/org.adempiere.base/src/org/compiere/model/MRecurring.java +++ b/org.adempiere.base/src/org/compiere/model/MRecurring.java @@ -34,22 +34,27 @@ import org.compiere.util.Util; public class MRecurring extends X_C_Recurring { /** - * + * generated serial id */ private static final long serialVersionUID = 6053691462050896981L; /** - * UUID based Constructor - * @param ctx Context - * @param C_Recurring_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Recurring_UU UUID key + * @param trxName Transaction + */ public MRecurring(Properties ctx, String C_Recurring_UU, String trxName) { super(ctx, C_Recurring_UU, trxName); if (Util.isEmpty(C_Recurring_UU)) setInitialDefaults(); } - + + /** + * @param ctx + * @param C_Recurring_ID + * @param trxName + */ public MRecurring (Properties ctx, int C_Recurring_ID, String trxName) { super (ctx, C_Recurring_ID, trxName); @@ -68,6 +73,11 @@ public class MRecurring extends X_C_Recurring setRunsRemaining (0); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MRecurring (Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); @@ -77,6 +87,7 @@ public class MRecurring extends X_C_Recurring * String representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder ("MRecurring[") @@ -93,11 +104,10 @@ public class MRecurring extends X_C_Recurring sb.append("]"); return sb.toString(); } // toString - - /************************************************************************** - * Execute Run. - * @return clear text info + /** + * Execute Recurring Run. + * @return clear text execution message */ public String executeRun() { @@ -109,7 +119,6 @@ public class MRecurring extends X_C_Recurring MRecurringRun run = new MRecurringRun (getCtx(), this); String msg = "@Created@ "; - // Copy if (getRecurringType().equals(MRecurring.RECURRINGTYPE_Order)) { @@ -177,7 +186,7 @@ public class MRecurring extends X_C_Recurring /** * Calculate & set remaining Runs - * @return true if runs left + * @return true if there are remaining runs left */ private boolean calculateRuns() { @@ -190,7 +199,7 @@ public class MRecurring extends X_C_Recurring } // calculateRuns /** - * Calculate next run date + * Calculate and set next run date */ private void setDateNextRun() { @@ -217,6 +226,7 @@ public class MRecurring extends X_C_Recurring * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { String rt = getRecurringType(); @@ -255,10 +265,16 @@ public class MRecurring extends X_C_Recurring /* The last PO generated by a recent execute Run */ private volatile PO lastPO; + /** + * @return last PO generated by recent {@link #executeRun()} + */ public PO getLastPO() { return lastPO; } + /** + * @param lastPO + */ public void setLastPO(PO lastPO) { this.lastPO = lastPO; } diff --git a/org.adempiere.base/src/org/compiere/model/MRecurringRun.java b/org.adempiere.base/src/org/compiere/model/MRecurringRun.java index 23c6d30dc7..f515e7038c 100644 --- a/org.adempiere.base/src/org/compiere/model/MRecurringRun.java +++ b/org.adempiere.base/src/org/compiere/model/MRecurringRun.java @@ -27,27 +27,35 @@ import java.util.Properties; */ public class MRecurringRun extends X_C_Recurring_Run { - /** - * + * generated by serial id */ private static final long serialVersionUID = 5247737541955962981L; /** - * UUID based Constructor - * @param ctx Context - * @param C_Recurring_Run_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Recurring_Run_UU UUID key + * @param trxName Transaction + */ public MRecurringRun(Properties ctx, String C_Recurring_Run_UU, String trxName) { super(ctx, C_Recurring_Run_UU, trxName); } - + + /** + * @param ctx + * @param C_Recurring_Run_ID + * @param trxName + */ public MRecurringRun (Properties ctx, int C_Recurring_Run_ID, String trxName) { super (ctx, C_Recurring_Run_ID, trxName); } // MRecurringRun + /** + * @param ctx + * @param recurring + */ public MRecurringRun (Properties ctx, MRecurring recurring) { super(ctx, 0, recurring.get_TrxName()); @@ -60,6 +68,11 @@ public class MRecurringRun extends X_C_Recurring_Run } } // MRecurringRun + /** + * @param ctx + * @param rs + * @param trxName + */ public MRecurringRun (Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); diff --git a/org.adempiere.base/src/org/compiere/model/MRefList.java b/org.adempiere.base/src/org/compiere/model/MRefList.java index 2143a2ab36..603dd5a51c 100644 --- a/org.adempiere.base/src/org/compiere/model/MRefList.java +++ b/org.adempiere.base/src/org/compiere/model/MRefList.java @@ -32,7 +32,7 @@ import org.idempiere.cache.ImmutablePOCache; import org.idempiere.cache.ImmutablePOSupport; /** - * Reference List Value + * List Values for {@link X_AD_Reference#VALIDATIONTYPE_ListValidation} * * @author Jorg Janke * @version $Id: MRefList.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $ @@ -44,7 +44,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MRefList extends X_AD_Ref_List implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -2704284822855131148L; /** RefList Value Cache */ @@ -79,7 +79,7 @@ public class MRefList extends X_AD_Ref_List implements ImmutablePOSupport } // get /** - * + * Copy constructor * @param ctx * @param copy */ @@ -89,7 +89,7 @@ public class MRefList extends X_AD_Ref_List implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -114,11 +114,11 @@ public class MRefList extends X_AD_Ref_List implements ImmutablePOSupport } /** - * Get Reference List Value Name (cached) + * Get Reference List Name for Value (cached) * @param AD_Language * @param AD_Reference_ID reference - * @param Value value - * @return List or "" + * @param Value list value + * @return List Name or "" */ public static String getListName (String AD_Language, int AD_Reference_ID, String Value) { @@ -167,14 +167,13 @@ public class MRefList extends X_AD_Ref_List implements ImmutablePOSupport // return retValue; } // getListName - - + /** - * Get Reference List Value Description (cached) + * Get Reference List Description (cached) for Value * @param ctx context - * @param ListName reference - * @param Value value - * @return List or null + * @param ListName list name + * @param Value list value + * @return List Description or null */ public static String getListDescription (Properties ctx, String ListName, String Value) { @@ -183,11 +182,11 @@ public class MRefList extends X_AD_Ref_List implements ImmutablePOSupport } /** - * Get Reference List Value Description (cached) + * Get Reference List Description (cached) for Value * @param AD_Language - * @param ListName reference - * @param Value value - * @return List or null + * @param ListName list name + * @param Value list value + * @return List Description or null */ public static String getListDescription (String AD_Language, String ListName, String Value) { @@ -241,11 +240,11 @@ public class MRefList extends X_AD_Ref_List implements ImmutablePOSupport } // getListDescription /** - * Get Reference List (translated) + * Get Reference List (translated name) entries * @param ctx context * @param AD_Reference_ID reference - * @param optional if true add "","" - * @return List or null + * @param optional if true add ValueNamePair("","") to list entries return + * @return Array of ValueNamePair(list value, translated list name) or null */ public static ValueNamePair[] getList (Properties ctx, int AD_Reference_ID, boolean optional) { @@ -253,25 +252,25 @@ public class MRefList extends X_AD_Ref_List implements ImmutablePOSupport } // getList /** - * Get Reference List (translated) + * Get Reference List (translated name) entries * @param ctx context * @param AD_Reference_ID reference - * @param optional if true add "","" - * @param orderBy N-Name, V-Value, D-Default (IsOrderByValue) - * @return List or null + * @param optional if true add ValueNamePair("","") to list entries return + * @param orderBy (Null,"" or N)-Name, V-Value, D-Default (IsOrderByValue) + * @return Array of ValueNamePair(list value, translated list name) or null */ public static ValueNamePair[] getList (Properties ctx, int AD_Reference_ID, boolean optional, String orderBy) { return getList(ctx, AD_Reference_ID, optional, "", orderBy); } /** - * Get Reference List (translated) + * Get Reference List (translated name) entries * @param ctx context * @param AD_Reference_ID reference - * @param optional if true add "","" + * @param optional if true add ValueNamePair("","") to list entries return * @param additionalWhereClause - * @param orderBy N-Name, V-Value, D-Default (IsOrderByValue) - * @return List or null + * @param orderBy (Null,"" or N)-Name, V-Value, D-Default (IsOrderByValue) + * @return Array of ValueNamePair(list value, translated list name) or null */ public static ValueNamePair[] getList (Properties ctx, int AD_Reference_ID, boolean optional, String additionalWhereClause, String orderBy) { @@ -323,21 +322,19 @@ public class MRefList extends X_AD_Ref_List implements ImmutablePOSupport /** Value Cache */ private static CCache s_cache = new CCache(Table_Name, 20); - /** - * UUID based Constructor - * @param ctx Context - * @param AD_Ref_List_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Ref_List_UU UUID key + * @param trxName Transaction + */ public MRefList(Properties ctx, String AD_Ref_List_UU, String trxName) { super(ctx, AD_Ref_List_UU, trxName); if (Util.isEmpty(AD_Ref_List_UU)) setInitialDefaults(); } - /************************************************************************** - * Persistency Constructor + /** * @param ctx context * @param AD_Ref_List_ID id * @param trxName transaction @@ -371,6 +368,7 @@ public class MRefList extends X_AD_Ref_List implements ImmutablePOSupport * String Representation * @return Name */ + @Override public String toString() { return getName(); diff --git a/org.adempiere.base/src/org/compiere/model/MRefTable.java b/org.adempiere.base/src/org/compiere/model/MRefTable.java index b32b2d8b8a..737ef6dda6 100644 --- a/org.adempiere.base/src/org/compiere/model/MRefTable.java +++ b/org.adempiere.base/src/org/compiere/model/MRefTable.java @@ -24,20 +24,22 @@ import org.compiere.util.Util; import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; - +/** + * Configuration for {@link X_AD_Reference#VALIDATIONTYPE_TableValidation} + */ public class MRefTable extends X_AD_Ref_Table implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 5068032076487795624L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Ref_Table_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Ref_Table_UU UUID key + * @param trxName Transaction + */ public MRefTable(Properties ctx, String AD_Ref_Table_UU, String trxName) { super(ctx, AD_Ref_Table_UU, trxName); if (Util.isEmpty(AD_Ref_Table_UU)) @@ -77,7 +79,7 @@ public class MRefTable extends X_AD_Ref_Table implements ImmutablePOSupport } // MRefTable /** - * + * Copy constructor * @param copy */ public MRefTable(MRefTable copy) @@ -86,7 +88,7 @@ public class MRefTable extends X_AD_Ref_Table implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -96,7 +98,7 @@ public class MRefTable extends X_AD_Ref_Table implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -117,7 +119,7 @@ public class MRefTable extends X_AD_Ref_Table implements ImmutablePOSupport private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 20); /** - * Get from Cache + * Get from Cache (immutable) * @param AD_Reference_ID id * @return category */ diff --git a/org.adempiere.base/src/org/compiere/model/MReference.java b/org.adempiere.base/src/org/compiere/model/MReference.java index 9061b8a6a7..5b13ad03bd 100644 --- a/org.adempiere.base/src/org/compiere/model/MReference.java +++ b/org.adempiere.base/src/org/compiere/model/MReference.java @@ -34,16 +34,16 @@ import org.idempiere.cache.ImmutablePOSupport; public class MReference extends X_AD_Reference implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -2722869411041069805L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Reference_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Reference_UU UUID key + * @param trxName Transaction + */ public MReference(Properties ctx, String AD_Reference_UU, String trxName) { super(ctx, AD_Reference_UU, trxName); if (Util.isEmpty(AD_Reference_UU)) @@ -80,7 +80,7 @@ public class MReference extends X_AD_Reference implements ImmutablePOSupport { } // MReference /** - * + * Copy constructor * @param copy */ public MReference(MReference copy) { @@ -88,7 +88,7 @@ public class MReference extends X_AD_Reference implements ImmutablePOSupport { } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -97,7 +97,7 @@ public class MReference extends X_AD_Reference implements ImmutablePOSupport { } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -111,7 +111,7 @@ public class MReference extends X_AD_Reference implements ImmutablePOSupport { private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 20); /** - * Get from Cache + * Get from Cache (immutable) * @param AD_Reference_ID id * @return category */ @@ -165,7 +165,7 @@ public class MReference extends X_AD_Reference implements ImmutablePOSupport { /** * Show inactive records - * @return + * @return true if this lookup reference should include inactive records */ public boolean isShowInactiveRecords() { return !Util.isEmpty(getShowInactive()) && MReference.SHOWINACTIVE_Yes.equalsIgnoreCase(getShowInactive()); diff --git a/org.adempiere.base/src/org/compiere/model/MRegion.java b/org.adempiere.base/src/org/compiere/model/MRegion.java index 30e32d512e..b619b804db 100644 --- a/org.adempiere.base/src/org/compiere/model/MRegion.java +++ b/org.adempiere.base/src/org/compiere/model/MRegion.java @@ -16,8 +16,6 @@ *****************************************************************************/ package org.compiere.model; -import static org.compiere.model.SystemIDs.COUNTRY_JAPAN; - import java.io.Serializable; import java.sql.ResultSet; import java.text.Collator; @@ -27,14 +25,13 @@ import java.util.List; import java.util.Properties; import java.util.logging.Level; -import org.compiere.Adempiere; import org.compiere.util.CLogger; import org.compiere.util.Env; import org.idempiere.cache.ImmutablePOCache; import org.idempiere.cache.ImmutablePOSupport; /** - * Location Region Model (Value Object) + * Location Region Model * * @author Jorg Janke * @version $Id: MRegion.java,v 1.3 2006/07/30 00:58:36 jjanke Exp $ @@ -43,7 +40,7 @@ public class MRegion extends X_C_Region implements Comparator, Serializable, ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 6956706379305907673L; @@ -72,9 +69,9 @@ public class MRegion extends X_C_Region } // loadAllRegions /** - * Get Country (cached) + * Get Region (cached) * @param C_Region_ID ID - * @return Country + * @return Region */ public static synchronized MRegion get (int C_Region_ID) { @@ -82,9 +79,9 @@ public class MRegion extends X_C_Region } /** - * Get Country (immutable, cached) + * Get Region (immutable, cached) * @param C_Region_ID ID - * @return Country + * @return Region */ public static synchronized MRegion get (Properties ctx, int C_Region_ID) { @@ -108,6 +105,7 @@ public class MRegion extends X_C_Region * @return Region or null * @deprecated */ + @Deprecated public static synchronized MRegion getDefault (Properties ctx) { return getDefault(); @@ -127,9 +125,10 @@ public class MRegion extends X_C_Region /** * Return Regions as Array * @param ctx ignore - * @return MCountry Array + * @return Region Array * @deprecated */ + @Deprecated public static synchronized MRegion[] getRegions(Properties ctx) { return getRegions(); @@ -137,7 +136,7 @@ public class MRegion extends X_C_Region /** * Return Regions as Array - * @return MCountry Array + * @return Region Array */ public static synchronized MRegion[] getRegions() { @@ -149,19 +148,20 @@ public class MRegion extends X_C_Region } // getRegions /** - * Return Array of Regions of Country + * Return Array of Regions of a Country * @param ctx ignore * @param C_Country_ID country * @return MRegion Array * @deprecated */ + @Deprecated public static synchronized MRegion[] getRegions (Properties ctx, int C_Country_ID) { return getRegions(C_Country_ID); } /** - * Return Array of Regions of Country + * Return Array of Regions of a Country * @param C_Country_ID country * @return MRegion Array */ @@ -181,20 +181,18 @@ public class MRegion extends X_C_Region private static MRegion s_default = null; /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MRegion.class); - /** - * UUID based Constructor - * @param ctx Context - * @param C_Region_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Region_UU UUID key + * @param trxName Transaction + */ public MRegion(Properties ctx, String C_Region_UU, String trxName) { super(ctx, C_Region_UU, trxName); } - /************************************************************************** - * Create empty Region + /** * @param ctx context * @param C_Region_ID id * @param trxName transaction @@ -228,7 +226,7 @@ public class MRegion extends X_C_Region } // MRegion /** - * + * Copy constructor * @param copy */ public MRegion(MRegion copy) @@ -237,7 +235,7 @@ public class MRegion extends X_C_Region } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -247,7 +245,7 @@ public class MRegion extends X_C_Region } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -259,17 +257,17 @@ public class MRegion extends X_C_Region } /** - * Return Name - * @return Name + * @return translated Name */ + @Override public String toString() { return getTrlName(); } // toString /** - * Get Translated Name - * @return name + * Get Translated Name + * @return translated name */ public String getTrlName() { @@ -277,9 +275,9 @@ public class MRegion extends X_C_Region } // getTrlName /** - * Get Translated Name + * Get Translated Name * @param language - * @return name + * @return translated name */ public String getTrlName(String language) { @@ -290,8 +288,9 @@ public class MRegion extends X_C_Region * Compare * @param o1 object 1 * @param o2 object 2 - * @return -1,0, 1 + * @return -1, 0, 1 */ + @Override public int compare(Object o1, Object o2) { String s1 = o1.toString(); @@ -313,200 +312,4 @@ public class MRegion extends X_C_Region return this; } - /** - * Test / Load - * @param args - */ - public static void main (String[] args) - { - Adempiere.startup(true); - /** To add your regions, complete the code below. - * Please make sure that the file is converted via the Java utility - * native2ascii - i.e. all seven bit code with /u0000 unicode stuff - */ - int C_Country_ID = COUNTRY_JAPAN; // Japan - MCountry country = new MCountry(Env.getCtx(), C_Country_ID, null); - // Hokkaido - MRegion temp = new MRegion (country, "\u5317\u6d77\u9053"); - temp.setDescription( "\u5317\u6d77\u9053(Hokkaido)" ); - temp.saveEx(); - // Aomori - temp = new MRegion (country, "\u9752\u68ee\u770c"); - temp.setDescription( "\u9752\u68ee\u770c(Aomori)" ); - temp.saveEx(); - // Iwate - temp = new MRegion (country, "\u5ca9\u624b\u770c"); - temp.setDescription( "\u5ca9\u624b\u770c(Iwate)" ); - temp.saveEx(); - // Miyagi - temp = new MRegion (country, "\u5bae\u57ce\u770c"); - temp.setDescription( "\u5bae\u57ce\u770c(Miyagi)" ); - temp.saveEx(); - // Akita - temp = new MRegion (country, "\u79cb\u7530\u770c"); - temp.setDescription( "\u79cb\u7530\u770c(Akita)" ); - temp.saveEx(); - // Yamagata - temp = new MRegion (country, "\u5c71\u5f62\u770c"); - temp.setDescription( "\u5c71\u5f62\u770c(Yamagata)" ); - temp.saveEx(); - // Fukushima - temp = new MRegion (country, "\u798f\u5cf6\u770c"); - temp.setDescription( "\u798f\u5cf6\u770c(Fukushima)" ); - temp.saveEx(); - // Ibaraki - temp = new MRegion (country, "\u8328\u57ce\u770c"); - temp.setDescription( "\u8328\u57ce\u770c(Ibaraki)" ); - temp.saveEx(); - // Gunma - temp = new MRegion (country, "\u7fa4\u99ac\u770c"); - temp.setDescription( "\u7fa4\u99ac\u770c(Gunma)" ); - temp.saveEx(); - // Saitama - temp = new MRegion (country, "\u57fc\u7389\u770c"); - temp.setDescription( "\u57fc\u7389\u770c(Saitama)" ); - temp.saveEx(); - // Chiba - temp = new MRegion (country, "\u5343\u8449\u770c"); - temp.setDescription( "\u5343\u8449\u770c(Chiba)" ); - temp.saveEx(); - // Tokyo - temp = new MRegion (country, "\u6771\u4eac\u90fd"); - temp.setDescription( "\u6771\u4eac\u90fd(Tokyo)" ); - temp.saveEx(); - // Kanagawa - temp = new MRegion (country, "\u795e\u5948\u5ddd\u770c"); - temp.setDescription( "\u795e\u5948\u5ddd\u770c(Kanagawa)" ); - temp.saveEx(); - // Niigata - temp = new MRegion (country, "\u65b0\u6f5f\u770c"); - temp.setDescription( "\u65b0\u6f5f\u770c(Niigata)" ); - temp.saveEx(); - // Toyama - temp = new MRegion (country, "\u5bcc\u5c71\u770c"); - temp.setDescription( "\u5bcc\u5c71\u770c(Toyama)" ); - temp.saveEx(); - // Ishikawa - temp = new MRegion (country, "\u77f3\u5ddd\u770c"); - temp.setDescription( "\u77f3\u5ddd\u770c(Ishikawa)" ); - temp.saveEx(); - // Fukui - temp = new MRegion (country, "\u798f\u4e95\u770c"); - temp.setDescription( "\u798f\u4e95\u770c(Fukui)" ); - temp.saveEx(); - // Yamanashi - temp = new MRegion (country, "\u5c71\u68a8\u770c"); - temp.setDescription( "\u5c71\u68a8\u770c(Yamanashi)" ); - temp.saveEx(); - // Gifu - temp = new MRegion (country, "\u5c90\u961c\u770c"); - temp.setDescription( "\u5c90\u961c\u770c(Gifu)" ); - temp.saveEx(); - // Shizuoka - temp = new MRegion (country, "\u9759\u5ca1\u770c"); - temp.setDescription( "\u9759\u5ca1\u770c(Shizuoka)" ); - temp.saveEx(); - // Aichi - temp = new MRegion (country, "\u611b\u77e5\u770c"); - temp.setDescription( "\u611b\u77e5\u770c(Aichi)" ); - temp.saveEx(); - // Mie - temp = new MRegion (country, "\u4e09\u91cd\u770c"); - temp.setDescription( "\u4e09\u91cd\u770c(Mie)" ); - temp.saveEx(); - // Siga - temp = new MRegion (country, "\u6ecb\u8cc0\u770c"); - temp.setDescription( "\u6ecb\u8cc0\u770c(Siga)" ); - temp.saveEx(); - // Kyoto - temp = new MRegion (country, "\u4eac\u90fd\u5e9c"); - temp.setDescription( "\u4eac\u90fd\u5e9c(Kyoto)" ); - temp.saveEx(); - // Osaka - temp = new MRegion (country, "\u5927\u962a\u5e9c"); - temp.setDescription( "\u5927\u962a\u5e9c(Osaka)" ); - temp.saveEx(); - // Hyogo - temp = new MRegion (country, "\u5175\u5eab\u770c"); - temp.setDescription( "\u5175\u5eab\u770c(Hyogo)" ); - temp.saveEx(); - // Nara - temp = new MRegion (country, "\u5948\u826f\u770c"); - temp.setDescription( "\u5948\u826f\u770c(Nara)" ); - temp.saveEx(); - // Wakayama - temp = new MRegion (country, "\u548c\u6b4c\u5c71\u770c"); - temp.setDescription( "\u548c\u6b4c\u5c71\u770c(Wakayama)" ); - temp.saveEx(); - // Tottori - temp = new MRegion (country, "\u9ce5\u53d6\u770c"); - temp.setDescription( "\u9ce5\u53d6\u770c(Tottori)" ); - temp.saveEx(); - // Shimane - temp = new MRegion (country, "\u5cf6\u6839\u770c"); - temp.setDescription( "\u5cf6\u6839\u770c(Shimane)" ); - temp.saveEx(); - // Okayama - temp = new MRegion (country, "\u5ca1\u5c71\u770c"); - temp.setDescription( "\u5ca1\u5c71\u770c(Okayama)" ); - temp.saveEx(); - // Hiroshima - temp = new MRegion (country, "\u5e83\u5cf6\u770c"); - temp.setDescription( "\u5e83\u5cf6\u770c(Hiroshima)" ); - temp.saveEx(); - // Yamaguchi - temp = new MRegion (country, "\u5c71\u53e3\u770c"); - temp.setDescription( "\u5c71\u53e3\u770c(Yamaguchi)" ); - temp.saveEx(); - // Tokushima - temp = new MRegion (country, "\u5fb3\u5cf6\u770c"); - temp.setDescription( "\u5fb3\u5cf6\u770c(Tokushima)" ); - temp.saveEx(); - // Kagawa - temp = new MRegion (country, "\u9999\u5ddd\u770c"); - temp.setDescription( "\u9999\u5ddd\u770c(Kagawa)" ); - temp.saveEx(); - // Ehime - temp = new MRegion (country, "\u611b\u5a9b\u770c"); - temp.setDescription( "\u611b\u5a9b\u770c(Ehime)" ); - temp.saveEx(); - // Kouchi - temp = new MRegion (country, "\u9ad8\u77e5\u770c"); - temp.setDescription( "\u9ad8\u77e5\u770c(Kouchi)" ); - temp.saveEx(); - // Fukuoka - temp = new MRegion (country, "\u798f\u5ca1\u770c"); - temp.setDescription( "\u798f\u5ca1\u770c(Fukuoka)" ); - temp.saveEx(); - // Saga - temp = new MRegion (country, "\u4f50\u8cc0\u770c"); - temp.setDescription( "\u4f50\u8cc0\u770c(Saga)" ); - temp.saveEx(); - // Nagasaki - temp = new MRegion (country, "\u9577\u5d0e\u770c"); - temp.setDescription( "\u9577\u5d0e\u770c(Nagasaki)" ); - temp.saveEx(); - // Kumamoto - temp = new MRegion (country, "\u718a\u672c\u770c"); - temp.setDescription( "\u718a\u672c\u770c(Kumamoto)" ); - temp.saveEx(); - // Ohita - temp = new MRegion (country, "\u5927\u5206\u770c"); - temp.setDescription( "\u5927\u5206\u770c(Ohita)" ); - temp.saveEx(); - // Miyasaki - temp = new MRegion (country, "\u5bae\u5d0e\u770c"); - temp.setDescription( "\u5bae\u5d0e\u770c(Miyasaki)" ); - temp.saveEx(); - // Kagoshima - temp = new MRegion (country, "\u9e7f\u5150\u5cf6\u770c"); - temp.setDescription( "\u9e7f\u5150\u5cf6\u770c(Kagoshima)" ); - temp.saveEx(); - // Okinawa - temp = new MRegion (country, "\u6c96\u7e04\u770c"); - temp.setDescription( "\u6c96\u7e04\u770c(Okinawa)" ); - temp.saveEx(); - - } // main - } // MRegion diff --git a/org.adempiere.base/src/org/compiere/model/MRegistration.java b/org.adempiere.base/src/org/compiere/model/MRegistration.java index d85a267a13..313de7f3ab 100644 --- a/org.adempiere.base/src/org/compiere/model/MRegistration.java +++ b/org.adempiere.base/src/org/compiere/model/MRegistration.java @@ -35,7 +35,9 @@ import org.compiere.util.WebUtil; * * @author Jorg Janke * @version $Id: MRegistration.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $ + * @deprecated not fully implemented */ +@Deprecated public class MRegistration extends X_A_Registration { /** diff --git a/org.adempiere.base/src/org/compiere/model/MRegistrationAttribute.java b/org.adempiere.base/src/org/compiere/model/MRegistrationAttribute.java index f87beff71d..41499021ca 100644 --- a/org.adempiere.base/src/org/compiere/model/MRegistrationAttribute.java +++ b/org.adempiere.base/src/org/compiere/model/MRegistrationAttribute.java @@ -33,7 +33,9 @@ import org.idempiere.cache.ImmutablePOSupport; * * @author Jorg Janke * @version $Id: MRegistrationAttribute.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $ + * @deprecated not fully implemented */ +@Deprecated public class MRegistrationAttribute extends X_A_RegistrationAttribute implements ImmutablePOSupport { /** diff --git a/org.adempiere.base/src/org/compiere/model/MRegistrationValue.java b/org.adempiere.base/src/org/compiere/model/MRegistrationValue.java index 7414bb43cf..79bbf893a0 100644 --- a/org.adempiere.base/src/org/compiere/model/MRegistrationValue.java +++ b/org.adempiere.base/src/org/compiere/model/MRegistrationValue.java @@ -24,7 +24,9 @@ import java.util.Properties; * * @author Jorg Janke * @version $Id: MRegistrationValue.java,v 1.2 2006/07/30 00:51:03 jjanke Exp $ + * @deprecated not fully implemented */ +@Deprecated public class MRegistrationValue extends X_A_RegistrationValue implements Comparable { diff --git a/org.adempiere.base/src/org/compiere/model/MReplenish.java b/org.adempiere.base/src/org/compiere/model/MReplenish.java index e761bc6a14..75561e8094 100644 --- a/org.adempiere.base/src/org/compiere/model/MReplenish.java +++ b/org.adempiere.base/src/org/compiere/model/MReplenish.java @@ -38,22 +38,21 @@ import java.util.Properties; import org.compiere.util.Env; /** - * + * Inventory Replenishment model * @author Daniel Tamm */ public class MReplenish extends X_M_Replenish { - /** - * + * generated serial id */ private static final long serialVersionUID = -76806183034687720L; /** - * UUID based Constructor - * @param ctx Context - * @param M_Replenish_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_Replenish_UU UUID key + * @param trxName Transaction + */ public MReplenish(Properties ctx, String M_Replenish_UU, String trxName) { super(ctx, M_Replenish_UU, trxName); } @@ -70,7 +69,7 @@ public class MReplenish extends X_M_Replenish { } /** - * Standard constructor to create a PO from a resultset. + * Standard constructor to create a PO from a result set. * * @param ctx * @param rs @@ -81,7 +80,7 @@ public class MReplenish extends X_M_Replenish { } /** - * + * Get active replenishment records for a product * @param ctx * @param M_ProductID * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MReplication.java b/org.adempiere.base/src/org/compiere/model/MReplication.java index 4373b7e615..0df35cb78e 100644 --- a/org.adempiere.base/src/org/compiere/model/MReplication.java +++ b/org.adempiere.base/src/org/compiere/model/MReplication.java @@ -29,39 +29,44 @@ import java.util.Properties; public class MReplication extends X_AD_Replication { /** - * + * geneated serial id */ private static final long serialVersionUID = -562186299848949607L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Replication_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Replication_UU UUID key + * @param trxName Transaction + */ public MReplication(Properties ctx, String AD_Replication_UU, String trxName) { super(ctx, AD_Replication_UU, trxName); } /** - * Load Constructor * @param ctx context * @param AD_Replication_ID id + * @param trxName */ public MReplication (Properties ctx, int AD_Replication_ID, String trxName) { super (ctx, AD_Replication_ID, trxName); } // MReplication + /** + * @param ctx + * @param rs + * @param trxName + */ public MReplication (Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } /** - * Public Access * @param DateLastRun date last run */ + @Override public void setDateLastRun (Timestamp DateLastRun) { super.setDateLastRun (DateLastRun); diff --git a/org.adempiere.base/src/org/compiere/model/MReplicationLog.java b/org.adempiere.base/src/org/compiere/model/MReplicationLog.java index 5e8022ce2c..d2419fe9c2 100644 --- a/org.adempiere.base/src/org/compiere/model/MReplicationLog.java +++ b/org.adempiere.base/src/org/compiere/model/MReplicationLog.java @@ -27,28 +27,28 @@ import java.util.Properties; */ public class MReplicationLog extends X_AD_Replication_Log { - /** - * + * generated serial id */ private static final long serialVersionUID = -8815834636981996509L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Replication_Log_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Replication_Log_UU UUID key + * @param trxName Transaction + */ public MReplicationLog(Properties ctx, String AD_Replication_Log_UU, String trxName) { super(ctx, AD_Replication_Log_UU, trxName); } /** - * Create new Log + * Create new Replication Log * @param ctx context * @param AD_Replication_Run_ID id * @param AD_ReplicationTable_ID id * @param P_Msg msg + * @param trxName */ public MReplicationLog(Properties ctx, int AD_Replication_Run_ID, int AD_ReplicationTable_ID, String P_Msg, String trxName) { @@ -59,6 +59,11 @@ public class MReplicationLog extends X_AD_Replication_Log setP_Msg(P_Msg); } // MReplicationLog + /** + * @param ctx + * @param rs + * @param trxName + */ public MReplicationLog(Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); diff --git a/org.adempiere.base/src/org/compiere/model/MReplicationRun.java b/org.adempiere.base/src/org/compiere/model/MReplicationRun.java index f38345ceb0..8463be5c90 100644 --- a/org.adempiere.base/src/org/compiere/model/MReplicationRun.java +++ b/org.adempiere.base/src/org/compiere/model/MReplicationRun.java @@ -29,25 +29,26 @@ import java.util.Properties; public class MReplicationRun extends X_AD_Replication_Run { /** - * + * generated serial id */ private static final long serialVersionUID = 7609847179225634980L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Replication_Run_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Replication_Run_UU UUID key + * @param trxName Transaction + */ public MReplicationRun(Properties ctx, String AD_Replication_Run_UU, String trxName) { super(ctx, AD_Replication_Run_UU, trxName); } /** - * Create new Run + * Create new Replication Run * @param ctx context * @param AD_Replication_ID id * @param dateRun date + * @param trxName */ public MReplicationRun (Properties ctx, int AD_Replication_ID, Timestamp dateRun, String trxName) { @@ -57,6 +58,11 @@ public class MReplicationRun extends X_AD_Replication_Run super.setIsReplicated (false); } // MReplicationRun + /** + * @param ctx + * @param rs + * @param trxName + */ public MReplicationRun (Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); @@ -66,6 +72,7 @@ public class MReplicationRun extends X_AD_Replication_Run * Set Replication Flag * @param IsReplicated replicated */ + @Override public void setIsReplicated (boolean IsReplicated) { super.setIsReplicated(IsReplicated); diff --git a/org.adempiere.base/src/org/compiere/model/MReplicationStrategy.java b/org.adempiere.base/src/org/compiere/model/MReplicationStrategy.java index 7f468db893..4b510567cd 100644 --- a/org.adempiere.base/src/org/compiere/model/MReplicationStrategy.java +++ b/org.adempiere.base/src/org/compiere/model/MReplicationStrategy.java @@ -34,26 +34,23 @@ import org.compiere.util.CLogger; *
      • http://jira.idempiere.com/browse/IDEMPIERE-218 */ public class MReplicationStrategy extends X_AD_ReplicationStrategy { - /** - * + * generated serial id */ private static final long serialVersionUID = 7231926756021012730L; public static final int REPLICATION_TABLE =0; public static final int REPLICATION_DOCUMENT =1; - - + /** Static Logger */ @SuppressWarnings("unused") private static CLogger s_log = CLogger.getCLogger (MReplicationStrategy.class); - /** - * UUID based Constructor - * @param ctx Context - * @param AD_ReplicationStrategy_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_ReplicationStrategy_UU UUID key + * @param trxName Transaction + */ public MReplicationStrategy(Properties ctx, String AD_ReplicationStrategy_UU, String trxName) { super(ctx, AD_ReplicationStrategy_UU, trxName); } @@ -68,12 +65,17 @@ public class MReplicationStrategy extends X_AD_ReplicationStrategy { super(ctx, AD_ReplicationStrategy_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MReplicationStrategy(Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } /** - * @return the list the X_AD_ReplicationTable + * @return the list of active X_AD_ReplicationTable record */ public List getReplicationTables() { final String whereClause = I_AD_ReplicationTable.COLUMNNAME_AD_ReplicationStrategy_ID+"=?"; // #1 @@ -86,7 +88,7 @@ public class MReplicationStrategy extends X_AD_ReplicationStrategy { } /** - * @return the list the X_AD_ReplicationDocument + * @return the list of active X_AD_ReplicationDocument record */ public List getReplicationDocuments() { final String whereClause = I_AD_ReplicationDocument.COLUMNNAME_AD_ReplicationStrategy_ID+"=?"; // #1 @@ -99,13 +101,15 @@ public class MReplicationStrategy extends X_AD_ReplicationStrategy { } /** - * + * Find X_AD_ReplicationTable record via replication strategy id and table id + * @param ctx + * @param AD_ReplicationStrategy_ID * @param AD_Table_ID - * @return X_AD_ReplicationTable table to replication + * @return X_AD_ReplicationTable record or null */ public static X_AD_ReplicationTable getReplicationTable(Properties ctx ,int AD_ReplicationStrategy_ID, int AD_Table_ID) { - final String whereClause = I_AD_ReplicationTable.COLUMNNAME_AD_ReplicationStrategy_ID + "=? AND " + final String whereClause = I_AD_ReplicationTable.COLUMNNAME_AD_ReplicationStrategy_ID + "=? AND " + I_AD_ReplicationTable.COLUMNNAME_AD_Table_ID + "=?"; return new Query(ctx, I_AD_ReplicationTable.Table_Name, whereClause, null) .setOnlyActiveRecords(true) @@ -116,9 +120,11 @@ public class MReplicationStrategy extends X_AD_ReplicationStrategy { } /** - * + * Find X_AD_ReplicationDocument record via replication strategy id and table id + * @param ctx + * @param AD_ReplicationStrategy_ID * @param AD_Table_ID - * @return X_AD_ReplicationDocument Document to replication + * @return X_AD_ReplicationDocument record or null */ public static X_AD_ReplicationDocument getReplicationDocument(Properties ctx ,int AD_ReplicationStrategy_ID , int AD_Table_ID) { @@ -133,9 +139,12 @@ public class MReplicationStrategy extends X_AD_ReplicationStrategy { } /** - * + * Find X_AD_ReplicationDocument record via replication strategy id, table id and document type id + * @param ctx + * @param AD_ReplicationStrategy_ID * @param AD_Table_ID - * @return X_AD_ReplicationDocument Document to replication + * @param C_DocType_ID + * @return X_AD_ReplicationDocument record or null */ public static X_AD_ReplicationDocument getReplicationDocument(Properties ctx ,int AD_ReplicationStrategy_ID , int AD_Table_ID, int C_DocType_ID) { diff --git a/org.adempiere.base/src/org/compiere/model/MReportCube.java b/org.adempiere.base/src/org/compiere/model/MReportCube.java index ffab08eb91..8c9f9fb5cc 100644 --- a/org.adempiere.base/src/org/compiere/model/MReportCube.java +++ b/org.adempiere.base/src/org/compiere/model/MReportCube.java @@ -29,32 +29,46 @@ import org.compiere.util.DB; import org.compiere.util.KeyNamePair; public class MReportCube extends X_PA_ReportCube { - /** - * + * generated serial id */ private static final long serialVersionUID = -4771117572936231607L; /** - * UUID based Constructor - * @param ctx Context - * @param PA_ReportCube_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param PA_ReportCube_UU UUID key + * @param trxName Transaction + */ public MReportCube(Properties ctx, String PA_ReportCube_UU, String trxName) { super(ctx, PA_ReportCube_UU, trxName); } + /** + * @param ctx + * @param PA_ReportCube_ID + * @param trxName + */ public MReportCube(Properties ctx, int PA_ReportCube_ID, String trxName) { super(ctx, PA_ReportCube_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MReportCube(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } - public String update(boolean reset, boolean force) { - + /** + * Update Fact_Acct_Summary base on this report cube configuration + * @param reset if false, will check whether update is needed since last update of Fact_Acct_Summary + * @param force if false, throw exception if can't lock this report cube record by changing Processing to Y + * @return info message + */ + public String update(boolean reset, boolean force) { String result = getName() + ": "; Timestamp ts = null; long start; @@ -75,7 +89,7 @@ public class MReportCube extends X_PA_ReportCube { "WHERE c.PA_ReportCube_ID = ? " + "AND fact.updated > c.LastRecalculated"; - log.log (Level.FINE, sql); + if (log.isLoggable(Level.FINE)) log.log (Level.FINE, sql); start = System.currentTimeMillis(); KeyNamePair[] changedPeriods = DB.getKeyNamePairs(sql, false, getPA_ReportCube_ID()); @@ -102,7 +116,6 @@ public class MReportCube extends X_PA_ReportCube { where += (" AND C_Period_ID IN " + periods); } - if ( !force ) { String lockSQL = "UPDATE PA_ReportCube SET Processing = 'Y' " + @@ -193,7 +206,6 @@ public class MReportCube extends X_PA_ReportCube { groups.append(", f." + dim); } - String sql = insert.append(select.toString()).append(from).append(groups.toString()).toString(); if (log.isLoggable(Level.FINE))log.log(Level.FINE, sql); Object[] params = new Object[] { getPA_ReportCube_ID(), getC_Calendar_ID(), getAD_Client_ID() }; @@ -206,7 +218,6 @@ public class MReportCube extends X_PA_ReportCube { if (log.isLoggable(Level.FINE))log.log(Level.FINE, insertResult); result += insertResult; - // set timestamp String tsSQL = "SELECT max(fas.Updated)" + " FROM Fact_Acct_Summary fas" + diff --git a/org.adempiere.base/src/org/compiere/model/MReportView.java b/org.adempiere.base/src/org/compiere/model/MReportView.java index 910598a0f3..a15b46e22b 100644 --- a/org.adempiere.base/src/org/compiere/model/MReportView.java +++ b/org.adempiere.base/src/org/compiere/model/MReportView.java @@ -24,34 +24,43 @@ import org.idempiere.cache.ImmutablePOSupport; public class MReportView extends X_AD_ReportView implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 6065574433744333005L; /** Cache */ static private ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 30, 60); - - + /** - * UUID based Constructor - * @param ctx Context - * @param AD_ReportView_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_ReportView_UU UUID key + * @param trxName Transaction + */ public MReportView(Properties ctx, String AD_ReportView_UU, String trxName) { super(ctx, AD_ReportView_UU, trxName); } + /** + * @param ctx + * @param AD_ReportView_ID + * @param trxName + */ public MReportView(Properties ctx, int AD_ReportView_ID, String trxName) { super(ctx, AD_ReportView_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MReportView(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } /** - * + * Copy constructor * @param copy */ public MReportView(MReportView copy) { @@ -59,7 +68,7 @@ public class MReportView extends X_AD_ReportView implements ImmutablePOSupport { } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -68,7 +77,7 @@ public class MReportView extends X_AD_ReportView implements ImmutablePOSupport { } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MRequest.java b/org.adempiere.base/src/org/compiere/model/MRequest.java index 587cb6d8f1..e10fd1a6a3 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequest.java +++ b/org.adempiere.base/src/org/compiere/model/MRequest.java @@ -40,14 +40,14 @@ import org.compiere.util.Util; public class MRequest extends X_R_Request { /** - * + * generated serial id */ private static final long serialVersionUID = -3807801381988066060L; /** * Get Request ID from mail text * @param mailText mail text - * @return ID if it contains request tag otherwise 0 + * @return R_Request_ID if mailText has request id tag ([Req#R_Request_ID#ID]), otherwise 0 */ public static int getR_Request_ID (String mailText) { @@ -81,21 +81,19 @@ public class MRequest extends X_R_Request /** Request Tag End */ private static final String TAG_END = "#ID]"; - - /** - * UUID based Constructor - * @param ctx Context - * @param R_Request_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param R_Request_UU UUID key + * @param trxName Transaction + */ public MRequest(Properties ctx, String R_Request_UU, String trxName) { super(ctx, R_Request_UU, trxName); if (Util.isEmpty(R_Request_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Constructor * @param ctx context * @param R_Request_ID request or 0 for new @@ -106,6 +104,12 @@ public class MRequest extends X_R_Request this (ctx, R_Request_ID, trxName, (String[]) null); } // MRequest + /** + * @param ctx + * @param R_Request_ID + * @param trxName + * @param virtualColumns + */ public MRequest(Properties ctx, int R_Request_ID, String trxName, String... virtualColumns) { super(ctx, R_Request_ID, trxName, virtualColumns); if (R_Request_ID == 0) @@ -180,8 +184,8 @@ public class MRequest extends X_R_Request public static final String SEPARATOR = "\n---------.----------.----------.----------.----------.----------\n"; - /************************************************************************** - * Set Default Request Type. + /** + * Find and Set Default Request Type. */ public void setR_RequestType_ID () { @@ -193,7 +197,7 @@ public class MRequest extends X_R_Request } // setR_RequestType_ID /** - * Set Default Request Status. + * Find and Set Default Request Status. */ public void setR_Status_ID () { @@ -210,7 +214,7 @@ public class MRequest extends X_R_Request /** * Add To Result - * @param Result + * @param Result text to append */ public void addToResult (String Result) { @@ -224,7 +228,7 @@ public class MRequest extends X_R_Request } // addToResult /** - * Set DueType based on Date Next Action + * Set DueType (DUETYPE_*) based on Date Next Action */ public void setDueType() { @@ -242,11 +246,10 @@ public class MRequest extends X_R_Request DueType = DUETYPE_Overdue; super.setDueType(DueType); } // setDueType - - /************************************************************************** + /** * Get Action History - * @return array of actions + * @return array of MRequestAction */ public MRequestAction[] getActions() { @@ -259,9 +262,9 @@ public class MRequest extends X_R_Request } // getActions /** - * Get Updates - * @param confidentialType maximum confidential type - null = all - * @return updates + * Get Request Updates that should be visible for the given confidentialType + * @param confidentialType confidential type (CONFIDENTIALTYPEENTRY_*) or null for all + * @return array of MRequestUpdate */ public MRequestUpdate[] getUpdates(String confidentialType) { @@ -342,11 +345,10 @@ public class MRequest extends X_R_Request } return m_requestType; } // getRequestType - /** - * Get Request Type Text (for jsp) - * @return Request Type Text + * Get Request Type Name + * @return Request Type Name */ public String getRequestTypeName() { @@ -359,7 +361,7 @@ public class MRequest extends X_R_Request /** * Get Request Category - * @return category + * @return MRequestCategory */ public MRequestCategory getCategory() { @@ -370,7 +372,7 @@ public class MRequest extends X_R_Request /** * Get Request Category Name - * @return name + * @return Request Category Name */ public String getCategoryName() { @@ -382,7 +384,7 @@ public class MRequest extends X_R_Request /** * Get Request Group - * @return group + * @return MGroup */ public MGroup getGroup() { @@ -393,7 +395,7 @@ public class MRequest extends X_R_Request /** * Get Request Group Name - * @return name + * @return Request Group Name */ public String getGroupName() { @@ -405,7 +407,7 @@ public class MRequest extends X_R_Request /** * Get Status - * @return status + * @return MStatus */ public MStatus getStatus() { @@ -416,7 +418,7 @@ public class MRequest extends X_R_Request /** * Get Request Status Name - * @return name + * @return Request Status Name */ public String getStatusName() { @@ -428,7 +430,7 @@ public class MRequest extends X_R_Request /** * Get Request Resolution - * @return resolution + * @return MResolution */ public MResolution getResolution() { @@ -439,7 +441,7 @@ public class MRequest extends X_R_Request /** * Get Request Resolution Name - * @return name + * @return Request Resolution Name */ public String getResolutionName() { @@ -468,8 +470,8 @@ public class MRequest extends X_R_Request } // isDue /** - * Get DueType Text (for jsp) - * @return text + * Get DueType Name + * @return DueType Name */ public String getDueTypeText() { @@ -477,8 +479,8 @@ public class MRequest extends X_R_Request } // getDueTypeText /** - * Get Priority Text (for jsp) - * @return text + * Get Priority Name + * @return Priority Name */ public String getPriorityText() { @@ -486,8 +488,8 @@ public class MRequest extends X_R_Request } // getPriorityText /** - * Get Importance Text (for jsp) - * @return text + * Get Importance Name + * @return Importance Name */ public String getPriorityUserText() { @@ -495,8 +497,8 @@ public class MRequest extends X_R_Request } // getPriorityUserText /** - * Get Confidential Text (for jsp) - * @return text + * Get Confidential Type Name + * @return Confidential Type Name */ public String getConfidentialText() { @@ -504,8 +506,8 @@ public class MRequest extends X_R_Request } // getConfidentialText /** - * Get Confidential Entry Text (for jsp) - * @return text + * Get Confidential Type Entry Name + * @return Confidential Type Entry Name */ public String getConfidentialEntryText() { @@ -533,7 +535,7 @@ public class MRequest extends X_R_Request /** * Get Sales Rep Name - * @return Sales Rep User + * @return Sales Rep Name */ public String getSalesRepName() { @@ -544,8 +546,8 @@ public class MRequest extends X_R_Request } // getSalesRepName /** - * Get Name of creator - * @return name + * Get Created By Name + * @return Created By Name */ public String getCreatedByName() { @@ -555,7 +557,7 @@ public class MRequest extends X_R_Request /** * Get Contact (may be not defined) - * @return Sales Rep User + * @return Contact User or null */ public MUser getUser() { @@ -570,7 +572,7 @@ public class MRequest extends X_R_Request /** * Get BPartner (may be not defined) - * @return Sales Rep User + * @return BPartner or null */ public MBPartner getBPartner() { @@ -601,7 +603,6 @@ public class MRequest extends X_R_Request return status.isWebCanUpdate(); } // isWebCanUpdate - /** * Set Priority */ @@ -643,6 +644,7 @@ public class MRequest extends X_R_Request * Set Confidential Type Entry * @param ConfidentialTypeEntry confidentiality */ + @Override public void setConfidentialTypeEntry (String ConfidentialTypeEntry) { if (ConfidentialTypeEntry == null) @@ -672,8 +674,8 @@ public class MRequest extends X_R_Request } // setConfidentialTypeEntry /** - * Web Update - * @param result result + * Web Update of result + * @param result result text * @return true if updated */ public boolean webUpdate (String result) @@ -691,6 +693,7 @@ public class MRequest extends X_R_Request * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MRequest["); @@ -700,7 +703,7 @@ public class MRequest extends X_R_Request /** * Create PDF - * @return pdf or null + * @return not implemented, always return null */ public File createPDF () { @@ -710,18 +713,19 @@ public class MRequest extends X_R_Request /** * Create PDF file * @param file output file - * @return file if success + * @return not implemented, always return null */ public File createPDF (File file) { return null; } // createPDF - /************************************************************************** + /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { // Request Type @@ -804,6 +808,7 @@ public class MRequest extends X_R_Request * Set SalesRep_ID * @param SalesRep_ID id */ + @Override public void setSalesRep_ID (int SalesRep_ID) { if (SalesRep_ID != 0) @@ -818,6 +823,7 @@ public class MRequest extends X_R_Request * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -863,7 +869,7 @@ public class MRequest extends X_R_Request /** * Get Mail Tag - * @return [Req@{id}@] + * @return [Req#@{id}@#ID] */ public String getMailTag() { @@ -872,7 +878,7 @@ public class MRequest extends X_R_Request /** * (Soft) Close request. - * Must be called after webUpdate + * Must be called after webUpdate. */ public void doClose() { @@ -898,7 +904,7 @@ public class MRequest extends X_R_Request /** * Escalate request - * @param user true if user escalated - otherwise system + * @param user true if user escalated (PriorityUser), otherwise system (Priority) */ public void doEscalate(boolean user) { @@ -932,11 +938,18 @@ public class MRequest extends X_R_Request } } // doEscalate + /** + * @return changed flag + */ public boolean isChanged() { return m_changed; } + /** + * Set changed flag + * @param changed + */ public void setIsChanged(boolean changed) { this.m_changed = changed; @@ -951,6 +964,7 @@ public class MRequest extends X_R_Request * @return int[], [0] = inactive request count and [1] = active request count * @deprecated - use {@link #getRequestCount(int, int, String, StringBuilder, String)} instead */ + @Deprecated public static int[] getRequestCount(int AD_Table_ID, int Record_ID, StringBuilder whereClause, String trxName) { return getRequestCount(AD_Table_ID, Record_ID, null, whereClause, trxName); } @@ -962,7 +976,7 @@ public class MRequest extends X_R_Request * @param Record_UU Record UUID * @param whereClause * @param trxName - * @return int[], [0] = inactive request count and [1] = active request count + * @return int[], [0] = inactive request count (Processed=Y) and [1] = active request count (Processed=N) */ public static int[] getRequestCount(int AD_Table_ID, int Record_ID, String Record_UU, StringBuilder whereClause, String trxName) { int[] counts = new int[] {0, 0}; @@ -1033,6 +1047,7 @@ public class MRequest extends X_R_Request * @param C_BPartner_ID * @deprecated - use {@link #newRequest(GridTab, int, int, String, int)} instead */ + @Deprecated public static void newRequest(GridTab tab, int AD_Table_ID, int Record_ID, int C_BPartner_ID) { newRequest(tab, AD_Table_ID, Record_ID, null, C_BPartner_ID); } diff --git a/org.adempiere.base/src/org/compiere/model/MRequestAction.java b/org.adempiere.base/src/org/compiere/model/MRequestAction.java index 8897aa84d9..7040294bf7 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequestAction.java +++ b/org.adempiere.base/src/org/compiere/model/MRequestAction.java @@ -30,25 +30,25 @@ import org.compiere.util.Msg; public class MRequestAction extends X_R_RequestAction { /** - * + * generated serial id */ private static final long serialVersionUID = 2902231219773596011L; /** - * UUID based Constructor - * @param ctx Context - * @param R_RequestAction_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param R_RequestAction_UU UUID key + * @param trxName Transaction + */ public MRequestAction(Properties ctx, String R_RequestAction_UU, String trxName) { super(ctx, R_RequestAction_UU, trxName); } /** - * Persistency Constructor * @param ctx context * @param R_RequestAction_ID id + * @param trxName */ public MRequestAction (Properties ctx, int R_RequestAction_ID, String trxName) { @@ -56,7 +56,7 @@ public class MRequestAction extends X_R_RequestAction } // MRequestAction /** - * Load Construtor + * Load Constructor * @param ctx context * @param rs result set */ @@ -93,7 +93,7 @@ public class MRequestAction extends X_R_RequestAction /** * Get Name of creator - * @return name + * @return created by name */ public String getCreatedByName() { @@ -103,7 +103,7 @@ public class MRequestAction extends X_R_RequestAction /** * Get Changes as HTML string - * @return changes + * @return changes HTML */ public String getChangesHTML() { @@ -153,7 +153,7 @@ public class MRequestAction extends X_R_RequestAction /** * Get individual Change HTML - * @param sb string to append to + * @param sb buffer to append change HTML to * @param columnName column name */ private void getChangeHTML (StringBuffer sb, String columnName) @@ -178,13 +178,13 @@ public class MRequestAction extends X_R_RequestAction } } } // getChangeHTML - - + /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { return true; diff --git a/org.adempiere.base/src/org/compiere/model/MRequestCategory.java b/org.adempiere.base/src/org/compiere/model/MRequestCategory.java index 3fc2d0acb6..9d5ba35895 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequestCategory.java +++ b/org.adempiere.base/src/org/compiere/model/MRequestCategory.java @@ -31,14 +31,14 @@ import org.idempiere.cache.ImmutablePOSupport; public class MRequestCategory extends X_R_Category implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 984010124643923205L; /** - * Get MCategory from Cache (immutable) + * Get MRequestCategory from Cache (immutable) * @param R_Category_ID id - * @return MCategory + * @return MRequestCategory */ public static MRequestCategory get (int R_Category_ID) { @@ -46,10 +46,10 @@ public class MRequestCategory extends X_R_Category implements ImmutablePOSupport } /** - * Get MCategory from Cache (immutable) + * Get MRequestCategory from Cache (immutable) * @param ctx context * @param R_Category_ID id - * @return MCategory + * @return MRequestCategory */ public static MRequestCategory get (Properties ctx, int R_Category_ID) { @@ -84,19 +84,18 @@ public class MRequestCategory extends X_R_Category implements ImmutablePOSupport /** Cache */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 20); - - + /** - * UUID based Constructor - * @param ctx Context - * @param R_Category_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param R_Category_UU UUID key + * @param trxName Transaction + */ public MRequestCategory(Properties ctx, String R_Category_UU, String trxName) { super(ctx, R_Category_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param R_Category_ID id @@ -119,7 +118,7 @@ public class MRequestCategory extends X_R_Category implements ImmutablePOSupport } // MCategory /** - * + * Copy constructor * @param copy */ public MRequestCategory(MRequestCategory copy) @@ -128,7 +127,7 @@ public class MRequestCategory extends X_R_Category implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -138,7 +137,7 @@ public class MRequestCategory extends X_R_Category implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MRequestProcessor.java b/org.adempiere.base/src/org/compiere/model/MRequestProcessor.java index 1ecbdacc16..29b842a4e6 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequestProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MRequestProcessor.java @@ -38,14 +38,14 @@ public class MRequestProcessor extends X_R_RequestProcessor implements AdempiereProcessor, AdempiereProcessor2 { /** - * + * generated serial id */ private static final long serialVersionUID = 8231854734466233461L; /** * Get Active Request Processors * @param ctx context - * @return array of Request + * @return array of MRequestProcessor */ public static MRequestProcessor[] getActive (Properties ctx) { @@ -78,20 +78,19 @@ public class MRequestProcessor extends X_R_RequestProcessor /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MRequestProcessor.class); - /** - * UUID based Constructor - * @param ctx Context - * @param R_RequestProcessor_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param R_RequestProcessor_UU UUID key + * @param trxName Transaction + */ public MRequestProcessor(Properties ctx, String R_RequestProcessor_UU, String trxName) { super(ctx, R_RequestProcessor_UU, trxName); if (Util.isEmpty(R_RequestProcessor_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param R_RequestProcessor_ID id @@ -138,12 +137,12 @@ public class MRequestProcessor extends X_R_RequestProcessor } // MRequestProcessor - /** The Lines */ + /** The Routes */ private MRequestProcessorRoute[] m_routes = null; /** * Get Routes - * @param reload reload data + * @param reload true to reload from DB * @return array of routes */ public MRequestProcessorRoute[] getRoutes (boolean reload) @@ -231,9 +230,9 @@ public class MRequestProcessor extends X_R_RequestProcessor } // deleteLog /** - * Get the date Next run - * @param requery requery database - * @return date next run + * Get next run date + * @param requery true to re-query database + * @return next run date */ public Timestamp getDateNextRun (boolean requery) { @@ -243,8 +242,8 @@ public class MRequestProcessor extends X_R_RequestProcessor } // getDateNextRun /** - * Get Unique ID - * @return Unique ID + * Get Unique Server ID + * @return Unique Server ID */ public String getServerID() { diff --git a/org.adempiere.base/src/org/compiere/model/MRequestProcessorLog.java b/org.adempiere.base/src/org/compiere/model/MRequestProcessorLog.java index 42dd158d21..85b054817c 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequestProcessorLog.java +++ b/org.adempiere.base/src/org/compiere/model/MRequestProcessorLog.java @@ -21,7 +21,6 @@ import java.util.Properties; import org.compiere.util.Util; - /** * Request Processor Log * @@ -32,16 +31,16 @@ public class MRequestProcessorLog extends X_R_RequestProcessorLog implements AdempiereProcessorLog { /** - * + * generated serial id */ private static final long serialVersionUID = 3295903266591998482L; /** - * UUID based Constructor - * @param ctx Context - * @param R_RequestProcessorLog_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param R_RequestProcessorLog_UU UUID key + * @param trxName Transaction + */ public MRequestProcessorLog(Properties ctx, String R_RequestProcessorLog_UU, String trxName) { super(ctx, R_RequestProcessorLog_UU, trxName); if (Util.isEmpty(R_RequestProcessorLog_UU)) @@ -52,6 +51,7 @@ public class MRequestProcessorLog extends X_R_RequestProcessorLog * Standard Constructor * @param ctx context * @param R_RequestProcessorLog_ID id + * @param trxName */ public MRequestProcessorLog (Properties ctx, int R_RequestProcessorLog_ID, String trxName) { @@ -71,6 +71,7 @@ public class MRequestProcessorLog extends X_R_RequestProcessorLog * Load Constructor * @param ctx context * @param rs result set + * @param trxName */ public MRequestProcessorLog (Properties ctx, ResultSet rs, String trxName) { @@ -89,6 +90,5 @@ public class MRequestProcessorLog extends X_R_RequestProcessorLog setR_RequestProcessor_ID(parent.getR_RequestProcessor_ID()); setSummary(summary); } // MRequestProcessorLog - } // MRequestProcessorLog diff --git a/org.adempiere.base/src/org/compiere/model/MRequestProcessorRoute.java b/org.adempiere.base/src/org/compiere/model/MRequestProcessorRoute.java index f13be69fec..0315ba5cec 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequestProcessorRoute.java +++ b/org.adempiere.base/src/org/compiere/model/MRequestProcessorRoute.java @@ -19,7 +19,6 @@ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; - /** * Request Processor Route * @@ -29,16 +28,16 @@ import java.util.Properties; public class MRequestProcessorRoute extends X_R_RequestProcessor_Route { /** - * + * generated serial id */ private static final long serialVersionUID = 8739358607059413339L; /** - * UUID based Constructor - * @param ctx Context - * @param R_RequestProcessor_Route_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param R_RequestProcessor_Route_UU UUID key + * @param trxName Transaction + */ public MRequestProcessorRoute(Properties ctx, String R_RequestProcessor_Route_UU, String trxName) { super(ctx, R_RequestProcessor_Route_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MRequestType.java b/org.adempiere.base/src/org/compiere/model/MRequestType.java index 699632ec5d..4024ec567c 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequestType.java +++ b/org.adempiere.base/src/org/compiere/model/MRequestType.java @@ -41,7 +41,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MRequestType extends X_R_RequestType implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -1772516764599702671L; @@ -118,22 +118,21 @@ public class MRequestType extends X_R_RequestType implements ImmutablePOSupport retValue = null; return retValue; - } // get - + } // getDefault /** - * UUID based Constructor - * @param ctx Context - * @param R_RequestType_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param R_RequestType_UU UUID key + * @param trxName Transaction + */ public MRequestType(Properties ctx, String R_RequestType_UU, String trxName) { super(ctx, R_RequestType_UU, trxName); if (Util.isEmpty(R_RequestType_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param R_RequestType_ID id @@ -175,7 +174,7 @@ public class MRequestType extends X_R_RequestType implements ImmutablePOSupport } // MRequestType /** - * + * Copy constructor * @param copy */ public MRequestType(MRequestType copy) @@ -184,7 +183,7 @@ public class MRequestType extends X_R_RequestType implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -194,7 +193,7 @@ public class MRequestType extends X_R_RequestType implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -205,7 +204,7 @@ public class MRequestType extends X_R_RequestType implements ImmutablePOSupport copyPO(copy); } - /** Next time stats to be created */ + /** Next time stats to be updated */ private long m_nextStats = 0; private int m_openNo = 0; @@ -264,8 +263,8 @@ public class MRequestType extends X_R_RequestType implements ImmutablePOSupport } // updateStatistics /** - * Get Total No of requests of type - * @return no + * Get total No of requests of type + * @return total No of requests */ public synchronized int getTotalNo() { @@ -274,8 +273,8 @@ public class MRequestType extends X_R_RequestType implements ImmutablePOSupport } /** - * Get Open No of requests of type - * @return no + * Get no of open requests of type + * @return no of open requests */ public synchronized int getOpenNo() { @@ -284,8 +283,8 @@ public class MRequestType extends X_R_RequestType implements ImmutablePOSupport } /** - * Get Closed in last 30 days of type - * @return no + * Get closed in last 30 days of type + * @return no of request closed in last 30 days */ public synchronized int getClosed30No() { @@ -294,8 +293,8 @@ public class MRequestType extends X_R_RequestType implements ImmutablePOSupport } /** - * Get New in the last 30 days of type - * @return no + * Get new request in last 30 days of type + * @return no of new request in last 30 days */ public synchronized int getNew30No() { @@ -348,7 +347,7 @@ public class MRequestType extends X_R_RequestType implements ImmutablePOSupport } // getRequests /** - * Get public Requests of Type + * Get public requests of Type * @return array of requests */ public MRequest[] getRequests () @@ -358,7 +357,7 @@ public class MRequestType extends X_R_RequestType implements ImmutablePOSupport /** * Get Default R_Status_ID for Type - * @return status or 0 + * @return R_Status_ID or 0 */ public int getDefaultR_Status_ID() { @@ -383,6 +382,7 @@ public class MRequestType extends X_R_RequestType implements ImmutablePOSupport * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getR_StatusCategory_ID() == 0) @@ -398,6 +398,7 @@ public class MRequestType extends X_R_RequestType implements ImmutablePOSupport * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MRequestType["); diff --git a/org.adempiere.base/src/org/compiere/model/MRequestUpdate.java b/org.adempiere.base/src/org/compiere/model/MRequestUpdate.java index 39b14be91b..d5657a9592 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequestUpdate.java +++ b/org.adempiere.base/src/org/compiere/model/MRequestUpdate.java @@ -31,16 +31,16 @@ import java.util.Properties; public class MRequestUpdate extends X_R_RequestUpdate { /** - * + * generated serial id */ private static final long serialVersionUID = -8862921042436867124L; /** - * UUID based Constructor - * @param ctx Context - * @param R_RequestUpdate_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param R_RequestUpdate_UU UUID key + * @param trxName Transaction + */ public MRequestUpdate(Properties ctx, String R_RequestUpdate_UU, String trxName) { super(ctx, R_RequestUpdate_UU, trxName); } @@ -101,7 +101,7 @@ public class MRequestUpdate extends X_R_RequestUpdate /** * Get Name of creator - * @return name + * @return created by name */ public String getCreatedByName() { @@ -110,8 +110,8 @@ public class MRequestUpdate extends X_R_RequestUpdate } // getCreatedByName /** - * Get Confidential Entry Text (for jsp) - * @return text + * Get Confidential Entry Name + * @return Confidential Entry Name */ public String getConfidentialEntryText() { @@ -123,6 +123,7 @@ public class MRequestUpdate extends X_R_RequestUpdate * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getConfidentialTypeEntry() == null) diff --git a/org.adempiere.base/src/org/compiere/model/MRequisition.java b/org.adempiere.base/src/org/compiere/model/MRequisition.java index e7eb0c8e65..5a18c3c235 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequisition.java +++ b/org.adempiere.base/src/org/compiere/model/MRequisition.java @@ -51,16 +51,16 @@ import org.compiere.util.Util; public class MRequisition extends X_M_Requisition implements DocAction { /** - * + * generated serial id */ private static final long serialVersionUID = 898606565778668659L; /** - * UUID based Constructor - * @param ctx Context - * @param M_Requisition_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_Requisition_UU UUID key + * @param trxName Transaction + */ public MRequisition(Properties ctx, String M_Requisition_UU, String trxName) { super(ctx, M_Requisition_UU, trxName); if (Util.isEmpty(M_Requisition_UU)) @@ -108,8 +108,8 @@ public class MRequisition extends X_M_Requisition implements DocAction private MRequisitionLine[] m_lines = null; /** - * Get Lines - * @return array of lines + * Get Requisition Lines + * @return array of requisition lines */ public MRequisitionLine[] getLines() { @@ -118,13 +118,11 @@ public class MRequisition extends X_M_Requisition implements DocAction return m_lines; } - //red1 - FR: [ 2214883 ] Remove SQL code and Replace for Query final String whereClause = I_M_RequisitionLine.COLUMNNAME_M_Requisition_ID+"=?"; List list = new Query(getCtx(), I_M_RequisitionLine.Table_Name, whereClause, get_TrxName()) .setParameters(get_ID()) .setOrderBy(I_M_RequisitionLine.COLUMNNAME_Line+","+I_M_RequisitionLine.COLUMNNAME_M_RequisitionLine_ID) .list(); - // red1 - end - m_lines = new MRequisitionLine[list.size ()]; list.toArray (m_lines); @@ -135,6 +133,7 @@ public class MRequisition extends X_M_Requisition implements DocAction * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MRequisition["); @@ -148,6 +147,7 @@ public class MRequisition extends X_M_Requisition implements DocAction * Get Document Info * @return document info */ + @Override public String getDocumentInfo() { return Msg.getElement(getCtx(), "M_Requisition_ID") + " " + getDocumentNo(); @@ -157,6 +157,7 @@ public class MRequisition extends X_M_Requisition implements DocAction * Create PDF * @return File or null */ + @Override public File createPDF () { try @@ -174,7 +175,7 @@ public class MRequisition extends X_M_Requisition implements DocAction /** * Create PDF file * @param file output file - * @return file if success + * @return not implemented, always return null */ public File createPDF (File file) { @@ -198,6 +199,7 @@ public class MRequisition extends X_M_Requisition implements DocAction * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (getM_PriceList_ID() == 0) @@ -213,11 +215,12 @@ public class MRequisition extends X_M_Requisition implements DocAction return true; } - /************************************************************************** + /** * Process document * @param processAction document action * @return true if performed */ + @Override public boolean processIt (String processAction) { m_processMsg = null; @@ -234,6 +237,7 @@ public class MRequisition extends X_M_Requisition implements DocAction * Unlock Document. * @return true if success */ + @Override public boolean unlockIt() { if (log.isLoggable(Level.INFO)) log.info("unlockIt - " + toString()); @@ -245,6 +249,7 @@ public class MRequisition extends X_M_Requisition implements DocAction * Invalidate Document * @return true if success */ + @Override public boolean invalidateIt() { if (log.isLoggable(Level.INFO)) log.info("invalidateIt - " + toString()); @@ -255,6 +260,7 @@ public class MRequisition extends X_M_Requisition implements DocAction * Prepare Document * @return new status (In Progress or Invalid) */ + @Override public String prepareIt() { if (log.isLoggable(Level.INFO)) log.info(toString()); @@ -312,6 +318,7 @@ public class MRequisition extends X_M_Requisition implements DocAction * Approve Document * @return true if success */ + @Override public boolean approveIt() { if (log.isLoggable(Level.INFO)) log.info("approveIt - " + toString()); @@ -323,6 +330,7 @@ public class MRequisition extends X_M_Requisition implements DocAction * Reject Approval * @return true if success */ + @Override public boolean rejectIt() { if (log.isLoggable(Level.INFO)) log.info("rejectIt - " + toString()); @@ -334,6 +342,7 @@ public class MRequisition extends X_M_Requisition implements DocAction * Complete Document * @return new status (Complete, In Progress, Invalid, Waiting ..) */ + @Override public String completeIt() { // Re-Check @@ -392,6 +401,7 @@ public class MRequisition extends X_M_Requisition implements DocAction * Same as Close. * @return true if success */ + @Override public boolean voidIt() { if (log.isLoggable(Level.INFO)) log.info("voidIt - " + toString()); @@ -416,6 +426,7 @@ public class MRequisition extends X_M_Requisition implements DocAction * Cancel not delivered Qunatities * @return true if success */ + @Override public boolean closeIt() { if (log.isLoggable(Level.INFO)) log.info("closeIt - " + toString()); @@ -467,8 +478,9 @@ public class MRequisition extends X_M_Requisition implements DocAction /** * Reverse Correction - * @return true if success + * @return not implemented, always return false */ + @Override public boolean reverseCorrectIt() { if (log.isLoggable(Level.INFO)) log.info("reverseCorrectIt - " + toString()); @@ -486,9 +498,10 @@ public class MRequisition extends X_M_Requisition implements DocAction } // reverseCorrectionIt /** - * Reverse Accrual - none - * @return true if success + * Reverse Accrual + * @return not implemented, always return false */ + @Override public boolean reverseAccrualIt() { if (log.isLoggable(Level.INFO)) log.info("reverseAccrualIt - " + toString()); @@ -509,6 +522,7 @@ public class MRequisition extends X_M_Requisition implements DocAction * Re-activate * @return true if success */ + @Override public boolean reActivateIt() { if (log.isLoggable(Level.INFO)) log.info("reActivateIt - " + toString()); @@ -517,7 +531,6 @@ public class MRequisition extends X_M_Requisition implements DocAction if (m_processMsg != null) return false; - // setProcessed(false); if (! reverseCorrectIt()) return false; @@ -529,10 +542,11 @@ public class MRequisition extends X_M_Requisition implements DocAction return true; } // reActivateIt - /************************************************************************* + /** * Get Summary * @return Summary of Document */ + @Override public String getSummary() { StringBuilder sb = new StringBuilder(); @@ -553,6 +567,7 @@ public class MRequisition extends X_M_Requisition implements DocAction * Get Process Message * @return clear text error message */ + @Override public String getProcessMsg() { return m_processMsg; @@ -562,6 +577,7 @@ public class MRequisition extends X_M_Requisition implements DocAction * Get Document Owner * @return AD_User_ID */ + @Override public int getDoc_User_ID() { return getAD_User_ID(); @@ -571,6 +587,7 @@ public class MRequisition extends X_M_Requisition implements DocAction * Get Document Currency * @return C_Currency_ID */ + @Override public int getC_Currency_ID() { MPriceList pl = MPriceList.get(getCtx(), getM_PriceList_ID(), get_TrxName()); @@ -581,6 +598,7 @@ public class MRequisition extends X_M_Requisition implements DocAction * Get Document Approval Amount * @return amount */ + @Override public BigDecimal getApprovalAmt() { return getTotalLines(); @@ -596,7 +614,7 @@ public class MRequisition extends X_M_Requisition implements DocAction } // getUserName /** - * Document Status is Complete or Closed + * Document Status is Complete, Closed or Reverse * @return true if CO, CL or RE */ public boolean isComplete() diff --git a/org.adempiere.base/src/org/compiere/model/MRequisitionLine.java b/org.adempiere.base/src/org/compiere/model/MRequisitionLine.java index 06a9b8e264..7a073dfa77 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequisitionLine.java +++ b/org.adempiere.base/src/org/compiere/model/MRequisitionLine.java @@ -30,6 +30,7 @@ import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.Util; + /** * Requisition Line Model * @@ -46,14 +47,14 @@ import org.compiere.util.Util; public class MRequisitionLine extends X_M_RequisitionLine { /** - * + * generated serial id */ private static final long serialVersionUID = -2567343619431184322L; /** - * Get corresponding Requisition Line for given Order Line + * Get corresponding Requisition Line for given Order * @param ctx - * @param C_Order_ID order line + * @param C_Order_ID order * @param trxName * @return Requisition Line array */ @@ -69,7 +70,7 @@ public class MRequisitionLine extends X_M_RequisitionLine } /** - * UnLink Requisition Lines for given Order + * UnLink Requisition Lines from Order * @param ctx * @param C_Order_ID * @param trxName @@ -83,7 +84,6 @@ public class MRequisitionLine extends X_M_RequisitionLine } } - /** * Get corresponding Requisition Line(s) for given Order Line * @param ctx @@ -101,7 +101,7 @@ public class MRequisitionLine extends X_M_RequisitionLine } /** - * UnLink Requisition Lines for given Order Line + * UnLink Requisition Lines from Order Line * @param ctx * @param C_OrderLine_ID * @param trxName @@ -115,13 +115,12 @@ public class MRequisitionLine extends X_M_RequisitionLine } } - /** - * UUID based Constructor - * @param ctx Context - * @param M_RequisitionLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_RequisitionLine_UU UUID key + * @param trxName Transaction + */ public MRequisitionLine(Properties ctx, String M_RequisitionLine_UU, String trxName) { super(ctx, M_RequisitionLine_UU, trxName); if (Util.isEmpty(M_RequisitionLine_UU)) @@ -139,6 +138,12 @@ public class MRequisitionLine extends X_M_RequisitionLine this (ctx, M_RequisitionLine_ID, trxName, (String[]) null); } // MRequisitionLine + /** + * @param ctx + * @param M_RequisitionLine_ID + * @param trxName + * @param virtualColumns + */ public MRequisitionLine(Properties ctx, int M_RequisitionLine_ID, String trxName, String... virtualColumns) { super(ctx, M_RequisitionLine_ID, trxName, virtualColumns); if (M_RequisitionLine_ID == 0) @@ -269,13 +274,13 @@ public class MRequisitionLine extends X_M_RequisitionLine BigDecimal lineNetAmt = getQty().multiply(getPriceActual()); super.setLineNetAmt (lineNetAmt); } // setLineNetAmt - - - /************************************************************************** + + /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (newRecord && getParent().isProcessed()) { @@ -323,19 +328,20 @@ public class MRequisitionLine extends X_M_RequisitionLine * @param success save was success * @return true if saved */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) return success; return updateHeader(); } // afterSave - /** * After Delete * @param success * @return true/false */ + @Override protected boolean afterDelete (boolean success) { if (!success) @@ -350,7 +356,7 @@ public class MRequisitionLine extends X_M_RequisitionLine } /** - * Update Header + * Update Header (M_Requisition) * @return header updated */ private boolean updateHeader() diff --git a/org.adempiere.base/src/org/compiere/model/MResolution.java b/org.adempiere.base/src/org/compiere/model/MResolution.java index 7d2b8fedf4..c17c45d101 100644 --- a/org.adempiere.base/src/org/compiere/model/MResolution.java +++ b/org.adempiere.base/src/org/compiere/model/MResolution.java @@ -31,7 +31,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MResolution extends X_R_Resolution implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 7430644542278601152L; @@ -84,19 +84,17 @@ public class MResolution extends X_R_Resolution implements ImmutablePOSupport /** Cache */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 10); - - /** - * UUID based Constructor - * @param ctx Context - * @param R_Resolution_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param R_Resolution_UU UUID key + * @param trxName Transaction + */ public MResolution(Properties ctx, String R_Resolution_UU, String trxName) { super(ctx, R_Resolution_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param R_Resolution_ID id @@ -119,7 +117,7 @@ public class MResolution extends X_R_Resolution implements ImmutablePOSupport } // MResolution /** - * + * Copy constructor * @param copy */ public MResolution(MResolution copy) @@ -128,7 +126,7 @@ public class MResolution extends X_R_Resolution implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -138,7 +136,7 @@ public class MResolution extends X_R_Resolution implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MResource.java b/org.adempiere.base/src/org/compiere/model/MResource.java index 5f35f7599f..f26b80bb86 100644 --- a/org.adempiere.base/src/org/compiere/model/MResource.java +++ b/org.adempiere.base/src/org/compiere/model/MResource.java @@ -24,7 +24,6 @@ import org.compiere.util.Env; import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; - /** * Resource Model * @@ -40,7 +39,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MResource extends X_S_Resource implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -6893347336885257619L; /** Cache */ @@ -94,11 +93,11 @@ public class MResource extends X_S_Resource implements ImmutablePOSupport } /** - * UUID based Constructor - * @param ctx Context - * @param S_Resource_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param S_Resource_UU UUID key + * @param trxName Transaction + */ public MResource(Properties ctx, String S_Resource_UU, String trxName) { super(ctx, S_Resource_UU, trxName); } @@ -107,6 +106,7 @@ public class MResource extends X_S_Resource implements ImmutablePOSupport * Standard Constructor * @param ctx context * @param S_Resource_ID id + * @param trxName */ public MResource (Properties ctx, int S_Resource_ID, String trxName) { @@ -124,7 +124,7 @@ public class MResource extends X_S_Resource implements ImmutablePOSupport } // MResource /** - * + * Copy constructor * @param copy */ public MResource(MResource copy) @@ -133,7 +133,7 @@ public class MResource extends X_S_Resource implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -143,7 +143,7 @@ public class MResource extends X_S_Resource implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -160,8 +160,7 @@ public class MResource extends X_S_Resource implements ImmutablePOSupport private MResourceType m_resourceType = null; /** Cached Product */ private MProduct m_product = null; - - + /** * Get cached Resource Type * @return Resource Type @@ -196,6 +195,9 @@ public class MResource extends X_S_Resource implements ImmutablePOSupport return m_product; } // getProduct + /** + * @return product C_UOM_ID + */ public int getC_UOM_ID() { return getProduct().getC_UOM_ID(); diff --git a/org.adempiere.base/src/org/compiere/model/MResourceAssignment.java b/org.adempiere.base/src/org/compiere/model/MResourceAssignment.java index 4e84cfa3a8..100c0fa292 100644 --- a/org.adempiere.base/src/org/compiere/model/MResourceAssignment.java +++ b/org.adempiere.base/src/org/compiere/model/MResourceAssignment.java @@ -23,7 +23,6 @@ import java.util.Properties; import org.compiere.util.Env; import org.compiere.util.Util; - /** * Resource Assignment Model * @@ -33,16 +32,16 @@ import org.compiere.util.Util; public class MResourceAssignment extends X_S_ResourceAssignment { /** - * + * generated serial id */ private static final long serialVersionUID = 4230793339153210998L; /** - * UUID based Constructor - * @param ctx Context - * @param S_ResourceAssignment_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param S_ResourceAssignment_UU UUID key + * @param trxName Transaction + */ public MResourceAssignment(Properties ctx, String S_ResourceAssignment_UU, String trxName) { super(ctx, S_ResourceAssignment_UU, trxName); p_info.setUpdateable(true); // default table is not updateable @@ -51,9 +50,10 @@ public class MResourceAssignment extends X_S_ResourceAssignment } /** - * Stnadard Constructor + * Standard Constructor * @param ctx * @param S_ResourceAssignment_ID + * @param trxName */ public MResourceAssignment (Properties ctx, int S_ResourceAssignment_ID, String trxName) { @@ -75,7 +75,7 @@ public class MResourceAssignment extends X_S_ResourceAssignment } /** - * Load Contsructor + * Load Constructor * @param ctx context * @param rs result set */ @@ -89,6 +89,7 @@ public class MResourceAssignment extends X_S_ResourceAssignment * String Representation * @return string */ + @Override public String toString() { StringBuilder sb = new StringBuilder ("MResourceAssignment[ID="); @@ -105,6 +106,7 @@ public class MResourceAssignment extends X_S_ResourceAssignment * Before Delete * @return true if not confirmed */ + @Override protected boolean beforeDelete () { // allow to delete, when not confirmed diff --git a/org.adempiere.base/src/org/compiere/model/MResourceType.java b/org.adempiere.base/src/org/compiere/model/MResourceType.java index ddcca8a9c1..4ac0339869 100644 --- a/org.adempiere.base/src/org/compiere/model/MResourceType.java +++ b/org.adempiere.base/src/org/compiere/model/MResourceType.java @@ -30,7 +30,6 @@ import org.compiere.util.TimeUtil; import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; - /** * Resource Type Model * @@ -45,7 +44,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MResourceType extends X_S_ResourceType implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 1738229111191830237L; /** Cache */ @@ -100,11 +99,11 @@ public class MResourceType extends X_S_ResourceType implements ImmutablePOSuppor } /** - * UUID based Constructor - * @param ctx Context - * @param S_ResourceType_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param S_ResourceType_UU UUID key + * @param trxName Transaction + */ public MResourceType(Properties ctx, String S_ResourceType_UU, String trxName) { super(ctx, S_ResourceType_UU, trxName); } @@ -130,7 +129,7 @@ public class MResourceType extends X_S_ResourceType implements ImmutablePOSuppor } // MResourceType /** - * + * Copy constructor * @param copy */ public MResourceType(MResourceType copy) @@ -139,7 +138,7 @@ public class MResourceType extends X_S_ResourceType implements ImmutablePOSuppor } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -149,7 +148,7 @@ public class MResourceType extends X_S_ResourceType implements ImmutablePOSuppor } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -204,6 +203,10 @@ public class MResourceType extends X_S_ResourceType implements ImmutablePOSuppor return success; } // afterSave + /** + * @param date + * @return day start time stamp + */ public Timestamp getDayStart(Timestamp date) { if(isTimeSlot()) @@ -216,6 +219,10 @@ public class MResourceType extends X_S_ResourceType implements ImmutablePOSuppor } } + /** + * @param date + * @return day end time stamp + */ public Timestamp getDayEnd(Timestamp date) { if(isTimeSlot()) @@ -228,6 +235,9 @@ public class MResourceType extends X_S_ResourceType implements ImmutablePOSuppor } } + /** + * @return duration of a day in millisecond + */ public long getDayDurationMillis() { if (isTimeSlot()) @@ -241,18 +251,18 @@ public class MResourceType extends X_S_ResourceType implements ImmutablePOSuppor } /** - * Get how many hours/day a is available. - * Minutes, secords and millis are discarded. + * Get how many hours/day is available. + * Minutes, seconds and millisecond are discarded. * @return available hours */ public int getTimeSlotHours() { long hours; - if (isTimeSlot()) - hours = (getTimeSlotEnd().getTime() - getTimeSlotStart().getTime()) / (60 * 60 * 1000); - else - hours = 24; - return (int) hours; + if (isTimeSlot()) + hours = (getTimeSlotEnd().getTime() - getTimeSlotStart().getTime()) / (60 * 60 * 1000); + else + hours = 24; + return (int) hours; } /** @@ -286,6 +296,10 @@ public class MResourceType extends X_S_ResourceType implements ImmutablePOSuppor return availableDays; } + /** + * @param dateTime + * @return true if given day is available + */ public boolean isDayAvailable(Timestamp dateTime) { if (!isActive()) @@ -336,7 +350,7 @@ public class MResourceType extends X_S_ResourceType implements ImmutablePOSuppor /** * @return true if a resource of this type is generally available - * (i.e. active, at least 1 day available, at least 1 hour available) + * (active, at least 1 day available and at least 1 hour available) */ public boolean isAvailable() { diff --git a/org.adempiere.base/src/org/compiere/model/MResourceUnAvailable.java b/org.adempiere.base/src/org/compiere/model/MResourceUnAvailable.java index 895dd9b9e2..f95853d3cc 100644 --- a/org.adempiere.base/src/org/compiere/model/MResourceUnAvailable.java +++ b/org.adempiere.base/src/org/compiere/model/MResourceUnAvailable.java @@ -24,9 +24,8 @@ import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.TimeUtil; - /** - * Resource Unavailable + * Resource Unavailable Model * * @author Jorg Janke * @version $Id: MResourceUnAvailable.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $ @@ -36,7 +35,7 @@ import org.compiere.util.TimeUtil; public class MResourceUnAvailable extends X_S_ResourceUnAvailable { /** - * + * generated serial id */ private static final long serialVersionUID = 1087763356022282086L; @@ -59,11 +58,11 @@ public class MResourceUnAvailable extends X_S_ResourceUnAvailable } /** - * UUID based Constructor - * @param ctx Context - * @param S_ResourceUnAvailable_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param S_ResourceUnAvailable_UU UUID key + * @param trxName Transaction + */ public MResourceUnAvailable(Properties ctx, String S_ResourceUnAvailable_UU, String trxName) { super(ctx, S_ResourceUnAvailable_UU, trxName); } @@ -83,6 +82,7 @@ public class MResourceUnAvailable extends X_S_ResourceUnAvailable * MResourceUnAvailable * @param ctx context * @param rs result set + * @param trxName */ public MResourceUnAvailable (Properties ctx, ResultSet rs, String trxName) { @@ -102,11 +102,10 @@ public class MResourceUnAvailable extends X_S_ResourceUnAvailable return true; } // beforeSave - /** * Check if the resource is unavailable for date * @param dateTime - * @return true if valid + * @return true if not available */ public boolean isUnAvailable(Timestamp dateTime) { @@ -120,6 +119,5 @@ public class MResourceUnAvailable extends X_S_ResourceUnAvailable return false; return true; } - } // MResourceUnAvailable diff --git a/org.adempiere.base/src/org/compiere/model/MRevenueRecogService.java b/org.adempiere.base/src/org/compiere/model/MRevenueRecogService.java index c06b8533ce..3643a9c964 100644 --- a/org.adempiere.base/src/org/compiere/model/MRevenueRecogService.java +++ b/org.adempiere.base/src/org/compiere/model/MRevenueRecogService.java @@ -26,19 +26,17 @@ import java.util.Properties; */ public class MRevenueRecogService extends X_C_RevenueRecog_Service { - - /** - * + * generated serial id */ private static final long serialVersionUID = -3434480004031478264L; /** - * UUID based Constructor - * @param ctx Context - * @param C_RevenueRecog_Service_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_RevenueRecog_Service_UU UUID key + * @param trxName Transaction + */ public MRevenueRecogService(Properties ctx, String C_RevenueRecog_Service_UU, String trxName) { super(ctx, C_RevenueRecog_Service_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MRevenueRecognition.java b/org.adempiere.base/src/org/compiere/model/MRevenueRecognition.java index d18d1b8791..7f70543665 100644 --- a/org.adempiere.base/src/org/compiere/model/MRevenueRecognition.java +++ b/org.adempiere.base/src/org/compiere/model/MRevenueRecognition.java @@ -20,7 +20,6 @@ import java.sql.ResultSet; import java.util.List; import java.util.Properties; - /** * Revenue Recognition Model * @@ -29,18 +28,17 @@ import java.util.Properties; */ public class MRevenueRecognition extends X_C_RevenueRecognition { - /** - * + * generated serial id */ private static final long serialVersionUID = -8528224265258285903L; /** - * UUID based Constructor - * @param ctx Context - * @param C_RevenueRecognition_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_RevenueRecognition_UU UUID key + * @param trxName Transaction + */ public MRevenueRecognition(Properties ctx, String C_RevenueRecognition_UU, String trxName) { super(ctx, C_RevenueRecognition_UU, trxName); } @@ -65,6 +63,9 @@ public class MRevenueRecognition extends X_C_RevenueRecognition super(ctx, rs, trxName); } // MRevenueRecognition + /** + * @return list of active MRevenueRecogService + */ public List getServicesList() { if ( isTimeBased() ) @@ -78,6 +79,11 @@ public class MRevenueRecognition extends X_C_RevenueRecognition return query.list(); } + /** + * @param ctx + * @param trxName + * @return list of MRevenueRecognition record (include both active and inactive) + */ public static List getAll(Properties ctx, String trxName) { Query query = new Query(ctx,MRevenueRecognition.Table_Name, null, trxName); return query.list(); diff --git a/org.adempiere.base/src/org/compiere/model/MRevenueRecognitionPlan.java b/org.adempiere.base/src/org/compiere/model/MRevenueRecognitionPlan.java index e1e172fe46..f70ec3aad0 100644 --- a/org.adempiere.base/src/org/compiere/model/MRevenueRecognitionPlan.java +++ b/org.adempiere.base/src/org/compiere/model/MRevenueRecognitionPlan.java @@ -36,16 +36,16 @@ import org.compiere.util.Util; public class MRevenueRecognitionPlan extends X_C_RevenueRecognition_Plan { /** - * + * generated serial id */ private static final long serialVersionUID = -8437258098744762898L; /** - * UUID based Constructor - * @param ctx Context - * @param C_RevenueRecognition_Plan_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_RevenueRecognition_Plan_UU UUID key + * @param trxName Transaction + */ public MRevenueRecognitionPlan(Properties ctx, String C_RevenueRecognition_Plan_UU, String trxName) { super(ctx, C_RevenueRecognition_Plan_UU, trxName); if (Util.isEmpty(C_RevenueRecognition_Plan_UU)) @@ -81,7 +81,6 @@ public class MRevenueRecognitionPlan extends X_C_RevenueRecognition_Plan { super(ctx, rs, trxName); } // MRevenueRecognitionPlan - /** * After Save @@ -89,6 +88,7 @@ public class MRevenueRecognitionPlan extends X_C_RevenueRecognition_Plan * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (newRecord) diff --git a/org.adempiere.base/src/org/compiere/model/MRevenueRecognitionRun.java b/org.adempiere.base/src/org/compiere/model/MRevenueRecognitionRun.java index 40d94fc71e..f4eed6e1d0 100644 --- a/org.adempiere.base/src/org/compiere/model/MRevenueRecognitionRun.java +++ b/org.adempiere.base/src/org/compiere/model/MRevenueRecognitionRun.java @@ -19,26 +19,22 @@ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; - /** * Revenue Recognition Run Model - * */ public class MRevenueRecognitionRun extends X_C_RevenueRecognition_Run { - - /** - * + * generated serial id */ private static final long serialVersionUID = -6068883255121303257L; /** - * UUID based Constructor - * @param ctx Context - * @param C_RevenueRecognition_Run_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_RevenueRecognition_Run_UU UUID key + * @param trxName Transaction + */ public MRevenueRecognitionRun(Properties ctx, String C_RevenueRecognition_Run_UU, String trxName) { super(ctx, C_RevenueRecognition_Run_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MRfQ.java b/org.adempiere.base/src/org/compiere/model/MRfQ.java index 78c30b1fee..a00eb29b5f 100644 --- a/org.adempiere.base/src/org/compiere/model/MRfQ.java +++ b/org.adempiere.base/src/org/compiere/model/MRfQ.java @@ -37,12 +37,12 @@ import org.compiere.util.Util; public class MRfQ extends X_C_RfQ { /** - * + * generated serial id */ private static final long serialVersionUID = 5332116213254863257L; /** - * Get MRfQ from Cache (immutable) + * Get MRfQ from DB * @param C_RfQ_ID id * @return MRfQ */ @@ -52,7 +52,7 @@ public class MRfQ extends X_C_RfQ } /** - * Get MRfQ from db + * Get MRfQ from DB * @param C_RfQ_ID id * @param trxName transaction * @return MRfQ @@ -63,7 +63,7 @@ public class MRfQ extends X_C_RfQ } /** - * Get MRfQ from db + * Get MRfQ from DB * @param ctx context * @param C_RfQ_ID id * @param trxName transaction @@ -80,11 +80,11 @@ public class MRfQ extends X_C_RfQ } // get /** - * UUID based Constructor - * @param ctx Context - * @param C_RfQ_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_RfQ_UU UUID key + * @param trxName Transaction + */ public MRfQ(Properties ctx, String C_RfQ_UU, String trxName) { super(ctx, C_RfQ_UU, trxName); if (Util.isEmpty(C_RfQ_UU)) @@ -131,7 +131,7 @@ public class MRfQ extends X_C_RfQ } // MRfQ /** - * + * Copy constructor * @param copy */ public MRfQ(MRfQ copy) @@ -140,7 +140,7 @@ public class MRfQ extends X_C_RfQ } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -150,7 +150,7 @@ public class MRfQ extends X_C_RfQ } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -162,8 +162,8 @@ public class MRfQ extends X_C_RfQ } /** - * Get active Lines - * @return array of lines + * Get active RFQ Lines + * @return array of RFQ lines */ public MRfQLine[] getLines() { @@ -198,8 +198,8 @@ public class MRfQ extends X_C_RfQ /** * Get RfQ Responses * @param activeOnly active responses only - * @param completedOnly complete responses only - * @return array of lines + * @param completedOnly completed responses only + * @return array of RFQ response */ public MRfQResponse[] getResponses (boolean activeOnly, boolean completedOnly) { @@ -239,6 +239,7 @@ public class MRfQ extends X_C_RfQ * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MRfQ["); @@ -247,11 +248,10 @@ public class MRfQ extends X_C_RfQ .append("]"); return sb.toString (); } // toString - - - /************************************************************************** + + /** * Is Quote Total Amt Only - * @return true if total amout only + * @return true if quote total amount only (QUOTETYPE_QuoteTotalOnly) */ public boolean isQuoteTotalAmtOnly() { @@ -260,7 +260,7 @@ public class MRfQ extends X_C_RfQ /** * Is Quote Selected Lines - * @return true if quote selected lines + * @return true if quote selected lines (QUOTETYPE_QuoteSelectedLines) */ public boolean isQuoteSelectedLines() { @@ -269,7 +269,7 @@ public class MRfQ extends X_C_RfQ /** * Is Quote All Lines - * @return true if quote selected lines + * @return true if quote all lines (QUOTETYPE_QuoteAllLines) */ public boolean isQuoteAllLines() { @@ -301,12 +301,12 @@ public class MRfQ extends X_C_RfQ return null; } // checkQuoteTotalAmtOnly - /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { // Calculate Complete Date (also used to verify) diff --git a/org.adempiere.base/src/org/compiere/model/MRfQLine.java b/org.adempiere.base/src/org/compiere/model/MRfQLine.java index 31e1bd8fa5..bde902d6fe 100644 --- a/org.adempiere.base/src/org/compiere/model/MRfQLine.java +++ b/org.adempiere.base/src/org/compiere/model/MRfQLine.java @@ -37,12 +37,12 @@ import org.compiere.util.Util; public class MRfQLine extends X_C_RfQLine { /** - * + * generated serial id */ private static final long serialVersionUID = -387372215148731148L; /** - * Get MRfQLine from db + * Get MRfQLine from DB * @param C_RfQLine_ID id * @return MRfQLine */ @@ -52,7 +52,7 @@ public class MRfQLine extends X_C_RfQLine } /** - * Get MRfQLine from db + * Get MRfQLine from DB * @param C_RfQLine_ID id * @param trxName transaction * @return MRfQLine @@ -63,7 +63,7 @@ public class MRfQLine extends X_C_RfQLine } /** - * Get MRfQLine from db + * Get MRfQLine from DB * @param ctx context * @param C_RfQLine_ID id * @param trxName transaction @@ -80,11 +80,11 @@ public class MRfQLine extends X_C_RfQLine } // get /** - * UUID based Constructor - * @param ctx Context - * @param C_RfQLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_RfQLine_UU UUID key + * @param trxName Transaction + */ public MRfQLine(Properties ctx, String C_RfQLine_UU, String trxName) { super(ctx, C_RfQLine_UU, trxName); if (Util.isEmpty(C_RfQLine_UU)) @@ -134,7 +134,7 @@ public class MRfQLine extends X_C_RfQLine } // MRfQLine /** - * + * Copy constructor * @param copy */ public MRfQLine(MRfQLine copy) @@ -143,7 +143,7 @@ public class MRfQLine extends X_C_RfQLine } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -153,7 +153,7 @@ public class MRfQLine extends X_C_RfQLine } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -165,7 +165,7 @@ public class MRfQLine extends X_C_RfQLine this.m_qtys = copy.m_qtys != null ? Arrays.stream(copy.m_qtys).map(e -> {return new MRfQLineQty(ctx, e, trxName);}).toArray(MRfQLineQty[]::new) : null; } - /** Qyantities */ + /** Line Quantities */ private MRfQLineQty[] m_qtys = null; /** @@ -178,9 +178,9 @@ public class MRfQLine extends X_C_RfQLine } // getQtys /** - * Get Quantities - * @param requery requery - * @return array of quantities + * Get RFQ Line Quantities + * @param requery true to re-query from DB + * @return array of RFQ line quantities */ public MRfQLineQty[] getQtys (boolean requery) { @@ -224,8 +224,8 @@ public class MRfQLine extends X_C_RfQLine } // getQtys /** - * Get Product Details - * @return Product Name, etc. + * Get Product Details in HTML + * @return Product Name and Description in HTML format */ public String getProductDetailHTML() { @@ -243,6 +243,7 @@ public class MRfQLine extends X_C_RfQLine * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MRfQLine["); @@ -256,6 +257,7 @@ public class MRfQLine extends X_C_RfQLine * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { // Calculate Complete Date (also used to verify) diff --git a/org.adempiere.base/src/org/compiere/model/MRfQLineQty.java b/org.adempiere.base/src/org/compiere/model/MRfQLineQty.java index 20a9d0ccba..5f745eea82 100644 --- a/org.adempiere.base/src/org/compiere/model/MRfQLineQty.java +++ b/org.adempiere.base/src/org/compiere/model/MRfQLineQty.java @@ -36,7 +36,7 @@ import org.compiere.util.Util; public class MRfQLineQty extends X_C_RfQLineQty { /** - * + * generated serial id */ private static final long serialVersionUID = 2742007712266317681L; @@ -66,11 +66,11 @@ public class MRfQLineQty extends X_C_RfQLineQty private static CCache s_cache = new CCache(Table_Name, 20); /** - * UUID based Constructor - * @param ctx Context - * @param C_RfQLineQty_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_RfQLineQty_UU UUID key + * @param trxName Transaction + */ public MRfQLineQty(Properties ctx, String C_RfQLineQty_UU, String trxName) { super(ctx, C_RfQLineQty_UU, trxName); if (Util.isEmpty(C_RfQLineQty_UU)) @@ -122,7 +122,7 @@ public class MRfQLineQty extends X_C_RfQLineQty } // MRfQLineQty /** - * + * Copy constructor * @param copy */ public MRfQLineQty(MRfQLineQty copy) @@ -131,7 +131,7 @@ public class MRfQLineQty extends X_C_RfQLineQty } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -141,7 +141,7 @@ public class MRfQLineQty extends X_C_RfQLineQty } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -157,8 +157,8 @@ public class MRfQLineQty extends X_C_RfQLineQty private MUOM m_uom = null; /** - * Get Uom Name - * @return UOM + * Get UOM Name + * @return UOM name */ public String getUomName() { @@ -168,7 +168,7 @@ public class MRfQLineQty extends X_C_RfQLineQty } // getUomText /** - * Get active Response Qtys of this RfQ Qty + * Get active Response Line Qty of this RfQ Line Qty * @param onlyValidAmounts only valid amounts * @return array of response line qtys */ @@ -211,6 +211,7 @@ public class MRfQLineQty extends X_C_RfQLineQty * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MRfQLineQty["); diff --git a/org.adempiere.base/src/org/compiere/model/MRfQResponse.java b/org.adempiere.base/src/org/compiere/model/MRfQResponse.java index e3e395caea..dfa9508f67 100644 --- a/org.adempiere.base/src/org/compiere/model/MRfQResponse.java +++ b/org.adempiere.base/src/org/compiere/model/MRfQResponse.java @@ -44,17 +44,16 @@ import org.compiere.util.Util; public class MRfQResponse extends X_C_RfQResponse { /** - * + * generated serial id */ private static final long serialVersionUID = 1472377321844135042L; - /** - * UUID based Constructor - * @param ctx Context - * @param C_RfQResponse_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_RfQResponse_UU UUID key + * @param trxName Transaction + */ public MRfQResponse(Properties ctx, String C_RfQResponse_UU, String trxName) { super(ctx, C_RfQResponse_UU, trxName); if (Util.isEmpty(C_RfQResponse_UU)) @@ -112,8 +111,8 @@ public class MRfQResponse extends X_C_RfQResponse /** * Parent Constructor - * @param rfq rfq - * @param partner web response + * @param rfq + * @param partner */ public MRfQResponse (MRfQ rfq, MBPartner partner) { @@ -125,8 +124,7 @@ public class MRfQResponse extends X_C_RfQResponse /** * Parent Constructor. - * Automatically saved if lines were created - * Saved automatically + * Automatically saved if lines were created . * @param rfq rfq * @param subscriber optional subscriber * @param C_BPartner_ID bpartner @@ -172,11 +170,10 @@ public class MRfQResponse extends X_C_RfQResponse private MRfQ m_rfq = null; /** Lines */ private MRfQResponseLine[] m_lines = null; - - - /************************************************************************** + + /** * Get Response Lines - * @param requery requery + * @param requery true to re-query from DB * @return array of Response Lines */ public MRfQResponseLine[] getLines(boolean requery) @@ -215,14 +212,13 @@ public class MRfQResponse extends X_C_RfQResponse } // getLines /** - * Get Response Lines (no requery) + * Get Response Lines (no re-query) * @return array of Response Lines */ public MRfQResponseLine[] getLines () { return getLines (false); - } // getLines - + } // getLines /** * Get RfQ @@ -240,6 +236,7 @@ public class MRfQResponse extends X_C_RfQResponse * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MRfQResponse["); @@ -249,11 +246,10 @@ public class MRfQResponse extends X_C_RfQResponse .append ("]"); return sb.toString (); } // toString - - - /************************************************************************** + + /** * Send RfQ - * @return true if RfQ is sent per email. + * @return true if RfQ is sent via email. */ public boolean sendRfQ() { @@ -320,11 +316,10 @@ public class MRfQResponse extends X_C_RfQResponse // ================================== return re.getPDF(file); } // getPDF - - /************************************************************************** - * Check if Response is Complete - * @return null if complere - error message otherwise + /** + * Check if Response is Completed + * @return null if completed, error message otherwise */ public String checkComplete() { @@ -405,7 +400,7 @@ public class MRfQResponse extends X_C_RfQResponse /** * Is Quote Total Amt Only - * @return true if only Total + * @return true if quote total amount only */ public boolean isQuoteTotalAmtOnly() { @@ -417,6 +412,7 @@ public class MRfQResponse extends X_C_RfQResponse * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { // Calculate Complete Date (also used to verify) diff --git a/org.adempiere.base/src/org/compiere/model/MRfQResponseLine.java b/org.adempiere.base/src/org/compiere/model/MRfQResponseLine.java index 2226839fd0..9a0b349bff 100644 --- a/org.adempiere.base/src/org/compiere/model/MRfQResponseLine.java +++ b/org.adempiere.base/src/org/compiere/model/MRfQResponseLine.java @@ -38,22 +38,21 @@ import org.compiere.util.TimeUtil; public class MRfQResponseLine extends X_C_RfQResponseLine { /** - * + * generated serial id */ private static final long serialVersionUID = 3388579962604552288L; /** - * UUID based Constructor - * @param ctx Context - * @param C_RfQResponseLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_RfQResponseLine_UU UUID key + * @param trxName Transaction + */ public MRfQResponseLine(Properties ctx, String C_RfQResponseLine_UU, String trxName) { super(ctx, C_RfQResponseLine_UU, trxName); } /** - * Persistency Constructor * @param ctx context * @param C_RfQResponseLine_ID * @param trxName transaction @@ -75,9 +74,8 @@ public class MRfQResponseLine extends X_C_RfQResponseLine } // MRfQResponseLine /** - * Parent Constructor. - * Also creates qtys if RfQ Qty - * Is saved if there are qtys(!) + * Parent Constructor.
        + * Create and save MRfQResponseLineQty if MRfQLineQty IsRfQQty=Y. * @param response response * @param line line */ @@ -112,7 +110,7 @@ public class MRfQResponseLine extends X_C_RfQResponseLine /** * Get Quantities - * @return array of quantities + * @return array of MRfQResponseLineQty */ public MRfQResponseLineQty[] getQtys () { @@ -121,8 +119,8 @@ public class MRfQResponseLine extends X_C_RfQResponseLine /** * Get Quantities - * @param requery requery - * @return array of quantities + * @param requery true to re-query from DB + * @return array of MRfQResponseLineQty */ public MRfQResponseLineQty[] getQtys (boolean requery) { @@ -173,6 +171,7 @@ public class MRfQResponseLine extends X_C_RfQResponseLine * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MRfQResponseLine["); @@ -180,13 +179,13 @@ public class MRfQResponseLine extends X_C_RfQResponseLine .append ("]"); return sb.toString (); } // toString - - + /** * Before Save * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { // Calculate Complete Date (also used to verify) @@ -202,8 +201,7 @@ public class MRfQResponseLine extends X_C_RfQResponseLine if (!isActive()) setIsSelectedWinner(false); return true; - } // beforeSave - + } // beforeSave /** * After Save @@ -211,6 +209,7 @@ public class MRfQResponseLine extends X_C_RfQResponseLine * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) diff --git a/org.adempiere.base/src/org/compiere/model/MRfQResponseLineQty.java b/org.adempiere.base/src/org/compiere/model/MRfQResponseLineQty.java index 9af07fe7d4..eea8040643 100644 --- a/org.adempiere.base/src/org/compiere/model/MRfQResponseLineQty.java +++ b/org.adempiere.base/src/org/compiere/model/MRfQResponseLineQty.java @@ -34,16 +34,16 @@ import org.compiere.util.Util; public class MRfQResponseLineQty extends X_C_RfQResponseLineQty implements Comparator { /** - * + * generated serial id */ private static final long serialVersionUID = -4118030805518374853L; /** - * UUID based Constructor - * @param ctx Context - * @param C_RfQResponseLineQty_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_RfQResponseLineQty_UU UUID key + * @param trxName Transaction + */ public MRfQResponseLineQty(Properties ctx, String C_RfQResponseLineQty_UU, String trxName) { super(ctx, C_RfQResponseLineQty_UU, trxName); if (Util.isEmpty(C_RfQResponseLineQty_UU)) @@ -51,7 +51,6 @@ public class MRfQResponseLineQty extends X_C_RfQResponseLineQty implements Compa } /** - * Persistency Constructor * @param ctx context * @param C_RfQResponseLineQty_ID id * @param trxName transaction @@ -94,8 +93,7 @@ public class MRfQResponseLineQty extends X_C_RfQResponseLineQty implements Compa setC_RfQResponseLine_ID (line.getC_RfQResponseLine_ID()); setC_RfQLineQty_ID (qty.getC_RfQLineQty_ID()); } // MRfQResponseLineQty - - + /** RfQ Line Qty */ private MRfQLineQty m_rfqQty = null; @@ -110,9 +108,11 @@ public class MRfQResponseLineQty extends X_C_RfQResponseLineQty implements Compa return m_rfqQty; } // getRfQLineQty - /** - * Is the Amount (price - discount) Valid + * Is the Amount Valid.
        + * - Price > 0
        + * - Discount <= 100
        + * - Net Amount > 0 * @return true if valid */ public boolean isValidAmt() @@ -160,16 +160,15 @@ public class MRfQResponseLineQty extends X_C_RfQResponseLineQty implements Compa if (discount == null || Env.ZERO.compareTo(discount) == 0) return price; // Calculate - // double result = price.doubleValue() * (100.0 - discount.doubleValue()) / 100.0; BigDecimal factor = Env.ONEHUNDRED.subtract(discount); return price.multiply(factor).divide(Env.ONEHUNDRED, 2, RoundingMode.HALF_UP); } // getNetAmt - /** * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MRfQResponseLineQty["); @@ -191,6 +190,7 @@ public class MRfQResponseLineQty extends X_C_RfQResponseLineQty implements Compa * @throws ClassCastException if the arguments' types prevent them from * being compared by this Comparator. */ + @Override public int compare(Object o1, Object o2) { if (o1 == null) @@ -226,6 +226,7 @@ public class MRfQResponseLineQty extends X_C_RfQResponseLineQty implements Compa * @param obj the reference object with which to compare. * @return true if Net Amount equal */ + @Override public boolean equals(Object obj) { if (obj instanceof MRfQResponseLineQty) @@ -244,6 +245,7 @@ public class MRfQResponseLineQty extends X_C_RfQResponseLineQty implements Compa return false; } // equals + @Override public int hashCode() { assert false : "hashCode not designed"; @@ -255,6 +257,7 @@ public class MRfQResponseLineQty extends X_C_RfQResponseLineQty implements Compa * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (!isActive()) diff --git a/org.adempiere.base/src/org/compiere/model/MRfQTopic.java b/org.adempiere.base/src/org/compiere/model/MRfQTopic.java index ababfffd46..156ebfbc22 100644 --- a/org.adempiere.base/src/org/compiere/model/MRfQTopic.java +++ b/org.adempiere.base/src/org/compiere/model/MRfQTopic.java @@ -24,7 +24,6 @@ import java.util.logging.Level; import org.compiere.util.DB; - /** * RfQ Topic Model * @@ -34,16 +33,16 @@ import org.compiere.util.DB; public class MRfQTopic extends X_C_RfQ_Topic { /** - * + * generated serial id */ private static final long serialVersionUID = 1569514263521190339L; /** - * UUID based Constructor - * @param ctx Context - * @param C_RfQ_Topic_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_RfQ_Topic_UU UUID key + * @param trxName Transaction + */ public MRfQTopic(Properties ctx, String C_RfQ_Topic_UU, String trxName) { super(ctx, C_RfQ_Topic_UU, trxName); } @@ -71,8 +70,8 @@ public class MRfQTopic extends X_C_RfQ_Topic } // MRfQTopic /** - * Get Current Topic Subscribers - * @return array subscribers + * Get active Topic Subscribers + * @return array of topic subscribers */ public MRfQTopicSubscriber[] getSubscribers() { diff --git a/org.adempiere.base/src/org/compiere/model/MRfQTopicSubscriber.java b/org.adempiere.base/src/org/compiere/model/MRfQTopicSubscriber.java index 44b6fbb5bd..fedca4c284 100644 --- a/org.adempiere.base/src/org/compiere/model/MRfQTopicSubscriber.java +++ b/org.adempiere.base/src/org/compiere/model/MRfQTopicSubscriber.java @@ -24,7 +24,6 @@ import java.util.logging.Level; import org.compiere.util.DB; - /** * RfQ Topic Subscriber Model * @@ -34,16 +33,16 @@ import org.compiere.util.DB; public class MRfQTopicSubscriber extends X_C_RfQ_TopicSubscriber { /** - * + * generated serial id */ private static final long serialVersionUID = 7364350828501354344L; /** - * UUID based Constructor - * @param ctx Context - * @param C_RfQ_TopicSubscriber_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_RfQ_TopicSubscriber_UU UUID key + * @param trxName Transaction + */ public MRfQTopicSubscriber(Properties ctx, String C_RfQ_TopicSubscriber_UU, String trxName) { super(ctx, C_RfQ_TopicSubscriber_UU, trxName); } @@ -75,8 +74,8 @@ public class MRfQTopicSubscriber extends X_C_RfQ_TopicSubscriber /** * Get Restriction Records - * @param requery requery - * @return arry of onlys + * @param requery true to re-query only + * @return array of MRfQTopicSubscriberOnly */ public MRfQTopicSubscriberOnly[] getRestrictions (boolean requery) { @@ -110,12 +109,11 @@ public class MRfQTopicSubscriber extends X_C_RfQ_TopicSubscriber list.toArray (m_restrictions); return m_restrictions; } // getRestrictions - - + /** * Is the product included? * @param M_Product_ID product - * @return true if no restrictions or included in "positive" only list + * @return true if no restrictions or included in restriction (product or product category) */ public boolean isIncluded (int M_Product_ID) { diff --git a/org.adempiere.base/src/org/compiere/model/MRfQTopicSubscriberOnly.java b/org.adempiere.base/src/org/compiere/model/MRfQTopicSubscriberOnly.java index 513507afbb..326ac7ea38 100644 --- a/org.adempiere.base/src/org/compiere/model/MRfQTopicSubscriberOnly.java +++ b/org.adempiere.base/src/org/compiere/model/MRfQTopicSubscriberOnly.java @@ -19,27 +19,25 @@ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; - /** - * Subcriber Topic Only List (positive - i.e. must be a match if exists) + * Subscriber Topic Only List (positive - i.e. must be a match if exists) * * @author Jorg Janke * @version $Id: MRfQTopicSubscriberOnly.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $ */ public class MRfQTopicSubscriberOnly extends X_C_RfQ_TopicSubscriberOnly { - /** - * + * generated serial id */ private static final long serialVersionUID = -7744686970311507813L; /** - * UUID based Constructor - * @param ctx Context - * @param C_RfQ_TopicSubscriberOnly_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_RfQ_TopicSubscriberOnly_UU UUID key + * @param trxName Transaction + */ public MRfQTopicSubscriberOnly(Properties ctx, String C_RfQ_TopicSubscriberOnly_UU, String trxName) { super(ctx, C_RfQ_TopicSubscriberOnly_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MRole.java b/org.adempiere.base/src/org/compiere/model/MRole.java index 5dcbd35d88..a8bf17c893 100644 --- a/org.adempiere.base/src/org/compiere/model/MRole.java +++ b/org.adempiere.base/src/org/compiere/model/MRole.java @@ -52,8 +52,8 @@ import org.idempiere.cache.ImmutablePOSupport; import org.idempiere.cache.POCopyCache; /** - * Role Model. - * Includes AD_User runtime info for Personal Access + * Role Model.
        + * Includes AD_User runtime info for Personal Access.
        * The class is final, so that you cannot overwrite the security rules. * * @author Jorg Janke @@ -65,13 +65,12 @@ import org.idempiere.cache.POCopyCache; public final class MRole extends X_AD_Role implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -8937680640915708588L; - /** - * Get Default (Client) Role + * Get role for current session/context * @return role */ public static MRole getDefault () @@ -80,9 +79,9 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // getDefault /** - * Get/Set Default Role. + * Get role for current session/context * @param ctx context - * @param reload if true forces load + * @param reload if true forces reload * @return role * @see org.compiere.util.Login#loadPreferences(KeyNamePair, KeyNamePair, java.sql.Timestamp, String) */ @@ -109,11 +108,19 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport return defaultRole; } // getDefault + /** + * Set role for current session/context + * @param defaultRole + */ private static void setDefaultRole(MRole defaultRole) { Env.getCtx().remove(ROLE_KEY); Env.getCtx().put(ROLE_KEY, defaultRole); } + /** + * Get role for current session/context + * @return MRole + */ private static MRole getDefaultRole() { return (MRole) Env.getCtx().get(ROLE_KEY); } @@ -149,7 +156,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport /** * Get Role (cached). - * Did not set user - so no access loaded + * Did not set user - so no access loaded. * @param ctx context * @param AD_Role_ID role * @return role @@ -204,10 +211,10 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // getOfClient /** - * Get Roles With where clause + * Get Roles via where clause * @param ctx context - * @param whereClause where clause - * @return roles of client + * @param whereClause SQL where clause + * @return roles matching where clause */ public static MRole[] getOf (Properties ctx, String whereClause) { @@ -258,24 +265,25 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport public static final int SYSTEM_USER_ID = USER_SYSTEM; private static final String ROLE_KEY = "org.compiere.model.DefaultRole"; - - + /** - * UUID based Constructor - * @param ctx Context - * @param AD_Role_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Role_UU UUID key + * @param trxName Transaction + */ public MRole(Properties ctx, String AD_Role_UU, String trxName) { super(ctx, AD_Role_UU, trxName); if (Util.isEmpty(AD_Role_UU)) setInitialDefaults(); } - /************************************************************************** - * Standard Constructor + /** + * Standard Constructor. + *
         	 *  NOTE - This method must not be used when the role is being requested to manage permissions,
        -	 *         in such case is necessary to use one of the get methods setting the userID
        +	 *         in such case is necessary to use one of the get methods setting AD_User_ID.
        +	 *  
        * @param ctx context * @param AD_Role_ID id * @param trxName transaction @@ -309,9 +317,11 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } /** - * Load Constructor + * Load Constructor. + *
         	 *  NOTE - This method must not be used when the role is being requested to manage permissions,
        -	 *         in such case is necessary to use one of the get methods setting the userID
        +	 *         in such case is necessary to use one of the get methods setting AD_User_ID.
        +	 *  
        * @param ctx context * @param rs result set * @param trxName transaction @@ -322,7 +332,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // MRole /** - * + * Copy constructor * @param copy */ public MRole(MRole copy) @@ -331,7 +341,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -341,7 +351,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -370,7 +380,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport /** * Get Confirm Query Records - * @return entered records or 500 (default) + * @return value of ConfirmQueryRecords or 500 if value of ConfirmQueryRecords is 0. */ public int getConfirmQueryRecords () { @@ -381,10 +391,11 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // getConfirmQueryRecords /** - * Require Query * @param noRecords records * @return true if query required + * @deprecated replace by {@link GridTab#isQueryRequire(int)} */ + @Deprecated public boolean isQueryRequire (int noRecords) { if (noRecords < 2) @@ -400,7 +411,9 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport * Over max Query * @param noRecords records * @return true if over max query + * @deprecated replace by {@link GridTab#isQueryMax(int)} */ + @Deprecated public boolean isQueryMax (int noRecords) { int max = getMaxQueryRecords(); @@ -412,6 +425,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport * @param newRecord new * @return true if it can be saved */ + @Override protected boolean beforeSave(boolean newRecord) { if (getAD_Client_ID() == 0) @@ -430,6 +444,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -463,6 +478,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport * @param success true if record deleted * @return true if delete is a success */ + @Override protected boolean afterDelete (boolean success) { if(success) { @@ -472,7 +488,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // afterDelete /** - * Create Access Records + * Create Access Records (delete existing access records prior to that) * @return info */ public String updateAccessRecords () @@ -483,7 +499,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport /** * Create Access Records - * @param reset true will reset existing access + * @param reset true to delete existing access records * @return info */ public String updateAccessRecords (boolean reset) @@ -635,7 +651,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // createAccessRecords /** - * Delete Access Records of the role after the role was (successfully) deleted. + * Delete Access Records of a role. */ private void deleteAccessRecords() { String whereDel = " WHERE AD_Role_ID=" + getAD_Role_ID(); @@ -659,6 +675,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder("MRole["); @@ -705,8 +722,6 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport return sb.toString(); } // toStringX - - /************************************************************************* * Access Management ************************************************************************/ @@ -740,7 +755,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport /** * Set Logged in user - * @param AD_User_ID user requesting info + * @param AD_User_ID logged in user id */ public void setAD_User_ID(int AD_User_ID) { @@ -749,17 +764,16 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport /** * Get Logged in user - * @return AD_User_ID user requesting info + * @return AD_User_ID */ public int getAD_User_ID() { return m_AD_User_ID; } // getAD_User_ID - - /************************************************************************** + /** * Load Access Info - * @param reload re-load from disk + * @param reload re-load from DB */ public void loadAccess (boolean reload) { @@ -779,8 +793,8 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // loadAccess /** - * Load Org Access - * @param reload reload + * Load Organization Access + * @param reload reload from DB */ private void loadOrgAccess (boolean reload) { @@ -811,8 +825,8 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // loadOrgAccess /** - * Load Org Access User - * @param list list + * Load Organization User Access (AD_User_OrgAccess) + * @param list list to load access record to */ private void loadOrgAccessUser(ArrayList list) { @@ -846,8 +860,8 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // loadOrgAccessRole /** - * Load Org Access Role - * @param list list + * Load Organization Role Access (AD_Role_OrgAccess) + * @param list list to load access record to */ private void loadOrgAccessRole(ArrayList list) { @@ -878,9 +892,10 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // loadOrgAccessRole /** - * Load Org Access Add Tree to List - * @param list list - * @param oa org access + * Add OrgAccess to OrgAccess list.
        + * If OrgAccess belongs to a summary organization, perform the same addition for child organization as well. + * @param list list to add OrgAccess to + * @param oa OrgAccess record * @see org.compiere.util.Login */ private void loadOrgAccessAdd (ArrayList list, OrgAccess oa) @@ -925,11 +940,10 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport rs = null; pstmt = null; } } // loadOrgAccessAdd - /** - * Load Table Access - * @param reload reload + * Load Table Access (AD_Table_Access) + * @param reload true to reload from DB */ private void loadTableAccess(boolean reload) { @@ -964,7 +978,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport /** * Check if tableName is a view * @param tableName - * @return boolean + * @return true if tableName is a view */ private boolean isView(String tableName) { @@ -974,6 +988,10 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport return table.isView(); } + /** + * @param tableName + * @return Id column for tableName or null + */ private String getIdColumnName(String tableName) { StringBuilder colkey = new StringBuilder(tableName).append("_ID"); @@ -986,8 +1004,8 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } /** - * Load Column Access - * @param reload reload + * Load Column Access (AD_Column_Access) + * @param reload true to reload from DB */ private void loadColumnAccess(boolean reload) { @@ -1020,8 +1038,8 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // loadColumnAccess /** - * Load Record Access - * @param reload reload + * Load Record Access (AD_Record_Access) + * @param reload true to reload from DB */ private void loadRecordAccess(boolean reload) { @@ -1061,11 +1079,10 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport if (log.isLoggable(Level.FINE)) log.fine("#" + m_recordAccess.length + " - Dependent #" + m_recordDependentAccess.length); } // loadRecordAccess - - /************************************************************************** - * Get Client Where Clause Value + /** + * Get Where Clause for client filter * @param rw read write - * @return "AD_Client_ID=0" or "AD_Client_ID IN(0,1)" + * @return "AD_Client_ID=0" or "AD_Client_ID IN(0,1,...)" */ public String getClientWhere (boolean rw) { @@ -1116,7 +1133,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport * Access to Client * @param AD_Client_ID client * @param rw read write access - * @return true if access + * @return true if can access */ public boolean isClientAccess(int AD_Client_ID, boolean rw) { @@ -1145,9 +1162,9 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // isClientAccess /** - * Get Org Where Clause Value + * Get Where Clause for organization filter * @param rw read write - * @return "AD_Org_ID=0" or "AD_Org_ID IN(0,1)" or null (if access all org) + * @return "AD_Org_ID=0" or "AD_Org_ID IN(0,1,...)" or null (if access all org) */ public String getOrgWhere (boolean rw) { @@ -1226,11 +1243,10 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport return false; } // isOrgAccess - /** * Can Report on table * @param AD_Table_ID table - * @return true if access + * @return true if can report */ public boolean isCanReport (int AD_Table_ID) { @@ -1274,7 +1290,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport /** * Can Export Table * @param AD_Table_ID - * @return true if access + * @return true if can export */ public boolean isCanExport (int AD_Table_ID) { @@ -1321,7 +1337,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport * Access to Table * @param AD_Table_ID table * @param ro check read only access otherwise read write access level - * @return has RO/RW access to table + * @return true if has RO/RW access to table */ public boolean isTableAccess (int AD_Table_ID, boolean ro) { @@ -1375,10 +1391,10 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // isTableAccess /** - * Access to Table based on Role User Level Table Access Level + * Access to Table based on User Level and Table Access Level * @param AD_Table_ID table * @param ro check read only access otherwise read write access level - * @return has RO/RW access to table + * @return true if has RO/RW access to table */ public boolean isTableAccessLevel (int AD_Table_ID, boolean ro) { @@ -1392,32 +1408,32 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport log.warning("No Table Found with AD_Table_ID=" + AD_Table_ID); return false; } - String roleAccessLevel = table.getAccessLevel(); - if (roleAccessLevel == null) + String tableAccessLevel = table.getAccessLevel(); + if (tableAccessLevel == null) { if (log.isLoggable(Level.FINE)) log.fine("NO - No AccessLevel - AD_Table_ID=" + AD_Table_ID); return false; } // Access to all User Levels - if (roleAccessLevel.equals(X_AD_Table.ACCESSLEVEL_All)) + if (tableAccessLevel.equals(X_AD_Table.ACCESSLEVEL_All)) return true; // User Level = SCO String userLevel = getUserLevel(); // if (userLevel.charAt(0) == 'S' - && (roleAccessLevel.equals(X_AD_Table.ACCESSLEVEL_SystemOnly) - || roleAccessLevel.equals(X_AD_Table.ACCESSLEVEL_SystemPlusClient))) + && (tableAccessLevel.equals(X_AD_Table.ACCESSLEVEL_SystemOnly) + || tableAccessLevel.equals(X_AD_Table.ACCESSLEVEL_SystemPlusClient))) return true; if (userLevel.charAt(1) == 'C' - && (roleAccessLevel.equals(X_AD_Table.ACCESSLEVEL_ClientOnly) - || roleAccessLevel.equals(X_AD_Table.ACCESSLEVEL_SystemPlusClient))) + && (tableAccessLevel.equals(X_AD_Table.ACCESSLEVEL_ClientOnly) + || tableAccessLevel.equals(X_AD_Table.ACCESSLEVEL_SystemPlusClient))) return true; if (userLevel.charAt(2) == 'O' - && (roleAccessLevel.equals(X_AD_Table.ACCESSLEVEL_Organization) - || roleAccessLevel.equals(X_AD_Table.ACCESSLEVEL_ClientPlusOrganization))) + && (tableAccessLevel.equals(X_AD_Table.ACCESSLEVEL_Organization) + || tableAccessLevel.equals(X_AD_Table.ACCESSLEVEL_ClientPlusOrganization))) return true; if (log.isLoggable(Level.FINE)) log.fine("NO - AD_Table_ID=" + AD_Table_ID - + ", UserLevel=" + userLevel + ", AccessLevel=" + roleAccessLevel); + + ", UserLevel=" + userLevel + ", AccessLevel=" + tableAccessLevel); return false; } // isTableAccessLevel @@ -1425,8 +1441,8 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport * Access to Column * @param AD_Table_ID table * @param AD_Column_ID column - * @param ro read only - * @return true if access + * @param ro true for read only, false for read write + * @return true if can access */ public boolean isColumnAccess (int AD_Table_ID, int AD_Column_ID, boolean ro) { @@ -1437,9 +1453,9 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport * Access to Column * @param AD_Table_ID table * @param AD_Column_ID column - * @param ro read only + * @param ro true for read only, false for read write * @param trxName - * @return true if access + * @return true if can access */ public boolean isColumnAccess (int AD_Table_ID, int AD_Column_ID, boolean ro, String trxName) { @@ -1513,11 +1529,11 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // isColumnAccess /** - * Access to Record (no check of table) + * Access to Record (AD_Record_Access) * @param AD_Table_ID table * @param Record_ID record - * @param ro read only - * @return boolean + * @param ro true for read only, false for read write + * @return true if can access */ public boolean isRecordAccess (int AD_Table_ID, int Record_ID, boolean ro) { @@ -1559,9 +1575,10 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // isRecordAccess /** - * Get Window Access + * Get Window Access (AD_Window_Access).
        + * Check ASP record as well if client is using ASP access control. * @param AD_Window_ID window - * @return null in no access, TRUE if r/w and FALSE if r/o + * @return null if can't access, TRUE if r/w and FALSE if r/o */ public synchronized Boolean getWindowAccess (int AD_Window_ID) { @@ -1646,9 +1663,10 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // getWindowAccess /** - * Get Process Access + * Get Process Access (AD_Process_Access). + * Check ASP record as well if client is using ASP access control. * @param AD_Process_ID process - * @return null in no access, TRUE if r/w and FALSE if r/o + * @return null if can't access, TRUE if r/w and FALSE if r/o */ public synchronized Boolean getProcessAccess (int AD_Process_ID) { @@ -1736,9 +1754,10 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // getProcessAccess /** - * Get Task Access + * Get Task Access (AD_Task_Access).
        + * Check ASP record as well if client is using ASP access control. * @param AD_Task_ID task - * @return null in no access, TRUE if r/w and FALSE if r/o + * @return null if can't access, TRUE if r/w and FALSE if r/o */ public synchronized Boolean getTaskAccess (int AD_Task_ID) { @@ -1824,9 +1843,10 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // getTaskAccess /** - * Get Form Access + * Get Form Access (AD_Form_Access).
        + * Check ASP record as well if client is using ASP access control. * @param AD_Form_ID form - * @return null in no access, TRUE if r/w and FALSE if r/o + * @return null if can't access, TRUE if r/w and FALSE if r/o */ public synchronized Boolean getFormAccess (int AD_Form_ID) { @@ -1912,9 +1932,10 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // getFormAccess /** - * Get Workflow Access + * Get Workflow Access (AD_Workflow_Access).
        + * Check ASP record as well if client is using ASP access control. * @param AD_Workflow_ID workflow - * @return null in no access, TRUE if r/w and FALSE if r/o + * @return null if can't access, TRUE if r/w and FALSE if r/o */ public synchronized Boolean getWorkflowAccess (int AD_Workflow_ID) { @@ -1998,16 +2019,15 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } return retValue; } // getWorkflowAccess - - /************************************************************************* - * Appends where clause to SQL statement for Table + /** + * Appends access where clause to SQL statement for Tables * * @param SQL existing SQL statement * @param TableNameIn Table Name or list of table names AAA, BBB or AAA a, BBB b - * @param fullyQualified fullyQualified names - * @param rw if false, includes System Data - * @return updated SQL statement + * @param fullyQualified fullyQualified column name + * @param rw if false, includes records belongs to System client (AD_Client_ID=0). + * @return updated SQL statement */ public String addAccessSQL (String SQL, String TableNameIn, boolean fullyQualified, boolean rw) @@ -2181,9 +2201,9 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport /** * Get Dependent Access - * @param whereColumnName column - * @param includes ids to include - * @param excludes ids to exclude + * @param whereColumnName column name for includes and excludes id + * @param includes record ids to include + * @param excludes record ids to exclude * @return where clause starting with AND or "" */ private String getDependentAccess(String whereColumnName, @@ -2227,14 +2247,13 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } if (log.isLoggable(Level.FINEST)) log.finest(where.toString()); return where.toString(); - } // getDependentAccess - + } // getDependentAccess /** - * Get Dependent Record Where clause + * Get column name for dependent record where clause * @param mainSql sql to examine - * @param columnName columnName - * @return where clause column "x.columnName" + * @param columnName + * @return original or updated column name (e.g "x.columnName") */ private String getDependentRecordWhereColumn (String mainSql, String columnName) { @@ -2259,18 +2278,16 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport return retValue; } // getDependentRecordWhereColumn - - /** - * UPDATE - Can I Update the record. - * Access error info (AccessTableNoUpdate) is saved in the log + * Check update access. + * Access error info (AccessTableNoUpdate) is saved in the log * * @param AD_Client_ID context to derive client/org/user level * @param AD_Org_ID number of the current window to retrieve context * @param AD_Table_ID table * @param Record_ID record id - * @param createError boolean - * @return true if you can update + * @param createError true to capture error into server log + * @return true if can update * see org.compiere.model.MTable#dataSave(boolean) **/ public boolean canUpdate (int AD_Client_ID, int AD_Org_ID, @@ -2345,21 +2362,21 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport /** * VIEW - Can I view record in Table with given TableLevel. - * - * TableLevel S__ 100 4 System info - * SCO 111 7 System shared info - * SC_ 110 6 System/Client info - * _CO 011 3 Client shared info - * _C_ 011 2 Client shared info - * __O 001 1 Organization info - * + *
        +	 *	TableLevel		S__ 100		4	System info
        +	 *			        SCO 111		7	System shared info
        +	 *			        SC_ 110		6	System/Client info
        +	 *			        _CO 011		3	Client shared info
        +	 *			        _C_ 011		2	Client shared info
        +	 *			        __O 001		1	Organization info
        +	 *  
        * * @param ctx context - * @param TableLevel AccessLevel - * @return true/false + * @param TableLevel table access level + * @return true if can view
        * Access error info (AccessTableNoUpdate, AccessTableNoView) is saved in the log - * see org.compiere.model.MTabVO#loadTabDetails(MTabVO, ResultSet) - **/ + * @see org.compiere.model.MTabVO#loadTabDetails(MTabVO, ResultSet) + */ public boolean canView(Properties ctx, String TableLevel) { String userLevel = getUserLevel(); // Format 'SCO' @@ -2406,12 +2423,11 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport return retValue; } // canView - /** - * Returns clear text String of TableLevel + * Returns translated display text of TableLevel * @param AD_Language language - * @param TableLevel level - * @return info + * @param TableLevel table access level + * @return translated display text of TableLevel */ private String getTableLevelString (String AD_Language, String TableLevel) { @@ -2433,7 +2449,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // getTableLevelString /** - * Get Table ID from name + * Get Table ID from table name * @param tableName table name * @return AD_Table_ID or 0 */ @@ -2446,7 +2462,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // getAD_Table_ID /** - * Return Where clause for Record Access + * Get Where clause for Record Access * @param AD_Table_ID table * @param keyColumnName (fully qualified) key column name * @param rw true if read write @@ -2523,16 +2539,15 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } // isShowPreference /** - * Org Access Summary + * Organization Access value object class */ class OrgAccess implements Serializable { /** - * + * generated serial id */ private static final long serialVersionUID = -4880665261978385315L; - /** * Org Access constructor * @param ad_Client_ID client @@ -2545,19 +2560,20 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport this.AD_Org_ID = ad_Org_ID; this.readOnly = readonly; } + /** Client */ public int AD_Client_ID = 0; /** Organization */ public int AD_Org_ID = 0; /** Read Only */ public boolean readOnly = true; - - + /** * Equals * @param obj object to compare * @return true if equals */ + @Override public boolean equals (Object obj) { if (obj != null && obj instanceof OrgAccess) @@ -2568,12 +2584,12 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } return false; } // equals - - + /** * Hash Code * @return hash Code */ + @Override public int hashCode () { return (AD_Client_ID*7) + AD_Org_ID; @@ -2583,6 +2599,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport * Extended String Representation * @return extended info */ + @Override public String toString () { String clientName = "System"; @@ -2605,12 +2622,11 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport /** * Checks the access rights of the given role/client for the given document actions. - * @param clientId - * @param docTypeId - * @param options - * @param maxIndex - * @return number of valid actions in the String[] options - * @see metas-2009_0021_AP1_G94 + * @param clientId AD_Client_ID + * @param docTypeId C_DocType_ID + * @param options array of document actions + * @param maxIndex define the range of elements to examine in options (>= 0 and < maxIndex) + * @return number of valid actions in the String[] options argument */ public int checkActionAccess(int clientId, int docTypeId, String[] options, int maxIndex) { @@ -2716,10 +2732,9 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport private List m_includedRoles = null; /** - * Include role permissions + * Add role to the included role list ({@link #m_includedRoles}). * @param role * @param seqNo - * @see metas-2009_0021_AP1_G94 */ private void includeRole(MRole role, int seqNo) { @@ -2750,9 +2765,8 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } /** - * + * @param recursive * @return unmodifiable list of included roles - * @see metas-2009_0021_AP1_G94 */ public List getIncludedRoles(boolean recursive) { @@ -2781,7 +2795,6 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport /** * Load all included roles (direct inclusion or from user substitution) * @param reload - * @see metas-2009_0021_AP1_G94 */ private void loadIncludedRoles(boolean reload) { @@ -2794,6 +2807,10 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } } + /** + * Merge access record from this role and immediate included roles. + * @param reload + */ private void mergeAccesses(boolean reload) { OrgAccess[] orgAccess = new OrgAccess[]{}; @@ -2837,7 +2854,6 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport /** * Load Child Roles * @param reload - * @see metas-2009_0021_AP1_G94 */ private void loadChildRoles(boolean reload) { @@ -2846,7 +2862,6 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport if (AD_User_ID < 0) { log.info("Trying to load Child Roles but user has not been set"); - //throw new IllegalStateException("AD_User_ID is not set"); return ; } // @@ -2868,7 +2883,6 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport /** * Load substituted roles * @param reload - * @see metas-2009_0021_AP1_G94 */ private void loadSubstitutedRoles(boolean reload) { @@ -2911,7 +2925,6 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport /** * Set parent role. This method is called when this role is included in a parent role. * @param parent - * @see metas-2009_0021_AP1_G94 */ private void setParentRole(MRole parent) { @@ -2927,7 +2940,6 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport * @param array1 * @param array2 * @return array of merged values - * @see metas-2009_0021_AP1_G94 */ @SuppressWarnings("unchecked") private static final T[] mergeAccess(T[] array1, T[] array2, boolean override) @@ -3022,6 +3034,13 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport return list.toArray(arr); } + /** + * Merge access records + * @param map1 + * @param map2 + * @param override + * @return merged access records + */ private static final HashMap mergeAccess( HashMap map1, HashMap map2, boolean override) @@ -3057,6 +3076,10 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport return map; } + /** + * Merge access record of this role and immediate included roles + * @param varname name for the type of access (for e.g m_formAccess, m_windowAccess, etc) + */ private void mergeIncludedAccess(String varname) { HashMap includedAccess = new HashMap(); @@ -3078,6 +3101,10 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport setAccessMap(varname, mergeAccess(getAccessMap(varname), includedAccess, false)); } + /** + * @param varname name for the type of access (for e.g m_formAccess, m_windowAccess, etc) + * @return access map for varname type + */ private HashMap getAccessMap(String varname) { if ("m_windowAccess".equals(varname)) @@ -3115,6 +3142,12 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport throw new IllegalArgumentException("varname not supported - "+varname); } } + + /** + * Set access map for varname type + * @param varname name for the type of access (for e.g m_formAccess, m_windowAccess, etc) + * @param map access map + */ private void setAccessMap(String varname, HashMap map) { if ("m_windowAccess".equals(varname)) @@ -3148,12 +3181,12 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } /** - * Get Role Where Clause. + * Get Where Clause filter for this role and included roles.
        * It will look something like myalias.AD_Role_ID IN (?, ?, ?). - * @param roleColumnSQL role columnname or role column SQL (e.g. myalias.AD_Role_ID) - * @param params a list where the method will put SQL parameters. - * If null, this method will generate a not parametrized query - * @return role SQL where clause + * @param roleColumnSQL role column name or role column SQL (e.g. myalias.AD_Role_ID) + * @param params a list where the method will put SQL parameters.
        + * If null, this method will generate a not parameterized query + * @return SQL where clause */ public String getIncludedRolesWhereClause(String roleColumnSQL, List params) { @@ -3185,6 +3218,11 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport return whereClause.toString(); } + /** + * Get info window access (AD_InfoWindow_Access) + * @param AD_InfoWindow_ID + * @return null if can't access, TRUE if r/w and FALSE if r/o + */ public synchronized Boolean getInfoAccess(int AD_InfoWindow_ID) { if (m_infoAccess == null) { @@ -3232,6 +3270,9 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport private Boolean m_canAccess_Info_Product = null; + /** + * @return true if can access info window for product + */ public boolean canAccess_Info_Product() { if (m_canAccess_Info_Product == null) { String sql = "" @@ -3269,8 +3310,8 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport /** * Get where clause for a role types list * @param roleType - comma separated list of role types, NULL can be used - * @param tableName - if table needs to be qualified - * @return whereClause - return null if roleType is null or empty + * @param tableName - if column needs to be qualified + * @return whereClause, return null if roleType is null or empty */ public static String getWhereRoleType(String roleType, String tableName) { if (Util.isEmpty(roleType, true)) { @@ -3312,10 +3353,10 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport return whereClause.toString(); } - /* + /** * Verify compatibility of AD_Role.UserLevel vs Access Level * @param accessLevel the access level of the dictionary object - * @return true if access and user level are compatible + * @return true if access level and user level are compatible */ private boolean isAccessLevelCompatible(String accessLevel) { boolean access = false; @@ -3356,9 +3397,9 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport } /** - * Does the table is excluded for current role (this method doesn't check the level of the table, use isTableAccess for this purpose) - * @param tableID ID of the table - * @return + * Does the table is excluded for current role (this method doesn't check the access level of the table, use isTableAccessLevel for that purpose) + * @param tableID AD_Table_ID + * @return true if table access is excluded for this role */ public boolean isTableAccessExcluded(int tableID) { diff --git a/org.adempiere.base/src/org/compiere/model/MRoleIncluded.java b/org.adempiere.base/src/org/compiere/model/MRoleIncluded.java index 6a03f7abaf..655104eacf 100644 --- a/org.adempiere.base/src/org/compiere/model/MRoleIncluded.java +++ b/org.adempiere.base/src/org/compiere/model/MRoleIncluded.java @@ -1,6 +1,24 @@ -/** - * - */ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.sql.PreparedStatement; @@ -21,25 +39,35 @@ import org.compiere.util.DB; public class MRoleIncluded extends X_AD_Role_Included { /** - * + * generated serial id */ private static final long serialVersionUID = -3284165639631581484L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Role_Included_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Role_Included_UU UUID key + * @param trxName Transaction + */ public MRoleIncluded(Properties ctx, String AD_Role_Included_UU, String trxName) { super(ctx, AD_Role_Included_UU, trxName); } - + + /** + * @param ctx + * @param AD_Role_Included_ID + * @param trxName + */ public MRoleIncluded(Properties ctx, int AD_Role_Included_ID, String trxName) { super(ctx, AD_Role_Included_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MRoleIncluded(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); diff --git a/org.adempiere.base/src/org/compiere/model/MRoleMenu.java b/org.adempiere.base/src/org/compiere/model/MRoleMenu.java index 01e18955a0..bf31ec2ed3 100644 --- a/org.adempiere.base/src/org/compiere/model/MRoleMenu.java +++ b/org.adempiere.base/src/org/compiere/model/MRoleMenu.java @@ -24,29 +24,39 @@ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; - +@Deprecated public class MRoleMenu extends X_U_RoleMenu { /** - * + * generated serial id */ private static final long serialVersionUID = 9022716123964882452L; /** - * UUID based Constructor - * @param ctx Context - * @param U_RoleMenu_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param U_RoleMenu_UU UUID key + * @param trxName Transaction + */ public MRoleMenu(Properties ctx, String U_RoleMenu_UU, String trxName) { super(ctx, U_RoleMenu_UU, trxName); } + /** + * @param ctx + * @param U_RoleMenu_ID + * @param trxName + */ public MRoleMenu(Properties ctx, int U_RoleMenu_ID, String trxName) { super(ctx, U_RoleMenu_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MRoleMenu(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MRoleOrgAccess.java b/org.adempiere.base/src/org/compiere/model/MRoleOrgAccess.java index 6299ec3d6d..b4b60e2b1a 100644 --- a/org.adempiere.base/src/org/compiere/model/MRoleOrgAccess.java +++ b/org.adempiere.base/src/org/compiere/model/MRoleOrgAccess.java @@ -28,7 +28,7 @@ import org.compiere.util.Msg; import org.compiere.util.Util; /** - * Role Org Access Model + * Role Organization Access Model * * @author Jorg Janke * @version $Id: MRoleOrgAccess.java,v 1.3 2006/07/30 00:58:38 jjanke Exp $ @@ -36,16 +36,15 @@ import org.compiere.util.Util; public class MRoleOrgAccess extends X_AD_Role_OrgAccess { /** - * + * generated serial id */ private static final long serialVersionUID = 4664267788838719168L; - /** * Get Organizational Access of Role * @param ctx context * @param AD_Role_ID role - * @return array of Role Org Access + * @return array of Role Organization Access */ public static MRoleOrgAccess[] getOfRole (Properties ctx, int AD_Role_ID) { @@ -56,7 +55,7 @@ public class MRoleOrgAccess extends X_AD_Role_OrgAccess * Get Organizational Access of Client * @param ctx context * @param AD_Client_ID client - * @return array of Role Org Access + * @return array of Role Organization Access */ public static MRoleOrgAccess[] getOfClient (Properties ctx, int AD_Client_ID) { @@ -64,10 +63,10 @@ public class MRoleOrgAccess extends X_AD_Role_OrgAccess } // getOfClient /** - * Get Organizational Access of Org + * Get Organizational Access of Organization * @param ctx context - * @param AD_Org_ID role - * @return array of Role Org Access + * @param AD_Org_ID organization + * @return array of Role Organization Access */ public static MRoleOrgAccess[] getOfOrg (Properties ctx, int AD_Org_ID) { @@ -75,11 +74,11 @@ public class MRoleOrgAccess extends X_AD_Role_OrgAccess } // getOfOrg /** - * Get Organizational Info + * Get Organizational Access for Role * @param ctx context - * @param sql sql command - * @param id id - * @return array of Role Org Access + * @param sql SQL select clause + * @param id id parameter for SQL clause + * @return array of Role Organization Access */ private static MRoleOrgAccess[] get (Properties ctx, String sql, int id) { @@ -110,8 +109,8 @@ public class MRoleOrgAccess extends X_AD_Role_OrgAccess } // get /** - * Create Organizational Access for all Automatic Roles - * @param org org + * Create Organizational Access for all Automatic Roles (IsManual=N) + * @param org organization * @return true if created */ public static boolean createForOrg (MOrg org) @@ -133,9 +132,8 @@ public class MRoleOrgAccess extends X_AD_Role_OrgAccess /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MRoleOrgAccess.class); - - /************************************************************************** + /** * Load Constructor * @param ctx context * @param rs result set @@ -147,11 +145,11 @@ public class MRoleOrgAccess extends X_AD_Role_OrgAccess } // MRoleOrgAccess /** - * UUID based Constructor - * @param ctx Context - * @param AD_Role_OrgAccess_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Role_OrgAccess_UU UUID key + * @param trxName Transaction + */ public MRoleOrgAccess(Properties ctx, String AD_Role_OrgAccess_UU, String trxName) { super(ctx, AD_Role_OrgAccess_UU, trxName); if (Util.isEmpty(AD_Role_OrgAccess_UU)) @@ -159,7 +157,6 @@ public class MRoleOrgAccess extends X_AD_Role_OrgAccess } /** - * Persistency Constructor * @param ctx context * @param ignored ignored * @param trxName transaction @@ -181,7 +178,7 @@ public class MRoleOrgAccess extends X_AD_Role_OrgAccess /** * Organization Constructor - * @param org org + * @param org organization * @param AD_Role_ID role */ public MRoleOrgAccess (MOrg org, int AD_Role_ID) @@ -194,7 +191,7 @@ public class MRoleOrgAccess extends X_AD_Role_OrgAccess /** * Role Constructor * @param role role - * @param AD_Org_ID org + * @param AD_Org_ID organization */ public MRoleOrgAccess (MRole role, int AD_Org_ID) { @@ -207,6 +204,7 @@ public class MRoleOrgAccess extends X_AD_Role_OrgAccess * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder("MRoleOrgAccess["); @@ -217,9 +215,8 @@ public class MRoleOrgAccess extends X_AD_Role_OrgAccess sb.append("]"); return sb.toString(); } // toString - - /************************************************************************** + /** * Extended String Representation * @param ctx context * @return extended info @@ -237,7 +234,7 @@ public class MRoleOrgAccess extends X_AD_Role_OrgAccess /** * Get Client Name - * @return name + * @return client name */ public String getClientName() { @@ -274,8 +271,8 @@ public class MRoleOrgAccess extends X_AD_Role_OrgAccess } // getClientName /** - * Get Client Name - * @return name + * Get organization Name + * @return organization name */ public String getOrgName() { diff --git a/org.adempiere.base/src/org/compiere/model/MRule.java b/org.adempiere.base/src/org/compiere/model/MRule.java index 073ce4de49..1b7b1f5478 100644 --- a/org.adempiere.base/src/org/compiere/model/MRule.java +++ b/org.adempiere.base/src/org/compiere/model/MRule.java @@ -33,7 +33,7 @@ import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; /** - * Persistent Rule Model + * Application Rule Model * @author Carlos Ruiz * @version $Id: MRule.java * @@ -41,7 +41,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MRule extends X_AD_Rule implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -288947666359685155L; //global or login context variable prefix @@ -90,7 +90,7 @@ public class MRule extends X_AD_Rule implements ImmutablePOSupport * Get Rule from Cache * @param ctx context * @param ruleValue case sensitive rule Value - * @return Rule + * @return MRule or null */ public static MRule get (Properties ctx, String ruleValue) { @@ -118,9 +118,9 @@ public class MRule extends X_AD_Rule implements ImmutablePOSupport } // get /** - * Get Model Validation Login Rules + * Get Login Rules * @param ctx context - * @return Rule + * @return list of rule or null */ public static List getModelValidatorLoginRules (Properties ctx) { @@ -143,19 +143,19 @@ public class MRule extends X_AD_Rule implements ImmutablePOSupport private static CLogger s_log = CLogger.getCLogger (MRule.class); /* The Engine */ - ScriptEngine engine = null; + protected ScriptEngine engine = null; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Rule_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Rule_UU UUID key + * @param trxName Transaction + */ public MRule(Properties ctx, String AD_Rule_UU, String trxName) { super(ctx, AD_Rule_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param AD_Rule_ID id @@ -178,7 +178,7 @@ public class MRule extends X_AD_Rule implements ImmutablePOSupport } // MRule /** - * + * Copy constructor * @param copy */ public MRule(MRule copy) @@ -187,7 +187,7 @@ public class MRule extends X_AD_Rule implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -197,7 +197,7 @@ public class MRule extends X_AD_Rule implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -214,6 +214,7 @@ public class MRule extends X_AD_Rule implements ImmutablePOSupport * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { // Validate format for scripts @@ -236,6 +237,7 @@ public class MRule extends X_AD_Rule implements ImmutablePOSupport * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder ("MRule["); @@ -245,7 +247,7 @@ public class MRule extends X_AD_Rule implements ImmutablePOSupport /** * Script Engine for this rule - * @return ScriptEngine + * @return ScriptEngine or null */ public ScriptEngine getScriptEngine() { String engineName = getEngineName(); @@ -254,6 +256,9 @@ public class MRule extends X_AD_Rule implements ImmutablePOSupport return engine; } + /** + * @return script engine name or null + */ public String getEngineName() { int colonPosition = getValue().indexOf(":"); if (colonPosition < 0) @@ -261,9 +266,9 @@ public class MRule extends X_AD_Rule implements ImmutablePOSupport return getValue().substring(0, colonPosition); } - /************************************************************************** - * Set Context ctx to the engine based on windowNo - * @param engine ScriptEngine + /** + * Add context entries as variable binding to the script engine based on windowNo + * @param engine Script Engine * @param ctx context * @param windowNo window number */ @@ -294,11 +299,11 @@ public class MRule extends X_AD_Rule implements ImmutablePOSupport } /** - * Convert Key + * Convert context key to script engine variable name
        * # -> _ * @param key * @param m_windowNo - * @return converted key + * @return context key converted to script engine variable name */ public static String convertKey (String key, int m_windowNo) { diff --git a/org.adempiere.base/src/org/compiere/model/MSLACriteria.java b/org.adempiere.base/src/org/compiere/model/MSLACriteria.java index 53fa7635bf..385afe12e0 100644 --- a/org.adempiere.base/src/org/compiere/model/MSLACriteria.java +++ b/org.adempiere.base/src/org/compiere/model/MSLACriteria.java @@ -34,7 +34,9 @@ import org.idempiere.cache.ImmutablePOSupport; * * @author Jorg Janke * @version $Id: MSLACriteria.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $ + * @deprecated not fully implement, marked as inactive in application dictionary */ +@Deprecated public class MSLACriteria extends X_PA_SLA_Criteria implements ImmutablePOSupport { /** diff --git a/org.adempiere.base/src/org/compiere/model/MSLAGoal.java b/org.adempiere.base/src/org/compiere/model/MSLAGoal.java index c1903c0fd0..5571a35f10 100644 --- a/org.adempiere.base/src/org/compiere/model/MSLAGoal.java +++ b/org.adempiere.base/src/org/compiere/model/MSLAGoal.java @@ -32,7 +32,9 @@ import org.compiere.util.Util; * * @author Jorg Janke * @version $Id: MSLAGoal.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $ + * @deprecated not fully implement, marked as inactive in application dictionary */ +@Deprecated public class MSLAGoal extends X_PA_SLA_Goal { diff --git a/org.adempiere.base/src/org/compiere/model/MSLAMeasure.java b/org.adempiere.base/src/org/compiere/model/MSLAMeasure.java index 4573a97423..85a79fd487 100644 --- a/org.adempiere.base/src/org/compiere/model/MSLAMeasure.java +++ b/org.adempiere.base/src/org/compiere/model/MSLAMeasure.java @@ -29,7 +29,9 @@ import org.compiere.util.Util; * * @author Jorg Janke * @version $Id: MSLAMeasure.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $ + * @deprecated not fully implement, marked as inactive in application dictionary */ +@Deprecated public class MSLAMeasure extends X_PA_SLA_Measure { diff --git a/org.adempiere.base/src/org/compiere/model/MSMTP.java b/org.adempiere.base/src/org/compiere/model/MSMTP.java index 3a052f4312..c1da94521e 100644 --- a/org.adempiere.base/src/org/compiere/model/MSMTP.java +++ b/org.adempiere.base/src/org/compiere/model/MSMTP.java @@ -32,12 +32,11 @@ import org.idempiere.cache.ImmutablePOCache; import org.idempiere.cache.ImmutablePOSupport; /** - * SMTP servers + * SMTP server for specific email address or domain */ public class MSMTP extends X_AD_SMTP implements ImmutablePOSupport { - /** - * + * generated serial id */ private static final long serialVersionUID = -3645639750095013941L; @@ -45,11 +44,11 @@ public class MSMTP extends X_AD_SMTP implements ImmutablePOSupport { private static ImmutablePOCache s_cache = new ImmutablePOCache(Table_Name, 20); /** - * UUID based Constructor - * @param ctx Context - * @param AD_SMTP_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_SMTP_UU UUID key + * @param trxName Transaction + */ public MSMTP(Properties ctx, String AD_SMTP_UU, String trxName) { super(ctx, AD_SMTP_UU, trxName); } @@ -75,7 +74,7 @@ public class MSMTP extends X_AD_SMTP implements ImmutablePOSupport { } // MSMTP /** - * + * Copy constructor * @param ctx * @param copy */ @@ -84,7 +83,7 @@ public class MSMTP extends X_AD_SMTP implements ImmutablePOSupport { } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -94,12 +93,25 @@ public class MSMTP extends X_AD_SMTP implements ImmutablePOSupport { copyPO(copy); } - /** Search a SMTP server for the sender (1st try with the full address, 2nd try with domain only) */ + /** + * Search a SMTP server for the sender (1st try with the full address, 2nd try with domain only) + * @param ctx + * @param clientID + * @param from from email address + * @return MSMTP or null + */ public static MSMTP get (Properties ctx, int clientID, String from) { return get(ctx, clientID, from, null); } - /** Search a SMTP server for the sender (1st try with the full address, 2nd try with domain only) */ + /** + * Search a SMTP server for the sender (1st try with the full address, 2nd try with domain only) + * @param ctx + * @param clientID + * @param from from email address + * @param trxName + * @return MSMTP or null + */ public static MSMTP get (Properties ctx, int clientID, String from, String trxName) { String key = new StringBuilder().append(clientID).append("_").append(from).toString(); @@ -134,6 +146,7 @@ public class MSMTP extends X_AD_SMTP implements ImmutablePOSupport { * String Representation * @return info */ + @Override public String toString() { return new StringBuilder ("MSMTP[").append(get_ID()).append(" - Name=").append(getName()).append(" - Host=").append(getSMTPHost()).append("]").toString(); } // toString diff --git a/org.adempiere.base/src/org/compiere/model/MSSOPrincipalConfig.java b/org.adempiere.base/src/org/compiere/model/MSSOPrincipalConfig.java index 2a52fac939..8643aaab93 100644 --- a/org.adempiere.base/src/org/compiere/model/MSSOPrincipalConfig.java +++ b/org.adempiere.base/src/org/compiere/model/MSSOPrincipalConfig.java @@ -10,7 +10,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * *****************************************************************************/ - package org.compiere.model; import java.sql.ResultSet; @@ -19,23 +18,39 @@ import java.util.Properties; import org.adempiere.exceptions.AdempiereException; import org.compiere.util.Env; +/** + * SSO Principal Service Configuration + */ public class MSSOPrincipalConfig extends X_SSO_PrincipalConfig { /** - * + * generated serial id */ private static final long serialVersionUID = -6330419996581130413L; + /** + * @param ctx + * @param MFA_SSOAuthentication_ID + * @param trxName + */ public MSSOPrincipalConfig(Properties ctx, int MFA_SSOAuthentication_ID, String trxName) { super(ctx, MFA_SSOAuthentication_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MSSOPrincipalConfig(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } + /** + * @return Default MSSOPrincipalConfig + */ public static MSSOPrincipalConfig getDefaultSSOPrincipalConfig() { return new Query(Env.getCtx(), Table_Name, COLUMNNAME_IsDefault + " = 'Y' ", null).setOnlyActiveRecords(true).firstOnly(); diff --git a/org.adempiere.base/src/org/compiere/model/MSalesRegion.java b/org.adempiere.base/src/org/compiere/model/MSalesRegion.java index 110b9622eb..6cb2b47595 100644 --- a/org.adempiere.base/src/org/compiere/model/MSalesRegion.java +++ b/org.adempiere.base/src/org/compiere/model/MSalesRegion.java @@ -23,7 +23,6 @@ import org.compiere.util.Env; import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; - /** * Sales Region Model * @@ -33,11 +32,10 @@ import org.idempiere.cache.ImmutablePOSupport; public class MSalesRegion extends X_C_SalesRegion implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -1958080117315345389L; - /** * Get SalesRegion from Cache (immutable) * @param C_SalesRegion_ID id @@ -72,18 +70,17 @@ public class MSalesRegion extends X_C_SalesRegion implements ImmutablePOSupport /** Cache */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 10); - /** - * UUID based Constructor - * @param ctx Context - * @param C_SalesRegion_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_SalesRegion_UU UUID key + * @param trxName Transaction + */ public MSalesRegion(Properties ctx, String C_SalesRegion_UU, String trxName) { super(ctx, C_SalesRegion_UU, trxName); } - /************************************************************************** + /** * Default Constructor * @param ctx context * @param C_SalesRegion_ID id @@ -106,7 +103,7 @@ public class MSalesRegion extends X_C_SalesRegion implements ImmutablePOSupport } // MSalesRegion /** - * + * Copy constructor * @param copy */ public MSalesRegion(MSalesRegion copy) @@ -115,7 +112,7 @@ public class MSalesRegion extends X_C_SalesRegion implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -125,7 +122,7 @@ public class MSalesRegion extends X_C_SalesRegion implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -144,6 +141,7 @@ public class MSalesRegion extends X_C_SalesRegion implements ImmutablePOSupport * @param success save success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -164,6 +162,7 @@ public class MSalesRegion extends X_C_SalesRegion implements ImmutablePOSupport * @param success * @return deleted */ + @Override protected boolean afterDelete (boolean success) { if (success) diff --git a/org.adempiere.base/src/org/compiere/model/MSchedule.java b/org.adempiere.base/src/org/compiere/model/MSchedule.java index 87e9762f0a..0aea89a9a0 100644 --- a/org.adempiere.base/src/org/compiere/model/MSchedule.java +++ b/org.adempiere.base/src/org/compiere/model/MSchedule.java @@ -14,7 +14,6 @@ * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * * or via info@compiere.org or http://www.compiere.org/license.html * *****************************************************************************/ - package org.compiere.model; import it.sauronsoftware.cron4j.Predictor; @@ -37,11 +36,13 @@ import org.compiere.util.Util; import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; - +/** + * Schedule model for scheduler + */ public class MSchedule extends X_AD_Schedule implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 7183417983901074702L; private static Pattern VALID_IPV4_PATTERN = null; @@ -50,25 +51,35 @@ public class MSchedule extends X_AD_Schedule implements ImmutablePOSupport private static final String ipv6Pattern = "([0-9a-f]{1,4}:){7}([0-9a-f]){1,4}"; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Schedule_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Schedule_UU UUID key + * @param trxName Transaction + */ public MSchedule(Properties ctx, String AD_Schedule_UU, String trxName) { super(ctx, AD_Schedule_UU, trxName); } + /** + * @param ctx + * @param AD_Schedule_ID + * @param trxName + */ public MSchedule(Properties ctx, int AD_Schedule_ID, String trxName) { super(ctx, AD_Schedule_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MSchedule(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } /** - * + * Copy constructor * @param copy */ public MSchedule(MSchedule copy) { @@ -76,7 +87,7 @@ public class MSchedule extends X_AD_Schedule implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -85,7 +96,7 @@ public class MSchedule extends X_AD_Schedule implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -97,34 +108,33 @@ public class MSchedule extends X_AD_Schedule implements ImmutablePOSupport @Override protected boolean beforeSave(boolean newRecord) { - // Set Schedule Type & Frequencies - if (SCHEDULETYPE_Frequency.equals(getScheduleType())) + // Set Schedule Type & Frequencies + if (SCHEDULETYPE_Frequency.equals(getScheduleType())) + { + if (getFrequencyType() == null) + setFrequencyType(FREQUENCYTYPE_Day); + if (getFrequency() < 1) + setFrequency(1); + setCronPattern(null); + } + else if (SCHEDULETYPE_CronSchedulingPattern.equals(getScheduleType())) + { + String pattern = getCronPattern(); + if (pattern != null && pattern.trim().length() > 0) { - if (getFrequencyType() == null) - setFrequencyType(FREQUENCYTYPE_Day); - if (getFrequency() < 1) - setFrequency(1); - setCronPattern(null); - } - else if (SCHEDULETYPE_CronSchedulingPattern.equals(getScheduleType())) - { - String pattern = getCronPattern(); - if (pattern != null && pattern.trim().length() > 0) + if (!SchedulingPattern.validate(pattern)) { - if (!SchedulingPattern.validate(pattern)) - { - log.saveError("Error", "InvalidCronPattern"); - return false; - } + log.saveError("Error", "InvalidCronPattern"); + return false; } } - return true; + } + return true; } /** - * Brought from Compiere Open Source Community version 3.3.0 - * Is it OK to Run process On IP of this box - * @return + * Is it OK to Run process on this server based on server IP verification. + * @return true if it is ok to run */ public boolean isOKtoRunOnIP() { @@ -147,11 +157,9 @@ public class MSchedule extends X_AD_Schedule implements ImmutablePOSupport } // isOKtoRunOnIP /** - * - * Brought from Compiere Open Source Community version 3.3.0 - * check whether this IP is allowed to process + * check whether this server's IP match the ipOnly argument * @param ipOnly - * @return true if IP is correct + * @return true if server IP match ipOnly */ private boolean checkIP(String ipOnly) { try { @@ -231,6 +239,10 @@ public class MSchedule extends X_AD_Schedule implements ImmutablePOSupport /** Cache */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache (Table_Name, 10); + /** + * @param ipOnly + * @return true if ipOnly is IPV4 IPV6 address + */ public boolean chekIPFormat(String ipOnly) { boolean IsIp = false; @@ -266,6 +278,7 @@ public class MSchedule extends X_AD_Schedule implements ImmutablePOSupport * @return next run in MS * @deprecated */ + @Deprecated public static long getNextRunMS (long last, String scheduleType, String frequencyType, int frequency, String cronPattern) { return getNextRunMS(last, scheduleType, frequencyType, frequency, cronPattern, null); @@ -279,7 +292,7 @@ public class MSchedule extends X_AD_Schedule implements ImmutablePOSupport * @param frequency * @param cronPattern * @param timeZone - * @return next run in MS + * @return next run time stamp in millisecond */ public static long getNextRunMS (long last, String scheduleType, String frequencyType, int frequency, String cronPattern, String timeZone) { diff --git a/org.adempiere.base/src/org/compiere/model/MScheduler.java b/org.adempiere.base/src/org/compiere/model/MScheduler.java index 9224c09b81..334a683565 100644 --- a/org.adempiere.base/src/org/compiere/model/MScheduler.java +++ b/org.adempiere.base/src/org/compiere/model/MScheduler.java @@ -31,7 +31,6 @@ import org.compiere.util.Msg; import org.compiere.util.Util; import org.idempiere.cache.ImmutablePOSupport; - /** * Scheduler Model * @@ -45,14 +44,14 @@ public class MScheduler extends X_AD_Scheduler implements AdempiereProcessor, AdempiereProcessor2, ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -2427229109274587547L; /** - * Get Active + * Get active schedulers * @param ctx context - * @return active processors + * @return active schedulers */ public static MScheduler[] getActive (Properties ctx) { @@ -65,11 +64,11 @@ public class MScheduler extends X_AD_Scheduler } // getActive /** - * UUID based Constructor - * @param ctx Context - * @param AD_Scheduler_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Scheduler_UU UUID key + * @param trxName Transaction + */ public MScheduler(Properties ctx, String AD_Scheduler_UU, String trxName) { super(ctx, AD_Scheduler_UU, trxName); if (Util.isEmpty(AD_Scheduler_UU)) @@ -108,7 +107,7 @@ public class MScheduler extends X_AD_Scheduler } // MScheduler /** - * + * Copy constructor * @param copy */ public MScheduler(MScheduler copy) @@ -117,7 +116,7 @@ public class MScheduler extends X_AD_Scheduler } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -127,7 +126,7 @@ public class MScheduler extends X_AD_Scheduler } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -147,7 +146,7 @@ public class MScheduler extends X_AD_Scheduler /** * Get Server ID - * @return id + * @return server id */ public String getServerID () { @@ -162,9 +161,9 @@ public class MScheduler extends X_AD_Scheduler } // getServerID /** - * Get Date Next Run + * Get Next Run time stamp * @param requery requery - * @return date next run + * @return next run time stamp */ public Timestamp getDateNextRun (boolean requery) { @@ -174,8 +173,8 @@ public class MScheduler extends X_AD_Scheduler } // getDateNextRun /** - * Get Logs - * @return logs + * Get scheduler logs + * @return scheduler logs */ public AdempiereProcessorLog[] getLogs () { @@ -190,8 +189,8 @@ public class MScheduler extends X_AD_Scheduler } // getLogs /** - * Delete old Request Log - * @return number of records + * Delete old scheduler logs + * @return number of records deleted */ public int deleteLog() { @@ -214,9 +213,9 @@ public class MScheduler extends X_AD_Scheduler } // getProcess /** - * Get Parameters - * @param reload reload - * @return parameter + * Get Scheduler Parameters + * @param reload true to reload from DB + * @return scheduler parameters */ public MSchedulerPara[] getParameters (boolean reload) { @@ -236,9 +235,9 @@ public class MScheduler extends X_AD_Scheduler } // getParameter /** - * Get Recipients - * @param reload reload - * @return Recipients + * Get Scheduler Recipients for notificationss + * @param reload true to reload from DB + * @return Scheduler Recipients */ public MSchedulerRecipient[] getRecipients (boolean reload) { @@ -260,7 +259,7 @@ public class MScheduler extends X_AD_Scheduler /** * Get Recipient AD_User_IDs - * @return array of user IDs + * @return array of recipient user IDs */ public Integer[] getRecipientAD_User_IDs() { @@ -269,8 +268,8 @@ public class MScheduler extends X_AD_Scheduler /** * Get Recipient AD_User_IDs - * @param excludeUploadRecipient - * @return array of user IDs + * @param excludeUploadRecipient true to exclude recipient with IsUpload=Y + * @return array of recipient user IDs */ public Integer[] getRecipientAD_User_IDs(boolean excludeUploadRecipient) { @@ -369,6 +368,7 @@ public class MScheduler extends X_AD_Scheduler * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MScheduler["); @@ -417,8 +417,8 @@ public class MScheduler extends X_AD_Scheduler } /** - * - * @return list of upload recipients + * Get scheduler upload recipients + * @return array of upload recipients */ public MSchedulerRecipient[] getUploadRecipients() { List list = new ArrayList<>(); diff --git a/org.adempiere.base/src/org/compiere/model/MSchedulerLog.java b/org.adempiere.base/src/org/compiere/model/MSchedulerLog.java index cf0d28e381..b119c2005a 100644 --- a/org.adempiere.base/src/org/compiere/model/MSchedulerLog.java +++ b/org.adempiere.base/src/org/compiere/model/MSchedulerLog.java @@ -21,7 +21,6 @@ import java.util.Properties; import org.compiere.util.Util; - /** * Scheduler Log * @@ -32,16 +31,16 @@ public class MSchedulerLog extends X_AD_SchedulerLog implements AdempiereProcessorLog { /** - * + * generated serial id */ private static final long serialVersionUID = -8105976307507562851L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_SchedulerLog_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_SchedulerLog_UU UUID key + * @param trxName Transaction + */ public MSchedulerLog(Properties ctx, String AD_SchedulerLog_UU, String trxName) { super(ctx, AD_SchedulerLog_UU, trxName); if (Util.isEmpty(AD_SchedulerLog_UU)) @@ -82,7 +81,7 @@ public class MSchedulerLog extends X_AD_SchedulerLog /** * Parent Constructor * @param parent parent - * @param summary summary + * @param summary summary text */ public MSchedulerLog (MScheduler parent, String summary) { diff --git a/org.adempiere.base/src/org/compiere/model/MSchedulerPara.java b/org.adempiere.base/src/org/compiere/model/MSchedulerPara.java index fd753fbc67..0771663c24 100644 --- a/org.adempiere.base/src/org/compiere/model/MSchedulerPara.java +++ b/org.adempiere.base/src/org/compiere/model/MSchedulerPara.java @@ -32,16 +32,16 @@ import org.idempiere.model.IProcessParameter; public class MSchedulerPara extends X_AD_Scheduler_Para implements ImmutablePOSupport, IProcessParameter { /** - * + * generated serial id */ private static final long serialVersionUID = -9178948165437974600L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Scheduler_Para_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Scheduler_Para_UU UUID key + * @param trxName Transaction + */ public MSchedulerPara(Properties ctx, String AD_Scheduler_Para_UU, String trxName) { super(ctx, AD_Scheduler_Para_UU, trxName); } @@ -69,7 +69,7 @@ public class MSchedulerPara extends X_AD_Scheduler_Para implements ImmutablePOSu } // MSchedulerPara /** - * + * Copy constructor * @param copy */ public MSchedulerPara(MSchedulerPara copy) @@ -78,7 +78,7 @@ public class MSchedulerPara extends X_AD_Scheduler_Para implements ImmutablePOSu } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -88,7 +88,7 @@ public class MSchedulerPara extends X_AD_Scheduler_Para implements ImmutablePOSu } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -115,7 +115,7 @@ public class MSchedulerPara extends X_AD_Scheduler_Para implements ImmutablePOSu } // getColumnName /** - * Get Display Type + * Get Display Type (AD_Reference_ID) * @return display type */ public int getDisplayType() @@ -129,6 +129,7 @@ public class MSchedulerPara extends X_AD_Scheduler_Para implements ImmutablePOSu * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder("MSchedulerPara["); diff --git a/org.adempiere.base/src/org/compiere/model/MSchedulerRecipient.java b/org.adempiere.base/src/org/compiere/model/MSchedulerRecipient.java index eca1515167..f6573bafdb 100644 --- a/org.adempiere.base/src/org/compiere/model/MSchedulerRecipient.java +++ b/org.adempiere.base/src/org/compiere/model/MSchedulerRecipient.java @@ -31,16 +31,16 @@ import org.idempiere.cache.ImmutablePOSupport; public class MSchedulerRecipient extends X_AD_SchedulerRecipient implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -4928359768598663557L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_SchedulerRecipient_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_SchedulerRecipient_UU UUID key + * @param trxName Transaction + */ public MSchedulerRecipient(Properties ctx, String AD_SchedulerRecipient_UU, String trxName) { super(ctx, AD_SchedulerRecipient_UU, trxName); } @@ -68,7 +68,7 @@ public class MSchedulerRecipient extends X_AD_SchedulerRecipient implements Immu } // MSchedulerRecipient /** - * + * Copy constructor * @param copy */ public MSchedulerRecipient(MSchedulerRecipient copy) @@ -77,7 +77,7 @@ public class MSchedulerRecipient extends X_AD_SchedulerRecipient implements Immu } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -87,7 +87,7 @@ public class MSchedulerRecipient extends X_AD_SchedulerRecipient implements Immu } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MSearchDefinition.java b/org.adempiere.base/src/org/compiere/model/MSearchDefinition.java index 1359584acb..b15d4babc0 100644 --- a/org.adempiere.base/src/org/compiere/model/MSearchDefinition.java +++ b/org.adempiere.base/src/org/compiere/model/MSearchDefinition.java @@ -41,11 +41,10 @@ import org.compiere.util.Env; /** * @author Jan Roessler, jr@schaeffer-ag.de - * */ public class MSearchDefinition extends X_AD_SearchDefinition { /** - * + * generated serial id */ private static final long serialVersionUID = -5366274782950561962L; /** Constant for the searchtype table */ @@ -56,14 +55,13 @@ public class MSearchDefinition extends X_AD_SearchDefinition { public static final String DATATYPE_STRING = "S"; /** Constant for the datatype Integer */ public static final String DATATYPE_INTEGER = "I"; - - + /** - * UUID based Constructor - * @param ctx Context - * @param AD_SearchDefinition_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_SearchDefinition_UU UUID key + * @param trxName Transaction + */ public MSearchDefinition(Properties ctx, String AD_SearchDefinition_UU, String trxName) { super(ctx, AD_SearchDefinition_UU, trxName); } @@ -77,6 +75,11 @@ public class MSearchDefinition extends X_AD_SearchDefinition { super(ctx, AD_SearchDefinition_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MSearchDefinition(Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } @@ -84,8 +87,8 @@ public class MSearchDefinition extends X_AD_SearchDefinition { /** * Returns all SearchDefinition objects with the given transaction code * - * @param transactionCode - * @return + * @param transactionCode optional transaction code, null to use default search definition + * @return search definition list * @throws SQLException */ public static List getForCode(String transactionCode) throws SQLException { @@ -122,6 +125,11 @@ public class MSearchDefinition extends X_AD_SearchDefinition { } + /** + * @param transactionCode + * @return true if transaction code exists in at least one active search definition record + * @throws SQLException + */ public static boolean isValidTransactionCode(String transactionCode) throws SQLException { boolean found = false; diff --git a/org.adempiere.base/src/org/compiere/model/MSequence.java b/org.adempiere.base/src/org/compiere/model/MSequence.java index 538e1a0872..990acad3dc 100644 --- a/org.adempiere.base/src/org/compiere/model/MSequence.java +++ b/org.adempiere.base/src/org/compiere/model/MSequence.java @@ -26,11 +26,9 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.text.DecimalFormat; import java.text.SimpleDateFormat; -import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Properties; -import java.util.Vector; import java.util.logging.Level; import org.adempiere.exceptions.AdempiereException; @@ -54,7 +52,7 @@ import org.compiere.util.Util; public class MSequence extends X_AD_Sequence { /** - * + * generated serial id */ private static final long serialVersionUID = -750059366190164777L; @@ -62,18 +60,22 @@ public class MSequence extends X_AD_Sequence private static final String NoYearNorMonth = "-"; + /** + * @param AD_Client_ID + * @param TableName + * @return next id from table id sequence + */ public static int getNextID (int AD_Client_ID, String TableName) { return getNextID(AD_Client_ID, TableName, null); } /** - * - * Get next number for Key column = 0 is Error. + * Get next number from table id sequence * @param AD_Client_ID client * @param TableName table name * @param trxName - * @return next no or (-1=not found, -2=error) + * @return next id or (-1=not found, -2=error) */ public static int getNextID (int AD_Client_ID, String TableName, String trxName) { @@ -269,8 +271,8 @@ public class MSequence extends X_AD_Sequence return retValue; } // getNextID - /************************************************************************** - * Get Document No from table + /** + * Get next Document No for table * @param AD_Client_ID client * @param TableName table name * @param trxName optional Transaction Name @@ -281,8 +283,9 @@ public class MSequence extends X_AD_Sequence return getDocumentNo(AD_Client_ID, TableName, trxName, null); } - /************************************************************************** - * Get Document No from table (when the document doesn't have a c_doctype) + + /** + * Get next Document No for table (when the document doesn't have a c_doctype) * @param AD_Client_ID client * @param TableName table name * @param trxName optional Transaction Name @@ -306,6 +309,13 @@ public class MSequence extends X_AD_Sequence return getDocumentNoFromSeq(seq, trxName, po); } // getDocumentNo + /** + * Get next document no from sequence + * @param seq + * @param trxName + * @param po + * @return document no or null + */ public static String getDocumentNoFromSeq(MSequence seq, String trxName, PO po) { // Check AdempiereSys boolean adempiereSys = false; @@ -562,13 +572,14 @@ public class MSequence extends X_AD_Sequence * @return document no or null * @deprecated */ + @Deprecated public static String getDocumentNo(int C_DocType_ID, String trxName) { return getDocumentNo (C_DocType_ID, trxName, false); } // getDocumentNo /** - * Get Document No based on Document Type + * Get next Document No based on Document Type * @param C_DocType_ID document type * @param trxName optional Transaction Name * @param definite asking for a definitive or temporary sequence @@ -580,7 +591,7 @@ public class MSequence extends X_AD_Sequence } /** - * Get Document No based on Document Type + * Get next Document No based on Document Type * @param C_DocType_ID document type * @param trxName optional Transaction Name * @param definite asking for a definitive or temporary sequence @@ -624,8 +635,7 @@ public class MSequence extends X_AD_Sequence return getDocumentNoFromSeq(seq, trxName, po); } // getDocumentNo - - /************************************************************************** + /** * Check/Initialize Client DocumentNo/Value Sequences * @param ctx context * @param AD_Client_ID client @@ -686,16 +696,23 @@ public class MSequence extends X_AD_Sequence return success; } // checkClientSequences - + /** + * Create Table ID Sequence + * @param ctx + * @param TableName + * @param trxName + * @return true if created + */ public static boolean createTableSequence (Properties ctx, String TableName, String trxName) { return createTableSequence (ctx, TableName, trxName, true); } /** - * Create Table ID Sequence + * Create Table Sequence * @param ctx context * @param TableName table name * @param trxName transaction + * @param tableID true for table id sequence, false for documentno/value sequence * @return true if created */ public static boolean createTableSequence (Properties ctx, String TableName, String trxName, boolean tableID) @@ -740,7 +757,6 @@ public class MSequence extends X_AD_Sequence return true; } // createTableSequence - /** * Get Sequence * @param ctx context @@ -752,7 +768,13 @@ public class MSequence extends X_AD_Sequence return get(ctx, tableName, null); } - /* Get the tableID sequence based on the TableName */ + /** + * Get the tableID sequence based on the TableName + * @param ctx + * @param tableName + * @param trxName + * @return sequence + */ public static MSequence get (Properties ctx, String tableName, String trxName) { return get (ctx, tableName, trxName, true); @@ -763,7 +785,7 @@ public class MSequence extends X_AD_Sequence * @param ctx context * @param tableName table name * @param trxName optional transaction name - * @param tableID + * @param tableID IsTableID flag * @return Sequence */ public static MSequence get (Properties ctx, String tableName, String trxName, boolean tableID) @@ -815,20 +837,19 @@ public class MSequence extends X_AD_Sequence /** Static Logger */ private static CLogger s_log = CLogger.getCLogger(MSequence.class); - /** - * UUID based Constructor - * @param ctx Context - * @param AD_Sequence_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Sequence_UU UUID key + * @param trxName Transaction + */ public MSequence(Properties ctx, String AD_Sequence_UU, String trxName) { super(ctx, AD_Sequence_UU, trxName); if (Util.isEmpty(AD_Sequence_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param AD_Sequence_ID id @@ -900,11 +921,12 @@ public class MSequence extends X_AD_Sequence setCurrentNextSys(StartNo/10); } // MSequence; - - /************************************************************************** + /** * Get Next No and increase current next * @return next no to use + * @deprecated use the static getNextID or getDocumentNo method instead */ + @Deprecated public int getNextID() { int retValue = getCurrentNext(); @@ -914,6 +936,10 @@ public class MSequence extends X_AD_Sequence return retValue; } // getNextNo + /** + * Validate Table Sequence Values + * @return info + */ public String validateTableIDValue() { return validateTableIDValue(null); @@ -922,7 +948,7 @@ public class MSequence extends X_AD_Sequence /** * Validate Table Sequence Values * trxName the Transaction - * @return true if updated + * @return info */ public String validateTableIDValue(String trxName) { @@ -1009,115 +1035,17 @@ public class MSequence extends X_AD_Sequence super.setCurrentNext(CurrentNext); } } - /************************************************************************** - * Test - * @param args ignored - */ - static public void main (String[] args) - { - org.compiere.Adempiere.startup(true); - CLogMgt.setLevel(Level.SEVERE); - CLogMgt.setLoggerLevel(Level.SEVERE, null); - s_list = new Vector(1000); - - /** Time Test */ - long time = System.currentTimeMillis(); - Thread[] threads = new Thread[10]; - for (int i = 0; i < 10; i++) - { - Runnable r = new GetIDs(i); - threads[i] = new Thread(r); - threads[i].start(); - } - for (int i = 0; i < 10; i++) - { - try - { - threads[i].join(); - } - catch (InterruptedException e) - { - } - } - time = System.currentTimeMillis() - time; - - System.out.println("-------------------------------------------"); - System.out.println("Size=" + s_list.size() + " (should be 1000)"); - Integer[] ia = new Integer[s_list.size()]; - s_list.toArray(ia); - Arrays.sort(ia); - Integer last = null; - int duplicates = 0; - for (int i = 0; i < ia.length; i++) - { - if (last != null) - { - if (last.compareTo(ia[i]) == 0) - { - duplicates++; - } - } - last = ia[i]; - } - System.out.println("-------------------------------------------"); - System.out.println("Size=" + s_list.size() + " (should be 1000)"); - System.out.println("Duplicates=" + duplicates); - System.out.println("Time (ms)=" + time + " - " + ((float)time/s_list.size()) + " each" ); - System.out.println("-------------------------------------------"); - } // main - - /** Test */ - private static Vector s_list = null; /** - * Test Sequence - Get IDs - * - * @author Jorg Janke - * @version $Id: MSequence.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ - */ - public static class GetIDs implements Runnable - { - /** - * Get IDs - * @param i - */ - public GetIDs (int i) - { - m_i = i; - } - @SuppressWarnings("unused") - private int m_i; - - /** - * Run - */ - public void run() - { - for (int i = 0; i < 100; i++) - { - try - { - int no = DB.getNextID(0, "Test", null); - s_list.add(Integer.valueOf(no)); - } - catch (Exception e) - { - System.err.println(e.getMessage()); - } - } - } - } // GetIDs - - /** - * Get next number for Key column + * Get next official id through http call * @param TableName table name - * @return next no or (-1=error) + * @return next official id or (-1=error) */ public static synchronized int getNextOfficialID_HTTP (String TableName) { String website = MSysConfig.getValue(MSysConfig.DICTIONARY_ID_WEBSITE); // "http://developer.adempiere.com/cgi-bin/get_ID"; - String prm_USER = MSysConfig.getValue(MSysConfig.DICTIONARY_ID_USER); // "globalqss"; - String prm_PASSWORD = MSysConfig.getValue(MSysConfig.DICTIONARY_ID_PASSWORD); // "password_inseguro"; + String prm_USER = MSysConfig.getValue(MSysConfig.DICTIONARY_ID_USER); + String prm_PASSWORD = MSysConfig.getValue(MSysConfig.DICTIONARY_ID_PASSWORD); String prm_TABLE = TableName; String prm_ALTKEY = ""; // TODO: generate alt-key based on key of table String prm_COMMENT = Env.getContext(Env.getCtx(), I_AD_UserPreference.COLUMNNAME_MigrationScriptComment); @@ -1128,9 +1056,9 @@ public class MSequence extends X_AD_Sequence } /** - * Get next number for Key column + * Get next centralized id through http call * @param TableName table name - * @return next no or (-1=error) + * @return next centralized id or (-1=error) */ public static synchronized int getNextProjectID_HTTP (String TableName) { @@ -1146,6 +1074,18 @@ public class MSequence extends X_AD_Sequence prm_PASSWORD, prm_TABLE, prm_ALTKEY, prm_COMMENT, prm_PROJECT); } + /** + * Get next id through http call + * @param TableName + * @param website + * @param prm_USER + * @param prm_PASSWORD + * @param prm_TABLE + * @param prm_ALTKEY + * @param prm_COMMENT + * @param prm_PROJECT + * @return next id or -1 if there's error + */ private static int getNextID_HTTP(String TableName, String website, String prm_USER, String prm_PASSWORD, String prm_TABLE, String prm_ALTKEY, String prm_COMMENT, @@ -1195,6 +1135,7 @@ public class MSequence extends X_AD_Sequence return retValue; } + /** List of table that shouldn't use centralized id */ private static String [] dontUseCentralized = new String[] { "AD_ACCESSLOG", "AD_ALERTPROCESSORLOG", @@ -1255,7 +1196,7 @@ public class MSequence extends X_AD_Sequence /** * @param tableName - * @return true if tableName has entity type column name + * @return true if table has entity type column */ public static synchronized boolean isTableWithEntityType(String tableName) { if (tablesWithEntityType.size() == 0) { diff --git a/org.adempiere.base/src/org/compiere/model/MSerNoCtl.java b/org.adempiere.base/src/org/compiere/model/MSerNoCtl.java index 9f81901efc..96f289f35d 100644 --- a/org.adempiere.base/src/org/compiere/model/MSerNoCtl.java +++ b/org.adempiere.base/src/org/compiere/model/MSerNoCtl.java @@ -30,16 +30,16 @@ import org.compiere.util.Util; public class MSerNoCtl extends X_M_SerNoCtl { /** - * + * generated serial id */ private static final long serialVersionUID = -6746210722573475011L; /** - * UUID based Constructor - * @param ctx Context - * @param M_SerNoCtl_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_SerNoCtl_UU UUID key + * @param trxName Transaction + */ public MSerNoCtl(Properties ctx, String M_SerNoCtl_UU, String trxName) { super(ctx, M_SerNoCtl_UU, trxName); if (Util.isEmpty(M_SerNoCtl_UU)) @@ -80,9 +80,9 @@ public class MSerNoCtl extends X_M_SerNoCtl } // MSerNoCtl /** - * Create new Lot. + * Create new serial no. * Increments Current Next and Commits - * @return saved Lot + * @return new serial no */ public String createSerNo () { diff --git a/org.adempiere.base/src/org/compiere/model/MSerNoCtlExclude.java b/org.adempiere.base/src/org/compiere/model/MSerNoCtlExclude.java index 64c6e58556..791532ae02 100644 --- a/org.adempiere.base/src/org/compiere/model/MSerNoCtlExclude.java +++ b/org.adempiere.base/src/org/compiere/model/MSerNoCtlExclude.java @@ -33,22 +33,21 @@ import org.compiere.util.Env; public class MSerNoCtlExclude extends X_M_SerNoCtlExclude { /** - * + * generated serial id */ private static final long serialVersionUID = -5338323423136199056L; /** - * UUID based Constructor - * @param ctx Context - * @param M_SerNoCtlExclude_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_SerNoCtlExclude_UU UUID key + * @param trxName Transaction + */ public MSerNoCtlExclude(Properties ctx, String M_SerNoCtlExclude_UU, String trxName) { super(ctx, M_SerNoCtlExclude_UU, trxName); } /** - * * @param ctx * @param M_SerNoCtlExclude_ID * @param trxName @@ -58,7 +57,6 @@ public class MSerNoCtlExclude extends X_M_SerNoCtlExclude { } /** - * * @param ctx * @param rs * @param trxName @@ -68,7 +66,7 @@ public class MSerNoCtlExclude extends X_M_SerNoCtlExclude { } /** - * + * Copy constructor * @param copy */ public MSerNoCtlExclude(MSerNoCtlExclude copy) { @@ -76,7 +74,7 @@ public class MSerNoCtlExclude extends X_M_SerNoCtlExclude { } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -85,7 +83,7 @@ public class MSerNoCtlExclude extends X_M_SerNoCtlExclude { } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MSession.java b/org.adempiere.base/src/org/compiere/model/MSession.java index 673bf6d2df..dffbd15b05 100644 --- a/org.adempiere.base/src/org/compiere/model/MSession.java +++ b/org.adempiere.base/src/org/compiere/model/MSession.java @@ -32,7 +32,6 @@ import org.idempiere.cache.ImmutablePOSupport; /** * Session Model. - * Maintained in AMenu. * * @author Jorg Janke * @version $Id: MSession.java,v 1.3 2006/07/30 00:58:05 jjanke Exp $ @@ -44,7 +43,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MSession extends X_AD_Session implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -5836154187760734691L; @@ -55,6 +54,7 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport * @return session session * @deprecated use Get and Create functions. */ + @Deprecated public static MSession get (Properties ctx, boolean createNew) { MSession session = get(ctx); @@ -64,9 +64,9 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport } // get /** - * Get existing local session + * Get session from context * @param ctx context - * @return session session + * @return session */ public static MSession get (Properties ctx) { @@ -88,11 +88,9 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport } // get /** - * Get existing or create local session + * Create new session for context * @param ctx context - * @param createNew create if not found - * @param isImmutable return Immutable Session Object (from Cache) - * @return session session + * @return session */ public static MSession create (Properties ctx) { @@ -104,7 +102,7 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport } // get /** - * Get existing or create remote session + * Get existing or create new session * @param ctx context * @param Remote_Addr remote address * @param Remote_Host remote host @@ -139,21 +137,20 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport return 0; // do not remove the session on update }; }; - - + /** - * UUID based Constructor - * @param ctx Context - * @param AD_Session_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Session_UU UUID key + * @param trxName Transaction + */ public MSession(Properties ctx, String AD_Session_UU, String trxName) { super(ctx, AD_Session_UU, trxName); if (Util.isEmpty(AD_Session_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param AD_Session_ID id @@ -185,7 +182,7 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport } // MSession /** - * New (remote) Constructor + * New Session Constructor * @param ctx context * @param Remote_Addr remote address * @param Remote_Host remote host @@ -211,7 +208,7 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport } // MSession /** - * New (local) Constructor + * New Session Constructor * @param ctx context * @param trxName transaction */ @@ -237,7 +234,7 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport } // MSession /** - * + * Copy constructor * @param copy */ public MSession(MSession copy) @@ -246,7 +243,7 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -256,7 +253,7 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -272,7 +269,7 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport /** * Is it a Web Store Session - * @return Returns true if Web Store Session. + * @return true if this is a Web Store Session. */ public boolean isWebStoreSession () { @@ -281,7 +278,7 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport /** * Set Web Store Session - * @param webStoreSession The webStoreSession to set. + * @param webStoreSession Web Store Session flag */ public void setWebStoreSession (boolean webStoreSession) { @@ -292,6 +289,7 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder("MSession[") @@ -309,7 +307,7 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport } // toString /** - * Session Logout + * Logout this session */ public void logout() { @@ -321,8 +319,9 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport /** * Preserved for backward compatibility - *@deprecated + * @deprecated */ + @Deprecated public MChangeLog changeLog ( String TrxName, int AD_ChangeLog_ID, int AD_Table_ID, int AD_Column_ID, int Record_ID, @@ -335,7 +334,7 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport } // changeLog /** - * Create Change Log only if table is logged + * Create Change Log (if table is logged) * @param TrxName transaction name * @param AD_ChangeLog_ID 0 for new change log * @param AD_Table_ID table @@ -345,6 +344,7 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport * @param AD_Org_ID org * @param OldValue old * @param NewValue new + * @param event * @return saved change log or null */ public MChangeLog changeLog ( @@ -359,7 +359,7 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport } /** - * Create Change Log only if table is logged + * Create Change Log (if table is logged) * @param TrxName transaction name * @param AD_ChangeLog_ID 0 for new change log * @param AD_Table_ID table @@ -370,6 +370,7 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport * @param AD_Org_ID org * @param OldValue old * @param NewValue new + * @param event * @return saved change log or null */ public MChangeLog changeLog ( @@ -430,7 +431,6 @@ public class MSession extends X_AD_Session implements ImmutablePOSupport } // changeLog /** - * * @return number of cached sessions */ public static int getCachedSessionCount() { diff --git a/org.adempiere.base/src/org/compiere/model/MSetup.java b/org.adempiere.base/src/org/compiere/model/MSetup.java index 0ac731d5a9..5997941a9a 100644 --- a/org.adempiere.base/src/org/compiere/model/MSetup.java +++ b/org.adempiere.base/src/org/compiere/model/MSetup.java @@ -112,13 +112,22 @@ public final class MSetup private boolean m_hasActivity = false; private boolean m_dryRun = false; + /** - * Create Client Info. + * Create Client Info.
        * - Client, Trees, Org, Role, User, User_Role * @param clientName client name + * @param orgValue org Value * @param orgName org name - * @param userClient user id client - * @param userOrg user id org + * @param userClient client user name + * @param userOrg org user name + * @param phone + * @param phone2 + * @param fax + * @param eMail + * @param taxID + * @param adminEmail + * @param userEmail * @param isSetInitialPassword * @return true if created */ @@ -396,7 +405,19 @@ public final class MSetup return true; } // createClient - // preserving backward compatibility with swing client + /** + * preserving backward compatibility with swing client + * @param currency + * @param hasProduct + * @param hasBPartner + * @param hasProject + * @param hasMCampaign + * @param hasSRegion + * @param AccountingFile + * @return true if created + * @deprecated + */ + @Deprecated public boolean createAccounting(KeyNamePair currency, boolean hasProduct, boolean hasBPartner, boolean hasProject, boolean hasMCampaign, boolean hasSRegion, @@ -407,14 +428,15 @@ public final class MSetup false, AccountingFile, false, false); } - /************************************************************************** + /** + *
         	 *  Create Accounting elements.
         	 *  - Calendar
         	 *  - Account Trees
         	 *  - Account Values
         	 *  - Accounting Schema
         	 *  - Default Accounts
        -	 *
        +	 *  
        * @param currency currency * @param hasProduct has product segment * @param hasBPartner has bp segment @@ -422,9 +444,9 @@ public final class MSetup * @param hasMCampaign has campaign segment * @param hasSRegion has sales region segment * @param hasActivity has activity segment - * @param AccountingFile file name of accounting file - * @param inactivateDefaults inactivate the default accounts after created + * @param AccountingFile accounting file * @param useDefaultCoA use the Default CoA (load and group summary account) + * @param inactivateDefaults inactivate the default accounts after created * @return true if created */ public boolean createAccounting(KeyNamePair currency, @@ -656,7 +678,6 @@ public final class MSetup } // Create AcctSchema - // Create Defaults Accounts try { createAccountingRecord(X_C_AcctSchema_GL.Table_Name); @@ -844,10 +865,15 @@ public final class MSetup return false; } // - log.info("fini"); + if (log.isLoggable(Level.INFO)) log.info("fini"); return true; } // createAccounting + /** + * Create new record for accounting table (M_Product_Acct, M_Product_Category_Acct, etc) + * @param tableName + * @throws Exception + */ private void createAccountingRecord(String tableName) throws Exception { MTable table = MTable.get(m_ctx, tableName); @@ -877,16 +903,15 @@ public final class MSetup } } - /** - * Get Account ID for key - * @param key key + * Create new valid combination for predefine account column + * @param key column name * @return C_ValidCombination_ID * @throws AdempiereUserError */ private Integer getAcct (String key) throws AdempiereUserError { - log.fine(key); + if (log.isLoggable(Level.FINE)) log.fine(key); // Element int C_ElementValue_ID = m_nap.getC_ElementValue_ID(key.toUpperCase()); if (C_ElementValue_ID == 0) @@ -913,7 +938,7 @@ public final class MSetup * Create GL Category * @param Name name * @param CategoryType category type MGLCategory.CATEGORYTYPE_* - * @param isDefault is default value + * @param isDefault is default flag * @return GL_Category_ID */ private int createGLCategory (String Name, String CategoryType, boolean isDefault) @@ -999,18 +1024,21 @@ public final class MSetup // return dt.getC_DocType_ID(); } // createDocType - - /************************************************************************** - * Create Default main entities. - * - Dimensions and BPGroup, Prod Category) + /** + *
        +	 *  Create default main entities.
        +	 *  - Dimensions, BPGroup and Product Category
         	 *  - Location, Locator, Warehouse
         	 *  - PriceList
         	 *  - Cashbook, PaymentTerm
        +	 *  
        * @param C_Country_ID country * @param City city * @param C_Region_ID region * @param C_Currency_ID currency + * @param postal + * @param address1 * @return true if created */ public boolean createEntities (int C_Country_ID, String City, int C_Region_ID, int C_Currency_ID, String postal, String address1) @@ -1459,14 +1487,14 @@ public final class MSetup boolean success = m_trx.commit(); m_trx.close(); - log.info("finish"); + if (log.isLoggable(Level.INFO)) log.info("finish"); return success; } // createEntities /** * Create Preference - * @param Attribute attribute - * @param Value value + * @param Attribute attribute name + * @param Value attribute value * @param AD_Window_ID window */ private void createPreference (String Attribute, String Value, int AD_Window_ID) @@ -1485,9 +1513,8 @@ public final class MSetup if (no != 1) log.log(Level.SEVERE, "Preference NOT inserted - " + Attribute); } // createPreference - - /************************************************************************** + /** * Get Next ID * @param AD_Client_ID client * @param TableName table name @@ -1507,6 +1534,7 @@ public final class MSetup { return m_client.getAD_Client_ID(); } + /** * Get AD_Org_ID * @return AD_Org_ID @@ -1515,6 +1543,7 @@ public final class MSetup { return m_org.getAD_Org_ID(); } + /** * Get AD_User_ID * @return AD_User_ID @@ -1523,6 +1552,7 @@ public final class MSetup { return AD_User_ID; } + /** * Get Info * @return Info diff --git a/org.adempiere.base/src/org/compiere/model/MShipper.java b/org.adempiere.base/src/org/compiere/model/MShipper.java index 73bf0074bc..7455e22dbb 100644 --- a/org.adempiere.base/src/org/compiere/model/MShipper.java +++ b/org.adempiere.base/src/org/compiere/model/MShipper.java @@ -22,7 +22,6 @@ import java.util.Properties; import org.compiere.util.Env; - /** * Shipper Model * @@ -32,17 +31,16 @@ import org.compiere.util.Env; public class MShipper extends X_M_Shipper { /** - * + * generated serial id */ private static final long serialVersionUID = -4026295839866634739L; - /** - * UUID based Constructor - * @param ctx Context - * @param M_Shipper_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_Shipper_UU UUID key + * @param trxName Transaction + */ public MShipper(Properties ctx, String M_Shipper_UU, String trxName) { super(ctx, M_Shipper_UU, trxName); } @@ -69,12 +67,11 @@ public class MShipper extends X_M_Shipper super(ctx, rs, trxName); } // MShipper - /** * @param ctx * @param FreightCategory_ID * @param trxName - * @return A list of shippers having the given freight category + * @return list of shippers having the given freight category */ public static List getShippersForFreightCategory(Properties ctx, int FreightCategory_ID, String trxName) { Query q = new Query(ctx, I_M_Shipper.Table_Name, @@ -85,26 +82,41 @@ public class MShipper extends X_M_Shipper return(result); } + /** + * @return shipping service code + */ public String getShippingServiceCode() { return getM_ShipperCfg().getShippingServiceCode(); } + /** + * @return true if this shipper support international shipping + */ public boolean isInternational() { return getM_ShipperCfg().isInternational(); } + /** + * @return true if this shipper support residential shipping + */ public boolean isResidential() { return getM_ShipperCfg().isResidential(); } + /** + * @return true if this shipper provide saturday delivery service + */ public boolean isSaturdayDelivery() { return getM_ShipperCfg().isSaturdayDelivery(); } + /** + * @return URL for delivery tracking + */ public String getTrackingURL() { return getM_ShipperCfg().getTrackingURL(); diff --git a/org.adempiere.base/src/org/compiere/model/MShipperLabels.java b/org.adempiere.base/src/org/compiere/model/MShipperLabels.java index 949e464cdb..013f6070a0 100644 --- a/org.adempiere.base/src/org/compiere/model/MShipperLabels.java +++ b/org.adempiere.base/src/org/compiere/model/MShipperLabels.java @@ -1,47 +1,89 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.math.BigDecimal; import java.sql.ResultSet; import java.util.Properties; +/** + * Shipper label model + */ public class MShipperLabels extends X_M_ShipperLabels -{ - +{ /** - * + * generated serial id */ private static final long serialVersionUID = 3903237243862044930L; /** - * UUID based Constructor - * @param ctx Context - * @param M_ShipperLabels_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_ShipperLabels_UU UUID key + * @param trxName Transaction + */ public MShipperLabels(Properties ctx, String M_ShipperLabels_UU, String trxName) { super(ctx, M_ShipperLabels_UU, trxName); } - + + /** + * @param ctx + * @param M_ShipperLabels_ID + * @param trxName + */ public MShipperLabels(Properties ctx, int M_ShipperLabels_ID, String trxName) { super(ctx, M_ShipperLabels_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MShipperLabels(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } + /** + * @return value (search key) of label + */ public String getValue() { return getM_ShipperLabelsCfg().getValue(); } + /** + * @return label height + */ public BigDecimal getHeight() { return getM_ShipperLabelsCfg().getHeight(); } + /** + * @return label width + */ public BigDecimal getWidth() { return getM_ShipperLabelsCfg().getWidth(); diff --git a/org.adempiere.base/src/org/compiere/model/MShipperPackaging.java b/org.adempiere.base/src/org/compiere/model/MShipperPackaging.java index b9ffeb92e0..edcb7f2602 100644 --- a/org.adempiere.base/src/org/compiere/model/MShipperPackaging.java +++ b/org.adempiere.base/src/org/compiere/model/MShipperPackaging.java @@ -1,36 +1,72 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; +/** + * Shipper packaging model + */ public class MShipperPackaging extends X_M_ShipperPackaging { - /** - * + * generated serial id */ private static final long serialVersionUID = 6403993556547324865L; /** - * UUID based Constructor - * @param ctx Context - * @param M_ShipperPackaging_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_ShipperPackaging_UU UUID key + * @param trxName Transaction + */ public MShipperPackaging(Properties ctx, String M_ShipperPackaging_UU, String trxName) { super(ctx, M_ShipperPackaging_UU, trxName); } - + + /** + * @param ctx + * @param M_ShipperPackaging_ID + * @param trxName + */ public MShipperPackaging(Properties ctx, int M_ShipperPackaging_ID, String trxName) { super(ctx, M_ShipperPackaging_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MShipperPackaging(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } + /** + * @return value (search key) of packaging + */ public String getValue() { return getM_ShipperPackagingCfg().getValue(); diff --git a/org.adempiere.base/src/org/compiere/model/MShipperPickupTypes.java b/org.adempiere.base/src/org/compiere/model/MShipperPickupTypes.java index 99a1d7f640..fd32910d83 100644 --- a/org.adempiere.base/src/org/compiere/model/MShipperPickupTypes.java +++ b/org.adempiere.base/src/org/compiere/model/MShipperPickupTypes.java @@ -1,36 +1,72 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; +/** + * Shipper pickup type model + */ public class MShipperPickupTypes extends X_M_ShipperPickupTypes -{ - +{ /** - * + * generated serial id */ private static final long serialVersionUID = 2836350317204286835L; /** - * UUID based Constructor - * @param ctx Context - * @param M_ShipperPickupTypes_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_ShipperPickupTypes_UU UUID key + * @param trxName Transaction + */ public MShipperPickupTypes(Properties ctx, String M_ShipperPickupTypes_UU, String trxName) { super(ctx, M_ShipperPickupTypes_UU, trxName); } - + + /** + * @param ctx + * @param M_ShipperPickupTypes_ID + * @param trxName + */ public MShipperPickupTypes(Properties ctx, int M_ShipperPickupTypes_ID, String trxName) { super(ctx, M_ShipperPickupTypes_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MShipperPickupTypes(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } + /** + * @return value (search key) of pickup type + */ public String getValue() { return getM_ShipperPickupTypesCfg().getValue(); diff --git a/org.adempiere.base/src/org/compiere/model/MShippingProcessor.java b/org.adempiere.base/src/org/compiere/model/MShippingProcessor.java index d708748bda..0aa4d1bcc4 100644 --- a/org.adempiere.base/src/org/compiere/model/MShippingProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MShippingProcessor.java @@ -1,71 +1,128 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; +/** + * Online shipping processor model + */ public class MShippingProcessor extends X_M_ShippingProcessor { - /** - * + * generated serial id */ private static final long serialVersionUID = -7635817773750467895L; /** - * UUID based Constructor - * @param ctx Context - * @param M_ShippingProcessor_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_ShippingProcessor_UU UUID key + * @param trxName Transaction + */ public MShippingProcessor(Properties ctx, String M_ShippingProcessor_UU, String trxName) { super(ctx, M_ShippingProcessor_UU, trxName); } - + + /** + * @param ctx + * @param M_ShippingProcessor_ID + * @param trxName + */ public MShippingProcessor(Properties ctx, int M_ShippingProcessor_ID, String trxName) { super(ctx, M_ShippingProcessor_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MShippingProcessor(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } + /** + * @return shipping process Java class name + */ public String getShippingProcessorClass() { return getM_ShippingProcessorCfg().getShippingProcessorClass(); } + /** + * @return host address of shipping processor + */ public String getHostAddress() { return getM_ShippingProcessorCfg().getHostAddress(); } + /** + * @return host port of shipping processor + */ public int getHostPort() { return getM_ShippingProcessorCfg().getHostPort(); } + /** + * @return proxy address of shipping processor + */ public String getProxyAddress() { return getM_ShippingProcessorCfg().getProxyAddress(); } + /** + * @return proxy port of shipping processor + */ public int getProxyPort() { return getM_ShippingProcessorCfg().getProxyPort(); } + /** + * @return proxy login of shipping processor + */ public String getProxyLogon() { return getM_ShippingProcessorCfg().getProxyLogon(); } + /** + * @return proxy password of shipping processor + */ public String getProxyPassword() { return getM_ShippingProcessorCfg().getProxyPassword(); } + /** + * @return path to access service provided by this shipping processor + */ public String getServicePath() { return getM_ShippingProcessorCfg().getServicePath(); diff --git a/org.adempiere.base/src/org/compiere/model/MShippingTransaction.java b/org.adempiere.base/src/org/compiere/model/MShippingTransaction.java index 2b77dd9e79..a7ec0b4f36 100644 --- a/org.adempiere.base/src/org/compiere/model/MShippingTransaction.java +++ b/org.adempiere.base/src/org/compiere/model/MShippingTransaction.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.sql.PreparedStatement; @@ -15,33 +36,50 @@ import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.Util; +/** + * Online shipping transaction model + */ public class MShippingTransaction extends X_M_ShippingTransaction { /** - * + * generated serial id */ private static final long serialVersionUID = -2444841696998774096L; /** - * UUID based Constructor - * @param ctx Context - * @param M_ShippingTransaction_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_ShippingTransaction_UU UUID key + * @param trxName Transaction + */ public MShippingTransaction(Properties ctx, String M_ShippingTransaction_UU, String trxName) { super(ctx, M_ShippingTransaction_UU, trxName); } - + + /** + * @param ctx + * @param M_ShippingTransaction_ID + * @param trxName + */ public MShippingTransaction(Properties ctx, int M_ShippingTransaction_ID, String trxName) { super(ctx, M_ShippingTransaction_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MShippingTransaction(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } + /** + * @param whereClause + * @return array of MShippingTransactionLine + */ public MShippingTransactionLine[] getLines(String whereClause) { StringBuilder whereClauseFinal = new StringBuilder(MShippingTransactionLine.COLUMNNAME_M_ShippingTransaction_ID + "=? "); @@ -59,16 +97,27 @@ public class MShippingTransaction extends X_M_ShippingTransaction /** Error Message */ private String m_errorMessage = null; + /** + * Set error message + * @param errorMessage + */ public void setErrorMessage(String errorMessage) { m_errorMessage = errorMessage; } + /** + * @return error message + */ public String getErrorMessage() { return m_errorMessage; } + /** + * Submit online shipping request (shipment, rate inquiry or void shipment) + * @return true if success + */ public boolean processOnline() { setErrorMessage(null); @@ -123,23 +172,35 @@ public class MShippingTransaction extends X_M_ShippingTransaction return processed; } + /** + * @return shipper + */ public MShipper getMShipper() { return new MShipper(getCtx(), getM_Shipper_ID(), get_TrxName()); } + /** + * @return true if this is an international shipment + */ public boolean isInternational() { MShipperFacade facade = new MShipperFacade(getMShipper()); return facade.isInternational(); } + /** + * @return currency ISO code + */ public String getCurrencyCode() { MCurrency currency = MCurrency.get(getCtx(), getC_Currency_ID()); return currency.getISO_Code(); } + /** + * @return true if freight charges will be pay by sender + */ public boolean isPayBySender() { // Payment Type must be SENDER or THIRD_PARTY when COD is requested @@ -151,29 +212,44 @@ public class MShippingTransaction extends X_M_ShippingTransaction return false; } + /** + * @return product id for freight charges + */ public int getProductFreightID() { return DB.getSQLValue(null, "SELECT M_ProductFreight_ID FROM AD_Clientinfo WHERE AD_Client_ID = ?", getAD_Client_ID()); } + /** + * @return true if shipping label is print as image + */ public boolean isPrintLabelAsImage() { MShipperLabels label = new MShipperLabels(getCtx(), getM_ShipperLabels_ID(), get_TrxName()); return MShipperLabels.LABELPRINTMETHOD_Image.equals(label.getLabelPrintMethod()); } + /** + * @return true if shipping label is for printing via Zebra label printer + */ public boolean isPrintZebraLabel() { MShipperLabels label = new MShipperLabels(getCtx(), getM_ShipperLabels_ID(), get_TrxName()); return MShipperLabels.LABELPRINTMETHOD_Zebra.equals(label.getLabelPrintMethod()); } + /** + * @return true if shipping label is for printing via Eltron label printer + */ public boolean isPrintEltronLabel() { MShipperLabels label = new MShipperLabels(getCtx(), getM_ShipperLabels_ID(), get_TrxName()); return MShipperLabels.LABELPRINTMETHOD_Eltron.equals(label.getLabelPrintMethod()); } + /** + * @return payor account + */ public String getPayorAccount() { if (isPayBySender()) @@ -193,6 +269,9 @@ public class MShippingTransaction extends X_M_ShippingTransaction } } + /** + * @return payor account for duties + */ public String getDutiesPayorAccount() { if (isPayBySender()) @@ -218,6 +297,9 @@ public class MShippingTransaction extends X_M_ShippingTransaction } } + /** + * @return country code of payor + */ public String getPayorCountryCode() { if (!isPayBySender()) @@ -237,16 +319,26 @@ public class MShippingTransaction extends X_M_ShippingTransaction } } + /** + * @return true if freight charges is to be collected from receiver + */ public boolean isCollect() { return MShippingTransaction.FREIGHTCHARGES_Collect.equals(getFreightCharges()); } + /** + * @return true if freight charges is pay by third party + */ public boolean is3rdParty() { return MShippingTransaction.FREIGHTCHARGES_3rdParty.equals(getFreightCharges()); } + /** + * @param M_Product_ID + * @return X_M_CommodityShipment + */ public X_M_CommodityShipment getCommodityShipment(int M_Product_ID) { X_M_CommodityShipment commodityShipment = null; @@ -288,30 +380,50 @@ public class MShippingTransaction extends X_M_ShippingTransaction return commodityShipment; } + /** + * @param M_Product_ID + * @return M_CommodityShipment_ID + */ public int getCommodityShipmentID(int M_Product_ID) { X_M_CommodityShipment commodityShipment = getCommodityShipment(M_Product_ID); return commodityShipment.getM_CommodityShipment_ID(); } + /** + * @param M_Product_ID + * @return commodity shipment description + */ public String getCommodityDescription(int M_Product_ID) { X_M_CommodityShipment commodityShipment = getCommodityShipment(M_Product_ID); return commodityShipment.getDescription(); } + /** + * @param M_Product_ID + * @return harmonized code of community shipment + */ public String getHarmonizedCode(int M_Product_ID) { X_M_CommodityShipment commodityShipment = getCommodityShipment(M_Product_ID); return commodityShipment.getHarmonizedCode(); } + /** + * @param M_Product_ID + * @return export license number of commodity shipment + */ public String getExportLicenseNum(int M_Product_ID) { X_M_CommodityShipment commodityShipment = getCommodityShipment(M_Product_ID); return commodityShipment.getExportLicenseNum(); } + /** + * @param M_Product_ID + * @return country code of manufacture country (from commodity shipment) + */ public String getCountryOfManufacture(int M_Product_ID) { X_M_CommodityShipment commodityShipment = getCommodityShipment(M_Product_ID); @@ -322,6 +434,9 @@ public class MShippingTransaction extends X_M_ShippingTransaction private PartyInfo senderInfo, recipientInfo; + /** + * @return sender details + */ public PartyInfo getSenderInfo() { if (senderInfo != null) @@ -348,6 +463,9 @@ public class MShippingTransaction extends X_M_ShippingTransaction return partyInfo; } + /** + * @return recipient details + */ public PartyInfo getRecipientInfo() { if (recipientInfo != null) @@ -373,6 +491,9 @@ public class MShippingTransaction extends X_M_ShippingTransaction return partyInfo; } + /** + * Sender/Recipient party value object + */ public class PartyInfo { private String companyName; diff --git a/org.adempiere.base/src/org/compiere/model/MShippingTransactionLine.java b/org.adempiere.base/src/org/compiere/model/MShippingTransactionLine.java index 3eb1efe75a..ff3756bc10 100644 --- a/org.adempiere.base/src/org/compiere/model/MShippingTransactionLine.java +++ b/org.adempiere.base/src/org/compiere/model/MShippingTransactionLine.java @@ -1,3 +1,24 @@ +/*********************************************************************** + * 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. * + **********************************************************************/ package org.compiere.model; import java.sql.ResultSet; @@ -5,32 +26,47 @@ import java.util.Properties; public class MShippingTransactionLine extends X_M_ShippingTransactionLine { - /** - * + * generated serial id */ private static final long serialVersionUID = -8148869412130244360L; /** - * UUID based Constructor - * @param ctx Context - * @param M_ShippingTransactionLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_ShippingTransactionLine_UU UUID key + * @param trxName Transaction + */ public MShippingTransactionLine(Properties ctx, String M_ShippingTransactionLine_UU, String trxName) { super(ctx, M_ShippingTransactionLine_UU, trxName); } - + + /** + * @param ctx + * @param M_ShippingTransactionLine_ID + * @param trxName + */ public MShippingTransactionLine(Properties ctx, int M_ShippingTransactionLine_ID, String trxName) { super(ctx, M_ShippingTransactionLine_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MShippingTransactionLine(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } + /** + * @param ctx + * @param M_ShippingTransactionLine_ID + * @param trxName + * @param virtualColumns + */ public MShippingTransactionLine(Properties ctx, int M_ShippingTransactionLine_ID, String trxName, String... virtualColumns) { super(ctx, M_ShippingTransactionLine_ID, trxName, virtualColumns); diff --git a/org.adempiere.base/src/org/compiere/model/MStatus.java b/org.adempiere.base/src/org/compiere/model/MStatus.java index 882045a1f9..02b69b6564 100644 --- a/org.adempiere.base/src/org/compiere/model/MStatus.java +++ b/org.adempiere.base/src/org/compiere/model/MStatus.java @@ -38,7 +38,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MStatus extends X_R_Status implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 446327334122691551L; @@ -93,10 +93,10 @@ public class MStatus extends X_R_Status implements ImmutablePOSupport } /** - * Get Default Request Status + * Get Default Request Status for given request type * @param ctx context * @param R_RequestType_ID request type - * @return Request Type + * @return default Request status or null */ public static MStatus getDefault (Properties ctx, int R_RequestType_ID) { @@ -139,9 +139,9 @@ public class MStatus extends X_R_Status implements ImmutablePOSupport } // getDefault /** - * Get Closed Status + * Get request status records with IsClosed=Y * @param ctx context - * @return Request Type + * @return array of request status */ public static MStatus[] getClosed (Properties ctx) { @@ -174,7 +174,6 @@ public class MStatus extends X_R_Status implements ImmutablePOSupport list.toArray(retValue); return retValue; } // get - /** Static Logger */ private static CLogger s_log = CLogger.getCLogger(MStatus.class); @@ -185,20 +184,19 @@ public class MStatus extends X_R_Status implements ImmutablePOSupport static private ImmutableIntPOCache s_cacheDefault = new ImmutableIntPOCache(Table_Name, "R_Status_Default", 10); - /** - * UUID based Constructor - * @param ctx Context - * @param R_Status_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param R_Status_UU UUID key + * @param trxName Transaction + */ public MStatus(Properties ctx, String R_Status_UU, String trxName) { super(ctx, R_Status_UU, trxName); if (Util.isEmpty(R_Status_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Default Constructor * @param ctx context * @param R_Status_ID is @@ -236,7 +234,7 @@ public class MStatus extends X_R_Status implements ImmutablePOSupport } // MStatus /** - * + * Copy constructor * @param copy */ public MStatus(MStatus copy) @@ -245,7 +243,7 @@ public class MStatus extends X_R_Status implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -255,7 +253,7 @@ public class MStatus extends X_R_Status implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -271,6 +269,7 @@ public class MStatus extends X_R_Status implements ImmutablePOSupport * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (isOpen() && isClosed()) @@ -290,6 +289,7 @@ public class MStatus extends X_R_Status implements ImmutablePOSupport * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("MStatus["); diff --git a/org.adempiere.base/src/org/compiere/model/MStatusCategory.java b/org.adempiere.base/src/org/compiere/model/MStatusCategory.java index 4c8083160d..10d17c8b76 100644 --- a/org.adempiere.base/src/org/compiere/model/MStatusCategory.java +++ b/org.adempiere.base/src/org/compiere/model/MStatusCategory.java @@ -40,12 +40,12 @@ import org.idempiere.cache.ImmutablePOSupport; public class MStatusCategory extends X_R_StatusCategory implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -5527646898927619293L; /** - * Get Default Status Categpru for Client + * Get Default Status Category for Client * @param ctx context * @return status category or null */ @@ -80,7 +80,7 @@ public class MStatusCategory extends X_R_StatusCategory implements ImmutablePOSu } // getDefault /** - * Get Default Status Categpru for Client + * Create Default Status Category for Client (with name equal to the translated message of "Standard") * @param ctx context * @return status category or null */ @@ -136,21 +136,20 @@ public class MStatusCategory extends X_R_StatusCategory implements ImmutablePOSu = new ImmutableIntPOCache (Table_Name, 20); /** Logger */ private static CLogger s_log = CLogger.getCLogger (MStatusCategory.class); - - + /** - * UUID based Constructor - * @param ctx Context - * @param R_StatusCategory_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param R_StatusCategory_UU UUID key + * @param trxName Transaction + */ public MStatusCategory(Properties ctx, String R_StatusCategory_UU, String trxName) { super(ctx, R_StatusCategory_UU, trxName); if (Util.isEmpty(R_StatusCategory_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Default Constructor * @param ctx context * @param R_StatusCategory_ID id @@ -182,7 +181,7 @@ public class MStatusCategory extends X_R_StatusCategory implements ImmutablePOSu } // RStatusCategory /** - * + * Copy constructor * @param copy */ public MStatusCategory(MStatusCategory copy) @@ -191,7 +190,7 @@ public class MStatusCategory extends X_R_StatusCategory implements ImmutablePOSu } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -201,7 +200,7 @@ public class MStatusCategory extends X_R_StatusCategory implements ImmutablePOSu } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -217,8 +216,8 @@ public class MStatusCategory extends X_R_StatusCategory implements ImmutablePOSu private MStatus[] m_status = null; /** - * Get all Status - * @param reload reload + * Get all Status for this category + * @param reload true to reload from DB * @return Status array */ public MStatus[] getStatus(boolean reload) @@ -258,7 +257,7 @@ public class MStatusCategory extends X_R_StatusCategory implements ImmutablePOSu } // getStatus /** - * Get Default R_Status_ID + * Get Default R_Status_ID for this category * @return id or 0 */ public int getDefaultR_Status_ID() @@ -292,6 +291,7 @@ public class MStatusCategory extends X_R_StatusCategory implements ImmutablePOSu * String Representation * @return info */ + @Override public String toString () { StringBuilder sb = new StringBuilder ("RStatusCategory["); diff --git a/org.adempiere.base/src/org/compiere/model/MStatusLine.java b/org.adempiere.base/src/org/compiere/model/MStatusLine.java index 8d48a3991a..e48eca52ee 100644 --- a/org.adempiere.base/src/org/compiere/model/MStatusLine.java +++ b/org.adempiere.base/src/org/compiere/model/MStatusLine.java @@ -40,7 +40,7 @@ import org.idempiere.cache.ImmutablePOSupport; import org.osgi.service.event.Event; /** - * Status Line Model + * Data Status Line Model * * @author Nicolas Micoud * @version $Id: MStatusLine.java @@ -48,7 +48,7 @@ import org.osgi.service.event.Event; public class MStatusLine extends X_AD_StatusLine implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -1542116796861052734L; @@ -62,11 +62,11 @@ public class MStatusLine extends X_AD_StatusLine implements ImmutablePOSupport public static final String EVENT_WINDOWNO = "event.windowno"; /** - * UUID based Constructor - * @param ctx Context - * @param AD_StatusLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_StatusLine_UU UUID key + * @param trxName Transaction + */ public MStatusLine(Properties ctx, String AD_StatusLine_UU, String trxName) { super(ctx, AD_StatusLine_UU, trxName); } @@ -94,7 +94,7 @@ public class MStatusLine extends X_AD_StatusLine implements ImmutablePOSupport } // MStatusLine /** - * + * Copy constructor * @param copy */ public MStatusLine(MStatusLine copy) @@ -103,7 +103,7 @@ public class MStatusLine extends X_AD_StatusLine implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -113,7 +113,7 @@ public class MStatusLine extends X_AD_StatusLine implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -193,12 +193,12 @@ public class MStatusLine extends X_AD_StatusLine implements ImmutablePOSupport } /** - * Get the widget lines defined for the window and tab and table (immutable) + * Get the widget lines defined for the window and tab and table and info window (immutable) * @param window_ID * @param tab_ID * @param table_ID * @param infoWindow_ID - * @return array of widget lines discovered for table or specific tab or general window + * @return array of widget lines discovered for table or specific tab or general window or info window */ public static MStatusLine[] getStatusLinesWidget(int window_ID, int tab_ID, int table_ID, int infoWindow_ID) { StringBuilder key = new StringBuilder().append(window_ID).append("|").append(tab_ID).append("|").append(table_ID).append("|").append(infoWindow_ID); @@ -242,6 +242,11 @@ public class MStatusLine extends X_AD_StatusLine implements ImmutablePOSupport return retValue; } + /** + * Parse and execute SQL statement. Combine result of execution (first row) with translated AD message. + * @param windowNo + * @return AD message formatted output of SQL statement execution result + */ public String parseLine(int windowNo) { Event event = EventManager.newEvent(BEFORE_PARSE_STATUS_LINE, new EventProperty(EventManager.EVENT_DATA, this), new EventProperty(EVENT_WINDOWNO, windowNo)); diff --git a/org.adempiere.base/src/org/compiere/model/MStatusLineUsedIn.java b/org.adempiere.base/src/org/compiere/model/MStatusLineUsedIn.java index 6f96cfb1b4..8946257699 100644 --- a/org.adempiere.base/src/org/compiere/model/MStatusLineUsedIn.java +++ b/org.adempiere.base/src/org/compiere/model/MStatusLineUsedIn.java @@ -30,16 +30,16 @@ import org.compiere.util.Msg; public class MStatusLineUsedIn extends X_AD_StatusLineUsedIn { /** - * + * generated serial id */ private static final long serialVersionUID = -6341924761622666560L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_StatusLineUsedIn_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_StatusLineUsedIn_UU UUID key + * @param trxName Transaction + */ public MStatusLineUsedIn(Properties ctx, String AD_StatusLineUsedIn_UU, String trxName) { super(ctx, AD_StatusLineUsedIn_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java b/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java index 1356bcd7bf..62e347f406 100644 --- a/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java +++ b/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java @@ -34,7 +34,7 @@ import org.compiere.util.Env; import org.compiere.util.Util; /** - * Inventory Storage Model + * Inventory On Hand Storage Model * * @author Jorg Janke * @version $Id: MStorageOnHand.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $ @@ -42,12 +42,11 @@ import org.compiere.util.Util; public class MStorageOnHand extends X_M_StorageOnHand { /** - * + * generated serial id */ private static final long serialVersionUID = -3820729340100521329L; /** - * * @param ctx * @param M_Locator_ID * @param M_Product_ID @@ -56,20 +55,21 @@ public class MStorageOnHand extends X_M_StorageOnHand * @deprecated * @return MStorageOnHand */ + @Deprecated public static MStorageOnHand get (Properties ctx, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, String trxName) { return get (ctx, M_Locator_ID, M_Product_ID, M_AttributeSetInstance_ID, null, trxName); } /** - * Get Storage Info + * Get On Hand Storage * @param ctx context * @param M_Locator_ID locator * @param M_Product_ID product * @param M_AttributeSetInstance_ID instance - * @param dateMPolicy + * @param dateMPolicy optional DateMaterialPolicy filter * @param trxName transaction - * @return existing or null + * @return existing MStorageOnHand or null */ public static MStorageOnHand get (Properties ctx, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID,Timestamp dateMPolicy, String trxName) @@ -101,13 +101,13 @@ public class MStorageOnHand extends X_M_StorageOnHand } // get /** - * Get all Storages for Product with ASI and QtyOnHand <> 0 + * Get all Storages for Product with ASI and QtyOnHand != 0 * @param ctx context * @param M_Product_ID product * @param M_Locator_ID locator - * @param FiFo first in-first-out + * @param FiFo true for fifo, false for lifo * @param trxName transaction - * @return existing or null + * @return array of MStorageOnHand */ public static MStorageOnHand[] getAllWithASI (Properties ctx, int M_Product_ID, int M_Locator_ID, boolean FiFo, String trxName) @@ -146,12 +146,12 @@ public class MStorageOnHand extends X_M_StorageOnHand } // getAllWithASI /** - * Get all Storages for Product where QtyOnHand <> 0 + * Get all Storages for Product where QtyOnHand != 0 * @param ctx context * @param M_Product_ID product * @param M_Locator_ID locator, 0 to match all locator * @param trxName transaction - * @return existing or null + * @return array of MStorageOnHand */ public static MStorageOnHand[] getAll (Properties ctx, int M_Product_ID, int M_Locator_ID, String trxName) @@ -160,14 +160,14 @@ public class MStorageOnHand extends X_M_StorageOnHand } /** - * Get all Storages for Product where QtyOnHand <> 0 + * Get all Storages for Product where QtyOnHand != 0 * @param ctx context * @param M_Product_ID product * @param M_Locator_ID locator, 0 to match all locator * @param trxName transaction - * @param forUpdate - * @param timeout - * @return existing or null + * @param forUpdate true to use For Update clause + * @param timeout query timeout if forUpdate is true (0 for no timeout) + * @return array of MStorageOnHand */ public static MStorageOnHand[] getAll (Properties ctx, int M_Product_ID, int M_Locator_ID, String trxName, boolean forUpdate, int timeout) @@ -176,16 +176,16 @@ public class MStorageOnHand extends X_M_StorageOnHand } /** - * Get all Storages for Product where QtyOnHand <> 0 - * @param ctx context - * @param M_Product_ID product - * @param M_Locator_ID locator, 0 to match all locator + * Get all Storages for Product where QtyOnHand != 0 + * @param ctx context + * @param M_Product_ID product + * @param M_Locator_ID locator, 0 to match all locator * @param locatorPriority If true, sort descending by locator Priority No - * @param fifo Sort ascending(fifo) or descending(lifo) by date material policy, m_attributesetinstance_id - * @param trxName transaction - * @param forUpdate If true, acquire db lock for update - * @param timeout timeout for the acquisition of db update lock - * @return existing or null + * @param fifo Sort ascending(FIFO) or descending(LIFO) by date material policy, m_attributesetinstance_id + * @param trxName transaction + * @param forUpdate If true, acquire DB lock with FOR UPDATE clause + * @param timeout query timeout if forUpdate is true (0 for no timeout) + * @return array of MStorageOnHand */ public static MStorageOnHand[] getAll (Properties ctx, int M_Product_ID, int M_Locator_ID, boolean locatorPriority, boolean fifo, String trxName, boolean forUpdate, int timeout) @@ -244,15 +244,15 @@ public class MStorageOnHand extends X_M_StorageOnHand } // getAll /** - * Get Storage Info + * Get On Hand Storage * @param ctx context * @param M_Product_ID product * @param M_Locator_ID locator * @param M_AttributeSetInstance_ID instance - * @param dateMPolicy - * @param ignoreZeroQty + * @param dateMPolicy optional DateMaterialPolicy filter + * @param ignoreZeroQty if true, only get storage record with on hand != 0 * @param trxName transaction - * @return existing or null + * @return array of MStorageOnHand */ public static MStorageOnHand[] getAll (Properties ctx, int M_Product_ID, int M_Locator_ID, int M_AttributeSetInstance_ID, Timestamp dateMPolicy, boolean ignoreZeroQty, String trxName) @@ -264,7 +264,7 @@ public class MStorageOnHand extends X_M_StorageOnHand else sqlWhere += "M_AttributeSetInstance_ID=?"; - if(ignoreZeroQty) + if (ignoreZeroQty) sqlWhere += " AND QtyOnHand<>0 "; if (dateMPolicy != null) @@ -293,11 +293,11 @@ public class MStorageOnHand extends X_M_StorageOnHand } // getAll /** - * Get Storage Info for Product across warehouses + * Get On Hand Storage for Product across warehouses * @param ctx context * @param M_Product_ID product * @param trxName transaction - * @return existing or null + * @return array of MStorageOnHand */ public static MStorageOnHand[] getOfProduct (Properties ctx, int M_Product_ID, String trxName) { @@ -314,20 +314,21 @@ public class MStorageOnHand extends X_M_StorageOnHand } // getOfProduct /** - * Get Storage Info for Warehouse + * Get On Hand Storage for Warehouse * @param ctx context * @param M_Warehouse_ID * @param M_Product_ID product * @param M_AttributeSetInstance_ID instance * @param M_AttributeSet_ID attribute set (NOT USED) * @param allAttributeInstances if true, all attribute set instances (NOT USED) - * @param minGuaranteeDate optional minimum guarantee date if all attribute instances + * @param minGuaranteeDate optional minimum guarantee date filter. ignore if M_AttributeSetInstance_ID != 0 * @param FiFo first in-first-out * @param trxName transaction * @return existing - ordered by location priority (desc) and/or guarantee date * * @deprecated */ + @Deprecated public static MStorageOnHand[] getWarehouse (Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, int M_AttributeSet_ID, boolean allAttributeInstances, Timestamp minGuaranteeDate, @@ -338,17 +339,17 @@ public class MStorageOnHand extends X_M_StorageOnHand } /** - * Get Storage Info for Warehouse or locator + * Get On Hand Storage for Warehouse or locator * @param ctx context * @param M_Warehouse_ID ignore if M_Locator_ID > 0 * @param M_Product_ID product * @param M_AttributeSetInstance_ID instance id, 0 to retrieve all instance - * @param minGuaranteeDate optional minimum guarantee date if all attribute instances - * @param FiFo first in-first-out + * @param minGuaranteeDate optional minimum guarantee date filter. ignore if M_AttributeSetInstance_ID != 0 + * @param FiFo true first in-first-out, false for LIFO * @param positiveOnly if true, only return storage records with qtyOnHand > 0 * @param M_Locator_ID optional locator id * @param trxName transaction - * @return existing - ordered by location priority (desc) and/or guarantee date + * @return array of MStorageOnHand - ordered by location priority (desc) and/or guarantee date */ public static MStorageOnHand[] getWarehouse (Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp minGuaranteeDate, @@ -359,18 +360,18 @@ public class MStorageOnHand extends X_M_StorageOnHand } /** - * Get Storage Info for Warehouse or locator + * Get On Hand Storage for Warehouse or locator * @param ctx context * @param M_Warehouse_ID ignore if M_Locator_ID > 0 * @param M_Product_ID product * @param M_AttributeSetInstance_ID instance id, 0 to retrieve all instance - * @param minGuaranteeDate optional minimum guarantee date if all attribute instances - * @param FiFo first in-first-out + * @param minGuaranteeDate optional minimum guarantee date filter. ignore if M_AttributeSetInstance_ID != 0 + * @param FiFo true for first in-first-out, false for LIFO * @param positiveOnly if true, only return storage records with qtyOnHand > 0 * @param M_Locator_ID optional locator id * @param trxName transaction - * @param forUpdate - * @return existing - ordered by location priority (desc) and/or guarantee date + * @param forUpdate true to acquire DB lock with FOR UPDATE clause + * @return array of MStorageOnHand - ordered by location priority (desc) and/or guarantee date */ public static MStorageOnHand[] getWarehouse (Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp minGuaranteeDate, @@ -380,19 +381,19 @@ public class MStorageOnHand extends X_M_StorageOnHand } /** - * Get Storage Info for Warehouse or locator + * Get On Hand Storage for Warehouse or locator * @param ctx context * @param M_Warehouse_ID ignore if M_Locator_ID > 0 * @param M_Product_ID product * @param M_AttributeSetInstance_ID instance id, 0 to retrieve all instance - * @param minGuaranteeDate optional minimum guarantee date if all attribute instances - * @param FiFo first in-first-out + * @param minGuaranteeDate optional minimum guarantee date filter. ignore if M_AttributeSetInstance_ID != 0 + * @param FiFo true for first in-first-out, false for LIFO * @param positiveOnly if true, only return storage records with qtyOnHand > 0 * @param M_Locator_ID optional locator id * @param trxName transaction - * @param forUpdate - * @param timeout - * @return existing - ordered by location priority (desc) and/or guarantee date + * @param forUpdate true to acquire DB lock with FOR UPDATE clause + * @param timeout if forUpdate is true, value for query timeout (0 for no timeout). + * @return array of MStorageOnHand - ordered by location priority (desc) and/or guarantee date */ public static MStorageOnHand[] getWarehouse (Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp minGuaranteeDate, @@ -523,16 +524,16 @@ public class MStorageOnHand extends X_M_StorageOnHand } // getWarehouse /** - * Get Storage Info for Warehouse or locator + * Get On Hand Storage for Warehouse or locator * @param ctx context * @param M_Warehouse_ID ignore if M_Locator_ID > 0 * @param M_Product_ID product * @param M_AttributeSetInstance_ID instance id, 0 to retrieve all instance - * @param minGuaranteeDate optional minimum guarantee date if all attribute instances - * @param FiFo first in-first-out + * @param minGuaranteeDate optional minimum guarantee date filter. ignore if M_AttributeSetInstance_ID != 0 + * @param FiFo true for first in-first-out, false for LIFO * @param M_Locator_ID optional locator id * @param trxName transaction - * @return existing - ordered by location priority (desc) and/or guarantee date + * @return array of MStorageOnHand - ordered by location priority (desc) and/or guarantee date */ public static MStorageOnHand[] getWarehouseNegative (Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp minGuaranteeDate, @@ -542,17 +543,17 @@ public class MStorageOnHand extends X_M_StorageOnHand } /** - * Get Storage Info for Warehouse or locator + * Get On Hand Storage for Warehouse or locator * @param ctx context * @param M_Warehouse_ID ignore if M_Locator_ID > 0 * @param M_Product_ID product * @param M_AttributeSetInstance_ID instance id, 0 to retrieve storages that don't have asi, -1 to retrieve all instance - * @param minGuaranteeDate optional minimum guarantee date if all attribute instances - * @param FiFo first in-first-out + * @param minGuaranteeDate optional minimum guarantee date filter. ignore if M_AttributeSetInstance_ID != 0 + * @param FiFo true for first in-first-out, false for LIFO * @param M_Locator_ID optional locator id * @param trxName transaction - * @param forUpdate - * @return existing - ordered by location priority (desc) and/or guarantee date + * @param forUpdate true to acquire DB lock with FOR UPDATE clause + * @return array of MStorageOnHand - ordered by location priority (desc) and/or guarantee date */ public static MStorageOnHand[] getWarehouseNegative (Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp minGuaranteeDate, @@ -562,18 +563,18 @@ public class MStorageOnHand extends X_M_StorageOnHand } /** - * Get Storage Info for Warehouse or locator + * Get On Hand Storage for Warehouse or locator * @param ctx context * @param M_Warehouse_ID ignore if M_Locator_ID > 0 * @param M_Product_ID product * @param M_AttributeSetInstance_ID instance id, 0 to retrieve storages that don't have asi, -1 to retrieve all instance - * @param minGuaranteeDate optional minimum guarantee date if all attribute instances - * @param FiFo first in-first-out + * @param minGuaranteeDate optional minimum guarantee date filter + * @param FiFo true for first in-first-out, false for LIFO * @param M_Locator_ID optional locator id * @param trxName transaction - * @param forUpdate - * @param timeout - * @return existing - ordered by location priority (desc) and/or guarantee date + * @param forUpdate true to acquire DB lock with FOR UPDATE clause + * @param timeout if forUpdate is true, value for query timeout (0 for no timeout). + * @return array of MStorageOnHand - ordered by location priority (desc) and/or guarantee date */ public static MStorageOnHand[] getWarehouseNegative (Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp minGuaranteeDate, @@ -674,13 +675,13 @@ public class MStorageOnHand extends X_M_StorageOnHand } // getWarehouse /** - * Create or Get Storage Info + * Create or Get On Hand Storage * @param ctx context * @param M_Locator_ID locator * @param M_Product_ID product * @param M_AttributeSetInstance_ID instance * @param trxName transaction - * @return existing/new or null + * @return existing or new MStorageOnHand */ public static MStorageOnHand getCreate (Properties ctx, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID,Timestamp dateMPolicy, String trxName) @@ -689,14 +690,15 @@ public class MStorageOnHand extends X_M_StorageOnHand } /** - * Create or Get Storage Info + * Create or Get On Hand Storage * @param ctx context * @param M_Locator_ID locator * @param M_Product_ID product * @param M_AttributeSetInstance_ID instance + * @param dateMPolicy optional DateMaterialPolicy filter * @param trxName transaction - * @param forUpdate - * @return existing/new or null + * @param forUpdate true to acquire DB lock with FOR UPDATE clause + * @return existing or new MStorageOnHand */ public static MStorageOnHand getCreate (Properties ctx, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID,Timestamp dateMPolicy, String trxName, boolean forUpdate) @@ -705,15 +707,16 @@ public class MStorageOnHand extends X_M_StorageOnHand } /** - * Create or Get Storage Info + * Create or Get On Hand Storage * @param ctx context * @param M_Locator_ID locator * @param M_Product_ID product * @param M_AttributeSetInstance_ID instance + * @param dateMPolicy optional DateMaterialPolicy filter * @param trxName transaction - * @param forUpdate - * @param timeout - * @return existing/new or null + * @param forUpdate true to acquire DB lock with FOR UPDATE clause + * @param timeout if forUpdate is true, value for query timeout (0 for no timeout). + * @return existing or new MStorageOnHand */ public static MStorageOnHand getCreate (Properties ctx, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID,Timestamp dateMPolicy, String trxName, boolean forUpdate, int timeout) @@ -750,7 +753,7 @@ public class MStorageOnHand extends X_M_StorageOnHand } // getCreate /** - * Update Storage Info add. + * Update On Hand Storage * Called from MProjectIssue * @param ctx context * @param M_Warehouse_ID warehouse @@ -760,6 +763,7 @@ public class MStorageOnHand extends X_M_StorageOnHand * @param diffQtyOnHand add on hand * @param trxName transaction * @return true if updated + * @deprecated */ @Deprecated public static boolean add (Properties ctx, int M_Warehouse_ID, int M_Locator_ID, @@ -770,7 +774,7 @@ public class MStorageOnHand extends X_M_StorageOnHand } /** - * Update Storage Info add. + * Update On Hand Storage * Called from MProjectIssue * @param ctx context * @param M_Warehouse_ID warehouse, not use @@ -783,6 +787,7 @@ public class MStorageOnHand extends X_M_StorageOnHand * @return true if updated * @deprecated */ + @Deprecated public static boolean add (Properties ctx, int M_Warehouse_ID, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, BigDecimal diffQtyOnHand,Timestamp dateMPolicy, String trxName) @@ -798,14 +803,14 @@ public class MStorageOnHand extends X_M_StorageOnHand } /** - * Update Storage Info add. + * Update On Hand Storage * Called from MProjectIssue * @param ctx context * @param M_Locator_ID locator * @param M_Product_ID product * @param M_AttributeSetInstance_ID AS Instance - * @param diffQtyOnHand add on hand - * @param dateMPolicy + * @param diffQtyOnHand difference to add to current on hand quantity + * @param dateMPolicy optional DateMaterialPolicy filter * @param trxName transaction * @return true if updated */ @@ -842,7 +847,7 @@ public class MStorageOnHand extends X_M_StorageOnHand } // add /** - * Add quantity on hand directly - not using cached value - solving IDEMPIERE-2629 + * Add addition to quantity on hand with direct SQL - not using cached value - solving IDEMPIERE-2629 * @param addition */ public void addQtyOnHand(BigDecimal addition) { @@ -862,7 +867,7 @@ public class MStorageOnHand extends X_M_StorageOnHand } /** - * Update Date Last Inventory + * Update Date Last Inventory of this record with direct SQL * @param dateLastInv */ public void updateDateLastInventory(Timestamp dateLastInv) { @@ -874,8 +879,8 @@ public class MStorageOnHand extends X_M_StorageOnHand load(get_TrxName()); } - /************************************************************************** - * Get Location with highest Locator Priority and a sufficient OnHand Qty + /** + * Get Locator with highest Locator Priority and a sufficient OnHand Qty * @param M_Warehouse_ID warehouse * @param M_Product_ID product * @param M_AttributeSetInstance_ID asi id, use negative value (for e.g -1) to match all asi including 0 @@ -939,19 +944,18 @@ public class MStorageOnHand extends X_M_StorageOnHand } // getM_Locator_ID /** - * UUID based Constructor - * @param ctx Context - * @param M_StorageOnHand_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_StorageOnHand_UU UUID key + * @param trxName Transaction + */ public MStorageOnHand(Properties ctx, String M_StorageOnHand_UU, String trxName) { super(ctx, M_StorageOnHand_UU, trxName); if (Util.isEmpty(M_StorageOnHand_UU)) setInitialDefaults(); } - /************************************************************************** - * Persistency Constructor + /** * @param ctx context * @param ignored ignored * @param trxName transaction @@ -983,12 +987,13 @@ public class MStorageOnHand extends X_M_StorageOnHand } // MStorageOnHand /** - * Full NEW Constructor + * NEW MStorageOnHand Constructor * @param locator (parent) locator * @param M_Product_ID product * @param M_AttributeSetInstance_ID attribute + * @param dateMPolicy */ - private MStorageOnHand (MLocator locator, int M_Product_ID, int M_AttributeSetInstance_ID,Timestamp dateMPolicy) + private MStorageOnHand (MLocator locator, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp dateMPolicy) { this (locator.getCtx(), 0, locator.get_TrxName()); setClientOrg(locator); @@ -1018,10 +1023,7 @@ public class MStorageOnHand extends X_M_StorageOnHand return m_M_Warehouse_ID; } // getM_Warehouse_ID - /** - * - * * Before Save * @param newRecord new * @return success @@ -1073,7 +1075,7 @@ public class MStorageOnHand extends X_M_StorageOnHand * Get Quantity On Hand of Warehouse * @param M_Product_ID * @param M_Warehouse_ID - * @param M_AttributeSetInstance_ID + * @param M_AttributeSetInstance_ID M_AttributeSetInstance_ID filter, ignore if 0 * @param trxName * @return QtyOnHand */ @@ -1124,10 +1126,9 @@ public class MStorageOnHand extends X_M_StorageOnHand return qty; } - - + /** - * Get Quantity On Hand of Warehouse Available for Reservation + * Get Quantity On Hand of Warehouse (only include Locator with Locator Type = Available for Reservation) * @param M_Product_ID * @param M_Warehouse_ID * @param M_AttributeSetInstance_ID @@ -1160,7 +1161,7 @@ public class MStorageOnHand extends X_M_StorageOnHand } /** - * Get Quantity On Hand of Warehouse Available for Reservation with ASI=0 + * Get Quantity On Hand of Warehouse with ASI=0 (only include Locator with Locator Type = Available for Reservation) * @param M_Product_ID * @param M_Warehouse_ID * @param trxName @@ -1187,7 +1188,7 @@ public class MStorageOnHand extends X_M_StorageOnHand } /** - * Get Quantity On Hand of Warehouse that's available for shipping + * Get Quantity On Hand of Warehouse (only include Locator with Locator Type = available for shipping) * @param M_Product_ID * @param M_Warehouse_ID * @param M_AttributeSetInstance_ID @@ -1219,7 +1220,7 @@ public class MStorageOnHand extends X_M_StorageOnHand } /** - * Get Quantity On Hand of Warehouse that's available for shipping with ASI=0 + * Get Quantity On Hand of Warehouse with ASI=0 (only include Locator with Locator Type = available for shipping) * @param M_Product_ID * @param M_Warehouse_ID * @param trxName @@ -1276,7 +1277,7 @@ public class MStorageOnHand extends X_M_StorageOnHand } /** - * Get Quantity On Hand of Locator wtih ASI=0 + * Get Quantity On Hand of Locator with ASI=0 * @param M_Product_ID * @param M_Locator_ID * @param trxName @@ -1304,6 +1305,7 @@ public class MStorageOnHand extends X_M_StorageOnHand * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder("MStorageOnHand[") @@ -1317,11 +1319,11 @@ public class MStorageOnHand extends X_M_StorageOnHand } // toString /** - * + * Get DateMaterialPolicy ORDER BY QtyOnHand DESC * @param M_Product_ID * @param M_AttributeSetInstance_ID * @param trxName - * @return datempolicy timestamp + * @return DateMaterialPolicy time stamp */ public static Timestamp getDateMaterialPolicy(int M_Product_ID, int M_AttributeSetInstance_ID,String trxName){ @@ -1358,14 +1360,14 @@ public class MStorageOnHand extends X_M_StorageOnHand } //getDateMaterialPolicy /** - * + * Get DateMaterialPolicy ORDER BY QtyOnHand DESC * @param M_Product_ID * @param M_AttributeSetInstance_ID * @param M_Locator_ID * @param trxName - * @return datempolicy timestamp + * @return DateMaterialPolicy time stamp */ - public static Timestamp getDateMaterialPolicy(int M_Product_ID, int M_AttributeSetInstance_ID, int M_Locator_ID, String trxName){ + public static Timestamp getDateMaterialPolicy(int M_Product_ID, int M_AttributeSetInstance_ID, int M_Locator_ID, String trxName) { if (M_Product_ID <= 0 || M_AttributeSetInstance_ID <= 0) return null; diff --git a/org.adempiere.base/src/org/compiere/model/MStorageProvider.java b/org.adempiere.base/src/org/compiere/model/MStorageProvider.java index bb302d96b6..fb9d91ace2 100644 --- a/org.adempiere.base/src/org/compiere/model/MStorageProvider.java +++ b/org.adempiere.base/src/org/compiere/model/MStorageProvider.java @@ -29,9 +29,12 @@ import org.compiere.util.Env; import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; +/** + * Binary content storage provider model + */ public class MStorageProvider extends X_AD_StorageProvider implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -7444967391781941193L; @@ -87,25 +90,35 @@ public class MStorageProvider extends X_AD_StorageProvider implements ImmutableP } /** - * UUID based Constructor - * @param ctx Context - * @param AD_StorageProvider_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_StorageProvider_UU UUID key + * @param trxName Transaction + */ public MStorageProvider(Properties ctx, String AD_StorageProvider_UU, String trxName) { super(ctx, AD_StorageProvider_UU, trxName); } + /** + * @param ctx + * @param AD_StorageProvider_ID + * @param trxName + */ public MStorageProvider(Properties ctx, int AD_StorageProvider_ID, String trxName) { super(ctx, AD_StorageProvider_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MStorageProvider(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } /** - * + * Copy constructor * @param copy */ public MStorageProvider(MStorageProvider copy) @@ -114,7 +127,7 @@ public class MStorageProvider extends X_AD_StorageProvider implements ImmutableP } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -124,7 +137,7 @@ public class MStorageProvider extends X_AD_StorageProvider implements ImmutableP } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -136,8 +149,7 @@ public class MStorageProvider extends X_AD_StorageProvider implements ImmutableP } /** - * - * @return {@link IAttachmentStore} + * @return {@link IAttachmentStore} instance */ public IAttachmentStore getAttachmentStore() { ServiceQuery query=new ServiceQuery(); @@ -155,9 +167,8 @@ public class MStorageProvider extends X_AD_StorageProvider implements ImmutableP private static CCache> s_attachmentStoreReference = new CCache<>(null, "IAttachmentStore", 3, false); /** - * * @param query - * @return {@link IAttachmentStore} + * @return {@link IAttachmentStore} service */ public static IAttachmentStore getAttachmentStoreService(ServiceQuery query) { IAttachmentStore store = null; @@ -179,8 +190,7 @@ public class MStorageProvider extends X_AD_StorageProvider implements ImmutableP } /** - * - * @return {@link IArchiveStore} + * @return {@link IArchiveStore} instance */ public IArchiveStore getArchiveStore() { ServiceQuery query=new ServiceQuery(); @@ -198,9 +208,8 @@ public class MStorageProvider extends X_AD_StorageProvider implements ImmutableP private static CCache> s_archiveStoreReference = new CCache<>(null, "IArchiveStore", 3, false); /** - * * @param query - * @return {@link IArchiveStore} + * @return {@link IArchiveStore} service */ public static IArchiveStore getArchiveStoreService(ServiceQuery query) { IArchiveStore store = null; @@ -223,8 +232,7 @@ public class MStorageProvider extends X_AD_StorageProvider implements ImmutableP } /** - * - * @return {@link IImageStore} + * @return {@link IImageStore} instance */ public IImageStore getImageStore() { ServiceQuery query=new ServiceQuery(); @@ -242,9 +250,8 @@ public class MStorageProvider extends X_AD_StorageProvider implements ImmutableP private static CCache> s_imageStoreReference = new CCache<>(null, "IImageStore", 3, false); /** - * * @param query - * @return {@link IImageStore} + * @return {@link IImageStore} service */ public static IImageStore getImageStoreService(ServiceQuery query) { IImageStore store = null; @@ -264,6 +271,9 @@ public class MStorageProvider extends X_AD_StorageProvider implements ImmutableP return store; } + /** + * @return default AD_StorageProvider_ID + */ public static int getDefaultStorageProviderID() { final String sql = "SELECT AD_StorageProvider_ID FROM AD_StorageProvider WHERE IsDefault='Y' AND IsActive='Y' ORDER BY AD_StorageProvider_ID"; return DB.getSQLValueEx(null, sql); diff --git a/org.adempiere.base/src/org/compiere/model/MStorageReservation.java b/org.adempiere.base/src/org/compiere/model/MStorageReservation.java index 7a622c038d..60045c4c96 100644 --- a/org.adempiere.base/src/org/compiere/model/MStorageReservation.java +++ b/org.adempiere.base/src/org/compiere/model/MStorageReservation.java @@ -27,21 +27,24 @@ import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; +/** + * Inventory reservation storage model + */ public class MStorageReservation extends X_M_StorageReservation { /** - * + * generated serial id */ private static final long serialVersionUID = 8179093165315835613L; /** - * Get Storage Info + * Get Reservation Storage * @param ctx context * @param M_Warehouse_ID warehouse * @param M_Product_ID product * @param M_AttributeSetInstance_ID instance * @param isSOTrx * @param trxName transaction - * @return existing or null + * @return existing MStorageReservation or null */ public static MStorageReservation get (Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, boolean isSOTrx, String trxName) @@ -88,25 +91,35 @@ public class MStorageReservation extends X_M_StorageReservation { private static CLogger s_log = CLogger.getCLogger(MStorageReservation.class); /** - * UUID based Constructor - * @param ctx Context - * @param M_StorageReservation_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_StorageReservation_UU UUID key + * @param trxName Transaction + */ public MStorageReservation(Properties ctx, String M_StorageReservation_UU, String trxName) { super(ctx, M_StorageReservation_UU, trxName); } + /** + * @param ctx + * @param M_StorageReservation_ID + * @param trxName + */ public MStorageReservation(Properties ctx, int M_StorageReservation_ID, String trxName) { super(ctx, M_StorageReservation_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MStorageReservation(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } /** - * Full NEW Constructor + * NEW MStorageReservation Constructor * @param warehouse (parent) warehouse * @param M_Product_ID product * @param M_AttributeSetInstance_ID attribute @@ -124,13 +137,13 @@ public class MStorageReservation extends X_M_StorageReservation { } // MStorageReservation /** - * Get Storage Info for Product on specified Warehouse + * Get Reservation Storage for Product on specified Warehouse * @param ctx * @param m_Warehouse_ID * @param m_Product_ID - * @param i + * @param i not use * @param trxName - * @return + * @return array of MStorageReservation */ public static MStorageReservation[] get(Properties ctx, int m_Warehouse_ID, int m_Product_ID, int i, String trxName) { @@ -146,11 +159,11 @@ public class MStorageReservation extends X_M_StorageReservation { } /** - * Get Storage Info for Product across warehouses + * Get Reservation Storage for Product across warehouses * @param ctx context * @param M_Product_ID product * @param trxName transaction - * @return existing or null + * @return array of MStorageReservation */ public static MStorageReservation[] getOfProduct (Properties ctx, int M_Product_ID, String trxName) { @@ -170,7 +183,7 @@ public class MStorageReservation extends X_M_StorageReservation { * Get Quantity Reserved/Ordered of Warehouse * @param M_Product_ID * @param M_Warehouse_ID - * @param M_AttributeSetInstance_ID + * @param M_AttributeSetInstance_ID M_AttributeSetInstance_ID filter if > 0 * @param isSOTrx - true to get reserved, false to get ordered * @param trxName * @return quantity reserved/ordered @@ -200,14 +213,12 @@ public class MStorageReservation extends X_M_StorageReservation { } /** - * Get Available Qty. - * The call is accurate only if there is a storage record - * and assumes that the product is stocked + * Get Available Qty (On Hand - Reserved) * @param M_Warehouse_ID wh * @param M_Product_ID product * @param M_AttributeSetInstance_ID masi * @param trxName transaction - * @return qty available (QtyOnHand-QtyReserved) or null + * @return qty available (QtyOnHand-QtyReserved) */ public static BigDecimal getQtyAvailable (int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, String trxName) @@ -219,7 +230,6 @@ public class MStorageReservation extends X_M_StorageReservation { } /** - * * @param ctx * @param M_Warehouse_ID * @param M_Product_ID @@ -230,6 +240,7 @@ public class MStorageReservation extends X_M_StorageReservation { * @return true if ok * @deprecated */ + @Deprecated public static boolean add (Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, BigDecimal diffQty, boolean isSOTrx, String trxName) @@ -238,13 +249,13 @@ public class MStorageReservation extends X_M_StorageReservation { } /** - * + * Add diffQty to quantity reserved/ordered * @param ctx * @param M_Warehouse_ID * @param M_Product_ID * @param M_AttributeSetInstance_ID - * @param diffQty - * @param isSOTrx + * @param diffQty difference to add to quantity reserved/ordered + * @param isSOTrx true for quantity reserved, false for quantity ordered * @param trxName * @param tracer * @return true if ok @@ -290,12 +301,13 @@ public class MStorageReservation extends X_M_StorageReservation { * @param addition * @deprecated */ + @Deprecated public void addQty(BigDecimal addition) { addQty(addition, null); } /** - * Add quantity on hand directly - not using cached value - solving IDEMPIERE-2629 + * Add addition to Qty of this record using direct SQL - not using cached value - solving IDEMPIERE-2629 * @param addition */ public void addQty(BigDecimal addition, IReservationTracer tracer) { @@ -312,7 +324,7 @@ public class MStorageReservation extends X_M_StorageReservation { } /** - * Update Storage Info add. + * Update Reservation Storage * Called from MProjectIssue * @param ctx context * @param M_Warehouse_ID warehouse @@ -334,14 +346,14 @@ public class MStorageReservation extends X_M_StorageReservation { } // add /** - * Create or Get Storage Info + * Create or Get Reservation Storage * @param ctx context * @param M_Warehouse_ID * @param M_Product_ID product * @param M_AttributeSetInstance_ID instance - * @param isSOTrx + * @param isSOTrx true for quantity reserved, false for quantity ordered * @param trxName transaction - * @return existing/new or null + * @return existing or new MStorageReservation */ public static MStorageReservation getCreate (Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, boolean isSOTrx, String trxName) @@ -369,6 +381,7 @@ public class MStorageReservation extends X_M_StorageReservation { * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder("MStorageReservation[") diff --git a/org.adempiere.base/src/org/compiere/model/MStorageReservationLog.java b/org.adempiere.base/src/org/compiere/model/MStorageReservationLog.java index 6cfc856e9f..2b67482347 100644 --- a/org.adempiere.base/src/org/compiere/model/MStorageReservationLog.java +++ b/org.adempiere.base/src/org/compiere/model/MStorageReservationLog.java @@ -28,29 +28,27 @@ import java.sql.ResultSet; import java.util.Properties; /** - * + * Change log for inventory reservation storage * @author hengsin - * */ public class MStorageReservationLog extends X_M_StorageReservationLog { /** - * + * generated serial id */ private static final long serialVersionUID = 4527538966135474314L; /** - * UUID based Constructor - * @param ctx Context - * @param M_StorageReservationLog_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param M_StorageReservationLog_UU UUID key + * @param trxName Transaction + */ public MStorageReservationLog(Properties ctx, String M_StorageReservationLog_UU, String trxName) { super(ctx, M_StorageReservationLog_UU, trxName); } /** - * * @param ctx * @param M_StorageReservationLog_ID * @param trxName @@ -60,7 +58,6 @@ public class MStorageReservationLog extends X_M_StorageReservationLog { } /** - * * @param ctx * @param rs * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MStyle.java b/org.adempiere.base/src/org/compiere/model/MStyle.java index f990797c4a..cb09618279 100644 --- a/org.adempiere.base/src/org/compiere/model/MStyle.java +++ b/org.adempiere.base/src/org/compiere/model/MStyle.java @@ -16,12 +16,12 @@ import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; /** + * CSS Style model * @author hengsin - * */ public class MStyle extends X_AD_Style implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 5409686715292148171L; /** Cache */ @@ -32,25 +32,35 @@ public class MStyle extends X_AD_Style implements ImmutablePOSupport { public static final String ZCLASS_PREFIX = "@zclass="; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Style_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Style_UU UUID key + * @param trxName Transaction + */ public MStyle(Properties ctx, String AD_Style_UU, String trxName) { super(ctx, AD_Style_UU, trxName); } + /** + * @param ctx + * @param AD_Style_ID + * @param trxName + */ public MStyle(Properties ctx, int AD_Style_ID, String trxName) { super(ctx, AD_Style_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MStyle(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } /** - * + * Copy constructor * @param copy */ public MStyle(MStyle copy) { @@ -58,7 +68,7 @@ public class MStyle extends X_AD_Style implements ImmutablePOSupport { } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -67,7 +77,7 @@ public class MStyle extends X_AD_Style implements ImmutablePOSupport { } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -111,6 +121,10 @@ public class MStyle extends X_AD_Style implements ImmutablePOSupport { return retValue; } // get + /** + * Get lines + * @return array of style line + */ public MStyleLine[] getStyleLines() { if (m_lines == null) { Query query = new Query(Env.getCtx(), I_AD_StyleLine.Table_Name, "AD_Style_ID=? AND InlineStyle IS NOT NULL", null); @@ -124,6 +138,12 @@ public class MStyle extends X_AD_Style implements ImmutablePOSupport { return m_lines; } + /** + * Build CSS style text from lines + * @param defaultTheme + * @param evaluatee evaluatee for display logic + * @return CSS style text + */ public String buildStyle(String defaultTheme, Evaluatee evaluatee) { X_AD_StyleLine[] lines = getStyleLines(); StringBuilder styleBuilder = new StringBuilder(); @@ -158,6 +178,5 @@ public class MStyle extends X_AD_Style implements ImmutablePOSupport { Arrays.stream(m_lines).forEach(e -> e.markImmutable()); return this; } - - + } diff --git a/org.adempiere.base/src/org/compiere/model/MStyleLine.java b/org.adempiere.base/src/org/compiere/model/MStyleLine.java index 9535eaa446..4c675fc452 100644 --- a/org.adempiere.base/src/org/compiere/model/MStyleLine.java +++ b/org.adempiere.base/src/org/compiere/model/MStyleLine.java @@ -32,22 +32,22 @@ import org.compiere.util.Env; import org.idempiere.cache.ImmutablePOSupport; /** + * Lines for MStyle * @author hengsin - * */ public class MStyleLine extends X_AD_StyleLine implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -5884961214171382581L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_StyleLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_StyleLine_UU UUID key + * @param trxName Transaction + */ public MStyleLine(Properties ctx, String AD_StyleLine_UU, String trxName) { super(ctx, AD_StyleLine_UU, trxName); } @@ -71,7 +71,7 @@ public class MStyleLine extends X_AD_StyleLine implements ImmutablePOSupport { } /** - * + * Copy constructor * @param copy */ public MStyleLine(MStyleLine copy) { @@ -79,7 +79,7 @@ public class MStyleLine extends X_AD_StyleLine implements ImmutablePOSupport { } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -88,7 +88,7 @@ public class MStyleLine extends X_AD_StyleLine implements ImmutablePOSupport { } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MSysConfig.java b/org.adempiere.base/src/org/compiere/model/MSysConfig.java index e9fe2d6651..eac7012615 100644 --- a/org.adempiere.base/src/org/compiere/model/MSysConfig.java +++ b/org.adempiere.base/src/org/compiere/model/MSysConfig.java @@ -36,16 +36,18 @@ import org.compiere.util.Util; * @author Armen Rizal * @version $Id: MSysConfig.java,v 1.5 2005/11/28 11:56:45 armen Exp $ * Contributor: Carlos Ruiz - globalqss - [ 1800371 ] System Configurator Enhancements - * @author Teo Sarca, SC ARHIPAC SERVICE SRL + * @author Teo Sarca, SC ARHIPAC SERVICE SRL *
      • BF [ 1885496 ] Performance NEEDS */ public class MSysConfig extends X_AD_SysConfig { /** - * + * generated serial id */ private static final long serialVersionUID = -8121703411463724745L; + /** Constant for Predefine System Configuration Names (in alphabetical order) */ + public static final String AD_CHANGELOG_SAVE_UUID = "AD_CHANGELOG_SAVE_UUID"; public static final String ADDRESS_VALIDATION = "ADDRESS_VALIDATION"; public static final String ALERT_SEND_ATTACHMENT_AS_XLS = "ALERT_SEND_ATTACHMENT_AS_XLS"; @@ -259,11 +261,11 @@ public class MSysConfig extends X_AD_SysConfig public static final String ZOOM_ACROSS_QUERY_TIMEOUT = "ZOOM_ACROSS_QUERY_TIMEOUT"; /** - * UUID based Constructor - * @param ctx Context - * @param AD_SysConfig_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_SysConfig_UU UUID key + * @param trxName Transaction + */ public MSysConfig(Properties ctx, String AD_SysConfig_UU, String trxName) { super(ctx, AD_SysConfig_UU, trxName); } @@ -307,7 +309,7 @@ public class MSysConfig extends X_AD_SysConfig /** * Get system configuration property of type string * @param Name - * @return String + * @return configured value */ public static String getValue(String Name) { @@ -315,10 +317,10 @@ public class MSysConfig extends X_AD_SysConfig } /** - * Get system configuration property of type int + * Get system configuration property of type integer * @param Name * @param defaultValue - * @return int + * @return configured value or defaultValue */ public static int getIntValue(String Name, int defaultValue) { @@ -345,8 +347,9 @@ public class MSysConfig extends X_AD_SysConfig * @param Name * @param defaultValue * @return double - * @deprecated use better getBigDecimalValue + * @deprecated replace by getBigDecimalValue */ + @Deprecated public static double getDoubleValue(String Name, double defaultValue) { String s = getValue(Name); @@ -368,7 +371,7 @@ public class MSysConfig extends X_AD_SysConfig * Get system configuration property of type BigDecimal * @param Name * @param defaultValue - * @return BigDecimal + * @return configured value or defaultValue */ public static BigDecimal getBigDecimalValue(String Name, BigDecimal defaultValue) { @@ -391,7 +394,7 @@ public class MSysConfig extends X_AD_SysConfig * Get system configuration property of type boolean * @param Name * @param defaultValue - * @return boolean + * @return configured value or defaultValue */ public static boolean getBooleanValue(String Name, boolean defaultValue) { @@ -412,7 +415,7 @@ public class MSysConfig extends X_AD_SysConfig * @param Name * @param defaultValue * @param AD_Client_ID Client ID - * @return String + * @return configured value or 0 */ public static String getValue(String Name, String defaultValue, int AD_Client_ID) { @@ -423,7 +426,7 @@ public class MSysConfig extends X_AD_SysConfig * Get system configuration property of type string * @param Name * @param AD_Client_ID Client ID - * @return String + * @return configured value or null */ public static String getValue(String Name, int AD_Client_ID) { @@ -435,7 +438,7 @@ public class MSysConfig extends X_AD_SysConfig * @param Name * @param defaultValue * @param AD_Client_ID Client ID - * @return int + * @return configured value or defaultValue */ public static int getIntValue(String Name, int defaultValue, int AD_Client_ID) { @@ -463,8 +466,9 @@ public class MSysConfig extends X_AD_SysConfig * @param defaultValue * @param AD_Client_ID Client ID * @return double - * @deprecated use better getBigDecimalValue + * @deprecated replace by getBigDecimalValue */ + @Deprecated public static double getDoubleValue(String Name, double defaultValue, int AD_Client_ID) { String s = getValue(Name, AD_Client_ID); @@ -487,7 +491,7 @@ public class MSysConfig extends X_AD_SysConfig * @param Name * @param defaultValue * @param AD_Client_ID Client ID - * @return BigDecimal + * @return configured value or defaultValue */ public static BigDecimal getBigDecimalValue(String Name, BigDecimal defaultValue, int AD_Client_ID) { @@ -511,7 +515,7 @@ public class MSysConfig extends X_AD_SysConfig * @param Name * @param defaultValue * @param AD_Client_ID Client ID - * @return boolean + * @return configured value or defaultValue */ public static boolean getBooleanValue(String Name, boolean defaultValue, int AD_Client_ID) { @@ -528,12 +532,12 @@ public class MSysConfig extends X_AD_SysConfig } /** - * Get client configuration property of type string + * Get organization configuration property of type string * @param Name * @param defaultValue * @param AD_Client_ID Client ID * @param AD_Org_ID Organization ID - * @return String + * @return configured value or defaultValue */ public static String getValue(String Name, String defaultValue, int AD_Client_ID, int AD_Org_ID) { @@ -587,11 +591,11 @@ public class MSysConfig extends X_AD_SysConfig } /** - * Get system configuration property of type string + * Get organization configuration property of type string * @param Name * @param AD_Client_ID Client ID * @param AD_Org_ID Organization ID - * @return String + * @return configured value or null */ public static String getValue(String Name, int AD_Client_ID, int AD_Org_ID) { @@ -599,12 +603,12 @@ public class MSysConfig extends X_AD_SysConfig } /** - * Get system configuration property of type int + * Get organization configuration property of type integer * @param Name * @param defaultValue * @param AD_Client_ID Client ID * @param AD_Org_ID Organization ID - * @return int + * @return configured value or defaultValue */ public static int getIntValue(String Name, int defaultValue, int AD_Client_ID, int AD_Org_ID) { @@ -633,8 +637,9 @@ public class MSysConfig extends X_AD_SysConfig * @param AD_Client_ID Client ID * @param AD_Org_ID Organization ID * @return double - * @deprecated use better getBigDecimalValue + * @deprecated replace by getBigDecimalValue */ + @Deprecated public static double getDoubleValue(String Name, double defaultValue, int AD_Client_ID, int AD_Org_ID) { String s = getValue(Name, AD_Client_ID, AD_Org_ID); @@ -658,7 +663,7 @@ public class MSysConfig extends X_AD_SysConfig * @param defaultValue * @param AD_Client_ID Client ID * @param AD_Org_ID Organization ID - * @return BigDecimal + * @return configured value or defaultValue */ public static BigDecimal getBigDecimalValue(String Name, BigDecimal defaultValue, int AD_Client_ID, int AD_Org_ID) { @@ -683,7 +688,7 @@ public class MSysConfig extends X_AD_SysConfig * @param defaultValue * @param AD_Client_ID Client ID * @param AD_Org_ID Organization ID - * @return boolean + * @return configured value or defaultValue */ public static boolean getBooleanValue(String Name, boolean defaultValue, int AD_Client_ID, int AD_Org_ID) { @@ -702,7 +707,7 @@ public class MSysConfig extends X_AD_SysConfig /** * Get system configuration property of type Timestamp * @param Name - * @return Timestamp + * @return configured value or null */ public static Timestamp getTimestampValue(String Name) { @@ -713,7 +718,7 @@ public class MSysConfig extends X_AD_SysConfig * Get system configuration property of type Timestamp * @param Name * @param defaultValue - * @return Timestamp + * @return configured value or defaultValue */ public static Timestamp getTimestampValue(String Name, Timestamp defaultValue) { @@ -725,7 +730,7 @@ public class MSysConfig extends X_AD_SysConfig * @param Name * @param defaultValue * @param AD_Client_ID Client ID - * @return Timestamp + * @return configured value or defaultValue */ public static Timestamp getTimestampValue(String Name, Timestamp defaultValue, int AD_Client_ID) { @@ -738,7 +743,7 @@ public class MSysConfig extends X_AD_SysConfig * @param defaultValue * @param AD_Client_ID Client ID * @param AD_Org_ID Organization ID - * @return Timestamp + * @return configured value or defaultValue */ public static Timestamp getTimestampValue(String Name, Timestamp defaultValue, int AD_Client_ID, int AD_Org_ID) { @@ -753,8 +758,13 @@ public class MSysConfig extends X_AD_SysConfig private static int lentime = DisplayType.DEFAULT_TIME_FORMAT.length(); private static int lentimestamp = DisplayType.DEFAULT_TIMESTAMP_FORMAT.length(); - /** convert a string to a timestamp */ - static Timestamp convertStringToTimestamp(String text) + /** + * Convert a string to a time stamp.
        + * The method uses the length of the text argument to determine the time stamp format pattern to use. + * @param text text to be converted to time stamp + * @return converted time stamp + */ + protected static Timestamp convertStringToTimestamp(String text) { SimpleDateFormat sdf = null; int lentext = text.length(); @@ -780,11 +790,12 @@ public class MSysConfig extends X_AD_SysConfig return dt; } - /************************************************************************** + /** * Before Save * @param newRecord * @return true if save */ + @Override protected boolean beforeSave (boolean newRecord) { if (log.isLoggable(Level.FINE)) log.fine("New=" + newRecord); diff --git a/org.adempiere.base/src/org/compiere/model/MSystem.java b/org.adempiere.base/src/org/compiere/model/MSystem.java index a21277e7a2..be5bd63e8a 100644 --- a/org.adempiere.base/src/org/compiere/model/MSystem.java +++ b/org.adempiere.base/src/org/compiere/model/MSystem.java @@ -43,7 +43,7 @@ import org.compiere.util.Ini; import org.compiere.util.TimeUtil; /** - * System Record (just one) + * System Record (there should be just one AD_System record in the DB) * * @author Jorg Janke * @version $Id: MSystem.java,v 1.3 2006/10/09 00:22:28 jjanke Exp $ @@ -54,7 +54,7 @@ import org.compiere.util.TimeUtil; public class MSystem extends X_AD_System { /** - * + * generated serial id */ private static final long serialVersionUID = -1917493005917422880L; @@ -86,19 +86,19 @@ public class MSystem extends X_AD_System private static CCache s_system = new CCache(Table_Name, 1, -1); /** - * UUID based Constructor - * @param ctx Context - * @param AD_System_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_System_UU UUID key + * @param trxName Transaction + */ public MSystem(Properties ctx, String AD_System_UU, String trxName) { super(ctx, AD_System_UU, trxName); } - /************************************************************************** + /** * Default Constructor * @param ctx context - * @param ignored id + * @param ignored ignore * @param mtrxName transaction */ public MSystem (Properties ctx, int ignored, String mtrxName) @@ -124,7 +124,7 @@ public class MSystem extends X_AD_System } // MSystem /** - * + * Copy constructor * @param copy */ public MSystem(MSystem copy) @@ -133,7 +133,7 @@ public class MSystem extends X_AD_System } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -143,7 +143,7 @@ public class MSystem extends X_AD_System } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -181,7 +181,7 @@ public class MSystem extends X_AD_System /** * Get DB Address - * @return address + * @return DB connection URL */ public String getDBAddress () { @@ -217,7 +217,7 @@ public class MSystem extends X_AD_System /** * Get Profile Info * @param recalc recalculate - * @return profile + * @return List of active AD_Client.Value separated by the '|' character */ public String getProfileInfo (boolean recalc) { @@ -257,6 +257,7 @@ public class MSystem extends X_AD_System * @param newRecord new * @return true/false */ + @Override protected boolean beforeSave (boolean newRecord) { // Mandatory Values @@ -293,9 +294,11 @@ public class MSystem extends X_AD_System } // beforeSave /** - * Save Record (ID=0) + * Save Record (ID=0). + * Override to always perform update. * @return true if saved */ + @Override public boolean save() { if (!beforeSave(false)) @@ -307,6 +310,7 @@ public class MSystem extends X_AD_System * String Representation * @return info */ + @Override public String toString() { return "MSystem[" + getName() @@ -314,12 +318,13 @@ public class MSystem extends X_AD_System + ",ReleaseNo=" + getReleaseNo() + "]"; } // toString - - /************************************************************************** + /** * Check validity * @return true if valid + * @deprecated */ + @Deprecated public boolean isValid() { if (getName() == null || getName().length() < 2) @@ -343,17 +348,18 @@ public class MSystem extends X_AD_System /** * Is there a PDF License * @return true if there is a PDF License + * @deprecated */ + @Deprecated public boolean isPDFLicense() { String key = getSummary(); return key != null && key.length() > 25; } // isPDFLicense - - - /************************************************************************** - * Set/Derive Info if more then a day old - * @return true if set + + /** + * Update System Info if more then a day old + * @return true if updated */ public boolean setInfo() { @@ -418,7 +424,6 @@ public class MSystem extends X_AD_System rs = pstmt.executeQuery (); if (rs.next()) { - // dbAddress = rs.getString(1); dbName = rs.getString(2); setDBInstance(dbName.toLowerCase()); } @@ -435,7 +440,7 @@ public class MSystem extends X_AD_System } // setDBInfo /** - * Get DB Info SQL + * Get DB Info SQL. Only implemented for Oracle. * @param dbType database type * @return sql */ @@ -449,11 +454,12 @@ public class MSystem extends X_AD_System // return "SELECT NULL,NULL FROM DUAL WHERE 1=0"; } // getDBInfoSQL - - + /** * Print info + * @deprecated */ + @Deprecated public void info() { if (!CLogMgt.isLevelFine()) @@ -516,11 +522,13 @@ public class MSystem extends X_AD_System } /** - * Verify if the system manages properties in a more secure way - * for Windows and swing client the properties are managed as always - * for other systems (like Linux) the default is to manage it with more security - * this can be overridden passing the parameter -DIDEMPIERE_SECURE_PROPERTIES=false to the JVM - * @return true if properties needs to be managed more secure + *
        +	 * Verify if the system manages properties in a more secure way.
        +	 * For Windows and swing client, the properties are managed as before.
        +	 * For other systems (like Linux), the default is to manage it with more security.
        +	 * This can be overridden by passing the parameter -DIDEMPIERE_SECURE_PROPERTIES=false to the JVM.
        +	 * 
        + * @return true if properties needs to be managed in a more secure way */ public static boolean isSecureProps() { if (Env.isWindows() || Ini.isClient()) @@ -530,7 +538,7 @@ public class MSystem extends X_AD_System /** * The system allows to use login prefix for tenant - * @return + * @return true if login support the use of prefix for identification of tenant */ public static boolean isUseLoginPrefix() { String loginWithTenantPrefix = MSysConfig.getValue(MSysConfig.LOGIN_WITH_TENANT_PREFIX, "N"); @@ -539,7 +547,7 @@ public class MSystem extends X_AD_System /** * The system forces to use login prefix for tenant - * @return + * @return true if the use of prefix for identification of tenant is mandatory */ public static boolean isLoginPrefixMandatory() { String loginWithTenantPrefix = MSysConfig.getValue(MSysConfig.LOGIN_WITH_TENANT_PREFIX, "N"); diff --git a/org.adempiere.base/src/org/compiere/model/MTab.java b/org.adempiere.base/src/org/compiere/model/MTab.java index d6a6f96e30..e374e25449 100644 --- a/org.adempiere.base/src/org/compiere/model/MTab.java +++ b/org.adempiere.base/src/org/compiere/model/MTab.java @@ -33,7 +33,7 @@ import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; /** - * Tab Model + * Window Tab Model * * @author Jorg Janke * @author victor.perez@e-evolution.com, e-Evolution @@ -44,7 +44,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MTab extends X_AD_Tab implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -8111075325920938135L; @@ -52,7 +52,7 @@ public class MTab extends X_AD_Tab implements ImmutablePOSupport private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 20); /** - * + * Get MTab from cache (immutable) * @param AD_Tab_ID * @return {@link MTab} */ @@ -72,11 +72,11 @@ public class MTab extends X_AD_Tab implements ImmutablePOSupport } /** - * UUID based Constructor - * @param ctx Context - * @param AD_Tab_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Tab_UU UUID key + * @param trxName Transaction + */ public MTab(Properties ctx, String AD_Tab_UU, String trxName) { super(ctx, AD_Tab_UU, trxName); if (Util.isEmpty(AD_Tab_UU)) @@ -138,7 +138,7 @@ public class MTab extends X_AD_Tab implements ImmutablePOSupport /** * Parent Constructor * @param parent parent - * @param from copy from + * @param from tab to copy from */ public MTab (MWindow parent, MTab from) { @@ -150,7 +150,7 @@ public class MTab extends X_AD_Tab implements ImmutablePOSupport } // M_Tab /** - * + * Copy constructor * @param copy */ public MTab(MTab copy) @@ -159,7 +159,7 @@ public class MTab extends X_AD_Tab implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -169,7 +169,7 @@ public class MTab extends X_AD_Tab implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -187,12 +187,11 @@ public class MTab extends X_AD_Tab implements ImmutablePOSupport /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MTab.class); - /** Packages for Model Classes */ /** * Get Fields - * @param reload reload data - * @return array of lines - * @param trxName transaction + * @param reload true to reload from DB + * @param trxName transaction + * @return array of field */ public MField[] getFields (boolean reload, String trxName) { @@ -230,6 +229,7 @@ public class MTab extends X_AD_Tab implements ImmutablePOSupport * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (! newRecord && is_ValueChanged(COLUMNNAME_AD_Table_ID) && getFields(false, get_TrxName()).length > 0) { @@ -252,12 +252,11 @@ public class MTab extends X_AD_Tab implements ImmutablePOSupport return true; } - // begin e-evolution vpj-cd /** - * get Tab ID - * @param AD_Window_ID String - * @param TabName String - * @return int retValue + * get AD_Tab_ID via tab name + * @param AD_Window_ID window id + * @param TabName tab name + * @return AD_Tab_ID or 0 (not found) or -1 (error) */ public static int getTab_ID(int AD_Window_ID , String TabName) { int retValue = 0; @@ -285,8 +284,11 @@ public class MTab extends X_AD_Tab implements ImmutablePOSupport } return retValue; } - //end vpj-cd e-evolution + /** + * Get AD_Tab_ID of parent tab + * @return AD_Tab_ID or -1 (no parent tab) + */ public int getParentTabID() { int parentTabID = -1; diff --git a/org.adempiere.base/src/org/compiere/model/MTable.java b/org.adempiere.base/src/org/compiere/model/MTable.java index 25b14b5bfc..b4e97915b9 100644 --- a/org.adempiere.base/src/org/compiere/model/MTable.java +++ b/org.adempiere.base/src/org/compiere/model/MTable.java @@ -64,14 +64,14 @@ import org.idempiere.cache.ImmutablePOSupport; public class MTable extends X_AD_Table implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 4325276636597337437L; public final static int MAX_OFFICIAL_ID = 999999; /** - * Get Table from Cache (immutable) + * Get MTable from Cache (immutable) * @param AD_Table_ID id * @return MTable */ @@ -81,7 +81,7 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } /** - * Get Table from Cache (immutable) + * Get MTable from Cache (immutable) * @param ctx context * @param AD_Table_ID id * @return MTable @@ -92,7 +92,7 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } // get /** - * Get Table from Cache (immutable) + * Get MTable from Cache (immutable) * @param ctx context * @param AD_Table_ID id * @param trxName transaction @@ -130,10 +130,10 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } /** - * Get Table from Cache + * Get MTable from Cache * @param ctx context * @param tableName case insensitive table name - * @return Table + * @return MTable */ public static synchronized MTable get (Properties ctx, String tableName) { @@ -141,10 +141,11 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } // get /** - * Get Table from Cache + * Get MTable from Cache * @param ctx context * @param tableName case insensitive table name - * @return Table + * @param trxName + * @return MTable */ public static synchronized MTable get (Properties ctx, String tableName, String trxName) { @@ -193,14 +194,13 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport * Get Table Name * @param ctx context * @param AD_Table_ID table - * @return tavle name + * @return table name */ public static String getTableName (Properties ctx, int AD_Table_ID) { return MTable.get(ctx, AD_Table_ID).getTableName(); } // getTableName - /** Cache */ private static ImmutableIntPOCache s_cache = new ImmutableIntPOCache(Table_Name, 20); @@ -210,9 +210,9 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport private static final CCache> s_modelFactoryCache = new CCache<>(null, "IModelFactory", 100, 120, false, 2000); /** - * Get Persistence Class for Table + * Get Java Model Class for Table * @param tableName table name - * @return class or null + * @return Java model class or null */ public static Class getClass (String tableName) { @@ -247,18 +247,18 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } // getClass /** - * UUID based Constructor - * @param ctx Context - * @param AD_Table_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Table_UU UUID key + * @param trxName Transaction + */ public MTable(Properties ctx, String AD_Table_UU, String trxName) { super(ctx, AD_Table_UU, trxName); if (Util.isEmpty(AD_Table_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param AD_Table_ID id @@ -297,7 +297,7 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } // MTable /** - * + * Copy constructor * @param copy */ public MTable(MTable copy) @@ -306,7 +306,7 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -316,7 +316,7 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -332,22 +332,21 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport this.m_viewComponents = copy.m_viewComponents != null ? Arrays.stream(copy.m_viewComponents).map(e -> {return new MViewComponent(ctx, e, trxName);}).toArray(MViewComponent[]::new) : null; } - /** Columns */ private MColumn[] m_columns = null; /** Key Columns */ private String[] m_KeyColumns = null; - /** column name to index map **/ + /** column name to column index map **/ private Map m_columnNameMap; - /** ad_column_id to index map **/ + /** ad_column_id to column index map **/ private Map m_columnIdMap; /** View Components */ private MViewComponent[] m_viewComponents = null; /** * Get Columns - * @param requery requery - * @return array of columns + * @param requery true to re-query from DB + * @return array of column */ public synchronized MColumn[] getColumns (boolean requery) { @@ -391,9 +390,9 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } // getColumns /** - * Get Column + * Get Column via column name * @param columnName (case insensitive) - * @return column if found + * @return MColumn if found, null otherwise */ public MColumn getColumn (String columnName) { @@ -406,8 +405,8 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } // getColumn /** - * Get Column Index - * @param ColumnName column name + * Get Column Index via column name + * @param ColumnName column name (case insensitive) * @return index of column with ColumnName or -1 if not found */ public synchronized int getColumnIndex (String ColumnName) @@ -422,9 +421,9 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } // getColumnIndex /** - * Column exists and is not virtual? - * @param ColumnName column name - * @return boolean - true indicating that the column exists in the table and is not virtual + * Is column exists and is not virtual ? + * @param ColumnName column name (case insensitive) + * @return true if column exists and is not virtual */ public synchronized boolean columnExistsInDB (String ColumnName) { @@ -434,8 +433,8 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport /** * Column exists? - * @param ColumnName column name - * @return boolean - true indicating that the column exists in dictionary + * @param ColumnName column name (case insensitive) + * @return true if column exists in dictionary */ public synchronized boolean columnExistsInDictionary (String ColumnName) { @@ -444,8 +443,8 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport /** * Get Column Index - * @param AD_Column_ID column - * @return index of column with ColumnName or -1 if not found + * @param AD_Column_ID column id + * @return index of column with AD_Column_ID or -1 if not found */ public synchronized int getColumnIndex (int AD_Column_ID) { @@ -459,8 +458,8 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } // getColumnIndex /** - * Table has a single Key - * @return true if table has single key column + * Table is with single primary key + * @return true if table has single primary key column */ public boolean isSingleKey() { @@ -470,7 +469,7 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport /** * Get Key Columns of Table - * @return key columns + * @return array of key column name */ public String[] getKeyColumns() { @@ -504,7 +503,7 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } // getKeyColumns /** - * @return true if table key is _ID key. + * @return true if table has single key column and the key column name ends with _ID. */ public boolean isIDKeyTable() { @@ -513,7 +512,7 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } /** - * @return true if table key is _UU instead of _ID or composite parent key. + * @return true if table has single key column and the key column name ends with _UU. */ public boolean isUUIDKeyTable() { @@ -522,7 +521,7 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } /** - * @return true if table has a UUID key + * @return true if table has a UUID column (column name ends with _UU) */ public boolean hasUUIDKey() { @@ -533,8 +532,8 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } /** - * Get Identifier Columns of Table - * @return Identifier columns + * Get Identifier Columns of Table (IsIdentifier=Y) + * @return array of identifier column name */ public String[] getIdentifierColumns() { ArrayList listkn = new ArrayList(); @@ -559,12 +558,11 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport return retValue; } // getIdentifierColumns - - /************************************************************************** - * Get PO Class Instance - * @param Record_ID record + /** + * Get PO Instance for this table + * @param Record_ID record id. 0 to create new record instance, > 0 to load existing record instance. * @param trxName - * @return PO for Record or null + * @return PO for Record_ID or null */ public PO getPO (int Record_ID, String trxName) { @@ -625,10 +623,10 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } // getPO /** - * Get PO Class Instance + * Get PO Instance from result set * @param rs result set * @param trxName transaction - * @return PO for Record or null + * @return PO instance */ public PO getPO (ResultSet rs, String trxName) { @@ -673,11 +671,11 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } // getPO /** - * Get PO Class Instance + * Get PO Instance * - * @param uuID UUID + * @param uuID UUID. Throw IllegalArgumentException if this is null or empty string. * @param trxName transaction - * @return PO for Record + * @return PO for uuID */ public PO getPOByUU (String uuID, String trxName) { @@ -688,10 +686,10 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } // getPOByUU /** - * Get PO Class Instance - * @param whereClause where clause + * Get PO Instance + * @param whereClause SQL where clause * @param trxName transaction - * @return PO for Record or null + * @return PO for whereClause or null */ public PO getPO (String whereClause, String trxName) { @@ -699,11 +697,11 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } // getPO /** - * Get PO class instance - * @param whereClause - * @param params + * Get PO instance + * @param whereClause SQL where clause + * @param params parameters for whereClause * @param trxName - * @return + * @return PO instance or null */ public PO getPO(String whereClause, Object[] params, String trxName) { @@ -753,6 +751,7 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (isView() && isDeleteable()) @@ -772,6 +771,7 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (!success) @@ -795,7 +795,7 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } // afterSave /** - * Get SQL Create + * Get Create table DDL * @return create table DDL */ public String getSQLCreate() @@ -807,15 +807,20 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport return Database.getDatabase(Database.DB_ORACLE).getSQLCreate(this); } // getSQLCreate - // globalqss + /** + * Get AD_Table_ID via table name + * @param tableName + * @return AD_Table_ID + */ public static int getTable_ID(String tableName) { return getTable_ID(tableName, null); } + /** - * Grant independence to GenerateModel from AD_Table_ID + * Get AD_Table_ID via table name * @param tableName String * @param trxName - * @return int retValue + * @return AD_Table_ID */ public static int getTable_ID(String tableName, String trxName) { MTable table = get(Env.getCtx(), tableName, trxName); @@ -823,10 +828,10 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } /** - * Create query to retrieve one or more PO. - * @param whereClause + * Create new query for whereClause + * @param whereClause SQL whereClause * @param trxName - * @return Query + * @return new Query instance */ public Query createQuery(String whereClause, String trxName) { @@ -834,8 +839,8 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } /** - * Get view components - * @param reload reload data + * Get active view components + * @param reload true to reload from DB * @return array of view component */ public MViewComponent[] getViewComponent(boolean reload) @@ -863,6 +868,7 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder ("MTable["); @@ -871,8 +877,8 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } // toString /** - * Verify if the table contains ID=0 - * @return true if table has zero ID + * Verify if the table has record with ID=0 + * @return true if table has record with ID=0 */ public static boolean isZeroIDTable(String tablename) { return (tablename.equals("AD_Org") || @@ -917,8 +923,8 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport } /** - * Get the UUID from the Zero ID record - * @return + * Get the UUID of Zero ID record + * @return UUID or null */ public String getUUIDFromZeroID() { if (! MTable.isZeroIDTable(getTableName())) diff --git a/org.adempiere.base/src/org/compiere/model/MTableAccess.java b/org.adempiere.base/src/org/compiere/model/MTableAccess.java index 0a854c332e..b8060d07b4 100644 --- a/org.adempiere.base/src/org/compiere/model/MTableAccess.java +++ b/org.adempiere.base/src/org/compiere/model/MTableAccess.java @@ -25,30 +25,28 @@ import org.compiere.util.DB; import org.compiere.util.Msg; /** - * - * + * Table access model * @author Jorg Janke * @version $Id: MTableAccess.java,v 1.3 2006/07/30 00:58:38 jjanke Exp $ */ public class MTableAccess extends X_AD_Table_Access { /** - * + * generated serial id */ private static final long serialVersionUID = -3747261579266442904L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Table_Access_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Table_Access_UU UUID key + * @param trxName Transaction + */ public MTableAccess(Properties ctx, String AD_Table_Access_UU, String trxName) { super(ctx, AD_Table_Access_UU, trxName); } /** - * Persistency Constructor * @param ctx context * @param ignored ignored * @param trxName transaction @@ -75,6 +73,7 @@ public class MTableAccess extends X_AD_Table_Access * String Representation * @return info */ + @Override public String toString() { StringBuilder sb = new StringBuilder("MTableAccess["); diff --git a/org.adempiere.base/src/org/compiere/model/MTableIndex.java b/org.adempiere.base/src/org/compiere/model/MTableIndex.java index c9ce91b68f..1cdb8579f0 100644 --- a/org.adempiere.base/src/org/compiere/model/MTableIndex.java +++ b/org.adempiere.base/src/org/compiere/model/MTableIndex.java @@ -27,12 +27,12 @@ import org.compiere.util.Util; public class MTableIndex extends X_AD_TableIndex { /** - * + * generated serial id */ private static final long serialVersionUID = 1433937879086456196L; /** - * Get active indexes from table + * Get active indexes of table * @param table table * @return array of table index */ @@ -51,8 +51,8 @@ public class MTableIndex extends X_AD_TableIndex { /** * Get table indexes with where clause * @param ctx context - * @param whereClause where clause - * @return array of table index + * @param whereClause SQL where clause + * @return list of table index */ public static List getTableIndexesByQuery(Properties ctx, String whereClause) { @@ -62,11 +62,11 @@ public class MTableIndex extends X_AD_TableIndex { } /** - * UUID based Constructor - * @param ctx Context - * @param AD_TableIndex_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_TableIndex_UU UUID key + * @param trxName Transaction + */ public MTableIndex(Properties ctx, String AD_TableIndex_UU, String trxName) { super(ctx, AD_TableIndex_UU, trxName); if (Util.isEmpty(AD_TableIndex_UU)) @@ -110,7 +110,7 @@ public class MTableIndex extends X_AD_TableIndex { /** * Parent constructor * @param parent parent - * @param name name + * @param name index name */ public MTableIndex(MTable parent, String name) { @@ -131,7 +131,7 @@ public class MTableIndex extends X_AD_TableIndex { /** * Get index columns - * @param reload reload data + * @param reload true to reload from DB * @return array of index column */ public MIndexColumn[] getColumns(boolean reload) @@ -141,7 +141,7 @@ public class MTableIndex extends X_AD_TableIndex { /** * Get index columns - * @param reload reload data + * @param reload true to reload from DB * @param activeOnly return active records only * @return array of index column */ @@ -177,8 +177,8 @@ public class MTableIndex extends X_AD_TableIndex { } /** - * Get SQL DDL - * @return DDL + * Get create index or constraint (if IsCreateConstraint=Y) DDL + * @return create index or constraint DDL */ private String createDDL() { @@ -211,6 +211,9 @@ public class MTableIndex extends X_AD_TableIndex { return sql.toString(); } + /** + * @return columns for create index/constraint DDL + */ private String createColumnList() { getColumns(false, true); if (m_columns.length <= 0) @@ -228,8 +231,8 @@ public class MTableIndex extends X_AD_TableIndex { } /** - * Get SQL index create DDL - * @return SQL DDL + * Get create index or constraint (if IsCreateConstraint=Y) DDL + * @return Create Index or Constraint DDL */ public String getDDL() { @@ -239,8 +242,8 @@ public class MTableIndex extends X_AD_TableIndex { } /** - * Get SQL index create DDL - * @return SQL DDL + * Get drop index or constraint (if IsCreateConstraint=Y) DDL + * @return Drop Index or Constraint DDL */ public String getDropDDL() { diff --git a/org.adempiere.base/src/org/compiere/model/MTableScriptValidator.java b/org.adempiere.base/src/org/compiere/model/MTableScriptValidator.java index 03a4a2c06d..bccec315fa 100644 --- a/org.adempiere.base/src/org/compiere/model/MTableScriptValidator.java +++ b/org.adempiere.base/src/org/compiere/model/MTableScriptValidator.java @@ -31,7 +31,7 @@ import org.idempiere.cache.ImmutableIntPOCache; import org.idempiere.cache.ImmutablePOSupport; /** - * Table Validator Scripts + * Script validator for Table * @author Carlos Ruiz * @version $Id: MTableScriptValidator.java * @@ -43,7 +43,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MTableScriptValidator extends X_AD_Table_ScriptValidator implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 6776991549481106111L; @@ -82,8 +82,8 @@ public class MTableScriptValidator extends X_AD_Table_ScriptValidator implements * Get Model Validation Script Rules for a table/event * @param ctx context * @param ad_table_id AD_Table_ID - * @param event Event - * @return array of MTableScriptValidator or null if error or no validators found + * @param event Event (EVENTMODELVALIDATOR_*) + * @return list of MTableScriptValidator or null if error or no validators found */ public static List getModelValidatorRules (Properties ctx, int ad_table_id, String event) { @@ -131,16 +131,16 @@ public class MTableScriptValidator extends X_AD_Table_ScriptValidator implements = new CCache>(null, Table_Name+"_TableEvent", 20, false); /** - * UUID based Constructor - * @param ctx Context - * @param AD_Table_ScriptValidator_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Table_ScriptValidator_UU UUID key + * @param trxName Transaction + */ public MTableScriptValidator(Properties ctx, String AD_Table_ScriptValidator_UU, String trxName) { super(ctx, AD_Table_ScriptValidator_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param AD_Table_ScriptValidator_ID id @@ -163,7 +163,7 @@ public class MTableScriptValidator extends X_AD_Table_ScriptValidator implements } // MTableScriptValidator /** - * + * Copy constructor * @param copy */ public MTableScriptValidator(MTableScriptValidator copy) @@ -172,7 +172,7 @@ public class MTableScriptValidator extends X_AD_Table_ScriptValidator implements } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -182,7 +182,7 @@ public class MTableScriptValidator extends X_AD_Table_ScriptValidator implements } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MTask.java b/org.adempiere.base/src/org/compiere/model/MTask.java index e83b55539c..2279037fc7 100644 --- a/org.adempiere.base/src/org/compiere/model/MTask.java +++ b/org.adempiere.base/src/org/compiere/model/MTask.java @@ -25,7 +25,7 @@ import org.compiere.util.Msg; import org.compiere.util.Task; /** - * Operating Task Model + * Operating System Task Model * * @author Jorg Janke * @version $Id: MTask.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $ @@ -33,16 +33,16 @@ import org.compiere.util.Task; public class MTask extends X_AD_Task { /** - * + * generated serial id */ private static final long serialVersionUID = 5286481246615520755L; /** - * UUID based Constructor - * @param ctx Context - * @param AD_Task_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Task_UU UUID key + * @param trxName Transaction + */ public MTask(Properties ctx, String AD_Task_UU, String trxName) { super(ctx, AD_Task_UU, trxName); } @@ -86,13 +86,13 @@ public class MTask extends X_AD_Task } // execute /** - * Execute Task locally and wait + * Execute command locally and wait * @param cmd command - * @return execution info + * @return output from execution of command */ public String executeLocal(String cmd) { - log.config(cmd); + if (log.isLoggable(Level.CONFIG)) log.config(cmd); if (m_task != null && m_task.isAlive()) m_task.interrupt(); @@ -121,7 +121,7 @@ public class MTask extends X_AD_Task if (!m_task.isAlive()) break; } - log.config("done"); + if (log.isLoggable(Level.CONFIG)) log.config("done"); return sb.toString(); } // executeLocal @@ -145,6 +145,7 @@ public class MTask extends X_AD_Task * @param success success * @return true if save complete (if not overwritten true) */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (log.isLoggable(Level.FINE)) log.fine("Success=" + success); diff --git a/org.adempiere.base/src/org/compiere/model/MTax.java b/org.adempiere.base/src/org/compiere/model/MTax.java index 83d9a37a58..8682a48811 100644 --- a/org.adempiere.base/src/org/compiere/model/MTax.java +++ b/org.adempiere.base/src/org/compiere/model/MTax.java @@ -44,7 +44,7 @@ import org.idempiere.cache.ImmutablePOSupport; public class MTax extends X_C_Tax implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = -7971399495606742382L; /** Cache */ @@ -57,11 +57,10 @@ public class MTax extends X_C_Tax implements ImmutablePOSupport /** Postal Codes */ private MTaxPostal[] m_postals = null; - /** - * Get All Tax codes (for AD_Client) + * Get All Tax codes for client of this session/context * @param ctx context - * @return MTax + * @return array of MTax */ public static MTax[] getAll (Properties ctx) { @@ -76,7 +75,6 @@ public class MTax extends X_C_Tax implements ImmutablePOSupport } // Create it - //FR: [ 2214883 ] Remove SQL code and Replace for Query - red1 List list = new Query(ctx, I_C_Tax.Table_Name, null, null) .setClient_ID() .setOrderBy("C_CountryGroupFrom_ID, C_Country_ID, C_Region_ID, C_CountryGroupTo_ID, To_Country_ID, To_Region_ID, ValidFrom DESC") @@ -141,18 +139,18 @@ public class MTax extends X_C_Tax implements ImmutablePOSupport } /** - * UUID based Constructor - * @param ctx Context - * @param C_Tax_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_Tax_UU UUID key + * @param trxName Transaction + */ public MTax(Properties ctx, String C_Tax_UU, String trxName) { super(ctx, C_Tax_UU, trxName); if (Util.isEmpty(C_Tax_UU)) setInitialDefaults(); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param C_Tax_ID id @@ -192,7 +190,7 @@ public class MTax extends X_C_Tax implements ImmutablePOSupport } // MTax /** - * New Constructor + * New record Constructor * @param ctx * @param Name * @param Rate @@ -208,7 +206,7 @@ public class MTax extends X_C_Tax implements ImmutablePOSupport } // MTax /** - * + * Copy constructor * @param copy */ public MTax(MTax copy) @@ -217,7 +215,7 @@ public class MTax extends X_C_Tax implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -227,7 +225,7 @@ public class MTax extends X_C_Tax implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName @@ -243,7 +241,7 @@ public class MTax extends X_C_Tax implements ImmutablePOSupport /** * Get Child Taxes - * @param requery reload + * @param requery true to reload from DB * @return array of taxes or null */ public MTax[] getChildTaxes (boolean requery) @@ -253,14 +251,12 @@ public class MTax extends X_C_Tax implements ImmutablePOSupport if (m_childTaxes != null && !requery) return m_childTaxes; // - //FR: [ 2214883 ] Remove SQL code and Replace for Query - red1 final String whereClause = COLUMNNAME_Parent_Tax_ID+"=?"; List list = new Query(getCtx(), I_C_Tax.Table_Name, whereClause, get_TrxName()) .setParameters(getC_Tax_ID()) .setOnlyActiveRecords(true) .setClient_ID() .list(); - //red1 - end - if (list.size() > 0 && is_Immutable()) list.stream().forEach(e -> e.markImmutable()); @@ -271,22 +267,20 @@ public class MTax extends X_C_Tax implements ImmutablePOSupport /** * Get Postal Qualifiers - * @param requery requery - * @return array of postal codes + * @param requery true to reload from DB + * @return array of MTaxPostal */ public MTaxPostal[] getPostals (boolean requery) { if (m_postals != null && !requery) return m_postals; - //FR: [ 2214883 ] Remove SQL code and Replace for Query - red1 final String whereClause = MTaxPostal.COLUMNNAME_C_Tax_ID+"=?"; List list = new Query(getCtx(), I_C_TaxPostal.Table_Name, whereClause, get_TrxName()) .setParameters(getC_Tax_ID()) .setOnlyActiveRecords(true) .setOrderBy(I_C_TaxPostal.COLUMNNAME_Postal+", "+I_C_TaxPostal.COLUMNNAME_Postal_To) .list(); - //red1 - end - if (list.size() > 0 && is_Immutable()) list.stream().forEach(e -> e.markImmutable()); @@ -298,12 +292,12 @@ public class MTax extends X_C_Tax implements ImmutablePOSupport } // getPostals /** - * Do we have Postal Codes - * @return true if postal codes exist + * Is this tax uses postal code criteria + * @return true if uses postal code criteria */ public boolean isPostal() { - if(getPostals(false) == null) + if (getPostals(false) == null) return false; return getPostals(false).length > 0; @@ -318,6 +312,7 @@ public class MTax extends X_C_Tax implements ImmutablePOSupport return getRate().signum() == 0; } // isZeroTax + @Override public String toString() { StringBuilder sb = new StringBuilder("MTax[") @@ -336,11 +331,11 @@ public class MTax extends X_C_Tax implements ImmutablePOSupport /** - * Calculate Tax - no rounding - * @param amount amount - * @param taxIncluded if true tax is calculated from gross otherwise from net - * @param scale scale - * @return tax amount + * Calculate Tax Amount + * @param amount base amount to calculate tax amount + * @param taxIncluded if true tax amount is already included in the amount parameter and we need to extract tax amount from it. + * @param scale rounding scale for tax amount + * @return tax amount */ public BigDecimal calculateTax (BigDecimal amount, boolean taxIncluded, int scale) { @@ -407,6 +402,7 @@ public class MTax extends X_C_Tax implements ImmutablePOSupport * @param success success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (newRecord && success) @@ -430,8 +426,9 @@ public class MTax extends X_C_Tax implements ImmutablePOSupport } /** - * - * @return true if input tax is added to product cost + * @return + * - true if tax is posted to the product asset account and added to product cost (non deductible input tax).
        + * - false if tax is posted to a separate GL account from product asset account (deductible input tax). */ public boolean isDistributeTaxWithLineItem() { diff --git a/org.adempiere.base/src/org/compiere/model/MTaxCategory.java b/org.adempiere.base/src/org/compiere/model/MTaxCategory.java index bd946c3dd9..f1d482cff7 100644 --- a/org.adempiere.base/src/org/compiere/model/MTaxCategory.java +++ b/org.adempiere.base/src/org/compiere/model/MTaxCategory.java @@ -32,16 +32,16 @@ import org.compiere.util.Util; public class MTaxCategory extends X_C_TaxCategory { /** - * + * generated serial id */ private static final long serialVersionUID = -5521670797405300136L; /** - * UUID based Constructor - * @param ctx Context - * @param C_TaxCategory_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_TaxCategory_UU UUID key + * @param trxName Transaction + */ public MTaxCategory(Properties ctx, String C_TaxCategory_UU, String trxName) { super(ctx, C_TaxCategory_UU, trxName); if (Util.isEmpty(C_TaxCategory_UU)) @@ -80,9 +80,8 @@ public class MTaxCategory extends X_C_TaxCategory } // MTaxCategory /** - * getDefaultTax - * Get the default tax id associated with this tax category - * + * Get the default tax associated with this tax category. + * @return default MTax for this tax category */ public MTax getDefaultTax() { diff --git a/org.adempiere.base/src/org/compiere/model/MTaxDeclaration.java b/org.adempiere.base/src/org/compiere/model/MTaxDeclaration.java index 404e72b5ff..89e42cdde4 100644 --- a/org.adempiere.base/src/org/compiere/model/MTaxDeclaration.java +++ b/org.adempiere.base/src/org/compiere/model/MTaxDeclaration.java @@ -30,16 +30,16 @@ import org.compiere.util.TimeUtil; public class MTaxDeclaration extends X_C_TaxDeclaration { /** - * + * generated serial id */ private static final long serialVersionUID = 560499885058913281L; /** - * UUID based Constructor - * @param ctx Context - * @param C_TaxDeclaration_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_TaxDeclaration_UU UUID key + * @param trxName Transaction + */ public MTaxDeclaration(Properties ctx, String C_TaxDeclaration_UU, String trxName) { super(ctx, C_TaxDeclaration_UU, trxName); } @@ -71,6 +71,7 @@ public class MTaxDeclaration extends X_C_TaxDeclaration * @param newRecord new * @return true */ + @Override protected boolean beforeSave (boolean newRecord) { if (is_ValueChanged("DateFrom")) diff --git a/org.adempiere.base/src/org/compiere/model/MTaxDeclarationAcct.java b/org.adempiere.base/src/org/compiere/model/MTaxDeclarationAcct.java index 4a892dfd57..13d653cb1c 100644 --- a/org.adempiere.base/src/org/compiere/model/MTaxDeclarationAcct.java +++ b/org.adempiere.base/src/org/compiere/model/MTaxDeclarationAcct.java @@ -20,7 +20,7 @@ import java.sql.ResultSet; import java.util.Properties; /** - * Tax Tax Declaration Accounting Model + * Tax Declaration Accounting Model * * @author Jorg Janke * @version $Id: MTaxDeclarationAcct.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $ @@ -28,16 +28,16 @@ import java.util.Properties; public class MTaxDeclarationAcct extends X_C_TaxDeclarationAcct { /** - * + * generated serial id */ private static final long serialVersionUID = -840113412342364029L; /** - * UUID based Constructor - * @param ctx Context - * @param C_TaxDeclarationAcct_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_TaxDeclarationAcct_UU UUID key + * @param trxName Transaction + */ public MTaxDeclarationAcct(Properties ctx, String C_TaxDeclarationAcct_UU, String trxName) { super(ctx, C_TaxDeclarationAcct_UU, trxName); } diff --git a/org.adempiere.base/src/org/compiere/model/MTaxDeclarationLine.java b/org.adempiere.base/src/org/compiere/model/MTaxDeclarationLine.java index 135fc365c7..f8780bf1af 100644 --- a/org.adempiere.base/src/org/compiere/model/MTaxDeclarationLine.java +++ b/org.adempiere.base/src/org/compiere/model/MTaxDeclarationLine.java @@ -31,16 +31,16 @@ import org.compiere.util.Util; public class MTaxDeclarationLine extends X_C_TaxDeclarationLine { /** - * + * generated serial id */ private static final long serialVersionUID = 2723299110241208689L; /** - * UUID based Constructor - * @param ctx Context - * @param C_TaxDeclarationLine_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_TaxDeclarationLine_UU UUID key + * @param trxName Transaction + */ public MTaxDeclarationLine(Properties ctx, String C_TaxDeclarationLine_UU, String trxName) { super(ctx, C_TaxDeclarationLine_UU, trxName); if (Util.isEmpty(C_TaxDeclarationLine_UU)) @@ -135,5 +135,4 @@ public class MTaxDeclarationLine extends X_C_TaxDeclarationLine setTaxAmt (tLine.getTaxAmt()); } // MTaxDeclarationLine - } // MTaxDeclarationLine diff --git a/org.adempiere.base/src/org/compiere/model/MTaxPostal.java b/org.adempiere.base/src/org/compiere/model/MTaxPostal.java index c6f52dcb53..d7454bd2fd 100644 --- a/org.adempiere.base/src/org/compiere/model/MTaxPostal.java +++ b/org.adempiere.base/src/org/compiere/model/MTaxPostal.java @@ -22,7 +22,6 @@ import java.util.Properties; import org.compiere.util.Env; import org.idempiere.cache.ImmutablePOSupport; - /** * Tax Postal Model * @@ -32,16 +31,16 @@ import org.idempiere.cache.ImmutablePOSupport; public class MTaxPostal extends X_C_TaxPostal implements ImmutablePOSupport { /** - * + * generated serial id */ private static final long serialVersionUID = 2517717028191578304L; /** - * UUID based Constructor - * @param ctx Context - * @param C_TaxPostal_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_TaxPostal_UU UUID key + * @param trxName Transaction + */ public MTaxPostal(Properties ctx, String C_TaxPostal_UU, String trxName) { super(ctx, C_TaxPostal_UU, trxName); } @@ -69,7 +68,7 @@ public class MTaxPostal extends X_C_TaxPostal implements ImmutablePOSupport } // MTaxPostal /** - * + * Copy constructor * @param copy */ public MTaxPostal(MTaxPostal copy) @@ -78,7 +77,7 @@ public class MTaxPostal extends X_C_TaxPostal implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy */ @@ -88,7 +87,7 @@ public class MTaxPostal extends X_C_TaxPostal implements ImmutablePOSupport } /** - * + * Copy constructor * @param ctx * @param copy * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/MTaxProvider.java b/org.adempiere.base/src/org/compiere/model/MTaxProvider.java index 87ac68859f..e2cbb7f8b0 100644 --- a/org.adempiere.base/src/org/compiere/model/MTaxProvider.java +++ b/org.adempiere.base/src/org/compiere/model/MTaxProvider.java @@ -24,35 +24,51 @@ import java.util.Properties; public class MTaxProvider extends X_C_TaxProvider { /** - * + * generated serial id */ private static final long serialVersionUID = 6621828279540899973L; /** - * UUID based Constructor - * @param ctx Context - * @param C_TaxProvider_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param C_TaxProvider_UU UUID key + * @param trxName Transaction + */ public MTaxProvider(Properties ctx, String C_TaxProvider_UU, String trxName) { super(ctx, C_TaxProvider_UU, trxName); } - + + /** + * @param ctx + * @param C_TaxProvider_ID + * @param trxName + */ public MTaxProvider(Properties ctx, int C_TaxProvider_ID, String trxName) { super(ctx, C_TaxProvider_ID, trxName); } + /** + * @param ctx + * @param rs + * @param trxName + */ public MTaxProvider(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } + /** + * @return Tax provider Java class name + */ public String getTaxProviderClass() { return getC_TaxProviderCfg().getTaxProviderClass(); } + /** + * @return URL for online tax provider service + */ public String getURL() { return getC_TaxProviderCfg().getURL(); diff --git a/org.adempiere.base/src/org/compiere/model/MTest.java b/org.adempiere.base/src/org/compiere/model/MTest.java index 64411e9443..08d850bbf6 100644 --- a/org.adempiere.base/src/org/compiere/model/MTest.java +++ b/org.adempiere.base/src/org/compiere/model/MTest.java @@ -23,7 +23,6 @@ import java.sql.Timestamp; import java.util.Properties; import java.util.logging.Level; -import org.compiere.Adempiere; import org.compiere.util.Env; /** @@ -35,7 +34,7 @@ import org.compiere.util.Env; public class MTest extends X_Test { /** - * + * generated serial id */ private static final long serialVersionUID = -5390179651635427303L; @@ -73,7 +72,7 @@ public class MTest extends X_Test } // MTest /** - * Test Object Constructor + * new Test record Constructor * @param ctx context * @param testString test string * @param testNo test no @@ -84,7 +83,7 @@ public class MTest extends X_Test } /** - * Test Object Constructor + * new Test record Constructor * @param ctx context * @param testString test string * @param testNo test no @@ -108,7 +107,12 @@ public class MTest extends X_Test setC_UOM_ID(100); // Each } // MTest - + /** + * @param ctx + * @param Test_ID + * @param trxName + * @param virtualColumns + */ public MTest(Properties ctx, int Test_ID, String trxName, String... virtualColumns) { super(ctx, Test_ID, trxName, virtualColumns); } @@ -117,6 +121,7 @@ public class MTest extends X_Test * Before Delete * @return true if it can be deleted */ + @Override protected boolean beforeDelete () { log.info("***"); @@ -128,6 +133,7 @@ public class MTest extends X_Test * @param success * @return success */ + @Override protected boolean afterDelete (boolean success) { if (log.isLoggable(Level.INFO)) log.info("*** Success=" + success); @@ -151,35 +157,11 @@ public class MTest extends X_Test * @param success * @return success */ + @Override protected boolean afterSave (boolean newRecord, boolean success) { if (log.isLoggable(Level.INFO)) log.info("New=" + newRecord + ", Success=" + success + " ***"); return success; } // afterSave - - /************************************************************************* - * Test - * @param args - */ - public static void main(String[] args) - { - Adempiere.startup(true); - Properties ctx = Env.getCtx(); - - /** Test CLOB */ - MTest t1 = new MTest (ctx, 0, null); - t1.setName("Test1"); - System.out.println("->" + t1.getCharacterData() + "<-"); - t1.saveEx(); - t1.setCharacterData("Long Text JJ"); - t1.saveEx(); - int Test_ID = t1.getTest_ID(); - // - MTest t2 = new MTest (Env.getCtx(), Test_ID, null); - System.out.println("->" + t2.getCharacterData() + "<-"); - - t2.delete(true); - } // main - } // MTest diff --git a/org.adempiere.base/src/org/compiere/model/MTestUU.java b/org.adempiere.base/src/org/compiere/model/MTestUU.java index 9256ffb46e..2c86622964 100644 --- a/org.adempiere.base/src/org/compiere/model/MTestUU.java +++ b/org.adempiere.base/src/org/compiere/model/MTestUU.java @@ -34,7 +34,7 @@ import java.util.Properties; */ public class MTestUU extends X_TestUU { /** - * + * generated serial id */ private static final long serialVersionUID = 5182486896440407051L; @@ -49,6 +49,12 @@ public class MTestUU extends X_TestUU { this(ctx, Test_UU, trxName, (String[]) null); } // MTestUU + /** + * @param ctx + * @param Test_UU + * @param trxName + * @param virtualColumns + */ public MTestUU(Properties ctx, String Test_UU, String trxName, String... virtualColumns) { super(ctx, Test_UU, trxName, virtualColumns); if ("".equals(Test_UU)) { diff --git a/org.adempiere.base/src/org/compiere/model/MTimeExpense.java b/org.adempiere.base/src/org/compiere/model/MTimeExpense.java index 764530a51d..d3b681f08e 100644 --- a/org.adempiere.base/src/org/compiere/model/MTimeExpense.java +++ b/org.adempiere.base/src/org/compiere/model/MTimeExpense.java @@ -256,14 +256,11 @@ public class MTimeExpense extends X_S_TimeExpense implements DocAction /** * Create PDF file * @param file output file - * @return file if success + * @return not implemented, always return null */ public File createPDF (File file) { - // ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.INVOICE, getC_Invoice_ID()); - // if (re == null) - return null; - // return re.getPDF(file); + return null; } // createPDF /************************************************************************** diff --git a/org.adempiere.base/src/org/compiere/model/M_Element.java b/org.adempiere.base/src/org/compiere/model/M_Element.java index ca0f462f7a..71e0871ab9 100644 --- a/org.adempiere.base/src/org/compiere/model/M_Element.java +++ b/org.adempiere.base/src/org/compiere/model/M_Element.java @@ -41,7 +41,7 @@ public class M_Element extends X_AD_Element { /** - * + * generated serial id */ private static final long serialVersionUID = -6644398794862560030L; @@ -76,7 +76,7 @@ public class M_Element extends X_AD_Element * Get Element * @param ctx context * @param columnName case insensitive column name - * @return case sensitive column name + * @return M_Element */ public static M_Element get (Properties ctx, String columnName) { @@ -88,7 +88,7 @@ public class M_Element extends X_AD_Element * @param ctx context * @param columnName case insensitive column name * @param trxName optional transaction name - * @return case sensitive column name + * @return M_Element */ public static M_Element get (Properties ctx, String columnName, String trxName) { @@ -134,16 +134,16 @@ public class M_Element extends X_AD_Element } // get /** - * UUID based Constructor - * @param ctx Context - * @param AD_Element_UU UUID key - * @param trxName Transaction - */ + * UUID based Constructor + * @param ctx Context + * @param AD_Element_UU UUID key + * @param trxName Transaction + */ public M_Element(Properties ctx, String AD_Element_UU, String trxName) { super(ctx, AD_Element_UU, trxName); } - /************************************************************************** + /** * Standard Constructor * @param ctx context * @param AD_Element_ID element @@ -182,7 +182,6 @@ public class M_Element extends X_AD_Element // setEntityType (EntityType); // U } // M_Element - /* (non-Javadoc) * @see org.compiere.model.PO#beforeSave(boolean) @@ -331,6 +330,11 @@ public class M_Element extends X_AD_Element return sb.toString (); } // toString + /** + * Change DB column name (i.e Alter Column) + * @param newColumnName + * @param pi + */ public void renameDBColumn(String newColumnName, ProcessInfo pi) { List columns = new Query(getCtx(), MColumn.Table_Name, "AD_Element_ID=?", get_TrxName()) .setParameters(getAD_Element_ID()) diff --git a/org.adempiere.base/src/org/compiere/model/MatchPOAutoMatch.java b/org.adempiere.base/src/org/compiere/model/MatchPOAutoMatch.java index 4acd53c9a5..2b86403c2d 100644 --- a/org.adempiere.base/src/org/compiere/model/MatchPOAutoMatch.java +++ b/org.adempiere.base/src/org/compiere/model/MatchPOAutoMatch.java @@ -25,14 +25,13 @@ import org.compiere.process.DocAction; import org.compiere.util.Env; /** - * + * Helper methods for auto matching of M_MatchPO records. * @author hengsin * */ public class MatchPOAutoMatch { /** - * * @param ctx * @param C_OrderLine_ID * @param trxName @@ -139,7 +138,7 @@ public class MatchPOAutoMatch { } /** - * auto match matchpo + * auto match matchpo (between match po created by vendor credit memo and match po created by vendor invoice) * @param ctx * @param C_OrderLine_ID * @param currentPO @@ -150,6 +149,8 @@ public class MatchPOAutoMatch { List notMatchedMatchPOList = new ArrayList(); List creditMemoMatchPOList = new ArrayList(); List matchedMatchPOList = new ArrayList(); + + //find not matched POs MMatchPO[] mpos = MMatchPO.getOrderLine(ctx, C_OrderLine_ID, trxName); for (MMatchPO mpo : mpos) { @@ -419,7 +420,7 @@ public class MatchPOAutoMatch { } /** - * remove match between vendor invoice and vendor cm + * remove matchpo and matchinv records between vendor invoice and vendor cm * @param ctx * @param C_Invoice_ID * @param trxName diff --git a/org.adempiere.base/src/org/compiere/model/Measure.java b/org.adempiere.base/src/org/compiere/model/Measure.java index 6a96329cb5..e99aced280 100644 --- a/org.adempiere.base/src/org/compiere/model/Measure.java +++ b/org.adempiere.base/src/org/compiere/model/Measure.java @@ -23,7 +23,9 @@ import java.math.BigDecimal; * * @author Jorg Janke * @version $Id: Measure.java,v 1.2 2006/07/30 00:51:03 jjanke Exp $ + * @deprecated Half build and not use in current code */ +@Deprecated public interface Measure { /** diff --git a/org.adempiere.base/src/org/compiere/model/ModelValidationEngine.java b/org.adempiere.base/src/org/compiere/model/ModelValidationEngine.java index ef25c3734b..6406653468 100644 --- a/org.adempiere.base/src/org/compiere/model/ModelValidationEngine.java +++ b/org.adempiere.base/src/org/compiere/model/ModelValidationEngine.java @@ -52,7 +52,7 @@ import org.osgi.service.event.Event; * @author Jorg Janke * @version $Id: ModelValidationEngine.java,v 1.2 2006/07/30 00:58:38 jjanke Exp $ * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL + * @author Teo Sarca, SC ARHIPAC SERVICE SRL *
      • FR [ 1670025 ] ModelValidator.afterLoadPreferences will be useful *
      • BF [ 1679692 ] fireDocValidate doesn't treat exceptions as errors *
      • FR [ 1724662 ] Support Email should contain model validators info @@ -62,15 +62,14 @@ import org.osgi.service.event.Event; * https://sourceforge.net/p/adempiere/bugs/1936/ *
      • BF [ 2819617 ] NPE if script validator rule returns null * https://sourceforge.net/p/adempiere/bugs/1976/ - * @author victor.perez@e-evolution.com, www.e-evolution.com + * @author victor.perez@e-evolution.com, www.e-evolution.com *
      • BF [ 2947607 ] Model Validator Engine duplicate listeners */ public class ModelValidationEngine { - /** - * Get Singleton - * @return engine + * Get Singleton instance + * @return singleton engine instance */ public synchronized static ModelValidationEngine get() { @@ -81,13 +80,12 @@ public class ModelValidationEngine /** Engine Singleton */ private static ModelValidationEngine s_engine = null; - /* flag to indicate a missing model validation class */ + /** flag to indicate a missing model validation class */ private static String missingModelValidationMessage = ""; - - /************************************************************************** - * Constructor. - * Creates Model Validators + /** + * Private Constructor. + * Use {@link #get()} to get the singleton instance. */ private ModelValidationEngine () { @@ -124,6 +122,11 @@ public class ModelValidationEngine } } // ModelValidatorEngine + /** + * Load validation instances + * @param client + * @param classNames Java class name list separated by semicolon + */ private void loadValidatorClasses(MClient client, String classNames) { StringTokenizer st = new StringTokenizer(classNames, ";"); @@ -150,6 +153,11 @@ public class ModelValidationEngine } } + /** + * Load validator instance + * @param client + * @param className + */ private void loadValidatorClass(MClient client, String className) { try { @@ -193,9 +201,9 @@ public class ModelValidationEngine private ArrayList m_globalValidators = new ArrayList(); /** - * Initialize and add validator + * Initialize and add validator to global or client validator list. * @param validator - * @param client + * @param client null for global validator, not null for client specific validator */ private void initialize(ModelValidator validator, MClient client) { @@ -207,7 +215,10 @@ public class ModelValidationEngine } // initialize /** - * Called when login is complete + * Called when login is complete.
        + * - Call {@link ModelValidator#login(int, int, int)} on register validators. + * - Call script validator (AD_Table_ScriptValidator)
        + * - Fire {@link IEventTopics#AFTER_LOGIN} OSGi event. * @param AD_Client_ID client * @param AD_Org_ID org * @param AD_Role_ID role @@ -228,7 +239,7 @@ public class ModelValidationEngine } } - // now process the script model validator login + // now process the script model validator for login List loginRules = MRule.getModelValidatorLoginRules (Env.getCtx()); if (loginRules != null) { for (MRule loginRule : loginRules) { @@ -288,11 +299,10 @@ public class ModelValidationEngine return null; } // loginComplete - - /************************************************************************** - * Add Model Change Listener + /** + * Add Model Change Listener for a table * @param tableName table name - * @param listener listener + * @param listener listener (global or tenant specific) */ public void addModelChange (String tableName, ModelValidator listener) { @@ -315,9 +325,9 @@ public class ModelValidationEngine } // addModelValidator /** - * Remove Model Change Listener + * Remove Model Change Listener for a table * @param tableName table name - * @param listener listener + * @param listener listener (global or tenant specific) */ public void removeModelChange (String tableName, ModelValidator listener) { @@ -336,9 +346,11 @@ public class ModelValidationEngine } // removeModelValidator /** - * Fire Model Change. - * Call modelChange method of added validators - * @param po persistent objects + * Fire Model Change event of a table. + * - Call {@link ModelValidator#modelChange(PO, int)} on register validators.
        + * - Call script validator (AD_Table_ScriptValidator)
        + * - Fire IEventTopics.PO_* OSGi event. + * @param po PO instance for the event * @param changeType ModelValidator.TYPE_* * @return error message or NULL for no veto */ @@ -425,6 +437,14 @@ public class ModelValidationEngine return null; } // fireModelChange + /** + * Fire model change event of a table.
        + * - Call {@link ModelValidator#modelChange(PO, int)} on register validators. + * @param po PO instance for the event + * @param changeType ModelValidator.TYPE_* + * @param list register validators + * @return error message or null + */ private String fireModelChange(PO po, int changeType, ArrayList list) { for (int i = 0; i < list.size(); i++) @@ -459,11 +479,10 @@ public class ModelValidationEngine return null; } - - /************************************************************************** - * Add Document Validation Listener + /** + * Add Document Validation Listener for a table * @param tableName table name - * @param listener listener + * @param listener listener (global or tenant specific) */ public void addDocValidate (String tableName, ModelValidator listener) { @@ -488,9 +507,9 @@ public class ModelValidationEngine } // addDocValidate /** - * Remove Document Validation Listener + * Remove Document Validation Listener of a table * @param tableName table name - * @param listener listener + * @param listener listener (global or tenant specific) */ public void removeDocValidate (String tableName, ModelValidator listener) { @@ -509,9 +528,11 @@ public class ModelValidationEngine } // removeDocValidate /** - * Fire Document Validation. - * Call docValidate method of added validators - * @param po persistent objects + * Fire Document Validation event of a table.
        + * - Call {@link ModelValidator#docValidate(PO, int)} on register validators.
        + * - Call script validator (AD_Table_ScriptValidator)
        + * - Fire IEventTopics.DOC_* OSGi event. + * @param po PO instance for the event * @param docTiming see ModelValidator.TIMING_ constants * @return error message or null */ @@ -597,6 +618,14 @@ public class ModelValidationEngine return null; } // fireDocValidate + /** + * Fire Document Validation event of a table.
        + * - Call {@link ModelValidator#docValidate(PO, int)} on register validators. + * @param po + * @param docTiming + * @param list register validators + * @return error message or null + */ private String fireDocValidate(PO po, int docTiming, ArrayList list) { for (int i = 0; i < list.size(); i++) @@ -633,10 +662,10 @@ public class ModelValidationEngine return null; } - /************************************************************************** + /** * Add Accounting Facts Validation Listener * @param tableName table name - * @param listener listener + * @param listener listener (global or tenant specific) */ public void addFactsValidate (String tableName, FactsValidator listener) { @@ -658,8 +687,8 @@ public class ModelValidationEngine list.add(listener); } // addFactsValidate - /************************************************************************** - * Add Date Import Validation Listener + /** + * Add Import Validation Listener of an import table * @param importTableName table name * @param listener listener */ @@ -680,7 +709,7 @@ public class ModelValidationEngine } /** - * Remove Accounting Facts Validation Listener + * Remove Accounting Facts Validation Listener of a table * @param tableName table name * @param listener listener */ @@ -701,11 +730,12 @@ public class ModelValidationEngine } // removeFactsValidate /** - * Fire Accounting Facts Validation. - * Call factsValidate method of added validators + * Fire Accounting Facts Validation event of a table.
        + * - Call {@link FactsValidator#factsValidate(MAcctSchema, List, PO)} on register validators.
        + * - Fire {@link IEventTopics#ACCT_FACTS_VALIDATE} OSGi event. * @param schema * @param facts - * @param po + * @param po PO instance of event * @return error message or null */ public String fireFactsValidate (MAcctSchema schema, List facts, PO po) @@ -752,6 +782,15 @@ public class ModelValidationEngine return null; } // fireFactsValidate + /** + * Fire Accounting Facts Validation event of a table.
        + * - Call {@link FactsValidator#factsValidate(MAcctSchema, List, PO)} on register validators. + * @param schema + * @param facts + * @param po PO instance of event + * @param list register validators + * @return error message or null + */ private String fireFactsValidate(MAcctSchema schema, List facts, PO po, ArrayList list) { for (int i = 0; i < list.size(); i++) @@ -789,8 +828,9 @@ public class ModelValidationEngine } /** - * Fire Import Validation. - * Call {@link ImportValidator#validate(ImportProcess, Object, Object, int)} or registered validators. + * Fire Import Validation event.
        + * - Call {@link ImportValidator#validate(ImportProcess, Object, Object, int)} on registered validators.
        + * - Fire IEventTopics.IMPORT_* OSGi event. * @param process import process * @param importModel import record (e.g. X_I_BPartner) * @param targetModel target model (e.g. MBPartner, MBPartnerLocation, MUser) @@ -826,9 +866,10 @@ public class ModelValidationEngine } /** - * String Representation - * @return info - */ + * String Representation + * @return info + */ + @Override public String toString() { StringBuilder sb = new StringBuilder("ModelValidationEngine["); @@ -840,10 +881,10 @@ public class ModelValidationEngine } // toString /** - * Create Model Validators Info + * Get Model Validation Engine Info * @param sb optional string buffer * @param ctx context - * @return Model Validators Info + * @return Model Validation Engine Info * * author Teo Sarca, FR [ 1724662 ] */ @@ -883,10 +924,11 @@ public class ModelValidationEngine } /** - * After Load Preferences into Context for selected client. + * After Load Preferences into Context for selected client.
        + * Fire afterLoadPreferences model validator event and {@link IEventTopics#PREF_AFTER_LOAD} OSGi event. * @param ctx context * @see org.compiere.util.Login#loadPreferences(KeyNamePair, KeyNamePair, java.sql.Timestamp, String) - * author Teo Sarca - FR [ 1670025 ] - https://sourceforge.net/p/adempiere/feature-requests/78/ + * @author Teo Sarca - FR [ 1670025 ] - https://sourceforge.net/p/adempiere/feature-requests/78/ */ public void afterLoadPreferences (Properties ctx) { @@ -921,7 +963,9 @@ public class ModelValidationEngine /** * Before Save Properties for selected client. + * @deprecated for deprecated swing client only */ + @Deprecated public void beforeSaveProperties () { int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); diff --git a/org.adempiere.base/src/org/compiere/model/ModelValidator.java b/org.adempiere.base/src/org/compiere/model/ModelValidator.java index bb3c3d1623..fdd7f1258f 100644 --- a/org.adempiere.base/src/org/compiere/model/ModelValidator.java +++ b/org.adempiere.base/src/org/compiere/model/ModelValidator.java @@ -32,23 +32,26 @@ public interface ModelValidator /** Model Change Type New */ public static final int TYPE_BEFORE_NEW = 1; // teo_sarca [ 1675490 ] public static final int TYPE_NEW = 1; + @Deprecated public static final int CHANGETYPE_NEW = 1; // Compatibility with Compiere 260c public static final int TYPE_AFTER_NEW = 4; // teo_sarca [ 1675490 ] public static final int TYPE_AFTER_NEW_REPLICATION = 7; // @Trifon /** Model Change Type Change */ public static final int TYPE_BEFORE_CHANGE = 2; // teo_sarca [ 1675490 ] public static final int TYPE_CHANGE = 2; + @Deprecated public static final int CHANGETYPE_CHANGE = 2; // Compatibility with Compiere 260c public static final int TYPE_AFTER_CHANGE = 5; // teo_sarca [ 1675490 ] public static final int TYPE_AFTER_CHANGE_REPLICATION = 8; // @Trifon /** Model Change Type Delete */ public static final int TYPE_BEFORE_DELETE = 3; // teo_sarca [ 1675490 ] public static final int TYPE_DELETE = 3; + @Deprecated public static final int CHANGETYPE_DELETE = 3; // Compatibility with Compiere 260c public static final int TYPE_AFTER_DELETE = 6; // teo_sarca [ 1675490 ] public static final int TYPE_BEFORE_DELETE_REPLICATION = 9; // @Trifon - // Correlation between constant events and list of event script model validators + // Correlation between AD_Table_ScriptValidator.EventModelValidator constants and model change TYPE_ constants. public static String[] tableEventValidators = new String[] { "", // 0 X_AD_Table_ScriptValidator.EVENTMODELVALIDATOR_TableBeforeNew, // TYPE_BEFORE_NEW = 1 @@ -62,7 +65,7 @@ public interface ModelValidator X_AD_Table_ScriptValidator.EVENTMODELVALIDATOR_TableBeforeDeleteReplication // TYPE_BEFORE_DELETE_REPLICATION = 9 }; - // Correlation between constant events and list of osgi event topic + // Correlation between OSGi event topic and model change TYPE_ constants public static String[] tableEventTopics = new String[] { "", // 0 IEventTopics.PO_BEFORE_NEW, // TYPE_BEFORE_NEW = 1 @@ -78,6 +81,7 @@ public interface ModelValidator /** Called before document is prepared */ public static final int TIMING_BEFORE_PREPARE = 1; + @Deprecated public static final int DOCTIMING_BEFORE_PREPARE = 1; // Compatibility with Compiere 260c /** Called before document is void */ public static final int TIMING_BEFORE_VOID = 2; @@ -95,6 +99,7 @@ public interface ModelValidator public static final int TIMING_AFTER_PREPARE = 8; /** Called after document is completed */ public static final int TIMING_AFTER_COMPLETE = 9; + @Deprecated public static final int DOCTIMING_AFTER_COMPLETE = 9; // Compatibility with Compiere 260c /** Called after document is void */ public static final int TIMING_AFTER_VOID = 10; @@ -111,7 +116,7 @@ public interface ModelValidator /** Called after document is posted */ public static final int TIMING_AFTER_POST = 16; - // Correlation between constant events and list of event script model validators + // Correlation between AD_Table_ScriptValidator.EventModelValidator constants and document change TIMING_ constants. public static String[] documentEventValidators = new String[] { "", // 0 X_AD_Table_ScriptValidator.EVENTMODELVALIDATOR_DocumentBeforePrepare, // TIMING_BEFORE_PREPARE = 1 @@ -132,7 +137,7 @@ public interface ModelValidator X_AD_Table_ScriptValidator.EVENTMODELVALIDATOR_DocumentAfterPost // TIMING_AFTER_POST = 16 }; - // Correlation between constant events and list of osgi event topics + // Correlation between OSGi event topics and document change TIMING_ constants. public static String[] documentEventTopics = new String[] { "", // 0 IEventTopics.DOC_BEFORE_PREPARE, // TIMING_BEFORE_PREPARE = 1 @@ -154,21 +159,21 @@ public interface ModelValidator }; /** - * Initialize Validation + * Initialize validator. * @param engine validation engine - * @param client client + * @param client optional client. null for validator that's applicable to all client. */ public void initialize (ModelValidationEngine engine, MClient client); /** * Get Client to be monitored - * @return AD_Client_ID + * @return AD_Client_ID or 0 */ public int getAD_Client_ID(); /** - * User logged in - * Called before preferences are set + * User logged in. + * Called before preferences are set. * @param AD_Org_ID org * @param AD_Role_ID role * @param AD_User_ID user @@ -176,24 +181,19 @@ public interface ModelValidator */ public String login (int AD_Org_ID, int AD_Role_ID, int AD_User_ID); - /** - * Model Change of a monitored Table. - * Called after PO.beforeSave/PO.beforeDelete - * when you called addModelChange for the table + * Model change event of a Table. * @param po persistent object - * @param type TYPE_ + * @param type TYPE_ event * @return error message or null * @exception Exception if the recipient wishes the change to be not accept. */ public String modelChange (PO po, int type) throws Exception; - /** - * Validate Document. + * Validate Document Action.
        * Called as first step of DocAction.prepareIt - * or at the end of DocAction.completeIt - * when you called addDocValidate for the table. + * or at the end of DocAction.completeIt.
        * Note that totals, etc. may not be correct before the prepare stage. * @param po persistent object * @param timing see TIMING_ constants diff --git a/org.adempiere.base/src/org/compiere/model/PO.java b/org.adempiere.base/src/org/compiere/model/PO.java index 564fe7a4df..48ee34daa0 100644 --- a/org.adempiere.base/src/org/compiere/model/PO.java +++ b/org.adempiere.base/src/org/compiere/model/PO.java @@ -1831,7 +1831,7 @@ public abstract class PO Class c = p_info.getColumnClass(i); String stringValue = null; if (c == Object.class) - ; // saveNewSpecial (value, i)); + ; else if (value == null || value.equals (Null.NULL)) ; else if (value instanceof Integer || value instanceof BigDecimal) @@ -1852,7 +1852,7 @@ public abstract class PO else if (DisplayType.isLOB(dt)) ; else - ; // saveNewSpecial (value, i)); + ; // if (stringValue != null) hmOut.put(p_info.getColumnName(i), stringValue); @@ -1874,8 +1874,8 @@ public abstract class PO } // get_HashMap /** - * Load Special data (images, ..). - * To be extended by sub-classes + * Load data for custom Java type that has no build in implementation (images, ..). + * To be extended by sub-classes (default implementation just return null). * @param rs result set * @param index zero based index * @return value value @@ -3834,8 +3834,8 @@ public abstract class PO /** - * Save Special Data. - * To be extended by sub-classes + * Save data for custom Java type that have no build in implementation.
        + * To be extended by sub-classes (default implementation just call value.toString()). * @param value value * @param index index * @return SQL code for INSERT VALUES clause @@ -3845,7 +3845,6 @@ public abstract class PO String colName = p_info.getColumnName(index); String colClass = p_info.getColumnClass(index).toString(); String colValue = value == null ? "null" : value.getClass().toString(); -// int dt = p_info.getColumnDisplayType(index); log.log(Level.SEVERE, "Unknown class for column " + colName + " (" + colClass + ") - Value=" + colValue); @@ -5134,9 +5133,8 @@ public abstract class PO return getAttachmentData(".pdf"); } // getPDFAttachment - - /************************************************************************** - * Dump Record + /** + * Dump where clause and column values */ public void dump () { @@ -5149,8 +5147,8 @@ public abstract class PO } // dump /** - * Dump column - * @param index index + * Dump column (index:columnName=oldValue (newValue)) + * @param index column index */ public void dump (int index) { @@ -5166,10 +5164,9 @@ public abstract class PO if (log.isLoggable(Level.FINEST)) log.finest(sb.toString()); } // dump - - /************************************************************************* + /** * Get All IDs of Table. - * Used for listing all Entities + * Used for listing of all records *
        {@code
         	 	int[] IDs = PO.getAllIDs ("AD_PrintFont", null);
         		for (int i = 0; i < IDs.length; i++)
        diff --git a/org.adempiere.base/src/org/compiere/process/DocActionEventData.java b/org.adempiere.base/src/org/compiere/process/DocActionEventData.java
        index 5d54f8f4d4..04ec90d2a1 100644
        --- a/org.adempiere.base/src/org/compiere/process/DocActionEventData.java
        +++ b/org.adempiere.base/src/org/compiere/process/DocActionEventData.java
        @@ -1,10 +1,38 @@
        +/***********************************************************************
        + * 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:                                                       *
        + * - hengsin                         								   *
        + **********************************************************************/
         package org.compiere.process;
         
         import java.util.ArrayList;
         import java.util.concurrent.atomic.AtomicInteger;
         
        +import org.adempiere.base.event.IEventTopics;
         import org.compiere.model.PO;
         
        +/**
        + * Event data for {@link IEventTopics#DOCACTION}.
        + */
         public class DocActionEventData {
         
         	public String docStatus;
        @@ -14,9 +42,21 @@ public class DocActionEventData {
         	public int AD_Table_ID;
         	public ArrayList docAction;
         	public ArrayList options;
        +	/** End index of valid options (exclusive) */
         	public AtomicInteger indexObj;
         	public PO po;
         
        +	/**
        +	 * @param docStatus
        +	 * @param processing
        +	 * @param orderType
        +	 * @param isSOTrx
        +	 * @param AD_Table_ID
        +	 * @param docAction
        +	 * @param options
        +	 * @param indexObj
        +	 * @param po
        +	 */
         	public DocActionEventData(String docStatus, Object processing, String orderType, String isSOTrx,
         			int AD_Table_ID, ArrayList docAction, ArrayList options, AtomicInteger indexObj, PO po) {
         		this.docStatus = docStatus;
        diff --git a/org.adempiere.base/src/org/compiere/process/DocumentEngine.java b/org.adempiere.base/src/org/compiere/process/DocumentEngine.java
        index 1b6bffb4ac..9335f57b37 100644
        --- a/org.adempiere.base/src/org/compiere/process/DocumentEngine.java
        +++ b/org.adempiere.base/src/org/compiere/process/DocumentEngine.java
        @@ -959,7 +959,7 @@ public class DocumentEngine implements DocAction
         	 * @param docAction
         	 * @param options
         	 * @param periodOpen - flag indicating if the period is Open - to avoid including Void and ReverseCorrect options in the list
        -	 * @return Number of valid options
        +	 * @return End index of valid options[] (exclusive)
         	 */
         	public static int getValidActions(String docStatus, Object processing,
         			String orderType, String isSOTrx, int AD_Table_ID, String[] docAction, String[] options, boolean periodOpen, PO po)
        diff --git a/org.adempiere.base/src/org/compiere/process/SvrProcess.java b/org.adempiere.base/src/org/compiere/process/SvrProcess.java
        index a5c76d441f..d2eeaa554f 100644
        --- a/org.adempiere.base/src/org/compiere/process/SvrProcess.java
        +++ b/org.adempiere.base/src/org/compiere/process/SvrProcess.java
        @@ -625,6 +625,9 @@ public abstract class SvrProcess implements ProcessCall
         			addLog (0, null, null, msg);
         	}	//	addLog
         
        +	/**
        +	 * Add buffer log to process info
        +	 */
         	private void flushBufferLog () {
         		if (listEntryLog == null)
         			return;
        @@ -685,7 +688,7 @@ public abstract class SvrProcess implements ProcessCall
         		if (log.isLoggable(Level.INFO)) log.info(pInstanceLogUU + " - " + id + " - " + date + " - " + number + " - " + msg);
         	}	//	saveLog
         	
        -	/**************************************************************************
        +	/**
         	 * 	Execute function
         	 * 	@param className class
         	 * 	@param methodName method
        @@ -714,7 +717,7 @@ public abstract class SvrProcess implements ProcessCall
         	}	//	doIt
         
         	
        -	/**************************************************************************
        +	/**
         	 *  Lock Process Instance
         	 */
         	private void lock()
        diff --git a/org.adempiere.base/src/org/compiere/sla/DeliveryAccuracy.java b/org.adempiere.base/src/org/compiere/sla/DeliveryAccuracy.java
        index 18b95b2114..28e3db667e 100644
        --- a/org.adempiere.base/src/org/compiere/sla/DeliveryAccuracy.java
        +++ b/org.adempiere.base/src/org/compiere/sla/DeliveryAccuracy.java
        @@ -40,7 +40,9 @@ import org.compiere.util.Env;
          *	
          *  @author Jorg Janke
          *  @version $Id: DeliveryAccuracy.java,v 1.2 2006/07/30 00:51:06 jjanke Exp $
        + *  @deprecated not fully implement, marked as inactive in application dictionary
          */
        +@Deprecated
         public class DeliveryAccuracy extends SLACriteria
         {
         
        diff --git a/org.adempiere.base/src/org/compiere/sla/SLACriteria.java b/org.adempiere.base/src/org/compiere/sla/SLACriteria.java
        index 85358a9ee7..1ca7b6fcf2 100644
        --- a/org.adempiere.base/src/org/compiere/sla/SLACriteria.java
        +++ b/org.adempiere.base/src/org/compiere/sla/SLACriteria.java
        @@ -27,7 +27,9 @@ import org.compiere.model.MSLAGoal;
          *	
          *  @author Jorg Janke
          *  @version $Id: SLACriteria.java,v 1.3 2006/07/30 00:51:06 jjanke Exp $
        + *  @deprecated not fully implement, marked as inactive in application dictionary
          */
        +@Deprecated
         public abstract class SLACriteria
         {
         	/**
        diff --git a/org.adempiere.base/src/org/compiere/sla/SLAGoalProcess.java b/org.adempiere.base/src/org/compiere/sla/SLAGoalProcess.java
        index 85b23205d7..c9d003c166 100644
        --- a/org.adempiere.base/src/org/compiere/sla/SLAGoalProcess.java
        +++ b/org.adempiere.base/src/org/compiere/sla/SLAGoalProcess.java
        @@ -33,7 +33,9 @@ import org.compiere.util.AdempiereUserError;
          *	
          *  @author Jorg Janke
          *  @version $Id: SLAGoalProcess.java,v 1.2 2006/07/30 00:51:06 jjanke Exp $
        + *  @deprecated not fully implement, marked as inactive in application dictionary
          */
        +@Deprecated
         @org.adempiere.base.annotation.Process
         public class SLAGoalProcess extends SvrProcess
         {
        diff --git a/org.adempiere.base/src/org/compiere/sla/SLAMeasureProcess.java b/org.adempiere.base/src/org/compiere/sla/SLAMeasureProcess.java
        index 240bc89d7f..8866cb8cd3 100644
        --- a/org.adempiere.base/src/org/compiere/sla/SLAMeasureProcess.java
        +++ b/org.adempiere.base/src/org/compiere/sla/SLAMeasureProcess.java
        @@ -34,7 +34,9 @@ import org.compiere.util.AdempiereUserError;
          *	
          *  @author Jorg Janke
          *  @version $Id: SLAMeasureProcess.java,v 1.2 2006/07/30 00:51:06 jjanke Exp $
        + *  @deprecated not fully implement, marked as inactive in application dictionary
          */
        +@Deprecated
         @org.adempiere.base.annotation.Process
         public class SLAMeasureProcess extends SvrProcess
         {
        diff --git a/org.adempiere.base/src/org/compiere/util/Env.java b/org.adempiere.base/src/org/compiere/util/Env.java
        index bbda1bdd03..bbd2a573f8 100644
        --- a/org.adempiere.base/src/org/compiere/util/Env.java
        +++ b/org.adempiere.base/src/org/compiere/util/Env.java
        @@ -52,7 +52,6 @@ import org.compiere.model.GridTab;
         import org.compiere.model.GridWindowVO;
         import org.compiere.model.MClient;
         import org.compiere.model.MColumn;
        -import org.compiere.model.MLookupCache;
         import org.compiere.model.MQuery;
         import org.compiere.model.MRefList;
         import org.compiere.model.MRole;
        @@ -1435,9 +1434,6 @@ public final class Env
         			if (tag.startsWith(WindowNo+"|"))
         				ctx.remove(keys[i]);
         		}
        -		//  Clear Lookup Cache
        -		MLookupCache.cacheReset(WindowNo);
        -	//	MLocator.cacheReset(WindowNo);
         		//
         		IEnvEventListener[] listeners = eventListeners.toArray(new IEnvEventListener[0]);
         		for(IEnvEventListener listener : listeners)
        diff --git a/org.adempiere.base/src/org/compiere/util/Ini.java b/org.adempiere.base/src/org/compiere/util/Ini.java
        index e2c4bafdfc..16c0556f0a 100644
        --- a/org.adempiere.base/src/org/compiere/util/Ini.java
        +++ b/org.adempiere.base/src/org/compiere/util/Ini.java
        @@ -225,6 +225,7 @@ public final class Ini implements Serializable
         	 *	Save INI parameters to disk
         	 *  @param tryUserHome get user home first
         	 */
        +	@SuppressWarnings("deprecation")
         	public static void saveProperties (boolean tryUserHome)
         	{
         		if (Ini.isClient() && DB.isConnected()) {
        diff --git a/org.adempiere.base/src/org/compiere/util/Task.java b/org.adempiere.base/src/org/compiere/util/Task.java
        index 6887505fb4..1d0bd7ecd3 100644
        --- a/org.adempiere.base/src/org/compiere/util/Task.java
        +++ b/org.adempiere.base/src/org/compiere/util/Task.java
        @@ -22,7 +22,7 @@ import java.io.OutputStream;
         import java.util.logging.Level;
         
         /**
        - *  Execute OS Task
        + *  Background thread for execution of OS Task
          *
          *  @author     Jorg Janke
          *  @version    $Id: Task.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $
        @@ -54,18 +54,17 @@ public class Task extends Thread
         	/**	Logger			*/
         	private static CLogger log = CLogger.getCLogger(Task.class);
         	
        -	/** Read Out                            */
        +	/** Read Standard Output                           */
         	private Thread          m_outReader = new Thread()
         	{
         		public void run()
         		{
        -			log.fine("outReader");
        +			if (log.isLoggable(Level.FINE)) log.fine("outReader");
         			try
         			{
         				int c;
         				while ((c = m_outStream.read()) != -1 && !isInterrupted())
         				{
        -			//		System.out.print((char)c);
         					m_out.append((char)c);
         				}
         				m_outStream.close();
        @@ -74,22 +73,21 @@ public class Task extends Thread
         			{
         				log.log(Level.SEVERE, "outReader", ioe);
         			}
        -			log.fine("outReader - done");
        +			if (log.isLoggable(Level.FINE)) log.fine("outReader - done");
         		}   //  run
         	};   //  m_outReader
         
        -	/** Read Out                            */
        +	/** Read Error Output                           */
         	private Thread          m_errReader = new Thread()
         	{
         		public void run()
         		{
        -			log.fine("errReader");
        +			if (log.isLoggable(Level.FINE)) log.fine("errReader");
         			try
         			{
         				int c;
         				while ((c = m_errStream.read()) != -1 && !isInterrupted())
         				{
        -			//		System.err.print((char)c);
         					m_err.append((char)c);
         				}
         				m_errStream.close();
        @@ -98,17 +96,16 @@ public class Task extends Thread
         			{
         				log.log(Level.SEVERE, "errReader", ioe);
         			}
        -			log.fine("errReader - done");
        +			if (log.isLoggable(Level.FINE)) log.fine("errReader - done");
         		}   //  run
         	};   //  m_errReader
         
        -
         	/**
        -	 *  Execute it
        +	 *  Execute command
         	 */
         	public void run()
         	{
        -		log.info(m_cmd);
        +		if (log.isLoggable(Level.INFO)) log.info(m_cmd);
         		try
         		{
         			m_child = Runtime.getRuntime().exec(m_cmd);
        @@ -145,7 +142,7 @@ public class Task extends Thread
         					if (log.isLoggable(Level.FINE)) log.fine("run - ExitValue=" + m_child.exitValue());
         			}
         			catch (Exception e) {}
        -			log.config("done");
        +			if (log.isLoggable(Level.CONFIG)) log.config("done");
         		}
         		catch (IOException ioe)
         		{
        @@ -161,7 +158,7 @@ public class Task extends Thread
         	{
         		if (isInterrupted())
         		{
        -			log.config("interrupted");
        +			if (log.isLoggable(Level.CONFIG)) log.config("interrupted");
         			//  interrupt child processes
         			if (m_child != null)
         				m_child.destroy();
        @@ -189,8 +186,8 @@ public class Task extends Thread
         	}   //  checkInterrupted
         
         	/**
        -	 *  Get Out Info
        -	 *  @return StringBuffer
        +	 *  Get Standard Output
        +	 *  @return Standard Output Buffer
         	 */
         	public StringBuffer getOut()
         	{
        @@ -198,8 +195,8 @@ public class Task extends Thread
         	}   //  getOut
         
         	/**
        -	 *  Get Err Info
        -	 *  @return StringBuffer
        +	 *  Get Error Output
        +	 *  @return Error Output Buffer
         	 */
         	public StringBuffer getErr()
         	{
        @@ -207,8 +204,8 @@ public class Task extends Thread
         	}   //  getErr
         
         	/**
        -	 *  Get The process input stream - i.e. we output to it
        -	 *  @return OutputStream
        +	 *  Get the process's input stream - i.e. we output to it
        +	 *  @return OutputStream (connect to input stream of OS process)
         	 */
         	public OutputStream getInStream()
         	{
        diff --git a/org.adempiere.base/src/org/idempiere/fa/util/POCacheLocal.java b/org.adempiere.base/src/org/idempiere/fa/util/POCacheLocal.java
        index 580bf146b4..43211adb85 100644
        --- a/org.adempiere.base/src/org/idempiere/fa/util/POCacheLocal.java
        +++ b/org.adempiere.base/src/org/idempiere/fa/util/POCacheLocal.java
        @@ -1,6 +1,24 @@
        -/**
        - * 
        - */
        +/***********************************************************************
        + * 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.                                                 *
        + **********************************************************************/
         package org.idempiere.fa.util;
         
         import java.util.Properties;
        @@ -10,7 +28,10 @@ import org.compiere.model.MTable;
         import org.compiere.model.PO;
         
         /**
        + * Load and cache instance of foreign key referenced PO.
        + * For e.g, parent is MOrderLine and referenced PO is MProduct. * @author Teo Sarca, SC ARHIPAC SERVICE SRL + * @param Foreing key reference type */ public final class POCacheLocal { @@ -19,21 +40,45 @@ public final class POCacheLocal private final String po_tableName; private T po = null; + /** + * Create new instance of POCacheLocal + * @param + * @param parent + * @param cl + * @return POCacheLocal + */ public static POCacheLocal newInstance(PO parent, Class cl) { return new POCacheLocal(parent, cl); } + /** + * Create new instance of POCacheLocal + * @param + * @param parent + * @param cl + * @param idColumnName + * @return POCacheLocal + */ public static POCacheLocal newInstance(PO parent, Class cl, String idColumnName) { return new POCacheLocal(parent, cl, idColumnName); } + /** + * @param parent + * @param cl + */ private POCacheLocal(PO parent, Class cl) { this(parent, cl, null); } + /** + * @param parent Parent PO + * @param cl foreign key reference type + * @param idColumnName optional foreign key reference column name in parent + */ private POCacheLocal(PO parent, Class cl, String idColumnName) { this.parent = parent; @@ -55,6 +100,11 @@ public final class POCacheLocal } } + /** + * Get instance of referenced PO from cache or DB + * @param requery true to always reload from DB + * @return instance of referenced PO + */ public T get(boolean requery) { int id = get_id(); @@ -70,6 +120,10 @@ public final class POCacheLocal return this.po; } + /** + * Set cached referenced PO + * @param po + */ public void set(T po) { if (isValidPO(po)) @@ -78,6 +132,10 @@ public final class POCacheLocal } } + /** + * @param po + * @return true if po is a valid instance of referenced PO + */ private boolean isValidPO(T po) { int id = get_id(); @@ -88,12 +146,22 @@ public final class POCacheLocal ; } + /** + * Load referenced PO from DB + * @param ctx + * @param id + * @param trxName + * @return loaded referenced PO instance + */ @SuppressWarnings("unchecked") protected T load(Properties ctx, int id, String trxName) { return (T)MTable.get(ctx, this.po_tableName).getPO(id, trxName); } + /** + * @return foreign key reference id value from parent PO + */ private int get_id() { return parent.get_ValueAsInt(idColumnName);