scottohara / loot

An implementation of some of the core MS Money features in Ruby on Rails
MIT License
4 stars 3 forks source link

"Add unassigned amount here" option #70

Closed scottohara closed 9 years ago

scottohara commented 10 years ago

When entering subtransactions, need an option to add any remaining unallocated amount to one of the splits.

scottohara commented 9 years ago

Add has-action class to surrounding div, then a span with the plus-sign icon; eg.

<div class="form-group has-feedback has-action" ng-class="{'has-error': amountForm.amount.$invalid}">
  ...
  <span class="form-control-feedback"><i class="action glyphicon glyphicon-plus-sign" tooltip="Add unallocated amount here" ng-click="addUnallocatedAmount($index)"></i></span>
</div>

$scope.addUnallocatedAmount = function(index) {
  $scope.transaction.subtransactions[index].amount += $scope.transaction.amount - $scopetotalAllocated;
};