! -> Note
$ -> Affected files
+11-Dec-2008 Joe Hunt
++ Two new fields in company table, accumulate_shipping and logal_text
+ Accumulat shipping is for accumulating shipping on batch invoice
+ Legal text is a last line legal info on sales invoices.
+$ /sql/alter2.1.sql
+ /admin/db/company_db.inc
+ /admin/gl_setup.php
+ /reporting/includes/header2.inc
+ /sales/customer_invoice.php
+
10-Dec-2008 Janusz Dobrowolski
# File and line was not displayed for devel error messages.
$ /includes/errors.inc
$allow_negative_stock,
$po_over_receive,
$po_over_charge,
+ $accumulate_shipping,
+ $legal_text,
$past_due_days,
$default_credit_limit,
$default_workorder_required,
allow_negative_stock=$allow_negative_stock,
po_over_receive=$po_over_receive,
po_over_charge=$po_over_charge,
+ accumulate_shipping=$accumulate_shipping,
+ legal_text=".db_escape($legal_text).",
past_due_days=$past_due_days,
default_credit_limit=$default_credit_limit,
default_workorder_required=$default_workorder_required,
check_value('allow_negative_stock'),
input_num('po_over_receive'),
input_num('po_over_charge'),
+ check_value('accumulate_shipping'),
+ $_POST['legal_text'],
$_POST['past_due_days'],
$_POST['default_credit_limit'],
$_POST['default_workorder_required'],
$_POST['past_due_days'] = $myrow['past_due_days'];
$_POST['default_credit_limit'] = $myrow['default_credit_limit'];
+$_POST['legal_text'] = $myrow['legal_text'];
+$_POST['accumulate_shipping'] = $myrow['accumulate_shipping'];
$_POST['default_workorder_required'] = $myrow['default_workorder_required'];
$_POST['default_dim_required'] = $myrow['default_dim_required'];
text_row(_("Default Credit Limit:"), 'default_credit_limit', $_POST['default_credit_limit'], 12, 12);
+check_row(_("Accumulate batch shipping:"), 'accumulate_shipping', null);
+
+textarea_row(_("Legal Text on Invoice:"), 'legal_text', $_POST['legal_text'], 32, 3);
+
gl_all_accounts_list_row(_("Shipping Charged Account:"), 'freight_act', $_POST['freight_act']);
//---------------
gl_all_accounts_list_row(_("Prompt Payment Discount Account:"), 'default_prompt_payment_act');
+//----------------
+
+table_section_title(_("Dimension Defaults"));
+
+text_row(_("Dimension Required By After:"), 'default_dim_required', $_POST['default_dim_required'], 6, 6, '', "", _("days"));
//---------------
+table_section(2);
+
table_section_title(_("Suppliers and Purchasing"));
percent_row(_("Delivery Over-Receive Allowance:"), 'po_over_receive');
percent_row(_("Invoice Over-Charge Allowance:"), 'po_over_charge');
+
// Not used in FA2.0.
//gl_all_accounts_list_row(_("Purchases Exchange Variances Account:"), 'purch_exchange_diff_act', $_POST['purch_exchange_diff_act']);
// Not used in FA2.0.
//gl_all_accounts_list_row(_("Goods Received Clearing Account:"), 'grn_act', $_POST['grn_act']);
-//---------------
-table_section(2);
table_section_title(_("Suppliers and Purchasing Defaults"));
gl_all_accounts_list_row(_("Payable Account:"), 'creditors_act', $_POST['creditors_act']);
text_row(_("Work Order Required By After:"), 'default_workorder_required', $_POST['default_workorder_required'], 6, 6, '', "", _("days"));
-//----------------
-
-table_section_title(_("Dimension Defaults"));
-
-text_row(_("Dimension Required By After:"), 'default_dim_required', $_POST['default_dim_required'], 6, 6, '', "", _("days"));
//----------------
//br();
display_note($heading2, 0, 0, "class='overduefg'");
}
- echo "</td><td align='right'>";
+ echo "</td><td width=10% align='right'>";
submit('InvGRNAll', _("Add All Items"), true, false,true);
}
$this->TextWrap($ccol, $this->row, $right - $ccol, $this->params['comments'], 'C');
$this->NewLine();
}
+ $legal = get_company_pref('legal_text');
+ if ($doctype == 10 && $legal != "")
+ {
+ $this->TextWrap($ccol, $this->row, $right - $ccol, $legal, 'C');
+ $this->NewLine();
+ }
$this->Font();
$temp = $iline6 - $this->lineHeight - 2;
?>
\ No newline at end of file
}
}
unset($line);
+
+ // Remove also src_doc delivery note
+ $sources = &$_SESSION['Items']->src_docs;
+ unset($sources[$_GET['RemoveDN']]);
}
//-----------------------------------------------------------------------------
return $ok;
}
+function set_delivery_shipping_sum($delivery_notes)
+{
+
+ $shipping = 0;
+
+ foreach($delivery_notes as $delivery_num)
+ {
+ $myrow = get_customer_trans($delivery_num, 13);
+ //$branch = get_branch($myrow["branch_code"]);
+ //$sales_order = get_sales_order_header($myrow["order_"]);
+
+ //$shipping += $sales_order['freight_cost'];
+ $shipping += $myrow['ov_freight'];
+ }
+ $_POST['ChargeFreightCost'] = price_format($shipping);
+}
+
+
function copy_to_cart()
{
$cart = &$_SESSION['Items'];
//-----------------------------------------------------------------------------
$is_batch_invoice = count($_SESSION['Items']->src_docs) > 1;
+
$is_edition = $_SESSION['Items']->trans_type == 10 && $_SESSION['Items']->trans_no != 0;
start_form(false, true);
}
}
+$accumulate_shipping = get_company_pref('accumulate_shipping');
+if ($is_batch_invoice && $accumulate_shipping)
+ set_delivery_shipping_sum(array_keys($_SESSION['Items']->src_docs));
+
start_row();
small_amount_cells(_("Shipping Cost"), 'ChargeFreightCost', null, "colspan=9 align=right");
ALTER TABLE `0_company` DROP COLUMN `foreign_codes`;
ALTER TABLE `0_company` ADD `foreign_codes` TINYINT(1) NOT NULL DEFAULT '0';
+ALTER TABLE `0_company` DROP COLUMN `accumulate_shipping`;
+ALTER TABLE `0_company` ADD `accumulate_shipping` TINYINT(1) NOT NULL DEFAULT '0';
+
+ALTER TABLE `0_company` DROP COLUMN `legal_text`;
+ALTER TABLE `0_company` ADD `legal_text` tinytext NOT NULL DEFAULT '';
+
ALTER TABLE `0_suppliers` DROP COLUMN `supp_address`;
ALTER TABLE `0_suppliers` ADD `supp_address` tinytext NOT NULL DEFAULT '' AFTER `address`;