X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=74433d772b4197be109003ca90c5b2d99b9e6f26;hb=b64599c894116623746b90d184ba708d67392c65;hp=c93a950886d1009ff53d915df7cae199c3736fb2;hpb=c901bfbd9114865ce0c6fd76c6378e534c3616d5;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index c93a95088..74433d772 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -279,6 +279,10 @@ Allow self-service editing of ticket subjects, empty or 'Y' Do not call, empty or 'Y' +=item invoice_ship_address + +Display ship_address ("Service address") on invoices for this customer, empty or 'Y' + =back =head1 METHODS @@ -1589,6 +1593,7 @@ sub check { || $self->ut_currencyn('currency') || $self->ut_alphan('po_number') || $self->ut_enum('complimentary', [ '', 'Y' ]) + || $self->ut_flag('invoice_ship_address') ; foreach (qw(company ship_company)) { @@ -1633,6 +1638,11 @@ sub check { $self->ss("$1-$2-$3"); } + #turn off invoice_ship_address if ship & bill are the same + if ($self->bill_locationnum eq $self->ship_locationnum) { + $self->invoice_ship_address(''); + } + # cust_main_county verification now handled by cust_location check $error = @@ -1913,6 +1923,21 @@ sub check { $self->SUPER::check; } +=item replace_check + +Additional checks for replace only. + +=cut + +sub replace_check { + my ($new,$old) = @_; + #preserve old value if global config is set + if ($old && $conf->exists('invoice-ship_address')) { + $new->invoice_ship_address($old->invoice_ship_address); + } + return ''; +} + =item addr_fields Returns a list of fields which have ship_ duplicates.