summaryrefslogtreecommitdiff
path: root/UI/payments/payments_detail.html
blob: 206d0d59cafb03e2a3b851172eb52bcafce7be41 (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_number"><?lsmb text('Account_number') ?></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.account_number ?>
  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 ?> <?lsmb currency ?></td>
  199. <td class="payment" class="details_select">
  200. <?lsmb INCLUDE input element_data = {
  201. name = "paid_$r.contact_id"
  202. value = "some"
  203. label = text('Some')
  204. checked = (${"paid_$r.contact_id"} == 'some') ? "checked" : ""
  205. type = "radio"
  206. } ?>
  207. <?lsmb INCLUDE input element_data = {
  208. name = "paid_$r.contact_id"
  209. value = "all"
  210. label = text('All')
  211. checked = (${"paid_$r.contact_id"} != 'some') ? "checked" : ""
  212. type = "radio"
  213. } ?>
  214. </td>
  215. <td rowspan = 2><?lsmb INCLUDE input element_data = {
  216. name = "source_$r.contact_id"
  217. value = (${"source_$r.contact_id"}) ? ${"source_$r.contact_id"} : r.source
  218. type = "text"
  219. size = "20"
  220. label = text('Source')
  221. } ?></td>
  222. </tr>
  223. <tr class="listrow<?lsmb rc ?>">
  224. <td class="invoice_detail_list" colspan="3">
  225. <table id = "invoice_data_table_<?lsmb r.contact_id ?>" width="100%" class = "detail_table_visible">
  226. <tr class="listheading">
  227. <th class="invoice_date_list"><?lsmb text('Date') ?>
  228. </th>
  229. <th class="invoice_list">
  230. <?lsmb text('Invoice Number') ?>
  231. </th>
  232. <th class="total_due_list"><?lsmb text('Total') ?></th>
  233. <th class="paid_list"><?lsmb text('Paid') ?></th>
  234. <th class="net_due_list"><?lsmb text('Net Due') ?> </th>
  235. <th class="to_pay_list"><?lsmb text('To Pay') ?></th>
  236. </tr>
  237. <?lsmb icount = 0 ?>
  238. <?lsmb FOREACH i = r.invoices ?>
  239. <?lsmb icount = icount + 1 ?>
  240. <tr>
  241. <td class="invoice_date_list">&nbsp;<?lsmb i.2 ?></td>
  242. <?lsmb PROCESS input element_data = {
  243. name = "invdate_$i.0"
  244. type = "hidden"
  245. value = i.2
  246. } ?>
  247. <td class="invoice_list">&nbsp;<?lsmb i.1 ?></td>
  248. <?lsmb PROCESS input element_data = {
  249. name = "invnumber_$i.0"
  250. type = "hidden"
  251. value = i.1
  252. } ?>
  253. <td class="total_due_list">&nbsp;
  254. <?lsmb INCLUDE format_money number=i.3 ?></td>
  255. <td class="paid_list">&nbsp;
  256. <?lsmb INCLUDE format_money number=i.4 ?></td>
  257. <td class="net_due_list">&nbsp;
  258. <?lsmb INCLUDE format_money number= i.6 ?>
  259. <?lsmb currency ?></td>
  260. <td class="to_pay_list">
  261. <?lsmb IF ! ${"payment_$r.contact_id_$i.0"} ?>
  262. <?lsmb ${"payment_$r.contact_id_$i.0"} =
  263. INCLUDE format_money number= i.6 ?>
  264. <?lsmb END # if ?>
  265. <?lsmb INCLUDE input element_data = {
  266. name = "payment_$r.contact_id_$i.0"
  267. value = ${"payment_$r.contact_id_$i.0"}
  268. size = 20
  269. type = "text"
  270. class = "monetary"
  271. } ?>
  272. <?lsmb contact_total = contact_total + ${"payment_$r.contact_id_$i.0"} ?>
  273. <?lsmb INCLUDE input element_data = {
  274. type = "hidden"
  275. name = "invoice_${r.contact_id}_$icount"
  276. value = i.0
  277. } ?>
  278. <?lsmb INCLUDE input element_data = {
  279. type = "hidden"
  280. name = "net_$i.0"
  281. value = ${"payment_$r.contact_id_$i.0"}
  282. } ?>
  283. </td>
  284. </tr>
  285. <?lsmb END # foreach i ?>
  286. <?lsmb INCLUDE input element_data = {
  287. type = "hidden"
  288. name = "invoice_count_${r.contact_id}"
  289. value = icount
  290. } ?>
  291. <?lsmb IF !r.unselected;
  292. IF (${"paid_$r.contact_id"} == 'all');
  293. grand_total = grand_total + r.total_due;
  294. ELSIF (${"paid_$r.contact_id"} == 'some');
  295. grand_total = grand_total + contact_total;
  296. ELSE;
  297. contact_total = 'error';
  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>