From e1c22a904052bae141ace1ebdaaf2b81d9111139 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Mon, 19 Jan 2009 23:52:24 +0000 Subject: [PATCH] Changed direct sales document line descriptions to be editable (via edit link) --- CHANGELOG.txt | 10 ++++++++++ reporting/rep107.php | 10 +++++++--- reporting/rep109.php | 8 ++++++-- reporting/rep110.php | 8 ++++++-- sales/includes/cart_class.inc | 15 +++++++++++++-- sales/includes/ui/sales_order_ui.inc | 7 +++++-- sales/sales_order_entry.php | 4 +++- 7 files changed, 50 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8f1d6f39..b3f80b9f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,16 @@ Legend: ! -> Note $ -> Affected files +19-Jan-2009 Joe Hunt +! Changed direct sales document line descriptions to be editable (via edit link) +$ /sales/sales_order_entry.php + /includes/cart_class.inc + /includes/ui/sales_order_ui.inc +! Fixed so the printed documents can handle multiple lines of description +$ /reporting/rep107.php + /reporting/rep109.php + /reporting/rep110.php + 17-Jan-2009 Joe Hunt ! Changed all smaller forms and tables to be uniform. Copyright notes. $ All files with small forms and tables. diff --git a/reporting/rep107.php b/reporting/rep107.php index f4e43cc0..98f419f0 100644 --- a/reporting/rep107.php +++ b/reporting/rep107.php @@ -124,13 +124,17 @@ function print_invoices() else $DisplayDiscount = number_format2($myrow2["discount_percent"]*100,user_percent_dec()) . "%"; $rep->TextCol(0, 1, $myrow2['stock_id'], -2); - $rep->TextCol(1, 2, $myrow2['StockDescription'], -2); + $oldrow = $rep->row; + $rep->TextColLines(1, 2, $myrow2['StockDescription'], -2); + $newrow = $rep->row; + $rep->row = $oldrow; $rep->TextCol(2, 3, $DisplayQty, -2); $rep->TextCol(3, 4, $myrow2['units'], -2); $rep->TextCol(4, 5, $DisplayPrice, -2); $rep->TextCol(5, 6, $DisplayDiscount, -2); $rep->TextCol(6, 7, $DisplayNet, -2); - $rep->NewLine(1); + $rep->row = $newrow; + //$rep->NewLine(1); if ($rep->row < $rep->bottomMargin + (15 * $rep->lineHeight)) $rep->Header2($myrow, $branch, $sales_order, $baccount,$j); } @@ -146,7 +150,7 @@ function print_invoices() $DisplaySubTot = number_format2($SubTotal,$dec); $DisplayFreight = number_format2($sign*$myrow["ov_freight"],$dec); - $rep->row = $rep->bottomMargin + (15 * $rep->lineHeight); + $rep->row = $rep->bottomMargin + (15 * $rep->lineHeight); $linetype = true; $doctype = $j; if ($rep->currency != $myrow['curr_code']) diff --git a/reporting/rep109.php b/reporting/rep109.php index c93fe069..78e7a1ea 100644 --- a/reporting/rep109.php +++ b/reporting/rep109.php @@ -112,13 +112,17 @@ function print_sales_orders() else $DisplayDiscount = number_format2($myrow2["discount_percent"]*100,user_percent_dec()) . "%"; $rep->TextCol(0, 1, $myrow2['stk_code'], -2); - $rep->TextCol(1, 2, $myrow2['description'], -2); + $oldrow = $rep->row; + $rep->TextColLines(1, 2, $myrow2['description'], -2); + $newrow = $rep->row; + $rep->row = $oldrow; $rep->TextCol(2, 3, $DisplayQty, -2); $rep->TextCol(3, 4, $myrow2['units'], -2); $rep->TextCol(4, 5, $DisplayPrice, -2); $rep->TextCol(5, 6, $DisplayDiscount, -2); $rep->TextCol(6, 7, $DisplayNet, -2); - $rep->NewLine(1); + $rep->row = $newrow; + //$rep->NewLine(1); if ($rep->row < $rep->bottomMargin + (15 * $rep->lineHeight)) $rep->Header2($myrow, $branch, $myrow, $baccount, 9); } diff --git a/reporting/rep110.php b/reporting/rep110.php index 75ffe45b..1add3c45 100644 --- a/reporting/rep110.php +++ b/reporting/rep110.php @@ -103,13 +103,17 @@ function print_deliveries() else $DisplayDiscount = number_format2($myrow2["discount_percent"]*100,user_percent_dec()) . "%"; $rep->TextCol(0, 1, $myrow2['stock_id'], -2); - $rep->TextCol(1, 2, $myrow2['StockDescription'], -2); + $oldrow = $rep->row; + $rep->TextColLines(1, 2, $myrow2['StockDescription'], -2); + $newrow = $rep->row; + $rep->row = $oldrow; $rep->TextCol(2, 3, $DisplayQty, -2); $rep->TextCol(3, 4, $myrow2['units'], -2); $rep->TextCol(4, 5, $DisplayPrice, -2); $rep->TextCol(5, 6, $DisplayDiscount, -2); $rep->TextCol(6, 7, $DisplayNet, -2); - $rep->NewLine(1); + $rep->row = $newrow; + //$rep->NewLine(1); if ($rep->row < $rep->bottomMargin + (15 * $rep->lineHeight)) $rep->Header2($myrow, $branch, $sales_order,'',13); } diff --git a/sales/includes/cart_class.inc b/sales/includes/cart_class.inc index ce885a32..1f54a613 100644 --- a/sales/includes/cart_class.inc +++ b/sales/includes/cart_class.inc @@ -1,5 +1,14 @@ . +***********************************************************************/ /* Definition of the cart class this class can hold all the information for: @@ -292,8 +301,10 @@ class cart return 0; } - function update_cart_item($line_no, $qty, $price, $disc) + function update_cart_item($line_no, $qty, $price, $disc, $description="") { + if ($description != "") + $this->line_items[$line_no]->item_description = $description; $this->line_items[$line_no]->quantity = $qty; $this->line_items[$line_no]->qty_dispatched = $qty; $this->line_items[$line_no]->price = $price; diff --git a/sales/includes/ui/sales_order_ui.inc b/sales/includes/ui/sales_order_ui.inc index 1349bdb4..5ef26f8c 100644 --- a/sales/includes/ui/sales_order_ui.inc +++ b/sales/includes/ui/sales_order_ui.inc @@ -167,7 +167,8 @@ function display_order_summary($title, &$order, $editable_items=false) view_stock_status_cell($stock_item->stock_id); - label_cell($stock_item->item_description, "nowrap" ); + //label_cell($stock_item->item_description, "nowrap" ); + label_cell($stock_item->item_description ); qty_cell($stock_item->qty_dispatched, false, get_qty_dec($stock_item->stock_id)); if ($order->trans_no!=0) @@ -437,10 +438,12 @@ function sales_order_item_controls(&$order, &$rowcounter, $line_no=-1) $_POST['qty'] = number_format2($order->line_items[$id]->qty_dispatched, $dec); $_POST['price'] = price_format($order->line_items[$id]->price); $_POST['Disc'] = percent_format($order->line_items[$id]->discount_percent*100); + $_POST['item_description'] = $order->line_items[$id]->item_description; $units = $order->line_items[$id]->units; hidden('stock_id', $_POST['stock_id']); label_cell($_POST['stock_id']); - label_cell($order->line_items[$line_no]->item_description, "nowrap"); + text_cells(null,'item_description', null, 45, 150); + //label_cell($order->line_items[$line_no]->item_description, "nowrap"); $Ajax->activate('items_table'); } else // prepare new line diff --git a/sales/sales_order_entry.php b/sales/sales_order_entry.php index 3f1b20db..09fc84f7 100644 --- a/sales/sales_order_entry.php +++ b/sales/sales_order_entry.php @@ -356,9 +356,11 @@ function check_item_data() function handle_update_item() { if ($_POST['UpdateItem'] != '' && check_item_data()) { + //alert("description=".$_POST['item_description']); + //$_SESSION['items']->line_items[$_POST['LineNo']]->item_description = $_POST['item_description']; $_SESSION['Items']->update_cart_item($_POST['LineNo'], input_num('qty'), input_num('price'), - input_num('Disc') / 100 ); + input_num('Disc') / 100, $_POST['item_description'] ); } line_start_focus(); } -- 2.30.2