X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_main%2FPackages.pm;h=1c921d604f03c9e1825daf64ac43b569f21b6412;hp=5a14e2e86d10378437e4c52b8b22a316d627b746;hb=9972d7caa7a3e1a29dc4201e0c7256ba093ea705;hpb=f5ba2c8127ef9fcbfda8c25e0eeb32d05e47fd30 diff --git a/FS/FS/cust_main/Packages.pm b/FS/FS/cust_main/Packages.pm index 5a14e2e86..1c921d604 100644 --- a/FS/FS/cust_main/Packages.pm +++ b/FS/FS/cust_main/Packages.pm @@ -74,6 +74,14 @@ Optional subject for a ticket created and attached to this customer Optional queue name for ticket additions +=item invoice_details + +Optional arrayref of invoice detail strings to add (creates cust_pkg_detail detailtype 'I') + +=item package_comments + +Optional arrayref of package comment strings to add (creates cust_pkg_detail detailtype 'C') + =back =cut @@ -208,6 +216,22 @@ sub order_pkg { } } + # add details/comments + if ($opt->{'invoice_details'}) { + $error = $cust_pkg->set_cust_pkg_detail('I', @{$opt->{'invoice_details'}}); + } + if ( $error ) { + $dbh->rollback if $oldAutoCommit; + return "setting invoice details: $error"; + } + if ($opt->{'package_comments'}) { + $error = $cust_pkg->set_cust_pkg_detail('C', @{$opt->{'package_comments'}}); + } + if ( $error ) { + $dbh->rollback if $oldAutoCommit; + return "setting package comments: $error"; + } + $dbh->commit or die $dbh->errstr if $oldAutoCommit; ''; #no error