summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2003-02-06 05:26:50 +0000
committerivan <ivan>2003-02-06 05:26:50 +0000
commitc232fac0743999105f6948b9fa352fe2293b09f8 (patch)
treecfeb31670fdedeeefd286d58fa6bef2e0d9e1095 /httemplate
parent6e2dcb26245ef419438f60e99c91873a8d762625 (diff)
time/data detail on invoices
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/docs/schema.html7
-rw-r--r--httemplate/docs/upgrade10.html11
-rwxr-xr-xhttemplate/edit/part_pkg.cgi6
3 files changed, 21 insertions, 3 deletions
diff --git a/httemplate/docs/schema.html b/httemplate/docs/schema.html
index b4d21f3..6522b04 100644
--- a/httemplate/docs/schema.html
+++ b/httemplate/docs/schema.html
@@ -59,6 +59,13 @@
<li>edate - ending date
<li>itemdesc - Line item description (currently used only when pkgnum is 0)
</ul>
+ <li><a name="cust_bill_pkg_detail" href="man/FS/cust_bill_pkg_detail.html">cust_bill_pkg_detail</a> - Invoice line items detail
+ <ul>
+ <li>detailnum - primary key
+ <li>pkgnum -
+ <li>invnum -
+ <li>detail - Detail description
+ </ul>
<li><a name="cust_credit" href="man/FS/cust_credit.html">cust_credit</a> - Credits. The equivalent of a negative <a href="#cust_bill">cust_bill</a> record.
<ul>
<li>crednum - primary key
diff --git a/httemplate/docs/upgrade10.html b/httemplate/docs/upgrade10.html
new file mode 100644
index 0000000..7aa26f6
--- /dev/null
+++ b/httemplate/docs/upgrade10.html
@@ -0,0 +1,11 @@
+this is very incomplete
+
+CREATE TABLE cust_bill_pkg_detail (
+ detailnum serial,
+ pkgnum int NOT NULL,
+ invnum int NOT NULL,
+ detail varchar(80),
+ PRIMARY KEY (detailnum)
+);
+CREATE INDEX cust_bill_pkg_detail1 ON cust_bill_pkg_detail ( pkgnum, invnum );
+
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
index 1fd6349..851d3aa 100755
--- a/httemplate/edit/part_pkg.cgi
+++ b/httemplate/edit/part_pkg.cgi
@@ -395,7 +395,7 @@ tie my %plans, 'Tie::IxHash',
},
'fieldorder' => [qw( setup_fee recur_flat recur_included_hours recur_hourly_charge recur_included_input recur_input_charge recur_included_output recur_output_charge recur_included_total recur_total_charge )],
'setup' => 'what.setup_fee.value',
- 'recur' => '\'my $last_bill = $cust_pkg->last_bill; my $hours = $cust_pkg->seconds_since_sqlradacct($last_bill, $sdate ) / 3600 - \' + what.recur_included_hours.value + \'; $hours = 0 if $hours < 0; my $input = $cust_pkg->attribute_since_sqlradacct($last_bill, $sdate, \"AcctInputOctets\" ) / 1048576; my $output = $cust_pkg->attribute_since_sqlradacct($last_bill, $sdate, \"AcctOutputOctets\" ) / 1048576; my $total = $input + $output - \' + what.recur_included_total.value + \'; $total = 0 if $total < 0; my $input = $input - \' + what.recur_included_input.value + \'; $input = 0 if $input < 0; my $output = $output - \' + what.recur_included_output.value + \'; $output = 0 if $output < 0; \' + what.recur_flat.value + \' + \' + what.recur_hourly_charge.value + \' * $hours + \' + what.recur_input_charge.value + \' * $input + \' + what.recur_output_charge.value + \' * $output + \' + what.recur_total_charge.value + \' * $total ;\'',
+ 'recur' => '\'my $last_bill = $cust_pkg->last_bill; my $hours = $cust_pkg->seconds_since_sqlradacct($last_bill, $sdate ) / 3600 - \' + what.recur_included_hours.value + \'; $hours = 0 if $hours < 0; my $input = $cust_pkg->attribute_since_sqlradacct($last_bill, $sdate, \"AcctInputOctets\" ) / 1048576; my $output = $cust_pkg->attribute_since_sqlradacct($last_bill, $sdate, \"AcctOutputOctets\" ) / 1048576; my $total = $input + $output - \' + what.recur_included_total.value + \'; $total = 0 if $total < 0; my $input = $input - \' + what.recur_included_input.value + \'; $input = 0 if $input < 0; my $output = $output - \' + what.recur_included_output.value + \'; $output = 0 if $output < 0; my $totalcharge = sprintf(\"%.2f\", \' + what.recur_total_charge.value + \' * $total); my $hourscharge = sprintf(\"%.2f\", \' + what.recur_hourly_charge.value + \' * $hours); push @details, \"Last month\\\'s excess data \". sprintf(\"%.1f\", $total). \" megs: \\\$$totalcharge\", \"Last month\\\'s excess time \". sprintf(\"%.1f\", $hours). \" hours: \\\$$hourscharge\"; \' + what.recur_flat.value + \' + $hourscharge + \' + what.recur_input_charge.value + \' * $input + \' + what.recur_output_charge.value + \' * $output + $totalcharge ;\'',
},
;
@@ -485,11 +485,11 @@ my $widget = new HTML::Widgets::SelectLayers(
'<TR><TD>'.
'<FONT SIZE="1">Setup expression<BR>'.
'<INPUT TYPE="text" NAME="setup" SIZE="160" VALUE="'.
- $hashref->{setup}. '" onLoad="fchanged(this)">'.
+ encode_entities($hashref->{setup}). '" onLoad="fchanged(this)">'.
'</FONT><BR>'.
'<FONT SIZE="1">Recurring espression<BR>'.
'<INPUT TYPE="text" NAME="recur" SIZE="160" VALUE="'.
- $hashref->{recur}. '" onLoad="fchanged(this)">'.
+ encode_entities($hashref->{recur}). '" onLoad="fchanged(this)">'.
'</FONT>'.
'</TR></TD>'.
'</TABLE>';