Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. <table>
  2. <thead>
  3. <tr>
  4. <th rowspan=2>Line</th>
  5. <th>Debit Account</th>
  6. <th>Credit Account</th>
  7. <th>Ref</th>
  8. <th>Amount</th>
  9. </tr>
  10. <tr>
  11. <th>Debit Account Name</th>
  12. <th>Credit Account Name</th>
  13. <th>Date</th>
  14. <th colspan=2>Description</th>
  15. </tr>
  16. </thead>
  17. <tbody>
  18. <tr ng-repeat="dbAccount in formData.dbAccounts track by $index" ng-repeat-start="crAccount in formData.crAccounts track by $index">
  19. <td rowspan=2>0000{{$index + 1}}</td>
  20. <td>
  21. <input type="text" ng-model="dbAccount.select"/>
  22. </td>
  23. <td>
  24. <input type="text" ng-model="crAccount.select"/>
  25. </td>
  26. <td>
  27. <input type="text" ng-model="referenceNumber"/>
  28. </td>
  29. <td>
  30. <input type="text" ng-model="dbAccount.debitAmount"/>
  31. </td>
  32. </tr>
  33. <tr>
  34. <td>
  35. <input readonly type="text" ng-model="dbAccountname"/>
  36. </td>
  37. <td>
  38. <input readonly type="text" ng-model="crAccountname"/>
  39. </td>
  40. <td>
  41. <input disabled sort type="text" datepicker-pop="dd MMMM yyyy" is-open="opened" ng-model="transDate"/>
  42. </td>
  43. <td colspan=2>
  44. <input type="text" ng-model="comments" ng-keydown="$event.keyCode === 13 && addNewBatchRow($index)"/>
  45. </td>
  46. </tr>
  47. </tbody>
  48. </table>
  49.  
  50. scope.formData.crAccounts = [{}];
  51. scope.formData.dbAccounts = [{}];
  52. scope.numberOfAcceptableRows = 5;
  53.  
  54. scope.addNewBatchRow = function (index) {
  55. if(scope.numberOfCreditsDebits <= 1){
  56. scope.formData.crAccounts.push({});
  57. scope.formData.dbAccounts.push({});
  58. scope.numberOfCreditsDebits = scope.numberOfCreditsDebits + 1;
  59. } else if (scope.numberOfCreditsDebits >= scope.numberOfAcceptableRows){
  60. scope.error = "Journal entry is limmited to " + scope.numberOfAcceptableRows + " rows.";
  61. }
  62. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement