Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <table>
- <thead>
- <tr>
- <th rowspan=2>Line</th>
- <th>Debit Account</th>
- <th>Credit Account</th>
- <th>Ref</th>
- <th>Amount</th>
- </tr>
- <tr>
- <th>Debit Account Name</th>
- <th>Credit Account Name</th>
- <th>Date</th>
- <th colspan=2>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr ng-repeat="dbAccount in formData.dbAccounts track by $index" ng-repeat-start="crAccount in formData.crAccounts track by $index">
- <td rowspan=2>0000{{$index + 1}}</td>
- <td>
- <input type="text" ng-model="dbAccount.select"/>
- </td>
- <td>
- <input type="text" ng-model="crAccount.select"/>
- </td>
- <td>
- <input type="text" ng-model="referenceNumber"/>
- </td>
- <td>
- <input type="text" ng-model="dbAccount.debitAmount"/>
- </td>
- </tr>
- <tr>
- <td>
- <input readonly type="text" ng-model="dbAccountname"/>
- </td>
- <td>
- <input readonly type="text" ng-model="crAccountname"/>
- </td>
- <td>
- <input disabled sort type="text" datepicker-pop="dd MMMM yyyy" is-open="opened" ng-model="transDate"/>
- </td>
- <td colspan=2>
- <input type="text" ng-model="comments" ng-keydown="$event.keyCode === 13 && addNewBatchRow($index)"/>
- </td>
- </tr>
- </tbody>
- </table>
- scope.formData.crAccounts = [{}];
- scope.formData.dbAccounts = [{}];
- scope.numberOfAcceptableRows = 5;
- scope.addNewBatchRow = function (index) {
- if(scope.numberOfCreditsDebits <= 1){
- scope.formData.crAccounts.push({});
- scope.formData.dbAccounts.push({});
- scope.numberOfCreditsDebits = scope.numberOfCreditsDebits + 1;
- } else if (scope.numberOfCreditsDebits >= scope.numberOfAcceptableRows){
- scope.error = "Journal entry is limmited to " + scope.numberOfAcceptableRows + " rows.";
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement