PageRenderTime 56ms CodeModel.GetById 26ms RepoModel.GetById 1ms app.codeStats 0ms

/applications/order/webapp/ordermgr/return/returnHeader.ftl

https://github.com/thanhvc/ofbiz
Freemarker Template | 274 lines | 254 code | 2 blank | 18 comment | 57 complexity | d6bf6275ef1246146e07b22010c88b94 MD5 | raw file
  1. <#--
  2. Licensed to the Apache Software Foundation (ASF) under one
  3. or more contributor license agreements. See the NOTICE file
  4. distributed with this work for additional information
  5. regarding copyright ownership. The ASF licenses this file
  6. to you under the Apache License, Version 2.0 (the
  7. "License"); you may not use this file except in compliance
  8. with the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing,
  11. software distributed under the License is distributed on an
  12. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  13. KIND, either express or implied. See the License for the
  14. specific language governing permissions and limitations
  15. under the License.
  16. -->
  17. <div class="screenlet">
  18. <div class="screenlet-title-bar">
  19. <ul>
  20. <li class="h3">${uiLabelMap.PageTitleReturnHeader}</li>
  21. </ul>
  22. <br class="clear"/>
  23. </div>
  24. <div class="screenlet-body">
  25. <#if returnHeader?exists>
  26. <form name="returnhead" method="post" action="<@ofbizUrl>updateReturn</@ofbizUrl>">
  27. <input type="hidden" name="returnId" value="${returnHeader.returnId}" />
  28. <input type="hidden" name="returnHeaderTypeId" value="CUSTOMER_RETURN"/>
  29. <input type="hidden" name="currentStatusId" value="${returnHeader.statusId?if_exists}" />
  30. <#else>
  31. <form name="returnhead" method="post" action="<@ofbizUrl>createReturn</@ofbizUrl>">
  32. <input type="hidden" name="returnHeaderTypeId" value="CUSTOMER_RETURN"/>
  33. </#if>
  34. <table cellspacing="0" class="basic-table">
  35. <#if returnHeader?exists>
  36. <tr>
  37. <td width='14%'>&nbsp;</td>
  38. <td width='6%' align='right' nowrap="nowrap" class="label">${uiLabelMap.OrderReturnId}</td>
  39. <td width='6%'>&nbsp;</td>
  40. <td width='74%' align='left'>${returnHeader.returnId}</td>
  41. </tr>
  42. </#if>
  43. <tr>
  44. <td width='14%'>&nbsp;</td>
  45. <td width='6%' align='right' nowrap="nowrap" class="label">${uiLabelMap.CommonCurrency}</td>
  46. <td width='6%'>&nbsp;</td>
  47. <td width='74%'>
  48. <#if returnHeader?exists>
  49. ${returnHeader.currencyUomId?if_exists}
  50. <#else>
  51. <select name="currencyUomId">
  52. <#if (orderHeader?has_content) && (orderHeader.currencyUom?has_content)>
  53. <option value="${orderHeader.currencyUom}" selected>${orderHeader.getRelatedOne("Uom").getString("description",locale)}</option>
  54. <option value="${orderHeader.currencyUom}">---</option>
  55. <#elseif defaultCurrency?has_content>
  56. <option value="${defaultCurrency.uomId}" selected>${defaultCurrency.getString("description")}</option>
  57. <option value="${defaultCurrency.uomId}">---</option>
  58. </#if>
  59. <#if currencies?has_content>
  60. <#list currencies as currency>
  61. <option value="${currency.uomId}">${currency.get("description",locale)}</option>
  62. </#list>
  63. </#if>
  64. </select>
  65. </#if>
  66. </td>
  67. </tr>
  68. <tr>
  69. <td width='14%'>&nbsp;</td>
  70. <td width='6%' align='right' nowrap="nowrap" class="label">${uiLabelMap.OrderEntryDate}</td>
  71. <td width='6%'>&nbsp;</td>
  72. <td width='74%'>
  73. <#if returnInfo.entryDate?exists>
  74. <#assign entryDate = returnInfo.get("entryDate").toString()>
  75. </#if>
  76. <@htmlTemplate.renderDateTimeField name="entryDate" event="" action="" value="${entryDate?if_exists}" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" size="25" maxlength="30" id="entryDate1" dateType="date" shortDateInput=false timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/>
  77. </td>
  78. </tr>
  79. <tr>
  80. <td width='14%'>&nbsp;</td>
  81. <td width='6%' align='right' nowrap="nowrap" class="label">${uiLabelMap.OrderReturnFromParty}</td>
  82. <td width='6%'>&nbsp;</td>
  83. <td width='74%'>
  84. <@htmlTemplate.lookupField value='${returnInfo.fromPartyId?if_exists}' formName="returnhead" name="fromPartyId" id="fromPartyId" fieldFormName="LookupPartyName"/>
  85. </td>
  86. </tr>
  87. <tr>
  88. <td width='14%'>&nbsp;</td>
  89. <td width='6%' align='right' nowrap="nowrap" class="label">${uiLabelMap.OrderReturnToFacility}</td>
  90. <td width='6%'>&nbsp;</td>
  91. <td width='74%'>
  92. <select name='destinationFacilityId'>
  93. <#if currentFacility?exists>
  94. <option value="${currentFacility.facilityId}">${currentFacility.facilityName?default(currentFacility.facilityId)}</option>
  95. <option value="${currentFacility.facilityId}">---</option>
  96. </#if>
  97. <option value="">${uiLabelMap.FacilityNoFacility}</option>
  98. <#list facilityList as facility>
  99. <option value="${facility.facilityId}" <#if (facilityList?size == 1)>selected="selected"</#if>>${facility.facilityName?default(facility.facilityId)}</option>
  100. </#list>
  101. </td>
  102. </tr>
  103. <tr>
  104. <td width='14%'>&nbsp;</td>
  105. <td width='6%' align='right' nowrap="nowrap" class="label">${uiLabelMap.AccountingBillingAccount}</td>
  106. <td width='6%'>&nbsp;</td>
  107. <td width='74%'>
  108. <#if billingAccountList?has_content>
  109. <select name='billingAccountId'>
  110. <#if currentAccount?exists>
  111. <option value="${currentAccount.billingAccountId}">${currentAccount.billingAccountId}: ${currentAccount.description?if_exists}</option>
  112. <option value="${currentAccount.billingAccountId}">---</option>
  113. </#if>
  114. <option value="">${uiLabelMap.AccountingNewBillingAccount}</option>
  115. <#list billingAccountList as ba>
  116. <option value="${ba.billingAccountId}">${ba.billingAccountId}: ${ba.description?if_exists}</option>
  117. </#list>
  118. </select>
  119. <#else>
  120. <input type='text' size='20' name='billingAccountId' />
  121. </#if>
  122. </td>
  123. </tr>
  124. <tr>
  125. <td width='14%'>&nbsp;</td>
  126. <td width='6%' align='right' nowrap="nowrap" class="label">${uiLabelMap.FormFieldTitle_paymentMethodId}</td>
  127. <td width='6%'>&nbsp;</td>
  128. <td width='74%'>
  129. <#if creditCardList?exists || eftAccountList?exists>
  130. <select name='paymentMethodId'>
  131. <#if currentCreditCard?exists>
  132. <option value="${currentCreditCard.paymentMethodId}">CC:&nbsp;${Static["org.ofbiz.party.contact.ContactHelper"].formatCreditCard(currentCreditCard)}</option>
  133. </#if>
  134. <#if currentEftAccount?exists>
  135. <option value="${currentEftAccount.paymentMethodId}">EFT:&nbsp;${currentEftAccount.nameOnAccount?if_exists}, ${currentEftAccount.accountNumber?if_exists}</option>
  136. </#if>
  137. <option value=""></option>
  138. <#if creditCardList?has_content>
  139. <#list creditCardList as creditCardPm>
  140. <#assign creditCard = creditCardPm.getRelatedOne("CreditCard")>
  141. <option value="${creditCard.paymentMethodId}">CC:&nbsp;${Static["org.ofbiz.party.contact.ContactHelper"].formatCreditCard(creditCard)}</option>
  142. </#list>
  143. </#if>
  144. <#if eftAccountList?has_content>
  145. <#list eftAccountList as eftAccount>
  146. <option value="${eftAccount.paymentMethodId}">EFT:&nbsp;${eftAccount.nameOnAccount?if_exists}, ${eftAccount.accountNumber?if_exists}</option>
  147. </#list>
  148. </#if>
  149. </select>
  150. <#else>
  151. <input type='text' size='20' name='paymentMethodId' value="${returnHeader?if_exists.paymentMethodId?if_exists}"/>
  152. </#if>
  153. <#if (returnHeader.fromPartyId)?has_content>
  154. <a href="/partymgr/control/editcreditcard?partyId=${returnHeader.fromPartyId}${externalKeyParam}" target="partymgr" class="smallSubmit">${uiLabelMap.AccountingCreateNewCreditCard}</a>
  155. </#if>
  156. </td>
  157. </tr>
  158. <tr>
  159. <td width='14%'>&nbsp;</td>
  160. <td width='6%' align='right' nowrap="nowrap" class="label">${uiLabelMap.OrderReturnNeedsAutoReceive}</td>
  161. <td width='6%'>&nbsp;</td>
  162. <td width='74%'>
  163. <select name='needsInventoryReceive'>
  164. <#if needsInventoryReceive?exists>
  165. <#if "Y" == needsInventoryReceive>
  166. <option selected="selected" value="${needsInventoryReceive}">${uiLabelMap.CommonYes}</option>
  167. <#elseif "N" == needsInventoryReceive>
  168. <option selected="selected" value="${needsInventoryReceive}">${uiLabelMap.CommonNo}</option>
  169. </#if>
  170. <option value="${needsInventoryReceive}">---</option>
  171. </#if>
  172. <option value="Y">${uiLabelMap.CommonYes}</option>
  173. <option value="N">${uiLabelMap.CommonNo}</option>
  174. </select>
  175. </td>
  176. </tr>
  177. <#if returnHeader?has_content>
  178. <tr>
  179. <td width='14%'>&nbsp;</td>
  180. <td width='6%' align='right' nowrap="nowrap" class="label">${uiLabelMap.CommonReturnStatus}</td>
  181. <td width='6%'>&nbsp;</td>
  182. <td width='74%'>
  183. <select name="statusId">
  184. <#if currentStatus?exists>
  185. <option value="${currentStatus.statusId}">${currentStatus.get("description",locale)}</option>
  186. <option value="${currentStatus.statusId}">---</option>
  187. </#if>
  188. <#list returnStatus as status>
  189. <option value="${status.statusIdTo}">${status.get("transitionName",locale)}</option>
  190. </#list>
  191. </select>
  192. </td>
  193. </tr>
  194. <tr>
  195. <td width='14%'>&nbsp;</td>
  196. <td width='6%' align='right' nowrap="nowrap" class="label">${uiLabelMap.FormFieldTitle_createdBy}</td>
  197. <td width='6%'>&nbsp;</td>
  198. <td width='74%'>${returnHeader.createdBy?default("Unknown")}</td>
  199. </tr>
  200. <tr>
  201. <td width='14%'>&nbsp;</td>
  202. <td width='6%' align='right' valign='top' nowrap="nowrap" class="label">${uiLabelMap.OrderReturnFromAddress}</td>
  203. <td width='6%'>&nbsp;</td>
  204. <td width='74%'>
  205. <div>
  206. <#if (addressEditable)>
  207. <#list addresses as address >
  208. <@displayAddress postalAddress = address.postalAddress editable = true/>
  209. </#list>
  210. <input type='radio' name="originContactMechId" value="" <#if (!postalAddressFrom?has_content)> checked="checked"</#if> />${uiLabelMap.CommonNoAddress}
  211. <#else>
  212. <#if (postalAddressFrom?has_content)>
  213. <@displayAddress postalAddress = postalAddressFrom editable = false />
  214. <#else>
  215. ${uiLabelMap.CommonNoAddress}
  216. </#if>
  217. </#if>
  218. </div>
  219. </td>
  220. </tr>
  221. <tr>
  222. <td width='14%'>&nbsp;</td>
  223. <td width='6%' align='right' valign='top' nowrap="nowrap" class="label">${uiLabelMap.OrderReturnToAddress}</td>
  224. <td width='6%'>&nbsp;</td>
  225. <td width='74%'>
  226. <#if (postalAddressTo?has_content)>
  227. <@displayAddress postalAddress = postalAddressTo editable=false />
  228. </#if>
  229. </td>
  230. </tr>
  231. <tr>
  232. <td width='14%'>&nbsp;</td>
  233. <td width='6%'>&nbsp;</td>
  234. <td width='6%'>&nbsp;</td>
  235. <td width='74%'>
  236. <input type="submit" value="${uiLabelMap.CommonUpdate}"/>
  237. </td>
  238. </tr>
  239. <#else>
  240. <input type="hidden" name="statusId" value="RETURN_REQUESTED" />
  241. <tr>
  242. <td width='14%'>&nbsp;</td>
  243. <td width='6%'>&nbsp;</td>
  244. <td width='6%'>&nbsp;</td>
  245. <td width='74%'>
  246. <input type="submit" value="${uiLabelMap.CommonCreateNew}"/>
  247. </td>
  248. </tr>
  249. </#if>
  250. </table>
  251. <#macro displayAddress postalAddress editable>
  252. <#if postalAddress?has_content>
  253. <div>
  254. <#if (editable)>
  255. <input type='radio' name="originContactMechId" value="${postalAddress.contactMechId?if_exists}"
  256. <#if ( postalAddressFrom?has_content && postalAddressFrom.contactMechId?default("") == postalAddress.contactMechId)>checked="checked"</#if> />
  257. </#if>
  258. <#if postalAddress.toName?has_content><span class="label">${uiLabelMap.CommonTo}</span>&nbsp;${postalAddress.toName}<br /></#if>
  259. <#if postalAddress.attnName?has_content><span class="label">${uiLabelMap.CommonAttn}</span>&nbsp;${postalAddress.attnName}<br /></#if>
  260. <#if postalAddress.address1?has_content>&nbsp;&nbsp;&nbsp;&nbsp;${postalAddress.address1}<br /></#if>
  261. <#if postalAddress.address2?has_content>&nbsp;&nbsp;&nbsp;&nbsp;${postalAddress.address2}<br /></#if>
  262. <#if postalAddress.city?has_content>&nbsp;&nbsp;&nbsp;&nbsp;${postalAddress.city}</#if>
  263. <#if postalAddress.stateProvinceGeoId?has_content>&nbsp;${postalAddress.stateProvinceGeoId}</#if>
  264. <#if postalAddress.postalCode?has_content>&nbsp;${postalAddress.postalCode}</#if>
  265. <#if postalAddress.countryGeoId?has_content><br />&nbsp;&nbsp;&nbsp;&nbsp;${postalAddress.countryGeoId}</#if>
  266. </div>
  267. </#if>
  268. </#macro>
  269. </div>
  270. </div>