Skip to content

Commit

Permalink
Merge pull request #15 from gurveenbagga/fix-view-order-payment-prefe…
Browse files Browse the repository at this point in the history
…rence

Improved the view of Order Payment Preference
  • Loading branch information
dixitdeepak authored Feb 20, 2023
2 parents 419d5db + c5b45d6 commit 47e844e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions entity/OmsOrderViewEntities.xml
Original file line number Diff line number Diff line change
Expand Up @@ -391,18 +391,30 @@ under the License.

<!-- NOTE: Not added group attribute in the view entity definition as fix done in Moqui,
TODO update all view entities to remove the use of group attribute as not needed now -->
<!-- The ReturnItemResponse entity is included in the view for handling below scenario,
1. The same order has a return and an appeasement.
2. The view should include ReturnItemResponse entity with join-optional true as for Sales,
this entity does not hold records, but it contains records for Returns and Appeasements.
2. Now for Sales Items, we can fetch payment details using order Id and statusId = 'PAYMENT_SETTLED'.
3. For Return Items, we can fetch payment details using return Id and statusId = 'PAYMENT_REFUNDED'.
4. For Appeasements, we can fetch payment details using return Id and statusId = 'PAYMENT_REFUNDED'.
5. This way we can correctly fetch details for the return and appeasement for the same order. -->
<view-entity entity-name="OrderPaymentPreferenceAndType" package="co.hotwax.financial">
<member-entity entity-alias="OPP" entity-name="org.apache.ofbiz.order.order.OrderPaymentPreference"/>
<member-entity entity-alias="PMT" entity-name="org.apache.ofbiz.accounting.payment.PaymentMethodType" join-from-alias="OPP" join-optional="true">
<key-map field-name="paymentMethodTypeId"/>
</member-entity>
<member-entity entity-alias="RIR" entity-name="org.apache.ofbiz.order.return.ReturnItemResponse" join-from-alias="OPP" join-optional="true">
<key-map field-name="orderPaymentPreferenceId"/>
</member-entity>
<alias entity-alias="OPP" name="orderId"/>
<alias entity-alias="OPP" name="statusId"/>
<alias entity-alias="OPP" field="maxAmount" name="amount" />
<alias entity-alias="OPP" name="createdDate" />
<alias entity-alias="PMT" name="paymentMethodTypeId"/>
<alias entity-alias="PMT" name="paymentMethodCode"/>
<alias entity-alias="PMT" field="description" name="paymentMethodDescription"/>
<alias entity-alias="RIR" name="returnId"/>
</view-entity>

<!-- To get the Party and Person details -->
Expand Down

0 comments on commit 47e844e

Please sign in to comment.