Welcome, Guest
Username: Password: Remember me

TOPIC: How to link a invoice with a contract using the AP

How to link a invoice with a contract using the AP 1 month 3 weeks ago #33404

  • dboulo
  • dboulo's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Karma: 0
Hello,
I'm developing an order/contract module in a web site and I need to send the contract to Dolibarr. I want to create a contract and its lines using the API, then validate the contract and then create an invoice linked with the contract. I have succeed in creating both using the API but I can't link them.
Thanks in advance.
The administrator has disabled public write access.

How to link a invoice with a contract using the AP 1 month 3 weeks ago #33405

  • eldy
  • eldy's Avatar
  • OFFLINE
  • Administrateur
  • Open Source ERP CRM expert.
  • Posts: 1674
  • Thank you received: 95
  • Karma: 173
When you create or update the contract or invoice, try to fill the array linkedObjectsIds
The administrator has disabled public write access.

How to link a invoice with a contract using the AP 1 month 3 weeks ago #33417

  • dboulo
  • dboulo's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Karma: 0
Thanks for your answer. I've tried to modify the linkedobjectID, but I haven't succeed in finding the right syntax. I've seen in the data sent by the API
'linkedObjectsIds' =>
array (
'contrat' =>
array (
7 => '3',
),
),

but I don't understand what 7 means.
Regards
The administrator has disabled public write access.

How to link a invoice with a contract using the AP 1 week 1 day ago #33669

  • michielp
  • michielp's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 12
  • Karma: 0
The 7 is in the database the link id between the contract and the invoice.

I have created via API, the link between the contract and the invoice with:
invoice = contractId
I hope that helps
The administrator has disabled public write access.

How to link a invoice with a contract using the AP 1 week 1 day ago #33670

  • michielp
  • michielp's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 12
  • Karma: 0
The 7 is in the database the link id between the contract and the invoice.

I have created via API, the link between the contract and the invoice with:
invoice['linkedObjectsIds']['contrat'] = contractId
I hope that helps

PS. Some texts got interpreted by bbcode
The administrator has disabled public write access.
Time to create page: 0.096 seconds