Changed direct sales document line descriptions to be editable (via edit link)
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 19 Jan 2009 23:52:24 +0000 (23:52 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 19 Jan 2009 23:52:24 +0000 (23:52 +0000)
CHANGELOG.txt
reporting/rep107.php
reporting/rep109.php
reporting/rep110.php
sales/includes/cart_class.inc
sales/includes/ui/sales_order_ui.inc
sales/sales_order_entry.php

index 8f1d6f396edd15014107ed223c4f4945ce6ee379..b3f80b9f268664f1f0e7a747e2ffc759af597975 100644 (file)
@@ -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.
index f4e43cc0f3b85e80a621f54aae9691991b807777..98f419f09f097a47ecfdfcfe2aa02a305224de68 100644 (file)
@@ -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'])
index c93fe0699e98a61ef95edf5797a30648c3d4c6d9..78e7a1eaa975fd950a39d3d9926ba15e07a12653 100644 (file)
@@ -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);
                }
index 75ffe45be85563c2e93036ed1b9f247dbabd28f8..1add3c45e430e666943ba8b0b2604bca94c47312 100644 (file)
@@ -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);
                        }
index ce885a3285e12ce72f53a91f4670d322353cc9b2..1f54a613b487ef5f065ff1350010a4131187c00e 100644 (file)
@@ -1,5 +1,14 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU Affero General Public License,
+       AGPL, as published by the Free Software Foundation, either version 
+       3 of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+***********************************************************************/
 /* 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;
index 1349bdb43468e0e0e051d20180f3cc474b8d814e..5ef26f8cad0e7b3386da24c41a4cf16b772416f4 100644 (file)
@@ -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
index 3f1b20dba1ce3732f53918e68411bd0d9550fc84..09fc84f772c86c35cd40c44f824aa3b875ea8347 100644 (file)
@@ -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();
 }