| version 1.14, 2011/03/22 02:37:14 |
version 1.15, 2011/03/22 02:41:43 |
|
|
| } |
} |
| } |
} |
| |
|
| $cust->{address} ||= get_user($custid); |
|
| $cust->{invoice} = $invoice; |
$cust->{invoice} = $invoice; |
| } |
} |
| |
|
|
|
| } |
} |
| |
|
| if ($discount_time) { |
if ($discount_time) { |
| $invoice->{discount}{amount} |
$invoice->{discount}{amount} |
| += round($discount_time * $fee->{rate}); |
+= round( $discount_time * $fee->{rate} ); |
| $invoice->{discount}{hours}{$h_type} += $discount_time; |
$invoice->{discount}{hours}{$h_type} += $discount_time; |
| |
|
| $h_type = '' if $h_type eq 'default'; |
$h_type = '' if $h_type eq 'default'; |
|
|
| |
|
| next unless $invoice->{total} > 0 || $invoice->{total_due}; |
next unless $invoice->{total} > 0 || $invoice->{total_due}; |
| |
|
| # XXX Here we need to "make_address" |
|
| $invoice->{info} = $config->get('info'); |
$invoice->{info} = $config->get('info'); |
| $invoice->{from} = make_address( $config->get('from') ); |
$invoice->{from} = make_address( $config->get('from') ); |
| $invoice->{to} = make_address( $cust->{address} ); |
$invoice->{to} = make_address( $cust->{address} || get_user($custid) ); |
| |
|
| $state->{lastinvoice}++; |
$state->{lastinvoice}++; |
| $invoice->{id} = $state->{lastinvoice}; |
$invoice->{id} = $state->{lastinvoice}; |
|
|
| return unless $custid; |
return unless $custid; |
| |
|
| my $cust = $config->get('default') || {}; |
my $cust = $config->get('default') || {}; |
| $cust->{address} = get_user($custid); |
|
| |
|
| $cust->{match} = [ |
$cust->{match} = [ |
| { type => 'requestors', |
{ type => 'requestors', |