[Frontaccounting-cvs_updates] /hgroot/frontaccounting/frontaccounting: Merge branch 'branches/...
Brought to you by:
frontaccounting,
itronics
From: FrontAccounting <fro...@us...> - 2013-03-15 18:55:45
|
details: http://frontaccounting.hg.sourceforge.net:8000/hgroot/frontaccounting/frontaccounting/hgroot/frontaccounting/frontaccounting/rev/026619fa3b3c changeset: 3204:026619fa3b3c user: Janusz Dobrowolski <ja...@fr...> date: Fri Mar 15 19:55:25 2013 +0100 description: Merge branch 'branches/default' of hg::ssh://itr...@fr.../hgroot/frontaccounting/frontaccounting into sf.default diffstat: includes/db/sql_functions.inc | 2 +- purchasing/includes/po_class.inc | 2 +- purchasing/po_entry_items.php | 3 ++- sales/create_recurrent_invoices.php | 6 ++++-- sales/includes/cart_class.inc | 6 +++--- sales/includes/db/cust_trans_db.inc | 2 +- sales/inquiry/sales_orders_view.php | 6 +++--- sales/sales_order_entry.php | 4 ++-- 8 files changed, 17 insertions(+), 14 deletions(-) diffs (137 lines): diff -r 43a83431f759 -r 026619fa3b3c includes/db/sql_functions.inc --- a/includes/db/sql_functions.inc Fri Mar 15 19:50:24 2013 +0100 +++ b/includes/db/sql_functions.inc Fri Mar 15 19:55:25 2013 +0100 @@ -55,7 +55,7 @@ // function update_record_status($id, $status, $table, $key) { $sql = "UPDATE ".TB_PREF.$table." SET inactive = " - . db_escape($status)." WHERE $key=".db_escape($id); + . ((int)$status)." WHERE $key=".db_escape($id); db_query($sql, "Can't update record status"); } diff -r 43a83431f759 -r 026619fa3b3c purchasing/includes/po_class.inc --- a/purchasing/includes/po_class.inc Fri Mar 15 19:50:24 2013 +0100 +++ b/purchasing/includes/po_class.inc Fri Mar 15 19:55:25 2013 +0100 @@ -55,7 +55,7 @@ function add_to_order($line_no, $stock_id, $qty, $item_descr, $price, $uom, $req_del_date, $qty_inv, $qty_recd) { - if ($qty != 0 && isset($qty)) + if (isset($qty) && $qty != 0) { $this->line_items[$line_no] = new po_line_details($line_no, $stock_id, $item_descr, $qty, $price, $uom, $req_del_date, $qty_inv, $qty_recd); diff -r 43a83431f759 -r 026619fa3b3c purchasing/po_entry_items.php --- a/purchasing/po_entry_items.php Fri Mar 15 19:50:24 2013 +0100 +++ b/purchasing/po_entry_items.php Fri Mar 15 19:55:25 2013 +0100 @@ -437,7 +437,8 @@ //Direct GRN if ($cart->trans_type == ST_SUPPRECEIVE) $cart->reference = $ref; - $cart->Comments = $cart->reference; //grn does not hold supp_ref + if ($cart->trans_type != ST_SUPPINVOICE) + $cart->Comments = $cart->reference; //grn does not hold supp_ref foreach($cart->line_items as $key => $line) $cart->line_items[$key]->receive_qty = $line->quantity; $grn_no = add_grn($cart); diff -r 43a83431f759 -r 026619fa3b3c sales/create_recurrent_invoices.php --- a/sales/create_recurrent_invoices.php Fri Mar 15 19:50:24 2013 +0100 +++ b/sales/create_recurrent_invoices.php Fri Mar 15 19:55:25 2013 +0100 @@ -39,7 +39,9 @@ $doc->due_date = get_invoice_duedate($doc->payment, $doc->document_date); $doc->reference = $Refs->get_next($doc->trans_type); - $doc->Comments = sprintf(_("Recurrent Invoice covers period %s - %s."), $from, add_days($to, -1)); + if ($doc->Comments != "") + $doc->Comments .= "\n"; + $doc->Comments .= sprintf(_("Recurrent Invoice covers period %s - %s."), $from, add_days($to, -1)); foreach ($doc->line_items as $line_no=>$item) { $line = &$doc->line_items[$line_no]; @@ -109,7 +111,7 @@ if (count($invs) > 0) { $ar = array('PARAM_0' => $min."-".ST_SALESINVOICE, 'PARAM_1' => $max."-".ST_SALESINVOICE, 'PARAM_2' => "", - 'PARAM_3' => 0, 'PARAM_4' => 0, 'PARAM_5' => "", 'PARAM_6' => ST_SALESINVOICE); + 'PARAM_3' => 0, 'PARAM_4' => 0, 'PARAM_5' => "", 'PARAM_6' => $def_print_orientation); display_note(print_link(sprintf(_("&Print Recurrent Invoices # %s - # %s"), $min, $max), 107, $ar), 0, 1); $ar['PARAM_3'] = 1; // email display_note(print_link(sprintf(_("&Email Recurrent Invoices # %s - # %s"), $min, $max), 107, $ar), 0, 1); diff -r 43a83431f759 -r 026619fa3b3c sales/includes/cart_class.inc --- a/sales/includes/cart_class.inc Fri Mar 15 19:50:24 2013 +0100 +++ b/sales/includes/cart_class.inc Fri Mar 15 19:55:25 2013 +0100 @@ -104,6 +104,9 @@ $this->trans_type = $type; $this->reference = $Refs->get_next($this->trans_type); + if ($type == ST_CUSTCREDIT) + $this->src_date = $this->document_date; + $this->document_date = new_doc_date(); for($line_no = 0; $line_no < count($this->line_items); $line_no++) { @@ -124,9 +127,6 @@ $this->due_date = get_invoice_duedate($this->payment, $this->document_date); } - if ($type == ST_CUSTCREDIT) - $this->src_date = $this->document_date; - $this->src_docs = $this->trans_no; $this->trans_no = 0; } diff -r 43a83431f759 -r 026619fa3b3c sales/includes/db/cust_trans_db.inc --- a/sales/includes/db/cust_trans_db.inc Fri Mar 15 19:50:24 2013 +0100 +++ b/sales/includes/db/cust_trans_db.inc Fri Mar 15 19:55:25 2013 +0100 @@ -103,7 +103,7 @@ ov_freight=".db_escape($Freight).", ov_freight_tax=$FreightTax, rate=$rate, ship_via=".db_escape($ship_via).", alloc=$AllocAmt, dimension_id=".db_escape($dimension_id).", dimension2_id=".db_escape($dimension2_id).", - payment_terms=".db_escape($payment_terms)." + payment_terms=".db_escape($payment_terms, true)." WHERE trans_no=".db_escape($trans_no)." AND type=".db_escape($trans_type); } db_query($sql, "The debtor transaction record could not be inserted"); diff -r 43a83431f759 -r 026619fa3b3c sales/inquiry/sales_orders_view.php --- a/sales/inquiry/sales_orders_view.php Fri Mar 15 19:50:24 2013 +0100 +++ b/sales/inquiry/sales_orders_view.php Fri Mar 15 19:55:25 2013 +0100 @@ -286,17 +286,17 @@ _("Currency") => array('align'=>'center') ); if ($_POST['order_view_mode'] == 'OutstandingOnly') { - //array_substitute($cols, 3, 1, _("Cust Order Ref")); + //array_substitute($cols, 4, 1, _("Cust Order Ref")); array_append($cols, array( array('insert'=>true, 'fun'=>'dispatch_link'), array('insert'=>true, 'fun'=>'edit_link'))); } elseif ($_POST['order_view_mode'] == 'InvoiceTemplates') { - array_substitute($cols, 3, 1, _("Description")); + array_substitute($cols, 4, 1, _("Description")); array_append($cols, array( array('insert'=>true, 'fun'=>'invoice_link'))); } else if ($_POST['order_view_mode'] == 'DeliveryTemplates') { - array_substitute($cols, 3, 1, _("Description")); + array_substitute($cols, 4, 1, _("Description")); array_append($cols, array( array('insert'=>true, 'fun'=>'delivery_link')) ); diff -r 43a83431f759 -r 026619fa3b3c sales/sales_order_entry.php --- a/sales/sales_order_entry.php Fri Mar 15 19:50:24 2013 +0100 +++ b/sales/sales_order_entry.php Fri Mar 15 19:55:25 2013 +0100 @@ -62,12 +62,12 @@ if (isset($_GET['NewDelivery']) && is_numeric($_GET['NewDelivery'])) { $_SESSION['page_title'] = _($help_context = "Direct Sales Delivery"); - create_cart(ST_CUSTDELIVERY, 0); + create_cart(ST_CUSTDELIVERY, $_GET['NewDelivery']); } elseif (isset($_GET['NewInvoice']) && is_numeric($_GET['NewInvoice'])) { $_SESSION['page_title'] = _($help_context = "Direct Sales Invoice"); - create_cart(ST_SALESINVOICE, 0); + create_cart(ST_SALESINVOICE, $_GET['NewInvoice']); } elseif (isset($_GET['ModifyOrderNumber']) && is_numeric($_GET['ModifyOrderNumber'])) { |