Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enter product on invoice item does not copy price #44 Popcommerce #159

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
1d06a4c
generate logo location for use in order PDF
hansbak Mar 11, 2020
14f2be4
Merge branch 'master' of https://github.com/moqui/mantle-usl.git
hansbak Mar 17, 2020
841d516
get vendor/customer contactInfo for PDF
hansbak Mar 23, 2020
698bfe8
Fixed: The UserAccount should be created if emailAddress is available
Mar 4, 2020
ba04aa3
In add#OrderProductQuantity service log when using calculated vs manu…
jonesde Mar 17, 2020
b95cff2
In cancel#AssetIssuance handle reservations that still exist because …
jonesde Mar 21, 2020
3c9dec5
Add tests for inventory reservation and issuance scenarios where ship…
jonesde Mar 21, 2020
67d51b4
Add tests to make sure QOH - ATP = Reservations and fix that issue in…
jonesde Mar 21, 2020
c558bd9
On order approve populate new OrderHeader.approvedDate field
jonesde Mar 22, 2020
fa70e20
In reserve#AssetForOrderItem reuse placeholder/dummy Asset records fo…
jonesde Mar 22, 2020
a34bdcb
In create#Order set new default disable promos, ship calc, and tax ca…
jonesde Mar 23, 2020
3a8235c
In issue#AssetReservation set AssetIssuance.invoiceId and item seq id…
jonesde Mar 31, 2020
96dc51b
Improve apply#InvoiceItemToShipment to fill in invoiceId and invoiceI…
jonesde Mar 31, 2020
856e3d6
In get#ProjectParties service also include Project roles so all proje…
jonesde Apr 1, 2020
25d0ccf
In Party/ContactServices add create#WebAddress service and add webAdd…
jonesde Apr 3, 2020
22f1e17
Add hasAllTrackingCodes out-parameter to get#ShipmentDisplayInfo serv…
jonesde Apr 4, 2020
43e0149
mantle.party.ContactServices.create#PostalAddress
hansbak Apr 6, 2020
3473b92
In search#Party service use a nested query to filter partyClassificat…
jonesde Apr 7, 2020
d62263d
Fix error messages in generate#NachaFile service
jonesde Apr 8, 2020
6b940fc
In store#PaymentMethodInfo automatically update open Payments with ne…
jonesde Apr 11, 2020
f5c4c14
In store#PaymentMethodInfo show message when automatically updating o…
jonesde Apr 11, 2020
9c0471d
In search#Party service use new StringUtilities.elasticQueryAutoWildc…
jonesde Apr 14, 2020
ab9f320
Add create#WorkerInvoiceItems service for direct billing from worker …
jonesde Apr 14, 2020
28c3b05
In AUTHORS file update my year range, add bottom line to help preserv…
jonesde Apr 24, 2020
a483c7a
In get#PartyEmployersAndPositionClasses service also return an employ…
jonesde Apr 27, 2020
2f0cc20
On RequestAndPartyDetail view-entity add Party member entity (for psu…
jonesde Apr 28, 2020
1a7e1d1
Add CommunicationEventContent Services
hellozhangwei Apr 28, 2020
cc6e832
Fix issue in add#OrderProductQuantity where orderHeader and orderPart…
jonesde Apr 30, 2020
3532d61
In CarrierServices and ShipmentInfoServices for order and shipment bu…
jonesde May 1, 2020
ee79cdc
Add UserPreferenceKey data for options to markup label price for ship…
jonesde May 1, 2020
d27590e
Use smaller bank size of 10 for IDs for tasks within a project
jonesde May 5, 2020
8d2ab26
In store#TimeEntry service add constraint that if fromDate and thruDa…
jonesde May 7, 2020
26ccced
In check#OrderPreApprove service before looking for grey- and black-l…
jonesde May 8, 2020
ae45432
Fixing typo that I saw after merging PR#152
danieltaylor-nz May 9, 2020
35917fb
Fixed missing customerPartyId and ownerPartyId in OrderItemSalesSumma…
danieltaylor-nz May 8, 2020
aebdf54
add retrieval of vendor logo at packsheet
hansbak May 29, 2020
c589caa
change invoice print service to add panels
hansbak Jun 6, 2020
378b42c
upstream merge dec 1
hansbak Dec 1, 2020
a4fc61c
Optionally use product calc price with invoiceItem input
hansbak Jan 4, 2021
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
57 changes: 57 additions & 0 deletions service/mantle/account/InvoiceServices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,57 @@ along with this software (see the LICENSE.md file). If not, see
<econdition field-name="isAdjustment" value="N" or-null="true"/>
<order-by field-name="invoiceItemSeqId"/>
</entity-find>
<entity-find entity-name="accugeo.order.InvoiceItemAndOrderPanel" list="orderPanels">
<econdition field-name="invoiceId"/>
</entity-find>
<if condition="orderPanels">
<log message="=====1=====orderpanels: ${orderPanels.size()}"/>
<log message="=====1=====invoiceitemList: ${invoiceItemList.size()}"/>
<log message="=====1=====invoiceitemList: ${invoiceItemList}"/>
<set field="index" value="0" type="Integer"/>
<set field="moveItem" value="false"/>
<iterate list="invoiceItemList" entry="invoiceItem">
<log message="=================orderitem seqId: ${orderPanels[0].invoiceItemSeqId}"/>
<log message="=================invoiceitem seqId: ${invoiceItem.invoiceItemSeqId}"/>
<if condition="invoiceItem.invoiceItemSeqId == orderPanels[0].invoiceItemSeqId">
<set field="moveItem" value="true"/>
<set field="description" from="invoiceItem.description"/>
<set field="quantityUomId" from="invoiceItem.quantityUomId"/>
<set field="amount" from="invoiceItem.amount"/>
<set field="productId" from="invoiceItem.productId"/>
<set field="itemTypeEnumId" from="invoiceItem.itemTypeEnumId"/>
<set field="lastUpdatedStamp" from="invoiceItem.lastUpdatedStamp"/>
</if>
<if condition="moveItem == 'true' &amp;&amp; (index+1) &lt; invoiceItemList.size()">
<log message="==========move item ${invoiceItemList[index].productId}"/>
<set field="invoiceItemList[index]" from="invoiceItemList[index+1]"/>
<set field="invoiceItemList[index].invoiceItemSeqId" from="Integer.toString(index)"/>
</if>
<set field="index" from="index + 1"/>
</iterate>
<script>invoiceItemList.remove(--index);</script>
<log message="=====2=====invoiceitemList: ${invoiceItemList.size()}"/>
<iterate list="orderPanels" entry="orderPanel">
<if condition="orderPanel.width &amp;&amp; orderPanel.length">
<entity-make-value entity-name="mantle.account.invoice.InvoiceItem"
value-field="invoiceItem" map="[
'invoiceId': invoiceId,
'invoiceItemSeqId': index.toString(),
'productId': productId,
'description': description + ' ' + orderPanel.width + '² X ' + orderPanel.length + '² feet',
'quantity': orderPanel.width * orderPanel.length,
'quantityUomId': quantityUomId,
'amount': amount,
'itemTypeEnumId': itemTypeEnumId,
'lastUpdatedStamp': lastUpdatedStamp,
]"/>
<script>invoiceItemList.add(invoiceItem)</script>
<set field="index" from="index + 1"/>
</if>
</iterate>
<log message="=====3=====invoiceitemList: ${invoiceItemList.size()}"/>
<log message="=====3=====invoiceitemList: ${invoiceItemList}"/>
</if>
<set field="topItemList" from="invoiceItemList.findAll({ it.parentItemSeqId == null })"/>

<entity-find entity-name="mantle.account.invoice.InvoiceItem" list="adjustmentItemList">
Expand Down Expand Up @@ -475,6 +526,9 @@ along with this software (see the LICENSE.md file). If not, see
in-map="[partyId:invoice.fromPartyId, partySettingTypeId:('Org' + templateSettingSuffix)]"/>
<set field="templateLocation" from="ptySettingOut?.settingValue"/>
</if>
<entity-find entity-name="accugeo.order.InvoiceItemAndOrderPanel" list="orderPanels">
<econdition field-name="invoiceId"/>
</entity-find>
</actions>
</service>
<service verb="get" noun="ReceivableStatementInfo">
Expand Down Expand Up @@ -781,11 +835,14 @@ along with this software (see the LICENSE.md file). If not, see
<service verb="create" noun="InvoiceItem">
<in-parameters>
<parameter name="invoiceId" required="true"/>
<parameter name="calcAmount"/>
<auto-parameters entity-name="mantle.account.invoice.InvoiceItem" include="nonpk">
<exclude field-name="invoiceItemSeqId"/><exclude field-name="isAdjustment"/></auto-parameters>
</in-parameters>
<out-parameters><parameter name="invoiceItemSeqId"/></out-parameters>
<actions>
<if condition="!amount">
<set field="amount" from="calcAmount"/></if>
<entity-find-one entity-name="mantle.account.invoice.Invoice" value-field="invoice"/>
<if condition="!(invoice.statusId in ['InvoiceInProcess', 'InvoiceIncoming', 'InvoiceReceived'])">
<return error="true" message="Invoice ${invoiceId} is not in a status that allows change (In Process for receivables, Incoming or Received for payables)"/></if>
Expand Down
26 changes: 19 additions & 7 deletions service/mantle/order/OrderInfoServices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ along with this software (see the LICENSE.md file). If not, see
<auto-parameters entity-name="mantle.party.contact.TelecomNumber"/></parameter>
</parameter>
<parameter name="customerDetail" type="Map"><auto-parameters entity-name="mantle.party.PartyDetail"/></parameter>
<parameter name="customerContactInfo"/>
<parameter name="customerEmail"/>
<parameter name="vendorDetail" type="Map"><auto-parameters entity-name="mantle.party.PartyDetail"/></parameter>
<parameter name="vendorContactInfo"/>
<parameter name="isCustomerInternalOrg" type="Boolean"/>
<parameter name="isVendorInternalOrg" type="Boolean"/>
<parameter name="orderPartPartyList" type="List"><parameter name="orderPartParty">
Expand All @@ -147,6 +149,7 @@ along with this software (see the LICENSE.md file). If not, see
<auto-parameters entity-name="mantle.shipment.ShipmentItemSource"/></parameter></parameter>
<parameter name="partShipmentIdSet" type="Set"><parameter name="partShipmentId"/></parameter>
</parameter></parameter>
<parameter name="logoImageLocation"/>

<parameter name="templateLocation"><description>Looked up from ProductStoreSetting and if no setting found for store or
no store is associated with the Order then from PartySetting (for vendorPartyId).</description></parameter>
Expand Down Expand Up @@ -368,7 +371,18 @@ along with this software (see the LICENSE.md file). If not, see
}

EntityValue customerDetail = ec.entity.find("mantle.party.PartyDetail").condition("partyId", orderPart.customerPartyId).one()
Map customerContactInfo = null;
if (customerDetail) {
customerContactInfo = ec.service.sync().name("mantle.party.ContactServices.get#PartyContactInfo")
.parameter("partyId", orderPart.customerPartyId).parameter("postalContactMechPurposeId","PostalOrder")
.parameter("emailContactMechPurposeId", 'EmailOrder').parameter("defaultToPrimaryPurpose", true).call()
String customerEmail = customerContactInfo?.emailAddress}
EntityValue vendorDetail = ec.entity.find("mantle.party.PartyDetail").condition("partyId", orderPart.vendorPartyId).one()
Map vendorContactInfo = null;
if (vendorDetail) {
vendorContactInfo = ec.service.sync().name("mantle.party.ContactServices.get#PartyContactInfo")
.parameter("partyId", orderPart.vendorPartyId).parameter("postalContactMechPurposeId","PostalOrder")
.parameter("defaultToPrimaryPurpose", true).call()}
boolean isCustomerInternalOrg = ec.entity.find("mantle.party.PartyRole")
.condition("partyId", orderPart.customerPartyId).condition("roleTypeId", "OrgInternal").one() as boolean
boolean isVendorInternalOrg = ec.entity.find("mantle.party.PartyRole")
Expand All @@ -381,13 +395,6 @@ along with this software (see the LICENSE.md file). If not, see
String shipToPartyId = customerShipToDetail?.partyId ?: orderPart.customerPartyId
String billToPartyId = customerBillToDetail?.partyId ?: orderPart.customerPartyId

String customerEmail = null
if (orderPart.customerPartyId) {
customerEmail = ec.service.sync().name("mantle.party.ContactServices.get#PartyContactInfo")
.parameter("partyId", orderPart.customerPartyId).parameter("emailContactMechPurposeId", "EmailOrder")
.parameter("defaultToPrimaryPurpose", true).call()?.emailAddress
}

boolean hasShippableItems = orderItemList.find({ it.product?.productTypeEnumId in ['PtAsset', 'PtDigitalAsset', 'PtAssetUse'] }) != null
boolean singleLot = false
boolean newerInventory = false
Expand Down Expand Up @@ -487,6 +494,7 @@ along with this software (see the LICENSE.md file). If not, see
postalAddress:postalAddress, postalAddressStateGeo:postalAddressStateGeo,
telecomNumber:telecomNumber, facility:facility,
facilityContactInfo:facilityContactInfo, customerDetail:customerDetail, customerEmail:customerEmail,
vendorContactInfo: vendorContactInfo, customerContactInfo: customerContactInfo,
vendorDetail:vendorDetail, isCustomerInternalOrg:isCustomerInternalOrg, isVendorInternalOrg:isVendorInternalOrg,
orderPartPartyList:orderPartPartyList, customerShipToDetail:customerShipToDetail,
customerBillToDetail:customerBillToDetail, partShipmentItemSourceList:partShipmentItemSourceList,
Expand Down Expand Up @@ -516,6 +524,10 @@ along with this software (see the LICENSE.md file). If not, see
in-map="[partyId:firstPart.vendorPartyId, partySettingTypeId:('Org' + templateSettingSuffix)]"/>
<set field="templateLocation" from="ptySettingOut?.settingValue"/>
</if>
<!-- get logo of vendor for PDF -->
<service-call name="mantle.party.PartyServices.get#PartyContentLocation" out-map="logoImageOut"
in-map="[partyId:firstPart.vendorPartyId, partyContentTypeEnumIdList:['PcntLogoImage', 'PcntPrimaryImage']]"/>
<set field="logoImageLocation" from="logoImageOut.contentLocation"/>
</actions>
</service>
<service verb="get" noun="OrderItemsTotalCount">
Expand Down
2 changes: 1 addition & 1 deletion service/mantle/party/ContactServices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ along with this software (see the LICENSE.md file). If not, see
<auto-parameters entity-name="mantle.party.contact.PostalAddress" include="nonpk"/>
<auto-parameters entity-name="moqui.basic.GeoPoint" include="nonpk"/>
<auto-parameters entity-name="mantle.party.contact.PartyContactMech" include="nonpk"/>

<parameter name="address1" required="true"/>
<parameter name="partyId"/>
<parameter name="facilityId"/>
<parameter name="contactMechPurposeId"/>
Expand Down
5 changes: 5 additions & 0 deletions service/mantle/shipment/ShipmentInfoServices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@ along with this software (see the LICENSE.md file). If not, see
in-map="[partyId:toPartyId, postalContactMechPurposeId:'PostalShippingDest',
telecomContactMechPurposeId:'PhoneShippingDest', emailContactMechPurposeId:'EmailShippingDest']"/>
</if>
<!-- get logo of vendor for PDF -->
<service-call name="mantle.party.PartyServices.get#PartyContentLocation" out-map="logoImageOut"
in-map="[partyId:fromPartyId, partyContentTypeEnumIdList:['PcntLogoImage', 'PcntPrimaryImage']]"/>
<set field="logoImageLocation" from="logoImageOut.contentLocation"/>
</actions>
</service>
<service verb="get" noun="ShipmentShippingOptions">
Expand Down Expand Up @@ -762,6 +766,7 @@ along with this software (see the LICENSE.md file). If not, see
<parameter name="otherLocationInfoMap" type="Map"/>
<parameter name="productInfoMap" type="Map"/>

<parameter name="logoImageLocation"/>
<parameter name="templateLocation"><description>If templateSettingSuffix specified this is looked up from
ProductStoreSetting and if no setting found for store then from PartySetting.</description></parameter>
</out-parameters>
Expand Down