summaryrefslogtreecommitdiff
path: root/UI/payments/payments_detail.html
blob: 193c30dc0ddc4c8fa357cf04414a83ba71ece806 (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 number
  9. ?><?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 = "meta_number"
  42. value = meta_number
  43. } ?>
  44. <?lsmb INCLUDE input element_data = {
  45. type = "hidden"
  46. name = "source_start"
  47. value = source_start
  48. } ?>
  49. <?lsmb INCLUDE input element_data = {
  50. type = "hidden"
  51. name = "approved"
  52. value = approved
  53. } ?>
  54. <?lsmb INCLUDE input element_data = {
  55. type = "hidden"
  56. name = "currency"
  57. value = currency
  58. } ?>
  59. <?lsmb INCLUDE input element_data = {
  60. type = "hidden"
  61. name = "ar_ap_accno"
  62. value = ar_ap_accno
  63. } ?>
  64. <?lsmb INCLUDE input element_data = {
  65. type = "hidden"
  66. name = "date_from"
  67. value = date_from
  68. } ?>
  69. <?lsmb INCLUDE input element_data = {
  70. type = "hidden"
  71. name = "date_to"
  72. value = date_to
  73. } ?>
  74. <?lsmb INCLUDE input element_data = {
  75. type = "hidden"
  76. name = "business_id"
  77. value = business_id
  78. } ?>
  79. <?lsmb INCLUDE input element_data = {
  80. type = "hidden"
  81. name = "batch_id"
  82. value = batch_id
  83. } ?>
  84. <div class="container">
  85. <div id="date_row">
  86. <label for="date_paid"><?lsmb text('Posting Date:') ?></label>
  87. <?lsmb IF batch_id ?>
  88. <?lsmb IF ! datepaid ?><?lsmb datepaid = batch_date
  89. ?><?lsmb END ?>
  90. <span id="date_paid"><?lsmb datepaid ?></span>
  91. <?lsmb END ?>
  92. <?lsmb INCLUDE input element_data= {
  93. value = datepaid
  94. name = "datepaid"
  95. size = 20
  96. class = (batch_id) ? "hidden" : "date"
  97. type = (batch_id) ? "hidden" : "text"
  98. } ?>
  99. </div>
  100. <div id="date_filter_row">
  101. <label for="filter_from"><?lsmb text('Filtering From:') ?></label>
  102. <span id="filter_from"><?lsmb date_from ?> </span>
  103. <label for="filter_to"><?lsmb text('To:') ?></label>
  104. <span id="filter_to"><?lsmb date_to ?> </span>
  105. <!-- the department will be shown if it was selected in the first step -->
  106. <?lsmb IF department.value # Only process element if one exists. As in project above ?>
  107. <div class="info">
  108. <label for="department_info"><?lsmb text('Department') ?></label>
  109. <span id="department_info">
  110. <?lsmb department ?>
  111. </span>
  112. </div>
  113. <?lsmb END ?>
  114. <div class="info" id="account_row">
  115. <label for="account_info">
  116. <?lsmb text('Account:'); ?>
  117. </label>
  118. <span id="account_info"></td>
  119. <?lsmb FOREACH a = debt_accounts ?><?lsmb
  120. IF a.accno == ar_ap_accno
  121. ?><?lsmb a.accno ?>--<?lsmb a.description ?><?lsmb
  122. END # If a.accno... ?><?lsmb
  123. END # FOREACH a ?>
  124. </span>
  125. </div>
  126. <?lsmb IF defaultcurrency != curr ?>
  127. <div class="info" id="exrate_row">
  128. <?lsmb PROCESS input element_data= {
  129. label = text('Exchange Rate')
  130. type = text
  131. class = "numeric"
  132. name = 'exchange_rate'
  133. value = exchange_rate
  134. size = 20
  135. } # ' ?>
  136. </div>
  137. <?lsmb END ?>
  138. <?lsmb IF business ?>
  139. <div class="info">
  140. <label for="business_info"><?lsmb text('Business:') ?></label>
  141. <span id="business_info"><?lsmb FOREACH b = businesses ?>
  142. <?lsmb IF b.id == business ?>
  143. <?lsmb b.id ?> -- <?lsmb b.description ?>
  144. <?lsmb END # if b.id... ?>
  145. <?lsmb END # foreach b ?></span>
  146. </div>
  147. <?lsmb END # if business ?>
  148. <div class="info" id="cash_account_div">
  149. <?lsmb INCLUDE input element_data = {
  150. type = "hidden"
  151. name = "cash_accno"
  152. value = cash_accno
  153. } ?>
  154. <label><?lsmb text('Pay From') ?></label>
  155. <?lsmb FOR c = cash_accounts -?>
  156. <?lsmb IF c.accno == cash_accno -?>
  157. <?lsmb c.accno ?>--<?lsmb c.description ?>
  158. <?lsmb END # if c.accno -?>
  159. <?lsmb END # for c -?>
  160. </div>
  161. <table id="payments_table">
  162. <tr class="listheading">
  163. <th class="account"><?lsmb text('Account') ?></th>
  164. <th class="entity_name"><?lsmb text('Name') ?></th>
  165. <th class="invoice"><?lsmb text('Invoice Total') ?></th>
  166. <th class="payment"><?lsmb text('Payment') ?></th>
  167. <th class="payment"><?lsmb text('Details') ?></th>
  168. </tr>
  169. <?lsmb rc = 1 ?><?lsmb count = 0 ?>
  170. <?lsmb FOREACH r = contact_invoices ?>
  171. <?lsmb rc = (rc + 1) % 2; count = count + 1 ?>
  172. <tr class="listrow<?lsmb rc ?>">
  173. <td class="account_number" rowspan="2" >
  174. <?lsmb INCLUDE input element_data = {
  175. type = "hidden"
  176. name = "contact_$count"
  177. value = r.contact_id
  178. } ?>
  179. <?lsmb IF action == "update_payments" -?>
  180. <?lsmb IF !${"id_$r.contact_id"} -?>
  181. <?lsmb r.unselected = 1 -?>
  182. <?lsmb END # IF !${"id_$r.contact_id"} -?>
  183. <?lsmb END # IF action ... -?>
  184. <?lsmb INCLUDE input element_data = {
  185. type = "checkbox"
  186. name = "id_$r.contact_id"
  187. value = r.contact_id
  188. checked = (r.unselected) ? undef : "checked"
  189. } ?>
  190. <?lsmb r.econtrol_code ?> --
  191. <?lsmb r.account_number ?> -- <?lsmb r.eca_description ?>
  192. </td>
  193. <td class="entity_name"><span class="<?lsmb
  194. IF r.has_vouchers; 'name_has_vouchers' ;
  195. ELSE ; 'name_has_no_vouchers' ;
  196. END
  197. ?>"><?lsmb r.contact_name ?></span></td>
  198. <td class="invoice"><?lsmb r.total_due ?>
  199. <?lsmb currency ?></td>
  200. <td class="payment" class="details_select">
  201. <?lsmb INCLUDE input element_data = {
  202. name = "paid_$r.contact_id"
  203. value = "some"
  204. label = text('Some')
  205. checked = (${"paid_$r.contact_id"} == 'some') ? "checked" : ""
  206. type = "radio"
  207. } ?>
  208. <?lsmb INCLUDE input element_data = {
  209. name = "paid_$r.contact_id"
  210. value = "all"
  211. label = text('All')
  212. checked = (${"paid_$r.contact_id"} != 'some') ? "checked" : ""
  213. type = "radio"
  214. } ?>
  215. </td>
  216. <td rowspan = 2><?lsmb INCLUDE input element_data = {
  217. name = "source_$r.contact_id"
  218. value = (${"source_$r.contact_id"}) ? ${"source_$r.contact_id"} : r.source
  219. type = "text"
  220. size = "20"
  221. label = text('Source')
  222. } ?></td>
  223. </tr>
  224. <tr class="listrow<?lsmb rc ?>">
  225. <td class="invoice_detail_list" colspan="3">
  226. <table id = "invoice_data_table_<?lsmb r.contact_id ?>" width="100%" class = "detail_table_visible">
  227. <tr class="listheading">
  228. <th class="invoice_date_list"><?lsmb text('Date') ?>
  229. </th>
  230. <th class="invoice_list">
  231. <?lsmb text('Invoice Number') ?>
  232. </th>
  233. <th class="total_due_list"><?lsmb text('Total') ?></th>
  234. <th class="paid_list"><?lsmb text('Paid') ?></th>
  235. <th class="net_due_list"><?lsmb text('Net Due') ?> </th>
  236. <th class="to_pay_list"><?lsmb text('To Pay') ?></th>
  237. </tr>
  238. <?lsmb icount = 0 ?>
  239. <?lsmb FOREACH i = r.invoices ?>
  240. <?lsmb IF i.7 ?>
  241. <?lsmb icount = icount + 1 ?>
  242. <tr>
  243. <td class="invoice_date_list">&nbsp;<?lsmb i.2 ?></td>
  244. <td class="invoice_list">&nbsp;<?lsmb i.1 ?></td>
  245. <td class="total_due_list">&nbsp;
  246. <?lsmb i.3 ?></td>
  247. <td class="paid_list">&nbsp;
  248. <?lsmb i.4 ?></td>
  249. <td class="net_due_list">&nbsp;
  250. <?lsmb i.6 ?>
  251. <?lsmb currency ?></td>
  252. <td class="to_pay_list">
  253. <input
  254. name = "<?lsmb "payment_$i.0" ?>"
  255. value = "<?lsmb ${"payment_$i.0"} ?>"
  256. size = 20
  257. type = "text"
  258. class = "monetary"
  259. />
  260. <input
  261. type = "hidden"
  262. name = "<?lsmb "invoice_${r.contact_id}_$icount" ?>"
  263. value = "<?lsmb i.0 ?>"
  264. />
  265. <input
  266. type = "hidden"
  267. name = "<?lsmb "net_$i.0" ?>"
  268. value = "<?lsmb ${"payment_$r.contact_id_$i.0"} ?>"
  269. />
  270. </td>
  271. </tr>
  272. <?lsmb ELSE #not $i.7 ?>
  273. <tr>
  274. <td class="invoice_date_list">&nbsp;<?lsmb i.2 ?></td>
  275. <td class="invoice_list">&nbsp;<?lsmb i.1 ?></td>
  276. <td class="total_due_list">&nbsp;
  277. <?lsmb i.3 ?></td>
  278. <td class="paid_list">&nbsp;
  279. <?lsmb i.4 ?></td>
  280. <td class="net_due_list">&nbsp;
  281. <?lsmb i.6 ?>
  282. <?lsmb currency ?></td>
  283. <td class="to_pay_list">
  284. <?lsmb text("Locked by [_1]", i.8) ?>
  285. </td>
  286. </tr>
  287. <?lsmb END # if i.8 ?>
  288. <?lsmb END # foreach i ?>
  289. <?lsmb INCLUDE input element_data = {
  290. type = "hidden"
  291. name = "invoice_count_${r.contact_id}"
  292. value = icount
  293. } ?>
  294. <tr class="subtotal">
  295. <td colspan="5" class="total_label">
  296. <?lsmb text('Contact Total (if paying "some")') ?>
  297. </td>
  298. <td><span id='<?lsmb ${"contact_total_$r.id"} ?>'>
  299. <?lsmb r.contact_total ?>
  300. </span><span class="currency">
  301. <?lsmb currency ?></span>
  302. </td>
  303. </tr>
  304. </table>
  305. </tr>
  306. <?lsmb END # foreach r ?>
  307. <tr class="subtotal">
  308. <td>&nbsp;</td>
  309. <td class="total_label"><?lsmb text('Grand Total') ?></td>
  310. <td>
  311. <span id="grand_total">
  312. <?lsmb grand_total ?>
  313. </span>
  314. <span class="currency">
  315. <?lsmb currency ?>
  316. </span>
  317. </td>
  318. </tr>
  319. </table>
  320. <?lsmb INCLUDE input element_data = {
  321. type = "hidden"
  322. name = "contact_count"
  323. value = count
  324. } ?>
  325. <?lsmb PROCESS input element_data = {
  326. name = "multiple"
  327. type = "hidden"
  328. value = '1'
  329. } ?>
  330. <?lsmb INCLUDE button element_data = {
  331. text = text('Update'),
  332. value = 'update_payments'
  333. class = "submit"
  334. name = 'action'
  335. } ?>
  336. <?lsmb INCLUDE button element_data = {
  337. text = text((batch_id) ? 'Save' : 'Post'),
  338. value = 'post_payments_bulk'
  339. class = "submit"
  340. name = 'action'
  341. } ?>
  342. <?lsmb INCLUDE button element_data = {
  343. text = text('Add Payment Fees') # '
  344. value = 'paycom_add_fees'
  345. class = 'submit'
  346. name = 'action'
  347. } ?>
  348. <?lsmb IF can_print ?>
  349. <?lsmb INCLUDE select element_data = {
  350. name = "media"
  351. class = "select"
  352. options = media_options
  353. value = media
  354. } ?>
  355. <?lsmb INCLUDE select element_data = {
  356. name = "format"
  357. class = "select"
  358. options = format_options
  359. value = format
  360. } ?>
  361. <?lsmb INCLUDE button element_data = {
  362. text = text('Print')
  363. value = 'print'
  364. class = 'submit'
  365. name = 'action'
  366. } ?>
  367. <?lsmb END # IF can_print ?>
  368. </form>
  369. </body>
  370. </html>