summaryrefslogtreecommitdiff
path: root/UI/payments/payments_detail.html
blob: b63b696a5ab97a678d9dfcd233e77906d862ad90 (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 = "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 ?><?lsmb grand_total = 0 ?>
  170. <?lsmb FOREACH r = contact_invoices ?>
  171. <?lsmb contact_total = 0 ?>
  172. <?lsmb rc = (rc + 1) % 2; count = count + 1 ?>
  173. <tr class="listrow<?lsmb rc ?>">
  174. <td class="account_number" rowspan="2" >
  175. <?lsmb INCLUDE input element_data = {
  176. type = "hidden"
  177. name = "contact_$count"
  178. value = r.contact_id
  179. } ?>
  180. <?lsmb IF action == "update_payments" -?>
  181. <?lsmb IF !${"id_$r.contact_id"} -?>
  182. <?lsmb r.unselected = 1 -?>
  183. <?lsmb END # IF !${"id_$r.contact_id"} -?>
  184. <?lsmb END # IF action ... -?>
  185. <?lsmb INCLUDE input element_data = {
  186. type = "checkbox"
  187. name = "id_$r.contact_id"
  188. value = r.contact_id
  189. checked = (r.unselected) ? undef : "checked"
  190. } ?>
  191. <?lsmb r.econtrol_code ?> --
  192. <?lsmb r.account_number ?> -- <?lsmb r.eca_description ?>
  193. </td>
  194. <td class="entity_name"><span class="<?lsmb
  195. IF r.has_vouchers; 'name_has_vouchers' ;
  196. ELSE ; 'name_has_no_vouchers' ;
  197. END
  198. ?>"><?lsmb r.contact_name ?></span></td>
  199. <td class="invoice"><?lsmb INCLUDE format_money number=r.total_due ?>
  200. <?lsmb currency ?></td>
  201. <td class="payment" class="details_select">
  202. <?lsmb INCLUDE input element_data = {
  203. name = "paid_$r.contact_id"
  204. value = "some"
  205. label = text('Some')
  206. checked = (${"paid_$r.contact_id"} == 'some') ? "checked" : ""
  207. type = "radio"
  208. } ?>
  209. <?lsmb INCLUDE input element_data = {
  210. name = "paid_$r.contact_id"
  211. value = "all"
  212. label = text('All')
  213. checked = (${"paid_$r.contact_id"} != 'some') ? "checked" : ""
  214. type = "radio"
  215. } ?>
  216. </td>
  217. <td rowspan = 2><?lsmb INCLUDE input element_data = {
  218. name = "source_$r.contact_id"
  219. value = (${"source_$r.contact_id"}) ? ${"source_$r.contact_id"} : r.source
  220. type = "text"
  221. size = "20"
  222. label = text('Source')
  223. } ?></td>
  224. </tr>
  225. <tr class="listrow<?lsmb rc ?>">
  226. <td class="invoice_detail_list" colspan="3">
  227. <table id = "invoice_data_table_<?lsmb r.contact_id ?>" width="100%" class = "detail_table_visible">
  228. <tr class="listheading">
  229. <th class="invoice_date_list"><?lsmb text('Date') ?>
  230. </th>
  231. <th class="invoice_list">
  232. <?lsmb text('Invoice Number') ?>
  233. </th>
  234. <th class="total_due_list"><?lsmb text('Total') ?></th>
  235. <th class="paid_list"><?lsmb text('Paid') ?></th>
  236. <th class="net_due_list"><?lsmb text('Net Due') ?> </th>
  237. <th class="to_pay_list"><?lsmb text('To Pay') ?></th>
  238. </tr>
  239. <?lsmb icount = 0 ?>
  240. <?lsmb FOREACH i = r.invoices ?>
  241. <?lsmb icount = icount + 1 ?>
  242. <tr>
  243. <td class="invoice_date_list">&nbsp;<?lsmb i.2 ?></td>
  244. <?lsmb PROCESS input element_data = {
  245. name = "invdate_$i.0"
  246. type = "hidden"
  247. value = i.2
  248. } ?>
  249. <td class="invoice_list">&nbsp;<?lsmb i.1 ?></td>
  250. <?lsmb PROCESS input element_data = {
  251. name = "invnumber_$i.0"
  252. type = "hidden"
  253. value = i.1
  254. } ?>
  255. <td class="total_due_list">&nbsp;
  256. <?lsmb INCLUDE format_money number=i.3 ?></td>
  257. <td class="paid_list">&nbsp;
  258. <?lsmb INCLUDE format_money number=i.4 ?></td>
  259. <td class="net_due_list">&nbsp;
  260. <?lsmb INCLUDE format_money number= i.6 ?>
  261. <?lsmb currency ?></td>
  262. <td class="to_pay_list">
  263. <?lsmb IF ! ${"payment_$r.contact_id_$i.0"} ?>
  264. <?lsmb ${"payment_$r.contact_id_$i.0"} =
  265. INCLUDE format_money number= i.6 ?>
  266. <?lsmb END # if ?>
  267. <?lsmb INCLUDE input element_data = {
  268. name = "payment_$r.contact_id_$i.0"
  269. value = ${"payment_$r.contact_id_$i.0"}
  270. size = 20
  271. type = "text"
  272. class = "monetary"
  273. } ?>
  274. <?lsmb contact_total = contact_total + ${"payment_$r.contact_id_$i.0"} ?>
  275. <?lsmb INCLUDE input element_data = {
  276. type = "hidden"
  277. name = "invoice_${r.contact_id}_$icount"
  278. value = i.0
  279. } ?>
  280. <?lsmb INCLUDE input element_data = {
  281. type = "hidden"
  282. name = "net_$i.0"
  283. value = ${"payment_$r.contact_id_$i.0"}
  284. } ?>
  285. </td>
  286. </tr>
  287. <?lsmb END # foreach i ?>
  288. <?lsmb INCLUDE input element_data = {
  289. type = "hidden"
  290. name = "invoice_count_${r.contact_id}"
  291. value = icount
  292. } ?>
  293. <?lsmb IF !r.unselected;
  294. IF (${"paid_$r.contact_id"} == 'some');
  295. grand_total = grand_total + contact_total;
  296. ELSE;
  297. grand_total = grand_total + r.total_due;
  298. END; # IF (paid...)
  299. END # IF !r.unselected) ?>
  300. <tr class="subtotal">
  301. <td colspan="5" class="total_label">
  302. <?lsmb text('Contact Total (if paying "some")') ?>
  303. </td>
  304. <td><span id='<?lsmb ${"contact_total_$r.id"} ?>'>
  305. <?lsmb INCLUDE format_money number= contact_total ?>
  306. </span><span class="currency">
  307. <?lsmb currency ?></span>
  308. </td>
  309. </tr>
  310. </table>
  311. </tr>
  312. <?lsmb END # foreach r ?>
  313. <tr class="subtotal">
  314. <td>&nbsp;</td>
  315. <td class="total_label"><?lsmb text('Grand Total') ?></td>
  316. <td>
  317. <span id="grand_total">
  318. <?lsmb INCLUDE format_money number = grand_total ?>
  319. </span>
  320. <span class="currency">
  321. <?lsmb currency ?>
  322. </span>
  323. </td>
  324. </tr>
  325. </table>
  326. <?lsmb INCLUDE input element_data = {
  327. type = "hidden"
  328. name = "contact_count"
  329. value = count
  330. } ?>
  331. <?lsmb PROCESS input element_data = {
  332. name = "multiple"
  333. type = "hidden"
  334. value = '1'
  335. } ?>
  336. <?lsmb INCLUDE button element_data = {
  337. text = text('Update'),
  338. value = 'update_payments'
  339. class = "submit"
  340. name = 'action'
  341. } ?>
  342. <?lsmb INCLUDE button element_data = {
  343. text = text((batch_id) ? 'Save' : 'Post'),
  344. value = 'post_payments_bulk'
  345. class = "submit"
  346. name = 'action'
  347. } ?>
  348. <?lsmb INCLUDE button element_data = {
  349. text = text('Add Payment Fees') # '
  350. value = 'paycom_add_fees'
  351. class = 'submit'
  352. name = 'action'
  353. } ?>
  354. <?lsmb IF can_print ?>
  355. <?lsmb INCLUDE select element_data = {
  356. name = "media"
  357. class = "select"
  358. options = media_options
  359. value = media
  360. } ?>
  361. <?lsmb INCLUDE select element_data = {
  362. name = "format"
  363. class = "select"
  364. options = format_options
  365. value = format
  366. } ?>
  367. <?lsmb INCLUDE button element_data = {
  368. text = text('Print')
  369. value = 'print'
  370. class = 'submit'
  371. name = 'action'
  372. } ?>
  373. <?lsmb END # IF can_print ?>
  374. </form>
  375. </body>
  376. </html>