summaryrefslogtreecommitdiff
path: root/UI/payments/payment2.html
blob: 335fc7787a29e609f44762ab26594f66f1d839cb (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. <table width="100%">
  22. <tr id="top_bar" class="listtop">
  23. <th id="top_bar_header" class="listtop"><?lsmb header.text ?></th>
  24. </tr>
  25. </table>
  26. <table width="100%" id="info_table">
  27. <tr valign="top" id="info_row">
  28. <td width="50%" id="info_data">
  29. <table id="cv_info_table">
  30. <tr id="cv_row">
  31. <th class="label_left" id="cv_label_column"><?lsmb text('Vendor') ?></th>
  32. <td id="cv_column">
  33. <?lsmb vc.name ?><?lsmb vendorcustomer.type = 'hidden'; INCLUDE input element_data=vendorcustomer?>
  34. </td>
  35. </tr>
  36. <tr id="cv_address_row">
  37. <th valign="top" align="right" id="cv_address_label_column"><?lsmb text('Location') ?></th>
  38. <td id="cv_address_column">
  39. <table id="cv_address_table">
  40. <?lsmb # this table will show the customer/vendor address, city, phone and others things that could help to reminds them?>
  41. <?lsmb FOREACH address IN vc.address # Loop through customer/vendor address info ?>
  42. <tr>
  43. <td><?lsmb address.text ?></td>
  44. </tr>
  45. <?lsmb END ?>
  46. </table>
  47. </td>
  48. </tr>
  49. <tr align="right" id="notes_row">
  50. <th valign="top" id="notes_column"><?lsmb text('Notes') ?></th>
  51. <td><textarea id="notes" name="notes" cols="35" rows="3"><?lsmb notes ?></textarea></td>
  52. </tr>
  53. </table>
  54. </td>
  55. <td align="right">
  56. <table>
  57. <?lsmb # the project will be shown if it was selected in the first step ?>
  58. <?lsmb IF project.value # Only process element if the value exists. ?>
  59. <tr id="project_row">
  60. <th align="right" nowrap id="project_label_column"><?lsmb text('Projects') ?>:</th>
  61. <td colspan="2" id="project_column">
  62. <?lsmb project.text ?>
  63. <?lsmb project.type="hidden"; INCLUDE input element_data=project ?>
  64. </td>
  65. </tr>
  66. <?lsmb END ?>
  67. <?lsmb #the department will be shown if it was selected in the first step ?>
  68. <?lsmb IF department.value # Only process element if one exists. As in project above ?>
  69. <tr id="department-row">
  70. <th align="right" nowrap id="department_label_column"><?lsmb text('Department') ?>:</th>
  71. <td colspan="2" id="department_column">
  72. <?lsmb department.text ?>
  73. <?lsmb department.type="hidden"; INCLUDE input element_data=department ?>
  74. </td>
  75. </tr>
  76. <?lsmb END ?>
  77. <tr id="account_row">
  78. <?lsmb #here goes all the posible accounts were the paid can be done ?>
  79. <th align="right" nowrap id="account_label_column"><?lsmb text('Account') ?></th>
  80. <td colspan="2" id="account_column">
  81. <select id="account" name="account">
  82. <?lsmb FOREACH item IN account -?>
  83. <option value="<?lsmb item.id -?>" <?lsmb IF item.id == selected_account -?> selected <?lsmb END ?>><?lsmb item.description -?></option>
  84. <?lsmb END -?>
  85. </select>
  86. </td>
  87. </tr>
  88. <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 ?>
  89. <th align="right" nowrap id="date_label_column"><?lsmb text('Date') ?></th>
  90. <td colspan="2" id="date_column"> <?lsmb INCLUDE input element_data=datepaid ?> </td>
  91. </tr>
  92. <tr id="source_row">
  93. <?lsmb # here goes all the posible sources wich we can use -?>
  94. <th align="right" nowrap id="source_label_column"><?lsmb text('Source')?></th>
  95. <td width="28%" id="source_column">
  96. <select id="source" name="source">
  97. <?lsmb FOREACH item IN source -?>
  98. <option value="<?lsmb item -?>"<?lsmb IF item == selected_source -?> selected <?lsmb END ?>><?lsmb item -?></option>
  99. <?lsmb END -?>
  100. </select>
  101. </td>
  102. <td id="source_text_column">
  103. <?lsmb INCLUDE input element_data={ name => 'source_value'
  104. id => 'source_value'
  105. value => source_value } -?>
  106. </td>
  107. </tr>
  108. <tr id="currency_row">
  109. <?lsmb # here goes the selected currency in step 1 ?>
  110. <th align="right" id="currency_label_column"><?lsmb text('Currency') -?>:</th>
  111. <td id="currency_column">
  112. <?lsmb curr.value -?><?lsmb curr.type='hidden'; INCLUDE input element_data=curr -?>
  113. </td>
  114. </tr>
  115. <?lsmb # here goes the exchange rate of the selected currency, it can be done by the ajax script or the update button ?>
  116. <?lsmb IF defaultcurrency.text != curr.text # Only process element if one exists. ?>
  117. <tr id="exrate_row">
  118. <th valig="top" align="right" id="exrate_label_column"><?lsmb text('Exchange Rate') ?>:</th>
  119. <td id="exrate_column">
  120. <?lsmb IF exrate.value -?>
  121. <?lsmb exrate.text -?>
  122. <?lsmb exrate.type='hidden'; INCLUDE input element_data=exrate -?>
  123. <?lsmb END -?>
  124. <?lsmb IF !exrate.value -?>
  125. <?lsmb INCLUDE input element_data=exrate -?>
  126. <?lsmb END -?>
  127. </td>
  128. </tr>
  129. <?lsmb END ?>
  130. </table>
  131. </td>
  132. </tr>
  133. </table>
  134. <table width="100%">
  135. <tr class="listheading">
  136. <?lsmb FOREACH column IN column_headers # Loop through columns ?>
  137. <th class="listheading"><?lsmb column.text ?></th>
  138. <?lsmb END ?>
  139. </tr>
  140. <?lsmb # We have to clear i for later usage :) ?>
  141. <?lsmb i = '0'; topay_subtotal = 0 -?>
  142. <?lsmb FOREACH row IN rows ?>
  143. <?lsmb i = i + 1; j = i % 2; alterning_style = "listrow$j" ?>
  144. <tr class="<?lsmb alterning_style ?>"=>
  145. <td><a href="<?lsmb row.invoice.href ?>"><?lsmb row.invoice.number ?></a>
  146. <input type="hidden" value="<?lsmb row.invoice.id ?>" /> </td>
  147. <?lsmb # we can use an href to link this invoice number to the invoice ?>
  148. <td><?lsmb row.invoice_date ?></td>
  149. <td><?lsmb row.amount ?></td>
  150. <td><?lsmb row.paid ?></td>
  151. <td><?lsmb row.due ?></td>
  152. <?lsmb IF defaultcurrency.text != curr.value ?>
  153. <td><?lsmb row.exchange_rate ?></td>
  154. <td><?lsmb row.due_fx ?></td>
  155. <td><div id="<?lsmb "div_topay_invoice_$i" ?>"><?lsmb row.topay ?></div></td>
  156. <?lsmb END ?>
  157. <?lsmb #This should be computed and updated to the div using ?>
  158. <td><?lsmb INCLUDE input element_data=row.topay_fx;
  159. topay_subtotal = topay_subtotal + row.topay_fx.value -?>
  160. <?lsmb # A DEGRADABLE JAVASCRIPT IS USED, BECAUSE OF THE VISUAL IMPACT
  161. # THAT CAUSES THE SIZE OF THIS DIV -?>
  162. <img src="UI/payments/img/up.gif" id="button_topay_<?lsmb row.invoice.id ?>" name="<?lsmb "button_topay_$i" ?>"
  163. onClick="maximize_minimize('div_topay_<?lsmb row.invoice.id ?>',
  164. 'topaystate_<?lsmb row.invoice.id ?>' ,this,
  165. 'UI/payments/img/down.gif', 'UI/payments/img/up.gif')">
  166. <div id="div_topay_<?lsmb row.invoice.id ?>">
  167. <table>
  168. <tr id="<?lsmb "account-row$i"?>">
  169. <?lsmb # here goes all the posible accounts were the paid can be done ?>
  170. <th align="right" nowrap id="<?lsmb "account_label_column$i" ?>"><?lsmb text('Account') ?></th>
  171. <td colspan="2" id="<?lsmb "account_column$i" ?>">
  172. <select id="account_<?lsmb row.invoice.id -?>" name="account_<?lsmb row.invoice.id -?>">
  173. <?lsmb FOREACH item IN account -?>
  174. <option value="<?lsmb item.id -?>" <?lsmb IF item.id == row.selected_account -?> selected <?lsmb END ?>><?lsmb item.description -?></option>
  175. <?lsmb END -?>
  176. </select>
  177. </td>
  178. </tr>
  179. <tr id="<?lsmb "source_row$i" ?>">
  180. <?lsmb # here goes all the posible sources wich we can used ?>
  181. <th align="right" nowrap id="<?lsmb "source_label_column$i" ?>"><?lsmb text('Source') ?></th>
  182. <td width="28%" id="<?lsmb "source_column$i" ?>">
  183. <select id="source_<?lsmb row.invoice.id -?>" name="source_<?lsmb row.invoice.id -?>">
  184. <?lsmb FOREACH item IN source -?>
  185. <option value="<?lsmb item -?>"<?lsmb IF item == row.selected_source -?> selected <?lsmb END ?>><?lsmb item -?></option>
  186. <?lsmb END -?>
  187. </select>
  188. </td>
  189. <td><?lsmb INCLUDE input element_data={
  190. name => "source_text_$row.invoice.id",
  191. id => "source_text_$row.invoice.id",
  192. value => row.source_text
  193. } -?></td>
  194. <td nowrap align="left"><input name="<?lsmb "optional_pay_$row.invoice.id" -?>" id="<?lsmb "optional_pay_$row.invoice.id" -?>" type="checkbox" class="checkbox"
  195. <?lsmb IF row.optional -?> checked <?lsmb END -?>></td>
  196. </tr>
  197. </table>
  198. </div>
  199. </td>
  200. <td valign="MIDDLE"><input type="checkbox" name="checkbox_<?lsmb row.invoice.id ?>"></td>
  201. <?lsmb END ?>
  202. </tr>
  203. <?lsmb IF exrate.text == 1 -?>
  204. <?lsmb colspan = 5 # We will use this later on totals -?>
  205. <?lsmb ELSE -?>
  206. <?lsmb colspan = 8 # We will use this later on totals -?>
  207. <?lsmb END -?>
  208. <tr class="listsubtotal">
  209. <th colspan="<?lsmb colspan -?>" align="right"><?lsmb text('Subtotal') -?></th>
  210. <th colspan="2"><?lsmb topay_subtotal -?>&nbsp;<?lsmb curr.value -?></th>
  211. </tr>
  212. </table>
  213. <table width="100%">
  214. <tr>
  215. <th class="listheading" colspan="5" ><?lsmb text('OVERPAYMENT / ADVANCED PAYMENT / PREPAYMENT') ?></th>
  216. </tr>
  217. <tr>
  218. <th class="listheading"><?lsmb text('Item') ?></th>
  219. <th class="listheading"><?lsmb text('Account') ?></th>
  220. <th class="listheading"><?lsmb text('Source') ?></th>
  221. <th class="listheading"><?lsmb text('Amount') ?></th>
  222. <th class="listheading">X</th>
  223. </tr>
  224. <?lsmb # We have to insert the overpayment data -?>
  225. <?lsmb overpayment_item = 0; overpayment_subtotal = 0 -?>
  226. <?lsmb FOREACH item IN overpayment -?>
  227. <?lsmb overpayment_item = overpayment_item + 1 -?>
  228. <?lsmb j = overpayment_item % 2; alterning_style = "listrow$j" ?>
  229. <tr class="<?lsmb alterning_style -?>">
  230. <td align="center"><?lsmb overpayment_item ?> </td>
  231. <td align="center">
  232. <?lsmb item.account.accno -?>--<?lsmb item.account.description -?>
  233. <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 ?>" />
  234. </td>
  235. <td align="center">
  236. <?lsmb item.source1 -?> <?lsmb item.source2 -?>
  237. <input type="hidden" id="overpayment_source1_<?lsmb overpayment_item -?>" name="overpayment_source1_<?lsmb overpayment_item -?>" value="<?lsmb item.source1 -?>" />
  238. <input type="hidden" id="overpayment_source2_<?lsmb overpayment_item -?>" name="overpayment_source2_<?lsmb overpayment_item -?>" value="<?lsmb item.source2 -?>" />
  239. </td>
  240. <td align="center">
  241. <?lsmb item.amount -?>
  242. <input type="hidden" id="overpayment_topay_<?lsmb overpayment_item -?>" name="overpayment_topay_<?lsmb overpayment_item -?>" value="<?lsmb item.amount ?>" />
  243. <?lsmb overpayment_subtotal = overpayment_subtotal + item.amount -?>
  244. </td>
  245. <td align="center"><input type="checkbox" name="overpayment_checkbox_<?lsmb overpayment_item -?>"/></td>
  246. </tr>
  247. <?lsmb END -?>
  248. <?lsmb #Now we insert an empty field to process a new overpayment -?>
  249. <?lsmb overpayment_item = overpayment_item + 1;
  250. j = overpayment_item % 2;
  251. alterning_style = "listrow$j" -?>
  252. <tr class="<?lsmb alterning_style -?>">
  253. <td align="center"><?lsmb overpayment_item -?></td>
  254. <td align="center">
  255. <select id="overpayment_account_<?lsmb overpayment_item -?>" name="overpayment_account_<?lsmb overpayment_item -?>">
  256. <?lsmb FOREACH item IN overpayment_account -?>
  257. <option value="<?lsmb item.id ?>--<?lsmb item.accno ?>--<?lsmb item.description ?>"> <?lsmb item.accno ?>--<?lsmb item.description -?></option>
  258. <?lsmb END -?>
  259. </select>
  260. </td>
  261. <td align="center">
  262. <select id="overpayment_source1_<?lsmb overpayment_item -?>" name="overpayment_source1_<?lsmb overpayment_item -?>">
  263. <?lsmb FOREACH item IN source -?>
  264. <option value="<?lsmb item -?>"><?lsmb item -?></option>
  265. <?lsmb END -?>
  266. </select>
  267. <input name="overpayment_source2_<?lsmb overpayment_item ?>" id="overpayment_source2_<?lsmb overpayment_item ?>" />
  268. <input type="hidden" name="overpayment_qty" id="overpayment_qty" value="<?lsmb overpayment_item ?>" />
  269. </td>
  270. <td align="center"><input name="overpayment_topay_<?lsmb overpayment_item -?>" id="overpayment_topay_<?lsmboverpayment_item ?>" /></td>
  271. <td align="center"><input type="checkbox" name="overpayment_checkbox_<?lsmb overpayment_item -?>"/></td>
  272. </tr>
  273. <tr class="listsubtotal">
  274. <th colspan="3" align="right"><?lsmb text('Subtotal') -?></th>
  275. <th colspan="2"><?lsmb overpayment_subtotal -?>&nbsp;<?lsmb curr.value -?></th>
  276. </tr>
  277. <tr class="listtotal">
  278. <?lsmb payment_total = overpayment_subtotal + topay_subtotal -?>
  279. <th colspan="3" align="right"><?lsmb text('Total') -?></th>
  280. <th colspan="2"><?lsmb payment_total -?>&nbsp;<?lsmb curr.value -?></th>
  281. </tr>
  282. </table>
  283. <hr />
  284. <?lsmb update.accesskey = "U";
  285. update.title = "UPDATE ALT+U";
  286. update.name = "action";
  287. update.value = "payment2";
  288. update.text = text("UPDATE");
  289. INCLUDE button element_data=update -?>
  290. <?lsmb post.accesskey = "P";
  291. post.title = "POST ALT+P";
  292. post.name = "action";
  293. post.value = "post";
  294. post.text = text("POST");
  295. INCLUDE button element_data=post -?>
  296. <?lsmb post_and_print.accesskey = "R";
  297. post_and_print.title = "POST AND PRINT ALT+R";
  298. post_and_print.name = "action";
  299. post_and_print.value = "post_and_print";
  300. post_and_print.text = text("POST AND PRINT");;
  301. INCLUDE button element_data=post_and_print ?>
  302. <?lsmb INCLUDE select element_data=format ?>
  303. <?lsmb INCLUDE select element_data=media ?>
  304. <?lsmb FOREACH element_data IN selectedcheckboxes ?>
  305. <?lsmb # We should use a cipher here, to avoid XSS
  306. element_data.type ='hidden';
  307. element_data.value ='checked';
  308. INCLUDE input element_data?>
  309. <?lsmb END ?>
  310. <div id=div_topay_state>
  311. <?lsmb FOREACH item IN topay_state -?>
  312. <?lsmb item.type = "hidden";
  313. item.name = item.id;
  314. INCLUDE input element_data=item ?>
  315. <?lsmb END -?>
  316. </div>
  317. </form>
  318. </body>
  319. </html>