In includes/ui/ui_lists.inc

The order by is simply: s.description

It also includes the category description so if different categories have similar named products you will get the stock listed in alpha sort with the same category names interspersed.

Maybe a better sort order would be c.description,s.description so we group the items within one category together and then sort the stock items

tom

ps. what is MB_FLAG = 'K' ? (s.mb_flag='M' OR s.mb_flag='K')

227

(5 replies, posted in Items and Inventory)

Well it looks like my next task will be to import BOM's

I do not like the way Sales Kits appear on the Sales Order/Invoice.

It looks like Manufacturing/BOM's is the way to go

tom

228

(59 replies, posted in Modules Add-on's)

Not bad for a hacker of my vintage...

yes i recall having wrapper functions for the basic stuff to handle the PHP3 to PHP4 transition...
(or maybe it was PHP4 point releases... a lot was in flux then)

Tom

229

(59 replies, posted in Modules Add-on's)

I see the html_entity_decode calls in write() of sales/includes/cart_class.inc

AH HA!

I think I should be doing a $cart->write instead of add_sales_order!

Yes that fixed it!

whew

230

(59 replies, posted in Modules Add-on's)

add_to_order calls $order->add_to_cart, calls line_details wth a NULL description so get_item is called and it uses that description, at that point the description is correct.

still tracing...

btw: add_to_cart and line_details are from sales/includes/cart_class.inc
----

I think the problem is that get_item fetches item details from the database and does not htmlspecialchars_decode() the data.

Maybe the caller should do it, but since get_item is a fairly generic utility function it should return plain decoded data

I am not sure the other impacts. - I did not see many other calls.
They were mostly used in areas that would be used for Display, not feed back to the database.

I will change it locally in line_details (since it knows it will feed it back to the db) and if that is the wrong change
i'll get the right one from CVS

tom

231

(59 replies, posted in Modules Add-on's)

Yes we agree.

But!

The string that has the problem is the DESCRIPTION which I am not passing to add_to_order, so it is NULL was add_to_order calls $order->add_to_cart and then the description is gotten from get_item()

I'll run an sql_trace and see...

232

(59 replies, posted in Modules Add-on's)

This is strange.

In my order import I use add_to_order() (sales/includes/ui/sales_order_ui.inc)

If I import an order with a Description that has a " in it I end up with

16" Plate Glass Blank

And if I enter the sales order by hand I get

16" Plate Glass Blank

Here is my code

include($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/includes/data_checks.inc");
include_once($path_to_root . "/sales/includes/db/branches_db.inc");
include_once($path_to_root . "/sales/includes/db/customers_db.inc");
include_once($path_to_root . "/sales/includes/db/sales_order_db.inc");
include_once($path_to_root . "/sales/includes/cart_class.inc");
include_once($path_to_root . "/sales/includes/ui/sales_order_ui.inc");

$cart = new Cart(30); // New Sales Order
        $cart->customer_id = $customer['debtor_no'];
        $cart->customer_currency = $customer['curr_code'];
        $cart->Branch = $branch['branch_code'];
        $cart->cust_ref = "osC Order # $oID";
        $cart->Comments = $comments;
        $cart->document_date = Today();
        // $_POST['OrderDate'] = $cart->document_date;
        $cart->sales_type = $customer['sales_type'];
        $cart->ship_via = $branch['default_ship_via'];
        $cart->deliver_to = $branch['br_name'];
        $cart->delivery_address = $branch['br_address'];
        $cart->phone = $branch['phone'];
        $cart->email = $branch['email'];
        $cart->freight_cost = $order_total['value'];
        $cart->Location = $branch['default_location'];
        $cart->due_date = Today();
        $sql = "SELECT * FROM orders_products WHERE orders_id = $oID";
        $result = mysql_query($sql, $osc);
        $lines = array();
        while ($prod = mysql_fetch_assoc($result)) {
            add_to_order($cart, $prod['products_model'], $prod['products_quantity'], $prod['products_price'], $customer['pymt_discount']);
        }
        mysql_free_result($result);
        // print_r($cart);
        $order_no = add_sales_order($cart);
        display_notification("Added Order Number $order_no");

What is funny, When I call add_to_order I do not pass the description, it gets pulled from the FA db.

confusing...

tom

233

(59 replies, posted in Modules Add-on's)

I have not seen any problems, I am just anticipating real life.

Since osCommerce computes Taxes and displays them to the customer and then
later FA has to re-compute taxes based on what is actually delivered.

I am worried about telling the customer the taxes are $x and then FA computing them to be $y

Based on the GL accounts we will send $y to the government, people tend to get upset if we collect one total and pay a different total.
(I think you can get fined if you Under pay taxes... over paying is usually not a problem!)

tom

234

(6 replies, posted in Installation)

When are email supposed to be sent?

In the code I saw emails can be send to a Inevntory Location email address.. it also looked like there was a flag to enable/disable it.

More details please!

tom

235

(1 replies, posted in Report Bugs here)

The demo data and new data (en_US-demo.sql  en_US-new.sql ) should be updated to have a default fiscal year of 2009

tom

236

(59 replies, posted in Modules Add-on's)

I have cleaned things up a bit.

I also expanded the item_import to support Sales Kits and Foreign Item Codes.

I am going to put together the modules and get them uploaded.
I stop at Sales Orders at the moment.

Order #     Customer     Branch     Comments

The 'Comments' column displays Customer Order Reference, not the SO comments

Verified by looking at view_sales_order.php

tom

238

(40 replies, posted in Report Bugs here)

Is it company 0?

If it is not the Training company then you will need to edit the SQL

UPDATE 0_debtors_master, 0_company SET 0_debtors_master.curr_code=0_company.curr_default;

changes all 4 of the "0_" to "3_" or whatever to match the company number of your company.

When using phpAdmin how many companies do you see?

Bunch of 0_ tables, followed by a bunch of 1_ tables, etc

tom

239

(4 replies, posted in Manufactoring)

I figured out how to do what I need.

I define the Bulk Item I stock on the shelves with units I use (lbs) and enough decimal places to account for all my needs.
(In my case 1lb, 1/2lb, 1/4lb) 1.00

So I buy it in 50 lb buckets and sell in 0.25 increments
(I use a Work Order to convert from 1 bucket purchased to 50lbs of stock)

I then can use sales kit of the BULK item and the quantity input looks up the units used for the BULK and allows the proper number of decimal places.

The problem I had was not allowing decimal places on the Bulk item, once I added those it all made sense

tom

240

(26 replies, posted in Setup)

I think he was referring to using Google to find articles on how to get sendmail working with php.

FA calls the PHP functions to send mail and they will work only if your php and system (sendmail, etc) are set up properly.

tom

241

(5 replies, posted in Items and Inventory)

Is it a bug that you can create a Sales Kit with the same alias as an existing Stock_ID?

I'm using FA 2.1.2

tom

242

(59 replies, posted in Modules Add-on's)

Well I have imported my first Sales Order!

Now I need to clean up the error checking and use proper FA notification messages

I really think I will try going the Direct Invoice route, because I think that is the only way I will be able to verify that osCommerce and FA computed the same taxes!

Can not collect one amount of taxes and report another!
The government does not like that!

tom

243

(59 replies, posted in Modules Add-on's)

I ported the Customer Import into the osCommerce module, but when I started looking at the Item Import it occurred to me that item import has too many special cases to do it automatically.

On to Order Import!

First I'll make a Sales Order and I may have an option to act like 'Direct Invoice'

244

(12 replies, posted in Accounts Receivable)

Henry wrote:

Sounds good.  Let me know if you'd like help testing when you're ready.

I am working on osCommerce specific code right now.

It may be 'easy' to convert to read your data source... if I write clean enough code smile

245

(12 replies, posted in Accounts Receivable)

Yes it is a bit different, but once you have a sales order in the system a few simple clicks and it is ready to ship...
Those clicks may be easily automated...

We'll see how helpful my code is, once I am done smile

I take things one small step at a time...

at the rate things are going I expect to have something of interest in a few weeks.

tom

246

(12 replies, posted in Accounts Receivable)

joe wrote:

You can also follow a member of the community, tom. He is planning to do this with osCommerse. Eventually he sees this topic, otherwise ask him directly.
/Joe

Yikes! smile

hat I am working on is taking osCommerce Orders (I guess it does look a lot like an Invoice) and importing them into a FA Sales Order.

Once it is a SO then FA can take over...

What online shopping system are you using?

tom

247

(59 replies, posted in Modules Add-on's)

joe wrote:

Hello tom,
BTW. tom, I guess you had a proposal for changing the install script to handle empty chart of accounts, using en_US-new.sql instead of the demo one.
I didn't like the idea in the form you suggested, but we could do it your way with a GET parameter, f.i. install/?accounts=new.
What do you say to that?

/Joe

How about an EXPERT mode button that adds a GET parameter, they we would consider any number of additional options for advanced installers?

That could be of some use to the other problem I am looking at...

tom

248

(59 replies, posted in Modules Add-on's)

joe wrote:

Hello tom,

Yes, according to the table structure it must be unique. While you never see the customer number, it would be difficult to separate them if not.

/Joe

My problem is that osCommerce uses the Email Address as unique, not a person's name.

Could you consider the problems associated with having the name not Unique?

I was considering changing 'customer_list_row' to include the email address in the pull-down text to aid in choosing WHICH 'John Doe' you wanted.

change line 403 of includes/ui/ui_lists.inc

$sql = "SELECT debtor_no, IF(email = NULL, name, CONCAT(name, ' (', email, ')')), curr_code FROM ".TB_PREF."debtors_master ";

That should cover the majority of the places you might need to pick between two people with the same name.

The other alternative would be to use a nickname for one of them, but if it is not a nickname they actually USE, it would be confusing.

I'd suggest making the email address unique, but that may cause bigger problems for cases where email is not used... (if any)

Yes I know I could make a hack in my copy of the code, but I want to make sure any modules I provide can be used easily with out
too many (any?) additional changes to the base code.

Maybe there is another solution that you can think of that fits better within FA...
I am just looking for the best long term solutions...

tom

249

(59 replies, posted in Modules Add-on's)

Here's a FA DB question.

Does the debtors_master.name need to be unique?

osComerce uses the email address as being unique.

Tom

Base for auto price calculations:    

That was it, thanks