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