summaryrefslogtreecommitdiff
path: root/UI/payments/payment2.html
blob: c1c99a8ec4b5664e12c3e859b19d4f27d34eca96 (plain)
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <title><?lsmb titlebar ?></title>
  6. <meta http-equiv="Pragma" content="no-cache" />
  7. <meta http-equiv="Expires" content="-1" />
  8. <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
  9. <link rel="stylesheet" href="css/<?lsmb stylesheet ?>" type="text/css" />
  10. <script language="JavaScript" src="UI/payments/javascript/maximize_minimize.js"></script>
  11. <meta http-equiv="content-type" content="text/html; charset=<?lsmb charset ?>" />
  12. <meta name="robots" content="noindex,nofollow" />
  13. </head>
  14. <body id="payment_2_body"
  15. onLoad="maximize_minimize_on_load('div_topay_state', 'UI/payments/img/down.gif','UI/payments/img/up.gif') ">
  16. <form name="pay_single_dues" method="post" action="payment.pl">
  17. <?lsmb PROCESS elements.html # Include form elements helper. ?>
  18. <?lsmb accountclass.type = 'hidden';
  19. INCLUDE input element_data=accountclass ?>
  20. <?lsmb login.type = 'hidden' ; INCLUDE input element_data=login ?>
  21. <?lsmb #WE NEED TO KNOW HOW MANY COLUMNS ARE WE USING, PLEASE DO NOT MOVE THE NEXT LINE -?>
  22. <?lsmb column_count = 0 -?>
  23. <table width="100%">
  24. <tr id="top_bar" class="listtop">
  25. <th id="top_bar_header" class="listtop">
  26. <?lsmb header.text ?>
  27. <?lsmb type.type = 'hidden' ; INCLUDE input element_data=type ?>
  28. </th>
  29. </tr>
  30. </table>
  31. <table width="100%" id="info_table">
  32. <tr valign="top" id="info_row">
  33. <td width="50%" id="info_data">
  34. <table id="cv_info_table">
  35. <tr id="cv_row">
  36. <th class="label_left" id="cv_label_column"><?lsmb text('Vendor') ?></th>
  37. <td id="cv_column">
  38. <?lsmb vc.name ?><?lsmb vendorcustomer.type = 'hidden'; INCLUDE input element_data=vendorcustomer?>
  39. </td>
  40. </tr>
  41. <tr id="cv_address_row">
  42. <th valign="top" align="right" id="cv_address_label_column"><?lsmb text('Location') ?></th>
  43. <td id="cv_address_column">
  44. <table id="cv_address_table">
  45. <?lsmb # this table will show the customer/vendor address, city, phone and others things that could help to reminds them?>
  46. <?lsmb FOREACH address IN vc.address # Loop through customer/vendor address info ?>
  47. <tr>
  48. <td><?lsmb address.text ?></td>
  49. </tr>
  50. <?lsmb END ?>
  51. </table>
  52. </td>
  53. </tr>
  54. <tr align="right" id="notes_row">
  55. <th valign="top" id="notes_column"><?lsmb text('Notes') ?></th>
  56. <td><textarea id="notes" name="notes" cols="35" rows="3"><?lsmb notes ?></textarea></td>
  57. </tr>
  58. </table>
  59. </td>
  60. <td align="right">
  61. <table>
  62. <?lsmb # the project will be shown if it was selected in the first step ?>
  63. <?lsmb IF project.value # Only process element if the value exists. ?>
  64. <tr id="project_row">
  65. <th align="right" nowrap id="project_label_column"><?lsmb text('Projects') ?>:</th>
  66. <td colspan="2" id="project_column">
  67. <?lsmb project.text ?>
  68. <?lsmb project.type="hidden"; INCLUDE input element_data=project ?>
  69. </td>
  70. </tr>
  71. <?lsmb END ?>
  72. <?lsmb #the department will be shown if it was selected in the first step ?>
  73. <?lsmb IF department.value # Only process element if one exists. As in project above ?>
  74. <tr id="department-row">
  75. <th align="right" nowrap id="department_label_column"><?lsmb text('Department') ?>:</th>
  76. <td colspan="2" id="department_column">
  77. <?lsmb department.text ?>
  78. <?lsmb department.type="hidden"; INCLUDE input element_data=department ?>
  79. </td>
  80. </tr>
  81. <?lsmb END ?>
  82. <tr id="account_row">
  83. <?lsmb #here goes all the posible accounts were the paid can be done ?>
  84. <th align="right" nowrap id="account_label_column"><?lsmb text('Account') ?></th>
  85. <td colspan="2" id="account_column">
  86. <select id="account" name="account">
  87. <?lsmb FOREACH item IN account -?>
  88. <option value="<?lsmb item.id -?>" <?lsmb IF item.id == selected_account -?> selected <?lsmb END ?>><?lsmb item.description -?></option>
  89. <?lsmb END -?>
  90. </select>
  91. </td>
  92. </tr>
  93. <tr id="date_row"><?lsmb # here goes an input where the date can be written, we can also use a java calendar :). We can use an ajax script to call the Exchange rate of the input date wich can be called with the onChange Method ?>
  94. <th align="right" nowrap id="date_label_column"><?lsmb text('Date') ?></th>
  95. <td colspan="2" id="date_column"> <?lsmb INCLUDE input element_data=datepaid ?> </td>
  96. </tr>
  97. <tr id="source_row">
  98. <?lsmb # here goes all the posible sources wich we can use -?>
  99. <th align="right" nowrap id="source_label_column"><?lsmb text('Source')?></th>
  100. <td width="28%" id="source_column">
  101. <select id="source" name="source">
  102. <?lsmb FOREACH item IN source -?>
  103. <option value="<?lsmb item -?>"<?lsmb IF item == selected_source -?> selected <?lsmb END ?>><?lsmb item -?></option>
  104. <?lsmb END -?>
  105. </select>
  106. </td>
  107. <td id="source_text_column">
  108. <?lsmb INCLUDE input element_data={ name => 'source_value'
  109. id => 'source_value'
  110. value => source_value } -?>
  111. </td>
  112. </tr>
  113. <tr id="currency_row">
  114. <?lsmb # here goes the selected currency in step 1 ?>
  115. <th align="right" id="currency_label_column"><?lsmb text('Currency') -?>:</th>
  116. <td id="currency_column">
  117. <?lsmb curr.value -?><?lsmb curr.type='hidden'; INCLUDE input element_data=curr -?>
  118. </td>
  119. </tr>
  120. <?lsmb # here goes the exchange rate of the selected currency, it can be done by the ajax script or the update button ?>
  121. <?lsmb IF defaultcurrency.text != curr.text # Only process element if one exists. ?>
  122. <tr id="exrate_row">
  123. <th valig="top" align="right" id="exrate_label_column"><?lsmb text('Exchange Rate') ?>:</th>
  124. <td id="exrate_column">
  125. <?lsmb IF exrate.value -?>
  126. <?lsmb exrate.text -?>
  127. <?lsmb exrate.type='hidden'; INCLUDE input element_data=exrate -?>
  128. <?lsmb END -?>
  129. <?lsmb IF !exrate.value -?>
  130. <?lsmb INCLUDE input element_data=exrate -?>
  131. <?lsmb END -?>
  132. </td>
  133. </tr>
  134. <?lsmb END ?>
  135. </table>
  136. </td>
  137. </tr>
  138. </table>
  139. <table width="100%">
  140. <tr class="listheading">
  141. <?lsmb FOREACH column IN column_headers # Loop through columns ?>
  142. <?lsmb column_count = column_count + 1 -?>
  143. <th class="listheading"><?lsmb column.text ?></th>
  144. <?lsmb END ?>
  145. </tr>
  146. <?lsmb # We have to clear i for later usage :) ?>
  147. <?lsmb i = '0'; topay_subtotal = 0 -?>
  148. <?lsmb FOREACH row IN rows ?>
  149. <?lsmb i = i + 1; j = i % 2; alterning_style = "listrow$j" ?>
  150. <tr class="<?lsmb alterning_style ?>"=>
  151. <td><a href="<?lsmb row.invoice.href ?>" target="_new"><?lsmb row.invoice.number ?></a>
  152. <input type="hidden" value="<?lsmb row.invoice.id ?>" /> </td>
  153. <?lsmb # we can use an href to link this invoice number to the invoice ?>
  154. <td><?lsmb row.invoice_date ?></td>
  155. <td><?lsmb row.amount ?></td>
  156. <td><?lsmb row.paid ?></td>
  157. <td><?lsmb row.discount ?></td>
  158. <td align="center"><input name="<?lsmb "optional_discount_$row.invoice.id" -?>" id="<?lsmb
  159. "optional_discount_$row.invoice.id" -?>" type="checkbox" class="checkbox"<?lsmb IF
  160. row.optional_discount OR first_load -?> checked <?lsmb END -?> ></td>
  161. <td align="center"><?lsmb row.memo.id=row.memo.name ; INCLUDE input element_data=row.memo; -?></td>
  162. <?lsmb IF defaultcurrency.text != curr.value ?>
  163. <td><?lsmb row.exchange_rate ?></td>
  164. <td><?lsmb row.due ?></td>
  165. <td><div id="<?lsmb "div_topay_invoice_$i" ?>"><?lsmb row.due_fx ?></div></td>
  166. <?lsmb END ?>
  167. <?lsmb #This should be computed and updated to the div using ?>
  168. <td align="center"><?lsmb row.topay_fx.id = row.topay_fx.name ;INCLUDE input element_data=row.topay_fx;
  169. topay_subtotal = topay_subtotal + row.topay_fx.value -?>
  170. <?lsmb # A DEGRADABLE JAVASCRIPT IS USED, BECAUSE OF THE VISUAL IMPACT
  171. # THAT CAUSES THE SIZE OF THIS DIV -?>
  172. <img src="UI/payments/img/up.gif" id="button_topay_<?lsmb row.invoice.id ?>" name="<?lsmb "button_topay_$i" ?>"
  173. onClick="maximize_minimize('div_topay_<?lsmb row.invoice.id ?>',
  174. 'topaystate_<?lsmb row.invoice.id ?>' ,this,
  175. 'UI/payments/img/down.gif', 'UI/payments/img/up.gif')">
  176. <div id="div_topay_<?lsmb row.invoice.id ?>">
  177. <table>
  178. <tr id="<?lsmb "account-row$i"?>">
  179. <?lsmb # here goes all the posible accounts were the paid can be done ?>
  180. <th align="right" nowrap id="<?lsmb "account_label_column$i" ?>"><?lsmb text('Account') ?></th>
  181. <td colspan="2" id="<?lsmb "account_column$i" ?>">
  182. <select id="account_<?lsmb row.invoice.id -?>" name="account_<?lsmb row.invoice.id -?>">
  183. <?lsmb FOREACH item IN account -?>
  184. <option value="<?lsmb item.id -?>" <?lsmb IF item.id == row.selected_account -?> selected <?lsmb END ?>><?lsmb item.description -?></option>
  185. <?lsmb END -?>
  186. </select>
  187. </td>
  188. </tr>
  189. <tr id="<?lsmb "source_row$i" ?>">
  190. <?lsmb # here goes all the posible sources wich we can used ?>
  191. <th align="right" nowrap id="<?lsmb "source_label_column$i" ?>"><?lsmb text('Source') ?></th>
  192. <td width="28%" id="<?lsmb "source_column$i" ?>">
  193. <select id="source_<?lsmb row.invoice.id -?>" name="source_<?lsmb row.invoice.id -?>">
  194. <?lsmb FOREACH item IN source -?>
  195. <option value="<?lsmb item -?>"<?lsmb IF item == row.selected_source -?> selected <?lsmb END ?>><?lsmb item -?></option>
  196. <?lsmb END -?>
  197. </select>
  198. </td>
  199. <td><?lsmb INCLUDE input element_data={
  200. name => "source_text_$row.invoice.id",
  201. id => "source_text_$row.invoice.id",
  202. value => row.source_text
  203. } -?></td>
  204. <td nowrap align="left"><input name="<?lsmb "optional_pay_$row.invoice.id" -?>" id="<?lsmb "optional_pay_$row.invoice.id" -?>" type="checkbox" class="checkbox"
  205. <?lsmb IF row.optional -?> checked <?lsmb END -?>></td>
  206. </tr>
  207. </table>
  208. </div>
  209. </td>
  210. <td valign="MIDDLE"><input type="checkbox" name="checkbox_<?lsmb row.invoice.id ?>"></td>
  211. <?lsmb END ?>
  212. </tr>
  213. <?lsmb colspan = column_count - 2 # We will use this later on totals -?>
  214. <tr class="listsubtotal">
  215. <th colspan="<?lsmb colspan -?>" align="right"><?lsmb text('Subtotal') -?></th>
  216. <th colspan="2"><?lsmb topay_subtotal -?>&nbsp;<?lsmb curr.value -?></th>
  217. </tr>
  218. </table>
  219. <table width="100%">
  220. <tr>
  221. <th class="listheading" colspan="7" ><?lsmb text('OVERPAYMENT / ADVANCED PAYMENT / PREPAYMENT') ?></th>
  222. </tr>
  223. <tr>
  224. <th class="listheading"><?lsmb text('Item') ?></th>
  225. <th class="listheading"><?lsmb text('Account') ?></th>
  226. <th class="listheading"><?lsmb text('Cash Account')?></th>
  227. <th class="listheading"><?lsmb text('Source') ?></th>
  228. <th class="listheading"><?lsmb text('Memo') ?></th>
  229. <th class="listheading"><?lsmb text('Amount') ?></th>
  230. <th class="listheading">X</th>
  231. </tr>
  232. <?lsmb # We have to insert the overpayment data -?>
  233. <?lsmb overpayment_item = 0; overpayment_subtotal = 0 -?>
  234. <?lsmb FOREACH item IN overpayment -?>
  235. <?lsmb overpayment_item = overpayment_item + 1 -?>
  236. <?lsmb j = overpayment_item % 2; alterning_style = "listrow$j" ?>
  237. <tr class="<?lsmb alterning_style -?>">
  238. <td align="center"><?lsmb overpayment_item ?> </td>
  239. <td align="center">
  240. <?lsmb item.account.accno -?>--<?lsmb item.account.description -?>
  241. <input type="hidden" id="overpayment_account_<?lsmb overpayment_item -?>" name="overpayment_account_<?lsmb overpayment_item -?>" value="<?lsmb item.account.id -?>--<?lsmb item.account.accno ?>--<?lsmb item.account.description ?>" />
  242. </td>
  243. <td align="center">
  244. <?lsmb item.cashaccount.accno -?>--<?lsmb item.cashaccount.description -?>
  245. <input type="hidden" id="overpayment_cash_account_<?lsmb overpayment_item -?>"
  246. name="overpayment_cash_account_<?lsmb overpayment_item -?>"
  247. value="<?lsmb item.cashaccount.id -?>--<?lsmb item.cashaccount.accno ?>--<?lsmb
  248. item.cashaccount.description ?>" />
  249. </td>
  250. <td align="center">
  251. <?lsmb item.source1 -?> <?lsmb item.source2 -?>
  252. <input type="hidden" id="overpayment_source1_<?lsmb overpayment_item -?>" name="overpayment_source1_<?lsmb overpayment_item -?>" value="<?lsmb item.source1 -?>" />
  253. <input type="hidden" id="overpayment_source2_<?lsmb overpayment_item -?>" name="overpayment_source2_<?lsmb overpayment_item -?>" value="<?lsmb item.source2 -?>" />
  254. </td>
  255. <td align="center">
  256. <?lsmb item.memo -?>
  257. <input type="hidden" id="overpayment_memo_<?lsmb overpayment_item -?>" name="overpayment_memo_<?lsmb overpayment_item -?>" value="<?lsmb item.memo -?>" />
  258. </td>
  259. <td align="center">
  260. <?lsmb item.amount -?>
  261. <input type="hidden" id="overpayment_topay_<?lsmb overpayment_item -?>" name="overpayment_topay_<?lsmb overpayment_item -?>" value="<?lsmb item.amount ?>" />
  262. <?lsmb overpayment_subtotal = overpayment_subtotal + item.amount -?>
  263. </td>
  264. <td align="center"><input type="checkbox" name="overpayment_checkbox_<?lsmb overpayment_item -?>"/></td>
  265. </tr>
  266. <?lsmb END -?>
  267. <?lsmb #Now we insert an empty field to process a new overpayment -?>
  268. <?lsmb overpayment_item = overpayment_item + 1;
  269. j = overpayment_item % 2;
  270. alterning_style = "listrow$j" -?>
  271. <tr class="<?lsmb alterning_style -?>">
  272. <td align="center"><?lsmb overpayment_item -?></td>
  273. <td align="center">
  274. <select id="overpayment_account_<?lsmb overpayment_item -?>" name="overpayment_account_<?lsmb overpayment_item -?>">
  275. <?lsmb FOREACH item IN overpayment_account -?>
  276. <option value="<?lsmb item.id ?>--<?lsmb item.accno ?>--<?lsmb item.description ?>"> <?lsmb item.accno ?>--<?lsmb item.description -?></option>
  277. <?lsmb END -?>
  278. </select>
  279. </td>
  280. <td align="center">
  281. <select id="overpayment_cash_account_<?lsmb overpayment_item -?>" name="overpayment_cash_account_<?lsmb overpayment_item -?>">
  282. <?lsmb FOREACH item IN account -?>
  283. <option value="<?lsmb item.id -?>--<?lsmb item.accno ?>--<?lsmb item.description ?>"><?lsmb item.description -?></option>
  284. <?lsmb END -?>
  285. </select>
  286. </td>
  287. <td align="center">
  288. <select id="overpayment_source1_<?lsmb overpayment_item -?>" name="overpayment_source1_<?lsmb overpayment_item -?>">
  289. <?lsmb FOREACH item IN source -?>
  290. <option value="<?lsmb item -?>"><?lsmb item -?></option>
  291. <?lsmb END -?>
  292. </select>
  293. <input name="overpayment_source2_<?lsmb overpayment_item -?>" id="overpayment_source2_<?lsmb overpayment_item -?>"/>
  294. <input type="hidden" name="overpayment_qty" id="overpayment_qty" value="<?lsmb overpayment_item ?>" />
  295. </td>
  296. <td align="center"><input name="overpayment_memo_<?lsmb overpayment_item -?>" id="overpayment_memo_<?lsmboverpayment_item ?>" /></td>
  297. <td align="center">
  298. <input
  299. name="overpayment_topay_<?lsmb overpayment_item -?>"
  300. id="overpayment_topay_<?lsmboverpayment_item ?>"
  301. value="<?lsmb IF unhandled_overpayment.value > 0 -?>
  302. <?lsmb unhandled_overpayment.value -?>
  303. <?lsmb END -?>"
  304. />
  305. </td>
  306. <td align="center"><input type="checkbox" name="overpayment_checkbox_<?lsmb overpayment_item -?>"/></td>
  307. </tr>
  308. <tr class="listsubtotal">
  309. <th colspan="5" align="right"><?lsmb text('Subtotal') -?></th>
  310. <th colspan="2"><?lsmb overpayment_subtotal -?>&nbsp;<?lsmb curr.value -?></th>
  311. </tr>
  312. <tr class="listtotal">
  313. <?lsmb payment_total = overpayment_subtotal + topay_subtotal -?>
  314. <th colspan="5" align="right"><?lsmb text('Total') -?></th>
  315. <th colspan="2"><?lsmb payment_total -?>&nbsp;<?lsmb curr.value -?></th>
  316. </tr>
  317. </table>
  318. <hr />
  319. <?lsmb update.accesskey = "U";
  320. update.title = "UPDATE ALT+U";
  321. update.name = "action";
  322. update.value = "payment2";
  323. update.text = text("UPDATE");
  324. INCLUDE button element_data=update -?>
  325. <?lsmb post.accesskey = "P";
  326. post.title = "POST ALT+P";
  327. post.name = "action";
  328. post.value = "post_payment";
  329. post.text = text("POST");
  330. INCLUDE button element_data=post -?>
  331. <?lsmb post_and_print.accesskey = "R";
  332. post_and_print.title = "POST AND PRINT ALT+R";
  333. post_and_print.name = "action";
  334. post_and_print.value = "post_and_print_payment";
  335. post_and_print.text = text("POST AND PRINT");;
  336. INCLUDE button element_data=post_and_print ?>
  337. <?lsmb INCLUDE select element_data=format ?>
  338. <?lsmb INCLUDE select element_data=media ?>
  339. <?lsmb FOREACH element_data IN selectedcheckboxes ?>
  340. <?lsmb # We should use a cipher here, to avoid XSS
  341. element_data.type ='hidden';
  342. element_data.value ='checked';
  343. INCLUDE input element_data?>
  344. <?lsmb END ?>
  345. <div id=div_topay_state>
  346. <?lsmb FOREACH item IN topay_state -?>
  347. <?lsmb item.type = "hidden";
  348. item.name = item.id;
  349. INCLUDE input element_data=item ?>
  350. <?lsmb END -?>
  351. </div>
  352. </form>
  353. </body>
  354. </html>