summaryrefslogtreecommitdiff
path: root/UI/payments/payments_detail.html
blob: f80cab95a5847e2f743a1e371619f1beba153051 (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 icount = icount + 1 ?>
  241. <tr>
  242. <td class="invoice_date_list">&nbsp;<?lsmb i.2 ?></td>
  243. <input
  244. name = "<?lsmb "invdate_$i.0" ?>"
  245. type = "hidden"
  246. value = i.2
  247. />
  248. <td class="invoice_list">&nbsp;<?lsmb i.1 ?></td>
  249. <input
  250. name = "<?lsmb "invnumber_$i.0" ?>"
  251. type = "hidden"
  252. value = "<?lsmb i.1 ?>"
  253. } ?>
  254. <td class="total_due_list">&nbsp;
  255. <?lsmb i.3 ?></td>
  256. <td class="paid_list">&nbsp;
  257. <?lsmb i.4 ?></td>
  258. <td class="net_due_list">&nbsp;
  259. <?lsmb i.6 ?>
  260. <?lsmb currency ?></td>
  261. <td class="to_pay_list">
  262. <input
  263. name = "<?lsmb "payment_$i.0" ?>"
  264. value = "<?lsmb ${"payment_$i.0"} ?>"
  265. size = 20
  266. type = "text"
  267. class = "monetary"
  268. />
  269. <input
  270. type = "hidden"
  271. name = "<?lsmb "invoice_${r.contact_id}_$icount" ?>"
  272. value = "<?lsmb i.0 ?>"
  273. />
  274. <input
  275. type = "hidden"
  276. name = "<?lsmb "net_$i.0" ?>"
  277. value = "<?lsmb ${"payment_$r.contact_id_$i.0"} ?>"
  278. />
  279. </td>
  280. </tr>
  281. <?lsmb END # foreach i ?>
  282. <?lsmb INCLUDE input element_data = {
  283. type = "hidden"
  284. name = "invoice_count_${r.contact_id}"
  285. value = icount
  286. } ?>
  287. <tr class="subtotal">
  288. <td colspan="5" class="total_label">
  289. <?lsmb text('Contact Total (if paying "some")') ?>
  290. </td>
  291. <td><span id='<?lsmb ${"contact_total_$r.id"} ?>'>
  292. <?lsmb r.contact_total ?>
  293. </span><span class="currency">
  294. <?lsmb currency ?></span>
  295. </td>
  296. </tr>
  297. </table>
  298. </tr>
  299. <?lsmb END # foreach r ?>
  300. <tr class="subtotal">
  301. <td>&nbsp;</td>
  302. <td class="total_label"><?lsmb text('Grand Total') ?></td>
  303. <td>
  304. <span id="grand_total">
  305. <?lsmb grand_total ?>
  306. </span>
  307. <span class="currency">
  308. <?lsmb currency ?>
  309. </span>
  310. </td>
  311. </tr>
  312. </table>
  313. <?lsmb INCLUDE input element_data = {
  314. type = "hidden"
  315. name = "contact_count"
  316. value = count
  317. } ?>
  318. <?lsmb PROCESS input element_data = {
  319. name = "multiple"
  320. type = "hidden"
  321. value = '1'
  322. } ?>
  323. <?lsmb INCLUDE button element_data = {
  324. text = text('Update'),
  325. value = 'update_payments'
  326. class = "submit"
  327. name = 'action'
  328. } ?>
  329. <?lsmb INCLUDE button element_data = {
  330. text = text((batch_id) ? 'Save' : 'Post'),
  331. value = 'post_payments_bulk'
  332. class = "submit"
  333. name = 'action'
  334. } ?>
  335. <?lsmb INCLUDE button element_data = {
  336. text = text('Add Payment Fees') # '
  337. value = 'paycom_add_fees'
  338. class = 'submit'
  339. name = 'action'
  340. } ?>
  341. <?lsmb IF can_print ?>
  342. <?lsmb INCLUDE select element_data = {
  343. name = "media"
  344. class = "select"
  345. options = media_options
  346. value = media
  347. } ?>
  348. <?lsmb INCLUDE select element_data = {
  349. name = "format"
  350. class = "select"
  351. options = format_options
  352. value = format
  353. } ?>
  354. <?lsmb INCLUDE button element_data = {
  355. text = text('Print')
  356. value = 'print'
  357. class = 'submit'
  358. name = 'action'
  359. } ?>
  360. <?lsmb END # IF can_print ?>
  361. </form>
  362. </body>
  363. </html>