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