Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions applications/accounting/minilang/ledger/GeneralLedgerServices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1635,6 +1635,19 @@ under the License.
<field-map field-name="inventoryItemId" from-field="parameters.inventoryItemId"/>
</entity-one>
<get-related-one value-field="workEffortInventoryAssign" relation-name="InventoryItem" to-value-field="inventoryItem"/>
<set field="partyAccountingPreferencesCallMap.organizationPartyId" from-field="inventoryItem.ownerPartyId"/>
<call-service service-name="getPartyAccountingPreferences" in-map-name="partyAccountingPreferencesCallMap">
<result-to-field result-name="partyAccountingPreference" field="partyAcctgPreference"/>
</call-service>
<if>
<condition>
<if-compare field="partyAcctgPreference.enableAccounting" value="N" operator="equals"/>
</condition>
<then>
<log level="warning" message="The internal organization with id [${partyAccountingPreferencesCallMap.organizationPartyId}] has no PartyAcctgPreference setting; the following accounting transaction will be ignored."/>
<return/>
</then>
</if>
<!-- TODO: handle serialized inventory -->
<calculate field="origAmount" decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}">
<calcop operator="multiply">
Expand All @@ -1660,6 +1673,19 @@ under the License.
<set field="creditEntry.origAmount" from-field="origAmount"/>
<set field="creditEntry.origCurrencyUomId" from-field="inventoryItem.currencyUomId"/>
<set field="acctgTransEntries[]" from-field="creditEntry" type="Object"/>

<!-- An inventory item detail record is created to keep track of the units (value) that we are going to add to the inventory account -->
<set field="quantityToDeduct" from-field="parameters.quantity" type="BigDecimal"/>
<if-empty field="quantityToDeduct">
<log level="warning" message="Accounting issuance for WorkEffort [${parameters.workEffortId}] and InventoryItem [${parameters.inventoryItemId}] is missing the incremental 'quantity' parameter. Falling back to assignment total: ${workEffortInventoryAssign.quantity}"/>
<set field="quantityToDeduct" from-field="workEffortInventoryAssign.quantity" type="BigDecimal"/>
</if-empty>

<set field="createInventoryDetailMap.inventoryItemId" from-field="parameters.inventoryItemId"/>
<set field="createInventoryDetailMap.workEffortId" from-field="parameters.workEffortId"/>
<set field="createInventoryDetailMap.accountingQuantityDiff" value="${(-1) * quantityToDeduct}" type="BigDecimal"/>
<call-service service-name="createInventoryItemDetail" in-map-name="createInventoryDetailMap"/>

<!-- Set header fields (AcctgTrans) -->
<set field="createAcctgTransAndEntriesInMap.glFiscalTypeId" value="ACTUAL"/>
<set field="createAcctgTransAndEntriesInMap.acctgTransTypeId" value="INVENTORY"/>
Expand Down
1 change: 1 addition & 0 deletions applications/accounting/servicedef/services_ledger.xml
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ under the License.
<description>Create an accounting transaction for inventory that is issued to a work effort (Type: INVENTORY D: RAWMAT_INVENTORY, C: WIP_INVENTORY)</description>
<attribute name="workEffortId" type="String" mode="IN" optional="false"/>
<attribute name="inventoryItemId" type="String" mode="IN" optional="false"/>
<attribute name="quantity" type="BigDecimal" mode="IN" optional="true"/>
<attribute name="acctgTransId" type="String" mode="OUT" optional="true"/>
</service>
<!-- Service for the automatic creation of AcctgTransForPhysicalInventoryVariance, triggered by SECAs -->
Expand Down
2 changes: 2 additions & 0 deletions applications/datamodel/data/seed/ManufacturingSeedData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,7 @@ under the License.
<!-- Rate Type for Labor Cost Data -->
<RateType rateTypeId="FLC" description="Fully Loaded Cost (price for WorkEffort)"/>

<!-- Inventory Detail Reason for Trinity Synchronization -->
<Enumeration description="Trinity of Truth Synchronization" enumCode="VAR_INTEGRITY_SYNC" enumId="VAR_INTEGRITY_SYNC" sequenceId="99" enumTypeId="IID_REASON"/>

</entity-engine-xml>
3 changes: 3 additions & 0 deletions applications/datamodel/entitydef/product-entitymodel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,9 @@ under the License.
<field name="defaultWeightUomId" type="id"></field>
<field name="geoPointId" type="id"></field>
<field name="facilityLevel" type="numeric"><description>This field will define the level of facility.</description></field>
<field name="autoReservePrun" type="indicator"><description>Flag to control if automated inventory reservation should be performed when a production run reaches the printed/approved status.</description></field>
<field name="allowInventoryReallocation" type="indicator"><description>Flag to control if high-priority Production Runs can reallocate stock from others.</description></field>
<field name="reconcilePrunBackorders" type="indicator"><description>Flag to enable automated settlement of production run backorders. If enabled (Y), the system will automatically satisfy backorders both in real-time (upon inventory receipt via SECA) and during the nightly scheduled job.</description></field>
<prim-key field="facilityId"/>
<relation type="one" fk-name="FACILITY_FCTYP" rel-entity-name="FacilityType">
<key-map field-name="facilityTypeId"/>
Expand Down
27 changes: 27 additions & 0 deletions applications/datamodel/entitydef/workeffort-entitymodel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,33 @@ under the License.
<key-map field-name="workEffortId"/>
</relation>
</entity>
<entity entity-name="WorkEffortInvRes"
package-name="org.apache.ofbiz.workeffort.workeffort"
title="Inventory Reservation for WorkEffort">
<field name="workEffortId" type="id"/>
<field name="inventoryItemId" type="id"/>
<field name="productId" type="id" col-name="WEGS_PRODUCT_ID"/>
<field name="reserveOrderEnumId" type="id"/>
<field name="quantity" type="fixed-point"/>
<field name="quantityNotAvailable" type="fixed-point"/>
<field name="reservedDatetime" type="date-time"/>
<field name="createdDatetime" type="date-time"/>
<field name="promisedDatetime" type="date-time"/>
<field name="currentPromisedDate" type="date-time"/>
<field name="sequenceId" type="id"/>
<prim-key field="workEffortId"/>
<prim-key field="inventoryItemId"/>
<prim-key field="productId"/>
<relation type="one" fk-name="WEIR_WE" rel-entity-name="WorkEffort">
<key-map field-name="workEffortId"/>
</relation>
<relation type="one" fk-name="WEIR_INV" rel-entity-name="InventoryItem">
<key-map field-name="inventoryItemId"/>
</relation>
<relation type="one" fk-name="WEIR_PROD" rel-entity-name="Product">
<key-map field-name="productId"/>
</relation>
</entity>
<entity entity-name="WorkEffortInventoryAssign"
package-name="org.apache.ofbiz.workeffort.workeffort"
title="Work Effort Inventory Assignment">
Expand Down
99 changes: 99 additions & 0 deletions applications/manufacturing/config/ManufacturingUiLabels.xml
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,19 @@
<value xml:lang="zh">实际开始日期/时间</value>
<value xml:lang="zh-TW">實際開始日期/時間</value>
</property>
<property key="ManufacturingEditWorkEffortInvRes">
<value xml:lang="en">Edit Inventory Reservations</value>
</property>
<property key="ManufacturingAddWorkEffortInvRes">
<value xml:lang="en">Add Inventory Reservation</value>
</property>
<property key="ManufacturingReservedQuantity">
<value xml:lang="en">Reserved</value>
</property>
<property key="ManufacturingManageReservations">
<value xml:lang="en">Manage Reservations</value>
</property>

<property key="ManufacturingAddExistingRoutingTask">
<value xml:lang="de">Einen bestehenden Arbeitsgang hinzufügen</value>
<value xml:lang="en">Add a existing RoutingTask</value>
Expand Down Expand Up @@ -2466,6 +2479,35 @@
<value xml:lang="zh">交付数量</value>
<value xml:lang="zh-TW">交付數量</value>
</property>
<property key="ManufacturingRemainingQuantity">
<value xml:lang="en">Remaining Quantity</value>
<value xml:lang="it">Quantità rimanente</value>
</property>
<property key="ManufacturingRequiredQuantity">
<value xml:lang="en">Required Quantity</value>
<value xml:lang="it">Quantità richiesta</value>
</property>
<property key="ManufacturingReservationSummary">
<value xml:lang="en">Reservation Summary</value>
</property>
<property key="ManufacturingTotalReserved">
<value xml:lang="en">Total Reserved</value>
</property>
<property key="ManufacturingShortfall">
<value xml:lang="en">Confirmed Shortage (Tried &amp; Failed)</value>
</property>
<property key="ManufacturingNetReserved">
<value xml:lang="en">Net Reserved</value>
</property>
<property key="ManufacturingShortageHelpText">
<value xml:lang="en">Confirmed Shortage indicates inventory that could not be reserved during the last attempt because the warehouse was empty.</value>
</property>
<property key="ManufacturingUnaccountedQuantity">
<value xml:lang="en">Pending Process (Untouched)</value>
</property>
<property key="ManufacturingUnaccountedHelpText">
<value xml:lang="en">Pending Process indicates requirements that have not yet been attempted for reservation or issuance.</value>
</property>
<property key="ManufacturingJobShop">
<value xml:lang="de">Produktionsaufträge</value>
<value xml:lang="en">JobShop</value>
Expand Down Expand Up @@ -3118,6 +3160,60 @@
<value xml:lang="en">Mrp run scheduled successfully</value>
<value xml:lang="fr">Exécution de Mrp programmée avec succès</value>
</property>
<property key="ManufacturingProductionRunTaskIssuedSuccessfully">
<value xml:lang="en">Issued Inventory for Production Run Task [${workEffortId}]</value>
</property>
<property key="ManufacturingAutoReservePrun">
<value xml:lang="en">Auto-Reserve Production Run Inventory</value>
</property>
<property key="ManufacturingAllowInventoryReallocation">
<value xml:lang="en">Allow Inventory Reallocation</value>
</property>
<property key="ManufacturingReconcilePrunBackorders">
<value xml:lang="en">Auto-Reconcile Production Backorders</value>
</property>
<property key="ManufacturingRelease">
<value xml:lang="en">Release</value>
</property>
<property key="ManufacturingReserve">
<value xml:lang="en">Reserve</value>
</property>
<property key="ManufacturingForceIssue">
<value xml:lang="en">Force Issue</value>
</property>
<property key="ManufacturingForceIssueImpact">
<value xml:lang="en">Force Issue Impact Warning</value>
</property>
<property key="ManufacturingForceIssueImpactWarning">
<value xml:lang="en">The following inventory reservations will be reallocated if you proceed with Force Issuance:</value>
</property>
<property key="ManufacturingImpactType">
<value xml:lang="en">Impact Type</value>
</property>
<property key="ManufacturingImpactId">
<value xml:lang="en">Ref ID</value>
</property>
<property key="ManufacturingImpactQuantity">
<value xml:lang="en">Impacted Qty</value>
</property>
<property key="ManufacturingConfirmForceIssue">
<value xml:lang="en">Confirm Force Issue</value>
</property>
<property key="ManufacturingNoImpactDetected">
<value xml:lang="en">No significant impact on other reservations detected.</value>
</property>
<property key="ManufacturingIssuancePreview">
<value xml:lang="en">Preview of Issuance Plan</value>
</property>
<property key="POOL_STOCK">
<value xml:lang="en">Free Stock</value>
</property>
<property key="TASK_RESERVATION">
<value xml:lang="en">Existing Reservation</value>
</property>
<property key="REALLOCATED_STOCK">
<value xml:lang="en">Re-allocated Stock</value>
</property>
<property key="ManufacturingNewCalendar">
<value xml:lang="de">Neuer Kalender</value>
<value xml:lang="en">New calendar</value>
Expand Down Expand Up @@ -6040,4 +6136,7 @@
<value xml:lang="zh">链接到生产运行</value>
<value xml:lang="zh-TW">連結生產運行</value>
</property>
<property key="ManufacturingReservationStrategy">
<value xml:lang="en">Reservation Strategy</value>
</property>
</resource>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ under the License.
<RecurrenceRule recurrenceRuleId="300" untilDateTime="" frequency="DAILY" intervalNumber="1" countNumber="-1"/>
<RecurrenceInfo recurrenceInfoId="300" startDateTime="2000-01-01 22:00:00.000" recurrenceRuleId="300" recurrenceCount="0"/>
<RecurrenceInfo recurrenceInfoId="301" startDateTime="2000-01-01 23:00:00.000" recurrenceRuleId="300" recurrenceCount="0"/>
<RecurrenceInfo recurrenceInfoId="302" startDateTime="2000-01-01 01:00:00.000" recurrenceRuleId="300" recurrenceCount="0"/>
<!--
The initLowLevelCode service is used to properly initialize the products' low level codes (Product.billOfMaterialsLevel field).
This information is needed by the MRP algorithm (executeMrp service) and by the standard cost algorithm (calculateAllProductsCosts service).
Expand Down Expand Up @@ -62,4 +63,9 @@ under the License.
</RuntimeData>

<JobSandbox jobId="8401" jobName="Calculate product costs" runTime="2000-01-01 00:00:00.000" serviceName="calculateAllProductsCosts" runtimeDataId="8401" poolId="pool" runAsUser="system" recurrenceInfoId="301"/>
<!--
The reconcileInventoryForProductionJobs service is a nightly cleanup job that audits logical debt (phantom backorders)
and auto-satisfies legitimate backorders based on facility policies.
-->
<JobSandbox jobId="8402" jobName="Nightly Inventory Reconciliation" runTime="2000-01-01 00:00:00.000" serviceName="reconcileInventoryForProductionJobs" poolId="pool" runAsUser="system" recurrenceInfoId="302"/>
</entity-engine-xml>
2 changes: 2 additions & 0 deletions applications/manufacturing/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ under the License.

<!-- entity resources: model(s), eca(s) and group definitions -->
<entity-resource type="data" reader-name="seed" loader="main" location="data/ManufacturingSecurityPermissionSeedData.xml"/>

<!--<entity-resource type="data" reader-name="seed-initial" loader="main" location="data/ManufacturingScheduledServices.xml"/>-->

<!-- service resources: model(s) [definitions], eca(s) and group definitions -->
Expand All @@ -42,6 +43,7 @@ under the License.
<service-resource type="eca" loader="main" location="servicedef/secas.xml"/>

<test-suite loader="main" location="testdef/productionruntests.xml"/>
<test-suite loader="main" location="testdef/InventoryIssuanceTests.xml"/>

<!-- web applications; will be mounted when using the embedded container -->
<webapp name="manufacturing"
Expand Down
11 changes: 11 additions & 0 deletions applications/manufacturing/servicedef/secas.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,15 @@ under the License.
<condition field-name="productAssocTypeId" operator="equals" value="MANUF_COMPONENT"/>
<action service="updateLowLevelCode" mode="sync"/>
</eca>
<!-- Trigger auto-reservation when a production run is confirmed (printed) -->
<eca service="changeProductionRunStatus" event="return">
<condition field-name="newStatusId" operator="equals" value="PRUN_DOC_PRINTED"/>
<condition-service service-name="checkProductionRunFacilityAutoReserve"/>
<action service="autoReserveWorkEffortInventory" mode="sync"/>
</eca>
<!-- Real-time Backorder Reconciliation for Production Runs -->
<eca service="balanceInventoryItems" event="commit">
<condition-service service-name="checkProductionRunFacilityRecon"/>
<action service="reassignWorkEffortInventoryReservations" mode="sync"/>
</eca>
</service-eca>
Loading
Loading