summaryrefslogtreecommitdiff
path: root/UI/payments/payments_detail.html
blob: 39a4f3341dff5afc02105670591fc51ba382d62f (plain)
  1. <?lsmb INCLUDE 'ui-header.html'
  2. titlebar = 'Payments'
  3. include_stylesheet = [
  4. 'css/global.css'
  5. 'UI/payments/payments.css'
  6. ]
  7. ?>
  8. <?lsmb BLOCK format_money ?><?lsmb FILTER format('%15.2f') ?><?lsmb number
  9. ?><?lsmb END # filter ?><?lsmb END # block ?>
  10. <?lsmb PROCESS elements.html # Include form elements helper. ?>
  11. <?lsmb contact_type = (account_class == 1) ? text('Vendor') : text('Customer')
  12. ?>
  13. <?lsmb payment_type = (account_class == 1) ? text('Payments') : text('Receipts')
  14. ?>
  15. <body id="payment_2_body">
  16. <div class="listtop"><?lsmb payment_type ?></div>
  17. <form name="pay_dues" method="post" action="payment.pl">
  18. <!-- Moving all hidden variables to the top. -CT -->
  19. <?lsmb INCLUDE input element_data = {
  20. type = "hidden"
  21. name = "project_id"
  22. value = project_id
  23. } ?>
  24. <?lsmb INCLUDE input element_data = {
  25. type = "hidden"
  26. name = "account_class"
  27. value = account_class
  28. } ?>
  29. <?lsmb INCLUDE input element_data = {
  30. type = "hidden"
  31. name = "department_id"
  32. value = department_id
  33. } ?>
  34. <?lsmb INCLUDE input element_data = {
  35. type = "hidden"
  36. name = "source_start"
  37. value = source_start
  38. } ?>
  39. <?lsmb INCLUDE input element_data = {
  40. type = "hidden"
  41. name = "approved"
  42. value = approved
  43. } ?>
  44. <?lsmb INCLUDE input element_data = {
  45. type = "hidden"
  46. name = "currency"
  47. value = currency
  48. } ?>
  49. <?lsmb INCLUDE input element_data = {
  50. type = "hidden"
  51. name = "ar_ap_accno"
  52. value = ar_ap_accno
  53. } ?>
  54. <?lsmb INCLUDE input element_data = {
  55. type = "hidden"
  56. name = "date_from"
  57. value = date_from
  58. } ?>
  59. <?lsmb INCLUDE input element_data = {
  60. type = "hidden"
  61. name = "date_to"
  62. value = date_to
  63. } ?>
  64. <?lsmb INCLUDE input element_data = {
  65. type = "hidden"
  66. name = "business_id"
  67. value = business_id
  68. } ?>
  69. <?lsmb INCLUDE input element_data = {
  70. type = "hidden"
  71. name = "batch_id"
  72. value = batch_id
  73. } ?>
  74. <div class="container">
  75. <div id="date_row">
  76. <label for="date_paid"><?lsmb text('Posting Date:') ?></label>
  77. <?lsmb IF batch_id ?>
  78. <?lsmb IF ! datepaid ?><?lsmb datepaid = batch_date
  79. ?><?lsmb END ?>
  80. <span id="date_paid"><?lsmb datepaid ?></span>
  81. <?lsmb END ?>
  82. <?lsmb INCLUDE input element_data= {
  83. value = datepaid
  84. name = "datepaid"
  85. size = 20
  86. class = (batch_id) ? "hidden" : "date"
  87. type = (batch_id) ? "hidden" : "text"
  88. } ?>
  89. </div>
  90. <div id="date_filter_row">
  91. <label for="filter_from"><?lsmb text('Filtering From:') ?></label>
  92. <span id="filter_from"><?lsmb date_from ?> </span>
  93. <label for="filter_to"><?lsmb text('To:') ?></label>
  94. <span id="filter_to"><?lsmb date_to ?> </span>
  95. <!-- the department will be shown if it was selected in the first step -->
  96. <?lsmb IF department.value # Only process element if one exists. As in project above ?>
  97. <div class="info">
  98. <label for="department_info"><?lsmb text('Department') ?></label>
  99. <span id="department_info">
  100. <?lsmb department ?>
  101. </span>
  102. </div>
  103. <?lsmb END ?>
  104. <div class="info" id="account_row">
  105. <label for="account_info">
  106. <?lsmb text('Account:'); ?>
  107. </label>
  108. <span id="account_info"></td>
  109. <?lsmb FOREACH a = debt_accounts ?><?lsmb
  110. IF a.accno == ar_ap_accno
  111. ?><?lsmb a.accno ?>--<?lsmb a.description ?><?lsmb
  112. END # If a.accno... ?><?lsmb
  113. END # FOREACH a ?>
  114. </span>
  115. </div>
  116. <?lsmb IF defaultcurrency != curr ?>
  117. <div class="info" id="exrate_row">
  118. <?lsmb PROCESS input element_data= {
  119. label = text('Exchange Rate')
  120. type = text
  121. class = "numeric"
  122. name = 'exchange_rate'
  123. value = exchange_rate
  124. size = 20
  125. } # ' ?>
  126. </div>
  127. <?lsmb END ?>
  128. <?lsmb IF business ?>
  129. <div class="info">
  130. <label for="business_info"><?lsmb text('Business:') ?></label>
  131. <span id="business_info"><?lsmb FOREACH b = businesses ?>
  132. <?lsmb IF b.id == business ?>
  133. <?lsmb b.id ?> -- <?lsmb b.description ?>
  134. <?lsmb END # if b.id... ?>
  135. <?lsmb END # foreach b ?></span>
  136. </div>
  137. <?lsmb END # if business ?>
  138. <div class="input" id="cash_account_div">
  139. <select name="cash_accno" id="cash_account">
  140. <?lsmb FOREACH a = cash_accounts ?>
  141. <option value="<?lsmb a.accno ?>">
  142. <?lsmb a.accno ?>--<?lsmb a.description ?>
  143. </option>
  144. <?lsmb END # foreach a ?>
  145. </select>
  146. </div>
  147. <table id="payments_table">
  148. <tr class="listheading">
  149. <th class="account_number"><?lsmb text('Account_number') ?></th>
  150. <th class="entity_name"><?lsmb text('Name') ?></th>
  151. <th class="invoice"><?lsmb text('Invoice Total') ?></th>
  152. <th class="payment"><?lsmb text('Payment') ?></th>
  153. <th class="payment"><?lsmb text('Details') ?></th>
  154. </tr>
  155. <?lsmb rc = 1 ?><?lsmb count = 0 ?>
  156. <?lsmb FOREACH r = contact_invoices ?>
  157. <?lsmb rc = (rc + 1) % 2; count = count + 1 ?>
  158. <tr class="listrow<?lsmb rc ?>">
  159. <td class="account_number" rowspan="2" >
  160. <?lsmb INCLUDE input element_data = {
  161. type = "hidden"
  162. name = "contact_$count"
  163. value = r.contact_id
  164. } ?>
  165. <?lsmb INCLUDE input element_data = {
  166. type = "checkbox"
  167. name = "id_$r.contact_id"
  168. value = r.contact_id
  169. checked = (r.unselected) ? "" : "checked"
  170. } ?>
  171. <?lsmb r.account_number ?>
  172. </td>
  173. <td class="entity_name"><?lsmb r.contact_name ?></td>
  174. <td class="invoice"><?lsmb r.total_due ?> <?lsmb currency ?></td>
  175. <td class="payment">
  176. <?lsmb INCLUDE input element_data = {
  177. name = "paid_$r.contact_id"
  178. value = "some"
  179. label = text('Some')
  180. checked = ("${paid_$r.contact_id}" == 'some') ? checked : ""
  181. type = "radio"
  182. } ?>
  183. <?lsmb INCLUDE input element_data = {
  184. name = "paid_$r.contact_id"
  185. value = "all"
  186. label = text('All')
  187. checked = ("${paid_$r.contact_id}" != 'some') ? checked : ""
  188. type = "radio"
  189. } ?>
  190. </td>
  191. <td rowspan = 2><?lsmb INCLUDE input element_data = {
  192. name = "source_$r.contact_id"
  193. value = r.source
  194. type = "text"
  195. size = "20"
  196. label = text('Source')
  197. } ?></td>
  198. </tr>
  199. <tr class="listrow<?lsmb rc ?>">
  200. <td class="invoice_detail_list" colspan="3">
  201. <table id = "invoice_data_table_<?lsmb r.contact_id ?>" width="100%">
  202. <tr class="listheading">
  203. <th class="invoice_date_list"><?lsmb text('Date') ?>
  204. </th>
  205. <th class="invoice_list">
  206. <?lsmb text('Invoice Number') ?>
  207. </th>
  208. <th class="total_due_list"><?lsmb text('Total') ?></th>
  209. <th class="paid_list"><?lsmb text('Paid') ?></th>
  210. <th class="net_due_list"><?lsmb text('Net Due') ?> </th>
  211. <th class="to_pay_list"><?lsmb text('To Pay') ?></th>
  212. </tr>
  213. <?lsmb icount = 0 ?>
  214. <?lsmb FOREACH i = r.invoices ?>
  215. <?lsmb icount = icount + 1 ?>
  216. <tr>
  217. <td class="invoice_date_list">&nbsp;<?lsmb i.2 ?></td>
  218. <td class="invoice_list">&nbsp;<?lsmb i.1 ?></td>
  219. <td class="total_due_list">&nbsp;<?lsmb i.3 ?></td>
  220. <td class="paid_list">&nbsp;<?lsmb i.4 ?></td>
  221. <td class="net_due_list">&nbsp;
  222. <?lsmb INCLUDE format_money number= i.6 ?>
  223. <?lsmb currency ?></td>
  224. <td class="to_pay_list">
  225. <?lsmb IF ! ${"payment_$r.contact_id_$i.0"} ?>
  226. <?lsmb ${"payment_$r.contact_id_$i.0"} =
  227. INCLUDE format_money number= i.6 ?>
  228. <?lsmb END # if ?>
  229. <?lsmb INCLUDE input element_data = {
  230. name = "payment_$r.contact_id_$i.0"
  231. value = ${"payment_$r.contact_id_$i.0"}
  232. size = 20
  233. type = "text"
  234. class = "monetary"
  235. } ?>
  236. <?lsmb INCLUDE input element_data = {
  237. type = "hidden"
  238. name = "invoice_${r.contact_id}_$icount"
  239. value = i.0
  240. } ?>
  241. <?lsmb INCLUDE input element_data = {
  242. type = "hidden"
  243. name = "net_$i.0"
  244. value = i.6
  245. } ?>
  246. </td>
  247. </tr>
  248. <?lsmb END # foreach i ?>
  249. <?lsmb INCLUDE input element_data = {
  250. type = "hidden"
  251. name = "invoice_count_${r.contact_id}"
  252. value = icount
  253. } ?>
  254. </table>
  255. </tr>
  256. <?lsmb END # foreach r ?>
  257. </table>
  258. <?lsmb INCLUDE input element_data = {
  259. type = "hidden"
  260. name = "contact_count"
  261. value = count
  262. } ?>
  263. <?lsmb INCLUDE button element_data = {
  264. text = text('Post'),
  265. value = 'post_payments_bulk'
  266. class = "submit"
  267. name = 'action'
  268. } ?>
  269. </form>
  270. </body>
  271. </html>