projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT# 81249 - added ability to validate price plan option fields
[freeside.git]
/
FS
/
FS
/
part_pkg.pm
diff --git
a/FS/FS/part_pkg.pm
b/FS/FS/part_pkg.pm
index
fb05706
..
356c0c0
100644
(file)
--- a/
FS/FS/part_pkg.pm
+++ b/
FS/FS/part_pkg.pm
@@
-693,6
+693,14
@@
sub replace {
'';
}
'';
}
+sub validate_number {
+ my ($option, $valref) = @_;
+ $$valref = 0 unless $$valref;
+ return "Invalid $option"
+ unless ($$valref) = ($$valref =~ /^\s*(\d+)\s*$/);
+ return '';
+}
+
=item check
Checks all fields to make sure this is a valid package definition. If
=item check
Checks all fields to make sure this is a valid package definition. If