summaryrefslogtreecommitdiff
path: root/UI/payments/payment2.html
blob: e28243493ee5a9da95a6e6b2209b5e29e7efaad8 (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 ?>"><?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><?lsmb row.due ?></td>
  159. <?lsmb IF defaultcurrency.text != curr.value ?>
  160. <td><?lsmb row.exchange_rate ?></td>
  161. <td><?lsmb row.due_fx ?></td>
  162. <td><div id="<?lsmb "div_topay_invoice_$i" ?>"><?lsmb row.topay ?></div></td>
  163. <?lsmb END ?>
  164. <?lsmb #This should be computed and updated to the div using ?>
  165. <td><?lsmb row.topay_fx.id = row.topay_fx.name ;INCLUDE input element_data=row.topay_fx;
  166. topay_subtotal = topay_subtotal + row.topay_fx.value -?>
  167. <?lsmb # A DEGRADABLE JAVASCRIPT IS USED, BECAUSE OF THE VISUAL IMPACT
  168. # THAT CAUSES THE SIZE OF THIS DIV -?>
  169. <img src="UI/payments/img/up.gif" id="button_topay_<?lsmb row.invoice.id ?>" name="<?lsmb "button_topay_$i" ?>"
  170. onClick="maximize_minimize('div_topay_<?lsmb row.invoice.id ?>',
  171. 'topaystate_<?lsmb row.invoice.id ?>' ,this,
  172. 'UI/payments/img/down.gif', 'UI/payments/img/up.gif')">
  173. <div id="div_topay_<?lsmb row.invoice.id ?>">
  174. <table>
  175. <tr id="<?lsmb "account-row$i"?>">
  176. <?lsmb # here goes all the posible accounts were the paid can be done ?>
  177. <th align="right" nowrap id="<?lsmb "account_label_column$i" ?>"><?lsmb text('Account') ?></th>
  178. <td colspan="2" id="<?lsmb "account_column$i" ?>">
  179. <select id="account_<?lsmb row.invoice.id -?>" name="account_<?lsmb row.invoice.id -?>">
  180. <?lsmb FOREACH item IN account -?>
  181. <option value="<?lsmb item.id -?>" <?lsmb IF item.id == row.selected_account -?> selected <?lsmb END ?>><?lsmb item.description -?></option>
  182. <?lsmb END -?>
  183. </select>
  184. </td>
  185. </tr>
  186. <tr id="<?lsmb "source_row$i" ?>">
  187. <?lsmb # here goes all the posible sources wich we can used ?>
  188. <th align="right" nowrap id="<?lsmb "source_label_column$i" ?>"><?lsmb text('Source') ?></th>
  189. <td width="28%" id="<?lsmb "source_column$i" ?>">
  190. <select id="source_<?lsmb row.invoice.id -?>" name="source_<?lsmb row.invoice.id -?>">
  191. <?lsmb FOREACH item IN source -?>
  192. <option value="<?lsmb item -?>"<?lsmb IF item == row.selected_source -?> selected <?lsmb END ?>><?lsmb item -?></option>
  193. <?lsmb END -?>
  194. </select>
  195. </td>
  196. <td><?lsmb INCLUDE input element_data={
  197. name => "source_text_$row.invoice.id",
  198. id => "source_text_$row.invoice.id",
  199. value => row.source_text
  200. } -?></td>
  201. <td nowrap align="left"><input name="<?lsmb "optional_pay_$row.invoice.id" -?>" id="<?lsmb "optional_pay_$row.invoice.id" -?>" type="checkbox" class="checkbox"
  202. <?lsmb IF row.optional -?> checked <?lsmb END -?>></td>
  203. </tr>
  204. </table>
  205. </div>
  206. </td>
  207. <td valign="MIDDLE"><input type="checkbox" name="checkbox_<?lsmb row.invoice.id ?>"></td>
  208. <?lsmb END ?>
  209. </tr>
  210. <?lsmb colspan = column_count - 2 # We will use this later on totals -?>
  211. <tr class="listsubtotal">
  212. <th colspan="<?lsmb colspan -?>" align="right"><?lsmb text('Subtotal') -?></th>
  213. <th colspan="2"><?lsmb topay_subtotal -?>&nbsp;<?lsmb curr.value -?></th>
  214. </tr>
  215. </table>
  216. <table width="100%">
  217. <tr>
  218. <th class="listheading" colspan="7" ><?lsmb text('OVERPAYMENT / ADVANCED PAYMENT / PREPAYMENT') ?></th>
  219. </tr>
  220. <tr>
  221. <th class="listheading"><?lsmb text('Item') ?></th>
  222. <th class="listheading"><?lsmb text('Account') ?></th>
  223. <th class="listheading"><?lsmb text('Cash Account')?></th>
  224. <th class="listheading"><?lsmb text('Source') ?></th>
  225. <th class="listheading"><?lsmb text('Memo') ?></th>
  226. <th class="listheading"><?lsmb text('Amount') ?></th>
  227. <th class="listheading">X</th>
  228. </tr>
  229. <?lsmb # We have to insert the overpayment data -?>
  230. <?lsmb overpayment_item = 0; overpayment_subtotal = 0 -?>
  231. <?lsmb FOREACH item IN overpayment -?>
  232. <?lsmb overpayment_item = overpayment_item + 1 -?>
  233. <?lsmb j = overpayment_item % 2; alterning_style = "listrow$j" ?>
  234. <tr class="<?lsmb alterning_style -?>">
  235. <td align="center"><?lsmb overpayment_item ?> </td>
  236. <td align="center">
  237. <?lsmb item.account.accno -?>--<?lsmb item.account.description -?>
  238. <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 ?>" />
  239. </td>
  240. <td align="center">
  241. <?lsmb item.cashaccount.accno -?>--<?lsmb item.cashaccount.description -?>
  242. <input type="hidden" id="overpayment_cash_account_<?lsmb overpayment_item -?>"
  243. name="overpayment_cash_account_<?lsmb overpayment_item -?>"
  244. value="<?lsmb item.cashaccount.id -?>--<?lsmb item.cashaccount.accno ?>--<?lsmb
  245. item.cashaccount.description ?>" />
  246. </td>
  247. <td align="center">
  248. <?lsmb item.source1 -?> <?lsmb item.source2 -?>
  249. <input type="hidden" id="overpayment_source1_<?lsmb overpayment_item -?>" name="overpayment_source1_<?lsmb overpayment_item -?>" value="<?lsmb item.source1 -?>" />
  250. <input type="hidden" id="overpayment_source2_<?lsmb overpayment_item -?>" name="overpayment_source2_<?lsmb overpayment_item -?>" value="<?lsmb item.source2 -?>" />
  251. </td>
  252. <td align="center">
  253. <?lsmb item.memo -?>
  254. <input type="hidden" id="overpayment_memo_<?lsmb overpayment_item -?>" name="overpayment_memo_<?lsmb overpayment_item -?>" value="<?lsmb item.memo -?>" />
  255. </td>
  256. <td align="center">
  257. <?lsmb item.amount -?>
  258. <input type="hidden" id="overpayment_topay_<?lsmb overpayment_item -?>" name="overpayment_topay_<?lsmb overpayment_item -?>" value="<?lsmb item.amount ?>" />
  259. <?lsmb overpayment_subtotal = overpayment_subtotal + item.amount -?>
  260. </td>
  261. <td align="center"><input type="checkbox" name="overpayment_checkbox_<?lsmb overpayment_item -?>"/></td>
  262. </tr>
  263. <?lsmb END -?>
  264. <?lsmb #Now we insert an empty field to process a new overpayment -?>
  265. <?lsmb overpayment_item = overpayment_item + 1;
  266. j = overpayment_item % 2;
  267. alterning_style = "listrow$j" -?>
  268. <tr class="<?lsmb alterning_style -?>">
  269. <td align="center"><?lsmb overpayment_item -?></td>
  270. <td align="center">
  271. <select id="overpayment_account_<?lsmb overpayment_item -?>" name="overpayment_account_<?lsmb overpayment_item -?>">
  272. <?lsmb FOREACH item IN overpayment_account -?>
  273. <option value="<?lsmb item.id ?>--<?lsmb item.accno ?>--<?lsmb item.description ?>"> <?lsmb item.accno ?>--<?lsmb item.description -?></option>
  274. <?lsmb END -?>
  275. </select>
  276. </td>
  277. <td align="center">
  278. <select id="overpayment_cash_account_<?lsmb overpayment_item -?>" name="overpayment_cash_account_<?lsmb overpayment_item -?>">
  279. <?lsmb FOREACH item IN account -?>
  280. <option value="<?lsmb item.id -?>--<?lsmb item.accno ?>--<?lsmb item.description ?>"><?lsmb item.description -?></option>
  281. <?lsmb END -?>
  282. </select>
  283. </td>
  284. <td align="center">
  285. <select id="overpayment_source1_<?lsmb overpayment_item -?>" name="overpayment_source1_<?lsmb overpayment_item -?>">
  286. <?lsmb FOREACH item IN source -?>
  287. <option value="<?lsmb item -?>"><?lsmb item -?></option>
  288. <?lsmb END -?>
  289. </select>
  290. <input name="overpayment_source2_<?lsmb overpayment_item ?>" id="overpayment_source2_<?lsmb overpayment_item ?>" />
  291. <input type="hidden" name="overpayment_qty" id="overpayment_qty" value="<?lsmb overpayment_item ?>" />
  292. </td>
  293. <td align="center"><input name="overpayment_memo_<?lsmb overpayment_item -?>" id="overpayment_memo_<?lsmboverpayment_item ?>" /></td>
  294. <td align="center"><input name="overpayment_topay_<?lsmb overpayment_item -?>" id="overpayment_topay_<?lsmboverpayment_item ?>" /></td>
  295. <td align="center"><input type="checkbox" name="overpayment_checkbox_<?lsmb overpayment_item -?>"/></td>
  296. </tr>
  297. <tr class="listsubtotal">
  298. <th colspan="5" align="right"><?lsmb text('Subtotal') -?></th>
  299. <th colspan="2"><?lsmb overpayment_subtotal -?>&nbsp;<?lsmb curr.value -?></th>
  300. </tr>
  301. <tr class="listtotal">
  302. <?lsmb payment_total = overpayment_subtotal + topay_subtotal -?>
  303. <th colspan="5" align="right"><?lsmb text('Total') -?></th>
  304. <th colspan="2"><?lsmb payment_total -?>&nbsp;<?lsmb curr.value -?></th>
  305. </tr>
  306. </table>
  307. <hr />
  308. <?lsmb update.accesskey = "U";
  309. update.title = "UPDATE ALT+U";
  310. update.name = "action";
  311. update.value = "payment2";
  312. update.text = text("UPDATE");
  313. INCLUDE button element_data=update -?>
  314. <?lsmb post.accesskey = "P";
  315. post.title = "POST ALT+P";
  316. post.name = "action";
  317. post.value = "post_payment";
  318. post.text = text("POST");
  319. INCLUDE button element_data=post -?>
  320. <?lsmb post_and_print.accesskey = "R";
  321. post_and_print.title = "POST AND PRINT ALT+R";
  322. post_and_print.name = "action";
  323. post_and_print.value = "post_and_print_payment";
  324. post_and_print.text = text("POST AND PRINT");;
  325. INCLUDE button element_data=post_and_print ?>
  326. <?lsmb INCLUDE select element_data=format ?>
  327. <?lsmb INCLUDE select element_data=media ?>
  328. <?lsmb FOREACH element_data IN selectedcheckboxes ?>
  329. <?lsmb # We should use a cipher here, to avoid XSS
  330. element_data.type ='hidden';
  331. element_data.value ='checked';
  332. INCLUDE input element_data?>
  333. <?lsmb END ?>
  334. <div id=div_topay_state>
  335. <?lsmb FOREACH item IN topay_state -?>
  336. <?lsmb item.type = "hidden";
  337. item.name = item.id;
  338. INCLUDE input element_data=item ?>
  339. <?lsmb END -?>
  340. </div>
  341. </form>
  342. </body>
  343. </html>