'svc_phone' => [qw( countrycode phonenum sip_password pin )],
'svc_external' => [qw( id title )],
'location' => [qw( address1 address2 city state zip country )],
- 'quan_price' => [qw( quantity setup_fee recur_fee )],
+ 'quan_price' => [qw( quantity setup_fee recur_fee invoice_details )],
);
sub _formatfields {
'postinsert_callback' => sub {
my( $record, $param ) = @_;
+ if ( $param->{'quan_price.invoice_details'} ) {
+
+ my $weight = 0;
+ foreach my $detail (split(/\|/, $param->{'quan_price.invoice_details'})) {
+
+ my $cust_pkg_detail = new FS::cust_pkg_detail {
+ 'pkgnum' => $record->pkgnum,
+ 'detail' => $detail,
+ 'detailtype' => 'I',
+ 'weight' => $weight++,
+ };
+
+ my $error = $cust_pkg_detail->insert;
+ return "error inserting invoice detail: $error" if $error;
+
+ }
+
+ }
+
my $formatfields = _formatfields;
foreach my $svc_x ( grep /^svc/, keys %$formatfields ) {
<b>Location, quantity and price customizations with phone service</b> format has the following field order: <i>custnum<%$req%>,
pkgpart<%$req%>, discountnum,
start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
-quantity, setup_fee, recur_fee,
+quantity, setup_fee, recur_fee, invoice_details,
address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>,
countrycode, phonenum, sip_password, pin
</i>
<b>Location, quantity and price customizations with phone service and agent_custid</b> format has the following field order: <i>agent_custid<%$req%>,
pkgpart<%$req%>, discountnum,
start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
-quantity, setup_fee, recur_fee,
+quantity, setup_fee, recur_fee, invoice_details,
address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>,
countrycode, phonenum, sip_password, pin
</i>
<b>Location, quantity and price customizations with phone service and agent_custid and agent_pkgid</b> format has the following field order: <i>agent_custid<%$req%>, agent_pkgid,
pkgpart<%$req%>, discountnum,
start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
-quantity, setup_fee, recur_fee,
+quantity, setup_fee, recur_fee, invoice_details,
address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>,
countrycode, phonenum, sip_password, pin
</i>
<li><i>expire</i>: Indicates a future cancellation on this date.
+ <li><i>quantity</i>
+
+ <li><i>setup_fee</i>: Including this fee implements per-customer custom pricing for this package, overriding package definition pricing
+
+ <li><i>recur_fee</i>: Including this fee implements per-customer custom pricing for this package, overriding package definition pricing
+
+ <li><i>invoice_details</i>: Package invoice details (optionally, can include multiple lines of details separated by a newline)
+
<!--
<li><i>username</i> and <i>_password</i> are required if <i>pkgpart</i> is specified. (Extended and Extended plus company formats)
-->