Jump to content

[Resolved] Delivery address & invoice address


Robin Somes

Recommended Posts

Using CC 6.06, Product_AddOns 1.02 on www.piscesconservation.com/cube

Just processed an order where the invoice address and delivery address were different. On printing the invoice to ship with the goods, only the delivery address is included. This is less than helpful.

I presume the relevant code is lines 24 to 33 of orders.print.php:
        <div id="printLabel">
          <div>
              {if !empty($order.name_d) && empty($order.last_name_d)}{$order.name_d}{else}{$order.title_d} {$order.first_name_d} {$order.last_name_d}{/if}<br>
              {if !empty($order.company_name_d)}{$order.company_name_d}<br>{/if}
              {$order.line1_d} <br>
              {if !empty($order.line2_d)}{$order.line2_d}<br>{/if}
              {$order.town_d}<br>
              {$order.state_d}, {$order.postcode_d}<br>
              {$order.country_d}
          </div>

No doubt I can amend the situation by hacking about, but should it not by default use the invoice address on the invoice?

Cheer,

Robin

 

Link to comment
Share on other sites

No and Yes (in my opinion).

The shipping manifest that is placed in the box really should contain a second area containing the delivery address. (The first, in the upper right, I cut off and tape to the box outside as the shipping label.) That way, if the box gets damaged and the shipping label gets obliterated, the shipper may still be able to complete delivery.

We would be interested to know why you think only having the destination address on the box's paperwork is less than helpful.

CubeCart has a setting that forces the customer's billing address to be the destination address. Many shops, to avoid fraud, will only ship to the customers billing address. And CubeCart can be set that way.

Link to comment
Share on other sites

Yes, I apologise for my less-than-accurate wording in the original. Should've been "On printing the invoice to *mail to the purchaser*, only the delivery address is included". The goods have been sent to the recipient, with a compliment slip. I now want to send an invoice to the fellow who has lashed out the pounds on the goods, who quite possibly needs a receipt with his own name on it, for accounting purposes. But only the recipient's name and address appears.

Link to comment
Share on other sites

I see your task as both interesting and perhaps misplaced.

I understand the purpose of a true 'invoice/statement'. And it would be nice to have CubeCart produce such a document. That can be done somewhat easily.

But, this then suggests that you are not using a true accounting program to manage the business's finances. I'm not saying you absolutely should - that's not for me to say. But I can say that I have never known CubeCart (I have no experience with any other online shop software) to even attempt to manage any aspect of the business's accounting.

For now, I conclude you are wanting a separate piece of paper (maybe an email?) that you can send to the billing address?

If so, in many cases, printing the shipping manifest actually prints two pages per order, the second page holding any customer comments and admin comments about the order. I think we can use this to our advantage by putting a form letter on this page with relevant details about the order that the customer's "accounts payable" department would need.

Your thoughts?

Link to comment
Share on other sites

Indeed, we simply want a piece of paper, with our company details, the details of the purchaser, the order number and date, the goods and the amount paid, to send to the purchaser. 

We generate income from a wide range of different sources, and so our accounting software is entirely separate from CubeCart.

The great majority of our customers bill to and receive goods to the same address. For most of those who don't, the email they received from PayPal or SagePay confirming their payment is more than sufficient. However, I can think of at least 4 scenarios where it may not be enough:
1. Universities and businesses, when the main office is purchasing software, books, etc for use by employees in off-campus departments or regional offices.

2. Self-employed and small businesses who suddenly realise at the end of the financial year that they need a paper receipt for their accounts, and have lost or deleted the email which was sent to them when they purchased the goods months before.

3. Overseas purchasers who have the goods delivered to a UK shipping agent for forwarding.

4. The situation I face today; man buys book for his friend/brother/workmate/employee/whatever he is. Book is sent to the recipient; cost of book or means of purchase is likely no business of the recipient. Perhaps it's a birthday present, even. So invoice if required goes to the purchaser.

And so on. For some an email would suffice, for others only a hard copy (or at least an invoice printed to PDF and emailed) would do. So, having an invoice address which doesn't appear on the invoice still seems... odd...

Link to comment
Share on other sites

I would ask that you create a word-processed document that shows (in not too great of detail), what you would like the page to be mailed to the customer's billing address. We can then work out how to get that written as Smarty template syntax and add that to the printout template.

Or, if you are handy with creating web pages directly, we can incorporate that HTML into the orders.print.php file.

In that template, starting near line 102...

{if !empty($order.notes)}
<div class="page-break">

...we can add the 'Statement' that will be mailed.

Link to comment
Share on other sites

I can and will do that if need be, but (as I see it) it could be simpler. The invoice that is printed when I click on the 'Print' button (on the overview page for the order) contains all the information that is needed (except the billing name & address), in the perfect format. If billing = delivery, then it's immaterial, but if both addresses exist, then it's always the billing address I want on the invoice. We print separate labels for the package, so I simply copy and paste that information from the order details.

The customer address block on that invoice contains the following variables from the delivery address:

$order.first_name_d, $order.last_name_d, $order.company_name_d, $order.line1_d,

$order.line2_d, $order.town_d, $order.state_d, $order.postcode_d, $order.country_d

The exact equivalent information from the billing address (presumably) exists as similar variables. So, is it feasible simply to replace the delivery address variables with the billing address variables (whatever they may be called, I can't actually track them down right now)  in that block, unless both addresses are the same? Or am I missing something fundamental?

Edited by Robin Somes
typos
Link to comment
Share on other sites

Yes, we can replace the delivery address data with the billing address data - with one additional edit to a core CubeCart file.

The billing address variables have the _d not as part of the variable name.

CubeCart's file that gathers the data and gives it to the template did not bother to convert the state/county numerical code and the country numerical code of the billing address to human-readable form, so we will need to make an edit in the appropriate code file.

I'll be back with that shortly.

Link to comment
Share on other sites

In /sources/orders.index.inc.php, near line 489:

Find:
	$summary['state_d'] = (is_numeric($summary['state_d'])) ? getStateFormat($summary['state_d']) : $summary['state_d'];
	$summary['country_d'] = getCountryFormat($summary['country_d']);

Add after:
	$summary['state'] = (is_numeric($summary['state'])) ? getStateFormat($summary['state']) : $summary['state'];
	$summary['country'] = getCountryFormat($summary['country']);

We now have actual state and country names for the billing address as part of the data set sent to the order shipping manifest.

Now, in the template file orders.print.php, you can change all the $variable_d to just $variable.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...