'Invoice', 'quote' => 'Quote', 'recurring' => 'Recurring Invoice'][$paper_type]; $paper_footer = $paper_type === 'quote' ? ($GLOBALS['config_quote_footer'] ?? '') : ($GLOBALS['config_invoice_footer'] ?? ''); // A stamp across a document that is done with $paper_stamp = ''; if ($paper_type === 'invoice' && $paper_status === 'Paid') { $paper_stamp = ['Paid', 'success']; } elseif ($paper_type === 'invoice' && $paper_status === 'Cancelled') { $paper_stamp = ['Cancelled', 'danger']; } elseif ($paper_type === 'quote' && in_array($paper_status, ['Accepted', 'Invoiced'], true)) { $paper_stamp = ['Accepted', 'success']; } elseif ($paper_type === 'quote' && $paper_status === 'Declined') { $paper_stamp = ['Declined', 'danger']; } $paper_dates = []; if ($paper_type === 'invoice') { $paper_dates = ['Invoice date' => $paper_row['invoice_date'], 'Due' => $paper_row['invoice_due']]; } elseif ($paper_type === 'quote') { $paper_dates = ['Quote date' => $paper_row['quote_date'], 'Valid until' => $paper_row['quote_expire']]; } else { $paper_dates = ['Billed' => recurringInvoiceFrequencies()[$paper_row['recurring_invoice_frequency']] ?? ucfirst((string) $paper_row['recurring_invoice_frequency']), 'Next invoice' => $paper_row['recurring_invoice_next_date']]; } // A recurring invoice's seat lines - what each counts now, and whether the line is off $paper_seats = $paper_type === 'recurring' ? recurringSeatLines($paper_id, intval($paper_row['client_id'])) : []; $paper_seat_sources = recurringSeatSources(); // A quote with lines billed each month, quarter or year shows them apart from // what is billed once - the lines under a heading each, and a total each $paper_groups = $paper_type === 'quote' && !empty($paper_totals['recurring']) ? $paper_totals['groups'] : null; $paper_line_groups = $paper_groups ?: ['' => ['frequency' => '', 'label' => '', 'items' => $paper_items]]; $paper_post = function ($params) use ($paper_type, $paper_id, $paper) { return 'post.php?' . http_build_query(array_merge($params, ['type' => $paper_type, 'doc_id' => $paper_id, 'csrf_token' => $paper['csrf'] ?? ''])); }; $paper_company_lines = array_merge(array_filter([ formatAddress($paper_company['company_address'] ?? '', $paper_company['company_city'] ?? '', $paper_company['company_state'] ?? '', $paper_company['company_zip'] ?? '', $paper_company['company_country'] ?? '', "\n"), implode(' · ', array_filter([$paper_company['company_email'] ?? '', $paper_company['phone_display'] ?? ''])), $paper_company['company_website'] ?? '', !empty($GLOBALS['config_invoice_show_tax_id']) && !empty($paper_company['company_tax_id']) ? 'Tax ID: ' . $paper_company['company_tax_id'] : '', ]), billingTaxRegistrationLines($paper_totals)); $paper_bill_lines = array_filter([ formatAddress($paper_bill_to['location_address'] ?? '', $paper_bill_to['location_city'] ?? '', $paper_bill_to['location_state'] ?? '', $paper_bill_to['location_zip'] ?? '', $paper_bill_to['location_country'] ?? '', "\n"), $paper_bill_to['contact_name'] ?? '', implode(' · ', array_filter([$paper_bill_to['contact_email'] ?? '', $paper_bill_to['contact_phone'] ?? ''])), !empty($paper_bill_to['client_tax_id_number']) ? 'Tax ID: ' . $paper_bill_to['client_tax_id_number'] : '', // Exempt - said only when nothing here is taxed, so an older taxed invoice doesn't contradict itself !empty($paper_bill_to['tax_exempt_text']) && $paper_totals['tax'] == 0 ? $paper_bill_to['tax_exempt_text'] : '', ]); ?>
$value) { ?>
0) { ?>
by
$paper_group) { if ($paper_frequency === '' && !$paper_group['items'] && $paper_group['discount'] == 0) { continue; } ?>
Quote total
Each
For
$paper_line_group) { if ($paper_groups) { ?>
Item Qty Price Tax Amount
'seat', 'icon' => 'fa-users']; ?>
Per · 0 ? ' · at least ' . billingQuantity($seat['item_seat_minimum']) : '' ?> The license is gone - it stays at Now
-
Nothing on it yet.
Say what it's for - lines from your catalog, labor at the client's rate.
Notes
Notes
$paper_group) { if ($paper_frequency === '' && !$paper_group['items'] && $paper_group['discount'] == 0) { continue; } ?> $tax_amount) { ?>
Subtotal
Discount-
$tax_amount) { ?> 0) { ?> 0) { ?>
Subtotal
Discount-
Credit-
Total
Paid-
Balance due