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