projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added two new helpers date_comp, sql_date_comp.
[fa-stable.git]
/
reporting
/
includes
/
doctext.inc
diff --git
a/reporting/includes/doctext.inc
b/reporting/includes/doctext.inc
index 06bb7b1f7b24816dbc6adbd70475164d3790ada9..be391fde7392bb3905c77ca602327c691b11f678 100644
(file)
--- a/
reporting/includes/doctext.inc
+++ b/
reporting/includes/doctext.inc
@@
-34,10
+34,7
@@
if (!in_array($this->formData['doctype'], array(ST_STATEMENT, ST_WORKORDER)))
{
if (!in_array($this->formData['doctype'], array(ST_STATEMENT, ST_WORKORDER)))
{
- $id = $this->formData['payment_terms'];
- $sql = "SELECT terms, days_before_due FROM ".TB_PREF."payment_terms WHERE terms_indicator=".db_escape($id);
- $result = db_query($sql,"could not get paymentterms");
- $row = db_fetch($result);
+ $row = get_payment_terms($this->formData['payment_terms']);
$Payment_Terms = _("Payment Terms") . ': ' . $row["terms"];
if ($this->formData['doctype'] == ST_SALESINVOICE && $this->formData['prepaid'])
$this->formData['prepaid'] = ($row['days_before_due'] >= 0) ? 'final' : 'partial';
$Payment_Terms = _("Payment Terms") . ': ' . $row["terms"];
if ($this->formData['doctype'] == ST_SALESINVOICE && $this->formData['prepaid'])
$this->formData['prepaid'] = ($row['days_before_due'] >= 0) ? 'final' : 'partial';
@@
-50,7
+47,7
@@
$this->title = _("SALES QUOTATION");
$this->formData['document_name'] =_("Quotation No.");
$this->formData['document_date'] = $this->formData['ord_date'];
$this->title = _("SALES QUOTATION");
$this->formData['document_name'] =_("Quotation No.");
$this->formData['document_date'] = $this->formData['ord_date'];
- $this->formData['document_number'] = $
print_invoice_no
== 0 && isset($this->formData['reference'])
+ $this->formData['document_number'] = $
SysPrefs->print_invoice_no()
== 0 && isset($this->formData['reference'])
? $this->formData['reference'] : $this->formData['order_no'];
$aux_info = array(
_("Customer's Reference") => $this->formData["customer_ref"],
? $this->formData['reference'] : $this->formData['order_no'];
$aux_info = array(
_("Customer's Reference") => $this->formData["customer_ref"],
@@
-65,7
+62,7
@@
$this->title = ($print_as_quote==1 ? _("QUOTE") : ($this->formData['prepaid'] ? _("PREPAYMENT ORDER") : _("SALES ORDER")));
$this->formData['document_name'] =_("Order No.");
$this->formData['document_date'] = $this->formData['ord_date'];
$this->title = ($print_as_quote==1 ? _("QUOTE") : ($this->formData['prepaid'] ? _("PREPAYMENT ORDER") : _("SALES ORDER")));
$this->formData['document_name'] =_("Order No.");
$this->formData['document_date'] = $this->formData['ord_date'];
- $this->formData['document_number'] = $
print_invoice_no
== 0 && isset($this->formData['reference'])
+ $this->formData['document_number'] = $
SysPrefs->print_invoice_no()
== 0 && isset($this->formData['reference'])
? $this->formData['reference'] : $this->formData['order_no'];
$this->formData['document_amount'] = $this->formData['order_no'];
? $this->formData['reference'] : $this->formData['order_no'];
$this->formData['document_amount'] = $this->formData['order_no'];
@@
-84,7
+81,7
@@
if (@$packing_slip)
$Payment_Terms = '';
$ref = $this->formData['order_'];
if (@$packing_slip)
$Payment_Terms = '';
$ref = $this->formData['order_'];
- if ($
print_invoice_no
== 0)
+ if ($
SysPrefs->print_invoice_no()
== 0)
{
$ref = get_reference(ST_SALESORDER, $this->formData['order_']);
if (!$ref)
{
$ref = get_reference(ST_SALESORDER, $this->formData['order_']);
if (!$ref)
@@
-121,7
+118,7
@@
$Footer[0] = _("Please quote Invoice no. when paying. All amounts stated in"). " - " . $this->formData['curr_code'];
$deliveries = get_sales_parent_numbers(ST_SALESINVOICE, $this->formData['trans_no']);
$Footer[0] = _("Please quote Invoice no. when paying. All amounts stated in"). " - " . $this->formData['curr_code'];
$deliveries = get_sales_parent_numbers(ST_SALESINVOICE, $this->formData['trans_no']);
- if ($
print_invoice_no
== 0)
+ if ($
SysPrefs->print_invoice_no()
== 0)
{
foreach($deliveries as $n => $delivery) {
$deliveries[$n] = get_reference(ST_CUSTDELIVERY, $delivery);
{
foreach($deliveries as $n => $delivery) {
$deliveries[$n] = get_reference(ST_CUSTDELIVERY, $delivery);
@@
-177,7
+174,7
@@
$Addr2['name'] = $this->company['coy_name'];
//$Addr2['address'] = $this->company['postal_address']; No, don't destroy delivery address!
$this->formData['document_date'] = $this->formData['ord_date'];
$Addr2['name'] = $this->company['coy_name'];
//$Addr2['address'] = $this->company['postal_address']; No, don't destroy delivery address!
$this->formData['document_date'] = $this->formData['ord_date'];
- $this->formData['document_number'] = $
print_invoice_no
== 0 && isset($this->formData['reference'])
+ $this->formData['document_number'] = $
SysPrefs->print_invoice_no()
== 0 && isset($this->formData['reference'])
? $this->formData['reference'] : $this->formData['order_no'];
$aux_info = array(
? $this->formData['reference'] : $this->formData['order_no'];
$aux_info = array(
@@
-252,7
+249,7
@@
$this->formData['document_date'] = $this->formData['tran_date'];
if (!isset($this->formData['document_number']))
$this->formData['document_date'] = $this->formData['tran_date'];
if (!isset($this->formData['document_number']))
- $this->formData['document_number'] = $
print_invoice_no
== 0 && isset($this->formData['reference'])
+ $this->formData['document_number'] = $
SysPrefs->print_invoice_no()
== 0 && isset($this->formData['reference'])
? $this->formData['reference'] : @$this->formData['trans_no'];
// footer generic content
? $this->formData['reference'] : @$this->formData['trans_no'];
// footer generic content