Relevant DiscountOrder tag rules are applied to orders on update

This commit is contained in:
Rob Harrington
2016-03-16 18:00:16 +11:00
parent bf72864c2b
commit f902474591
9 changed files with 159 additions and 68 deletions

View File

@@ -0,0 +1,11 @@
angular.module("admin.enterprises").directive "invertNumber", ->
restrict: "A"
require: "ngModel"
link: (scope, element, attrs, ngModel) ->
ngModel.$parsers.push (viewValue) ->
return -parseInt(viewValue) unless isNaN(parseInt(viewValue))
viewValue
ngModel.$formatters.push (modelValue) ->
return -parseInt(modelValue) unless isNaN(parseInt(modelValue))
modelValue