X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FConf.pm;h=279a4dfe8c4b1d4979ddf4c92e0193082b922223;hb=f13c9d8580d02851b150e21ea9beb6fc1dfbd3c8;hp=e584f0042e851e4e7e64893d8308a34905e1e543;hpb=03c12b4dabfcaabc218f39ee13557edebc13931d;p=freeside.git diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index e584f0042..279a4dfe8 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -1233,9 +1233,24 @@ sub reason_type_options { { 'key' => 'invoice_from', 'section' => 'required', - 'description' => 'Return address on email invoices', + 'description' => 'Return address on email invoices (address only, see invoice_from_name)', 'type' => 'text', 'per_agent' => 1, + 'validate' => sub { $_[0] =~ + /^[^@]+\@[[:alnum:]-]+(\.[[:alnum:]-]+)+$/ + ? '' : 'Invalid email address'; + } + }, + + { + 'key' => 'invoice_from_name', + 'section' => 'invoicing', + 'description' => 'Return name on email invoices (set address in invoice_from)', + 'type' => 'text', + 'per_agent' => 1, + 'validate' => sub { (($_[0] =~ /[^[:alnum:][:space:]]/) && ($_[0] !~ /^\".*\"$/)) + ? 'Invalid name. Use quotation marks around names that contain punctuation.' + : '' } }, { @@ -2622,7 +2637,7 @@ and customer address. Include units.', 'section' => 'billing', 'description' => 'Available payment types.', 'type' => 'selectmultiple', - 'select_enum' => [ qw(CARD DCRD CHEK DCHK BILL CASH WEST MCRD PPAL COMP) ], + 'select_enum' => [ qw(CARD DCRD CHEK DCHK BILL CASH WEST MCRD MCHK PPAL COMP) ], }, {