It appears that Dolibarr does not allow me to print “Bill To” and “Deliver To” (alternate addresses) on my Sales Orders. I have tried setting of ODT templates to add this type of information, but I don’t have enough background to make the necessary changes.
First approach: Is there any way to link the ODT ‘tag’ for Sales Order “Customer invoice contact” or “Customer shipping contact” or “Customer contact following-up order”?
Second approach: If there is no way to accomplish the First approach, can I setup Complimentary fields to select a new Contact, and then load the Contact Address automatically? For instance, 1 field called “Delivery Contact” and 2 field called “Delivery Address”.
Any help would be greatly appreciated! I don’t understand how to set up Dolibarr so that I can sell goods to a Customer who has multiple warehouse locations???
Okay, I’ll reply at a later time or date with more details. I am using something a little similar - though I link to other Thirdparties, but I expect it to be trivial to change to contacts.
I am not sure it can bring up the address though :-/
I have 2 fields on my proposal, one links to another thirdparty and the other links to proposal on that other thirdparty.
I use it for a dance class registration system, where the other thirdparty is their dance partner and the proposal link is to the dance partners registration. (the last linke I haven’t coded yet, just prepared.
You need to create the link using a Value like this_
you can of course give it a Label like “Delivery Contact” or “Delivery Address”.
For me it shows up on a Proposal like the smallest picture below
I don’t 100% know what you mean with “pull up the Address” but if I click the link inside Dolibarr I’ll be taken to the other Thirdparty or Proposal. So surely clicking a link for you could take you to a Contact.
Thanks @jonbendtsen
I have that set up the same as you explanation. Now I just need to ‘compute’ the contact Address (in another Complimentary attribute) in order to display it on the Sales Order.
I need to generate a Contact Address string for a Sales Order (to be included in my doc template).
How to setup Complimentary fields to select a new Contact, and then load the Contact Address automatically? For instance, 1 field called “Delivery Contact” and 2 field called “Delivery Address”.
I have already figured out how to use the ‘Select from table’ option. But when I include it on my .ODT, it only displays the rowid (for instance: “8”). Maybe there is a way to convert to a string?
If not, if anyone has an idea how to do this, please help!
Possibly also an third party extra field (checkbox/combolist/…) for the selection of the contact (checkbox: checked = use contact address, not checked = use company address)
Store the contact with the new contact type under the third party contacts.
Create a new function in the ODT module with a corresponding database query for the contact with this contact type and store the result in the tags “object_delivery_contact” and/or “object_delivery_address”
Is there no way without changing source code? Your solution makes perfect sense, but I’m not a very accomplished programmer (don’t get me wrong, I’m willing to learn). It seems like this could be done without source code???
If I may ask you some questions:
Should Dolibarr not already do this on some level? (It’s a very common business practice to show this information on a Sales Order. How are others using this module?)
Why when I use “select from table” field to select a “Contact”, does it only result in “8” (rowid) on my ODT doc? Any way to produce a string?
Using Complimentary field::: (($reloadedobj = new socpeople($db)) && ($reloadedobj->fetch(8) > 0)) ? $reloadedobj->address : ‘not found’ ::: does not work for me. How can I pull “address” string from “Contacts” table?
I would think that some combination of the Complimentary Attributes: “Link to an object”, “Select from table”, and “String/Computed field” could accomplish this goal. Where is the err in my logic?
Hi @jh482002
I started with odt as well because at first glance seemed easier to customize and style but i soon realized that functionality wise is underdeveloped and i had to jump through hoops every time i wanted to add sth and finally all this just to generate a pdf!
Process description for v. 20.0.0 with pdf models
From a purchase order or a signed proposal(cyan) with billing and shipping contacts info entered, you can generate a sales order(eratosthene) which is usually an internal use document.
Employee that process it has no use for billing or shipping info and that is why there is no billing and shipping contacts in pdf.
After it is processed shipping sheet(espadon) contains shipping info and finally invoice(sponge) contains both billing and shipping contact info.
The classname is wrong. There is no object “socpeople”.
Exchange that with the correct classname “Contact” and you will get the address for the record with the rowid 8 from the db-table “llx_socpeople”.
And it gets even more complicated with different selectable addresses .
My previous method is perhaps more suitable here, but it requires a change to the source code.
But perhaps someone else has an even better, more suitable method
Sure, we are on 19.0.3 right now(i always wait for .1 release) but i test on a 20.0.0 instance and process is already better streamlined(automation wise) from 19 at this point!