1 (edited by rodw 03/11/2010 05:16:26 am)

Topic: No Delivery Address on Purchase Order report

Hi Guys

I just tried to enter a couple of purchase orders where goods are to be shipped directly to my customers by the Supplier.

The Delivery Address I entered is shown when viewing the Purchas order button the printed report that goes to the Supplier, the Delivery Address is not shown. Instead it says Charge to: My Company Name.

Surely this is a bug? Not much point entering a delivery address if you don't tell the supplier what it is.

How can I fix this?

[b]RodW[/b]
Brisbane, QLD, Australia

Re: No Delivery Address on Purchase Order report

Yes, there is some inconsistence here, but fixing displayed addresses is not enough to support third party deliveries. How do you want to keep control over quantities delivered ? Currently  purchase invoice is always entered against GRNs, but items are never received into inventory in your case.

Unfortunately I cannot keep care of this bug right now, so please add the bug report to Mantis.

Janusz

Re: No Delivery Address on Purchase Order report

The main problem is simply the address as it is currenty meaningless for any supplier with no delivery address on it

Quantities should look after themselves. I raise a purchase order for an item to purchase it (add one to stock) and also a sales order and invoice for my customer (remove one from stock).

I just cut and paste the customer's delivery address into the purchase order when creating the purchase order.

I see the Purchase order is rep112.php but I can't work out where/how the delivery addrss block (right side might be formatted) Where do I look for an example?

[b]RodW[/b]
Brisbane, QLD, Australia

Re: No Delivery Address on Purchase Order report

Purchase order rep209, not rep122 (there is a mistake in header comment). Right address header is at he top of doctext/doctext2.inc, and content in header2.inc
Janusz

Re: No Delivery Address on Purchase Order report

OK, this is 1st effort ever at PHP, looking at this, it looks like:
1. Ammend function get_po($order_no) in rep209.php to retrieve the delivery address from PO as it does not seem to be in the SELECT statement.
2. Print the address in header 2.inc. I think that should be done by modifying this block:

if ($sales_order != NULL)
        {
            $this->row = $temp;
            if ($doctype == ST_PURCHORDER)
                $this->Text($mcol, $this->company['coy_name']);
            elseif ($doctype != ST_SUPPAYMENT && isset($sales_order['deliver_to']))
                $this->Text($mcol, $sales_order['deliver_to']);
            $this->NewLine();
            if ($doctype != ST_SUPPAYMENT && isset($sales_order['deliver_to']))
                $this->TextWrapLines($mcol, $this->rightMargin - $mcol, $sales_order['delivery_address']);
        }

3. Change Description in doctext.inc for the right hand text block to "Deliver to"

However, I see the delivery address is being printed for ST_SUPPAYMENT. Is that being retrieved elsewhere in which case I can skip step 1? That would be nice and easy!

Is there a list of report numbers somewhere? being able to find the  ST_SUPPAYMENT report would be a great help

[b]RodW[/b]
Brisbane, QLD, Australia

Re: No Delivery Address on Purchase Order report

Ah, Now I see it, I missed the purch_orders.*, in the select statement, the report gets all fields so I think I just start at step 2. Sounds too easy. I am sure something will go wrong!

[b]RodW[/b]
Brisbane, QLD, Australia

Re: No Delivery Address on Purchase Order report

OK I got it, been working with 2.2.6 (why is it tat every time I install an open source product, a new version issues the next day?)

Header2.inc needs following changes

if ($sales_order != NULL)
        {
            $this->row = $temp;
//
// These modifications By RodW 12 March 2010 to make delivery Address Print On Purchase order
//
            if ($doctype == ST_PURCHORDER){
                //
                // RodW - Comment out following two lines if you don't want to print your own Company name
                //
                //$this->Text($mcol, $this->company['coy_name']);
                //$this->NewLine();
                //
                // RodW - Prints Delivery Address here
                $this->TextWrapLines($mcol, $this->rightMargin - $mcol, $sales_order['delivery_address']);
            }
//
// End RodW's Modifications
//
            elseif ($doctype != ST_SUPPAYMENT && isset($sales_order['deliver_to']))
                $this->Text($mcol, $sales_order['deliver_to']);
            $this->NewLine();
            if ($doctype != ST_SUPPAYMENT && isset($sales_order['deliver_to']))
                $this->TextWrapLines($mcol, $this->rightMargin - $mcol, $sales_order['delivery_address']);
        }

doctext.inc needs the following change right at the top of the file

if (isset($header2type))
{
    $doc_Cust_no = _("Cust no");
    $doc_Date = _("Date");
    if ($doctype == ST_PURCHORDER || $doctype == ST_SUPPAYMENT) // Purchase Order
    {
        $doc_Charge_To = _("Order To");
        $doc_Delivered_To = _("Charge To");
//
// Changes by RodW 10 March 2010 to print delivery address on Purchase order
//
        if ($doctype == ST_PURCHORDER)
            $doc_Delivered_To = _("Deliver To");
//
// End Changes by RodW
//

Sorry Notepad does not count lines! sad

I don't think the Name of your company (coy_name) should be printed in the delivery address. A lot of companies eg a building suupply company would have the same requirement to ship to a totally different address. eg.  A builder orders building material that is delivered to my front lawn for a job he is doing for me.

[b]RodW[/b]
Brisbane, QLD, Australia