23 if (!defined(
"NOCSRFCHECK")) define(
"NOCSRFCHECK",
'1');
25 require_once
'../master.inc.php';
26 require_once NUSOAP_PATH.
'/nusoap.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/ws.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
34 dol_syslog(
"Call Dolibarr webservices interfaces");
39 if (empty($conf->global->MAIN_MODULE_WEBSERVICES))
41 $langs->load(
"admin");
42 dol_syslog(
"Call Dolibarr webservices interfaces with module webservices disabled");
43 print $langs->trans(
"WarningModuleNotActive",
'WebServices').
'.<br><br>';
44 print $langs->trans(
"ToActivateModule");
49 $server =
new nusoap_server();
50 $server->soap_defencoding =
'UTF-8';
51 $server->decode_utf8 =
false;
52 $ns =
'http://www.dolibarr.org/ns/';
53 $server->configureWSDL(
'WebServicesDolibarrThirdParty', $ns);
54 $server->wsdl->schemaTargetNamespace = $ns;
58 $server->wsdl->addComplexType(
65 'dolibarrkey' => array(
'name'=>
'dolibarrkey',
'type'=>
'xsd:string'),
66 'sourceapplication' => array(
'name'=>
'sourceapplication',
'type'=>
'xsd:string'),
67 'login' => array(
'name'=>
'login',
'type'=>
'xsd:string'),
68 'password' => array(
'name'=>
'password',
'type'=>
'xsd:string'),
69 'entity' => array(
'name'=>
'entity',
'type'=>
'xsd:string'),
73 $server->wsdl->addComplexType(
80 'result_code' => array(
'name'=>
'result_code',
'type'=>
'xsd:string'),
81 'result_label' => array(
'name'=>
'result_label',
'type'=>
'xsd:string'),
86 $thirdparty_fields = array(
87 'id' => array(
'name'=>
'id',
'type'=>
'xsd:string'),
88 'ref' => array(
'name'=>
'name',
'type'=>
'xsd:string'),
89 'ref_ext' => array(
'name'=>
'ref_ext',
'type'=>
'xsd:string'),
90 'fk_user_author' => array(
'name'=>
'fk_user_author',
'type'=>
'xsd:string'),
91 'status' => array(
'name'=>
'status',
'type'=>
'xsd:string'),
92 'client' => array(
'name'=>
'client',
'type'=>
'xsd:string'),
93 'supplier' => array(
'name'=>
'supplier',
'type'=>
'xsd:string'),
94 'customer_code' => array(
'name'=>
'customer_code',
'type'=>
'xsd:string'),
95 'supplier_code' => array(
'name'=>
'supplier_code',
'type'=>
'xsd:string'),
96 'customer_code_accountancy' => array(
'name'=>
'customer_code_accountancy',
'type'=>
'xsd:string'),
97 'supplier_code_accountancy' => array(
'name'=>
'supplier_code_accountancy',
'type'=>
'xsd:string'),
98 'date_creation' => array(
'name'=>
'date_creation',
'type'=>
'xsd:dateTime'),
99 'date_modification' => array(
'name'=>
'date_modification',
'type'=>
'xsd:dateTime'),
100 'note_private' => array(
'name'=>
'note_private',
'type'=>
'xsd:string'),
101 'note_public' => array(
'name'=>
'note_public',
'type'=>
'xsd:string'),
102 'address' => array(
'name'=>
'address',
'type'=>
'xsd:string'),
103 'zip' => array(
'name'=>
'zip',
'type'=>
'xsd:string'),
104 'town' => array(
'name'=>
'town',
'type'=>
'xsd:string'),
105 'province_id' => array(
'name'=>
'province_id',
'type'=>
'xsd:string'),
106 'country_id' => array(
'name'=>
'country_id',
'type'=>
'xsd:string'),
107 'country_code' => array(
'name'=>
'country_code',
'type'=>
'xsd:string'),
108 'country' => array(
'name'=>
'country',
'type'=>
'xsd:string'),
109 'phone' => array(
'name'=>
'phone',
'type'=>
'xsd:string'),
110 'fax' => array(
'name'=>
'fax',
'type'=>
'xsd:string'),
111 'email' => array(
'name'=>
'email',
'type'=>
'xsd:string'),
112 'url' => array(
'name'=>
'url',
'type'=>
'xsd:string'),
113 'profid1' => array(
'name'=>
'profid1',
'type'=>
'xsd:string'),
114 'profid2' => array(
'name'=>
'profid2',
'type'=>
'xsd:string'),
115 'profid3' => array(
'name'=>
'profid3',
'type'=>
'xsd:string'),
116 'profid4' => array(
'name'=>
'profid4',
'type'=>
'xsd:string'),
117 'profid5' => array(
'name'=>
'profid5',
'type'=>
'xsd:string'),
118 'profid6' => array(
'name'=>
'profid6',
'type'=>
'xsd:string'),
119 'capital' => array(
'name'=>
'capital',
'type'=>
'xsd:string'),
120 'vat_used' => array(
'name'=>
'vat_used',
'type'=>
'xsd:string'),
121 'vat_number' => array(
'name'=>
'vat_number',
'type'=>
'xsd:string'));
123 $elementtype =
'societe';
128 $extrafields->fetch_name_optionals_label($elementtype,
true);
129 $extrafield_array = null;
130 if (is_array($extrafields) && count($extrafields) > 0) {
131 $extrafield_array = array();
133 if (isset($extrafields->attributes[$elementtype][
'label']) && is_array($extrafields->attributes[$elementtype][
'label']) && count($extrafields->attributes[$elementtype][
'label']))
135 foreach ($extrafields->attributes[$elementtype][
'label'] as $key => $label)
138 $type = $extrafields->attributes[$elementtype][
'type'][$key];
139 if ($type ==
'date' || $type ==
'datetime') {$type =
'xsd:dateTime'; }
140 else {$type =
'xsd:string'; }
142 $extrafield_array[
'options_'.$key] = array(
'name'=>
'options_'.$key,
'type'=>$type);
146 if (is_array($extrafield_array)) $thirdparty_fields = array_merge($thirdparty_fields, $extrafield_array);
149 $server->wsdl->addComplexType(
159 $server->wsdl->addComplexType(
167 'client' => array(
'name'=>
'client',
'type'=>
'xsd:string'),
168 'supplier' => array(
'name'=>
'supplier',
'type'=>
'xsd:string'),
169 'category' => array(
'name'=>
'category',
'type'=>
'xsd:string')
173 $server->wsdl->addComplexType(
181 array(
'ref'=>
'SOAP-ENC:arrayType',
'wsdl:arrayType'=>
'tns:thirdparty[]')
185 $server->wsdl->addComplexType(
186 'ThirdPartiesArray2',
192 'thirdparty' => array(
193 'name' =>
'thirdparty',
194 'type' =>
'tns:thirdparty',
196 'maxOccurs' =>
'unbounded'
206 $styleuse =
'encoded';
213 array(
'authentication'=>
'tns:authentication',
'id'=>
'xsd:string',
'ref'=>
'xsd:string',
'ref_ext'=>
'xsd:string'),
215 array(
'result'=>
'tns:result',
'thirdparty'=>
'tns:thirdparty'),
217 $ns.
'#getThirdParty',
220 'WS to get a thirdparty from its id, ref or ref_ext'
227 array(
'authentication'=>
'tns:authentication',
'thirdparty'=>
'tns:thirdparty'),
229 array(
'result'=>
'tns:result',
'id'=>
'xsd:string',
'ref'=>
'xsd:string'),
231 $ns.
'#createThirdParty',
234 'WS to create a thirdparty'
241 array(
'authentication'=>
'tns:authentication',
'thirdparty'=>
'tns:thirdparty'),
243 array(
'result'=>
'tns:result',
'id'=>
'xsd:string'),
245 $ns.
'#updateThirdParty',
248 'WS to update a thirdparty'
254 'getListOfThirdParties',
256 array(
'authentication'=>
'tns:authentication',
'filterthirdparty'=>
'tns:filterthirdparty'),
258 array(
'result'=>
'tns:result',
'thirdparties'=>
'tns:ThirdPartiesArray2'),
260 $ns.
'#getListOfThirdParties',
263 'WS to get list of thirdparties id and ref'
270 array(
'authentication'=>
'tns:authentication',
'id'=>
'xsd:string',
'ref'=>
'xsd:string',
'ref_ext'=>
'xsd:string'),
272 array(
'result'=>
'tns:result',
'id'=>
'xsd:string'),
274 $ns.
'#deleteThirdParty',
277 'WS to delete a thirdparty from its id, ref or ref_ext'
295 dol_syslog(
"Function: getThirdParty login=".$authentication[
'login'].
" id=".$id.
" ref=".$ref.
" ref_ext=".$ref_ext);
297 if ($authentication[
'entity']) $conf->entity = $authentication[
'entity'];
300 $objectresp = array();
301 $errorcode =
''; $errorlabel =
'';
305 if (!$error && (($id && $ref) || ($id && $ref_ext) || ($ref && $ref_ext)))
308 $errorcode =
'BAD_PARAMETERS'; $errorlabel =
"Parameter id, ref and ref_ext can't be both provided. You must choose one or other but not both.";
315 if ($fuser->rights->societe->lire)
317 $thirdparty =
new Societe($db);
318 $result = $thirdparty->fetch($id, $ref, $ref_ext);
321 $thirdparty_result_fields = array(
322 'id' => $thirdparty->id,
323 'ref' => $thirdparty->name,
324 'ref_ext' => $thirdparty->ref_ext,
325 'status' => $thirdparty->status,
326 'client' => $thirdparty->client,
327 'supplier' => $thirdparty->fournisseur,
328 'customer_code' => $thirdparty->code_client,
329 'supplier_code' => $thirdparty->code_fournisseur,
330 'customer_code_accountancy' => $thirdparty->code_compta,
331 'supplier_code_accountancy' => $thirdparty->code_compta_fournisseur,
332 'user_creation' => $thirdparty->user_creation,
333 'date_creation' =>
dol_print_date($thirdparty->date_creation,
'dayhourrfc'),
334 'user_modification' => $thirdparty->user_modification,
335 'date_modification' =>
dol_print_date($thirdparty->date_modification,
'dayhourrfc'),
336 'address' => $thirdparty->address,
337 'zip' => $thirdparty->zip,
338 'town' => $thirdparty->town,
339 'province_id' => $thirdparty->state_id,
340 'country_id' => $thirdparty->country_id,
341 'country_code' => $thirdparty->country_code,
342 'country' => $thirdparty->country,
343 'phone' => $thirdparty->phone,
344 'fax' => $thirdparty->fax,
345 'email' => $thirdparty->email,
346 'url' => $thirdparty->url,
347 'profid1' => $thirdparty->idprof1,
348 'profid2' => $thirdparty->idprof2,
349 'profid3' => $thirdparty->idprof3,
350 'profid4' => $thirdparty->idprof4,
351 'profid5' => $thirdparty->idprof5,
352 'profid6' => $thirdparty->idprof6,
353 'capital' => $thirdparty->capital,
354 'barcode' => $thirdparty->barcode,
355 'vat_used' => $thirdparty->tva_assuj,
356 'vat_number' => $thirdparty->tva_intra,
357 'note_private' => $thirdparty->note_private,
358 'note_public' => $thirdparty->note_public);
360 $elementtype =
'societe';
365 $extrafields->fetch_name_optionals_label($elementtype,
true);
367 $thirdparty->fetch_optionals();
369 if (isset($extrafields->attributes[$elementtype][
'label']) && is_array($extrafields->attributes[$elementtype][
'label']) && count($extrafields->attributes[$elementtype][
'label']))
371 foreach ($extrafields->attributes[$elementtype][
'label'] as $key => $label)
373 if (isset($thirdparty->array_options[
'options_'.$key])) {
374 $thirdparty_result_fields = array_merge($thirdparty_result_fields, array(
'options_'.$key => $thirdparty->array_options[
'options_'.$key]));
381 'result'=>array(
'result_code'=>
'OK',
'result_label'=>
''),
382 'thirdparty'=>$thirdparty_result_fields);
386 $errorcode =
'NOT_FOUND'; $errorlabel =
'Object not found for id='.$id.
' nor ref='.$ref.
' nor ref_ext='.$ref_ext;
391 $errorcode =
'PERMISSION_DENIED'; $errorlabel =
'User does not have permission for this request';
397 $objectresp = array(
'result'=>array(
'result_code' => $errorcode,
'result_label' => $errorlabel));
418 dol_syslog(
"Function: createThirdParty login=".$authentication[
'login']);
420 if ($authentication[
'entity']) $conf->entity = $authentication[
'entity'];
423 $objectresp = array();
424 $errorcode =
''; $errorlabel =
'';
428 if (empty($thirdparty[
'ref']))
430 $error++; $errorcode =
'KO'; $errorlabel =
"Name is mandatory.";
436 include_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
439 $newobject->ref = $thirdparty[
'ref'];
440 $newobject->name = $thirdparty[
'ref'];
441 $newobject->ref_ext = $thirdparty[
'ref_ext'];
442 $newobject->status = $thirdparty[
'status'];
443 $newobject->client = $thirdparty[
'client'];
444 $newobject->fournisseur = $thirdparty[
'supplier'];
445 $newobject->code_client = $thirdparty[
'customer_code'];
446 $newobject->code_fournisseur = $thirdparty[
'supplier_code'];
447 $newobject->code_compta = $thirdparty[
'customer_code_accountancy'];
448 $newobject->code_compta_fournisseur = $thirdparty[
'supplier_code_accountancy'];
449 $newobject->date_creation = $now;
450 $newobject->note_private = $thirdparty[
'note_private'];
451 $newobject->note_public = $thirdparty[
'note_public'];
452 $newobject->address = $thirdparty[
'address'];
453 $newobject->zip = $thirdparty[
'zip'];
454 $newobject->town = $thirdparty[
'town'];
456 $newobject->country_id = $thirdparty[
'country_id'];
457 if ($thirdparty[
'country_code']) $newobject->country_id =
getCountry($thirdparty[
'country_code'], 3);
458 $newobject->province_id = $thirdparty[
'province_id'];
461 $newobject->phone = $thirdparty[
'phone'];
462 $newobject->fax = $thirdparty[
'fax'];
463 $newobject->email = $thirdparty[
'email'];
464 $newobject->url = $thirdparty[
'url'];
465 $newobject->idprof1 = $thirdparty[
'profid1'];
466 $newobject->idprof2 = $thirdparty[
'profid2'];
467 $newobject->idprof3 = $thirdparty[
'profid3'];
468 $newobject->idprof4 = $thirdparty[
'profid4'];
469 $newobject->idprof5 = $thirdparty[
'profid5'];
470 $newobject->idprof6 = $thirdparty[
'profid6'];
472 $newobject->capital = $thirdparty[
'capital'];
474 $newobject->barcode = empty($thirdparty[
'barcode']) ?
'' : $thirdparty[
'barcode'];
475 $newobject->tva_assuj = empty($thirdparty[
'vat_used']) ? 0 : $thirdparty[
'vat_used'];
476 $newobject->tva_intra = empty($thirdparty[
'vat_number']) ?
'' : $thirdparty[
'vat_number'];
478 $newobject->canvas = empty($thirdparty[
'canvas']) ?
'' : $thirdparty[
'canvas'];
479 $newobject->particulier = empty($thirdparty[
'individual']) ? 0 : $thirdparty[
'individual'];
481 $elementtype =
'societe';
486 $extrafields->fetch_name_optionals_label($elementtype,
true);
487 if (isset($extrafields->attributes[$elementtype][
'label']) && is_array($extrafields->attributes[$elementtype][
'label']) && count($extrafields->attributes[$elementtype][
'label']))
489 foreach ($extrafields->attributes[$elementtype][
'label'] as $key => $label)
491 $key =
'options_'.$key;
492 if (isset($thirdparty[$key])) {
493 $newobject->array_options[$key] = $thirdparty[$key];
500 $result = $newobject->create($fuser);
501 if ($newobject->particulier && $result > 0) {
502 $newobject->firstname = $thirdparty[
'firstname'];
503 $newobject->name_bis = $thirdparty[
'lastname'];
504 $result = $newobject->create_individual($fuser);
516 if (!empty($thirdparty[
'commid']) && $thirdparty[
'commid'] > 0)
517 $newobject->add_commercial($fuser, $thirdparty[
"commid"]);
519 $objectresp = array(
'result'=>array(
'result_code'=>
'OK',
'result_label'=>
''),
'id'=>$newobject->id,
'ref'=>$newobject->ref);
525 $errorlabel = $newobject->error;
531 $objectresp = array(
'result'=>array(
'result_code' => $errorcode,
'result_label' => $errorlabel));
550 dol_syslog(
"Function: updateThirdParty login=".$authentication[
'login']);
552 if ($authentication[
'entity']) $conf->entity = $authentication[
'entity'];
555 $objectresp = array();
556 $errorcode =
''; $errorlabel =
'';
560 if (empty($thirdparty[
'id'])) {
561 $error++; $errorcode =
'KO'; $errorlabel =
"Thirdparty id is mandatory.";
566 $objectfound =
false;
568 include_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
571 $result = $object->fetch($thirdparty[
'id']);
573 if (!empty($object->id)) {
576 $object->ref = $thirdparty[
'ref'];
577 $object->name = $thirdparty[
'ref'];
578 $object->ref_ext = $thirdparty[
'ref_ext'];
579 $object->status = $thirdparty[
'status'];
580 $object->client = $thirdparty[
'client'];
581 $object->fournisseur = $thirdparty[
'supplier'];
582 $object->code_client = $thirdparty[
'customer_code'];
583 $object->code_fournisseur = $thirdparty[
'supplier_code'];
584 $object->code_compta = $thirdparty[
'customer_code_accountancy'];
585 $object->code_compta_fournisseur = $thirdparty[
'supplier_code_accountancy'];
586 $object->date_creation = $now;
587 $object->note_private = $thirdparty[
'note_private'];
588 $object->note_public = $thirdparty[
'note_public'];
589 $object->address = $thirdparty[
'address'];
590 $object->zip = $thirdparty[
'zip'];
591 $object->town = $thirdparty[
'town'];
593 $object->country_id = $thirdparty[
'country_id'];
594 if ($thirdparty[
'country_code']) $object->country_id =
getCountry($thirdparty[
'country_code'], 3);
595 $object->province_id = $thirdparty[
'province_id'];
598 $object->phone = $thirdparty[
'phone'];
599 $object->fax = $thirdparty[
'fax'];
600 $object->email = $thirdparty[
'email'];
601 $object->url = $thirdparty[
'url'];
602 $object->idprof1 = $thirdparty[
'profid1'];
603 $object->idprof2 = $thirdparty[
'profid2'];
604 $object->idprof3 = $thirdparty[
'profid3'];
605 $object->idprof4 = $thirdparty[
'profid4'];
606 $object->idprof5 = $thirdparty[
'profid5'];
607 $object->idprof6 = $thirdparty[
'profid6'];
609 $object->capital = $thirdparty[
'capital'];
611 $object->barcode = $thirdparty[
'barcode'];
612 $object->tva_assuj = $thirdparty[
'vat_used'];
613 $object->tva_intra = $thirdparty[
'vat_number'];
615 $object->canvas = $thirdparty[
'canvas'];
617 $elementtype =
'societe';
622 $extrafields->fetch_name_optionals_label($elementtype,
true);
623 if (isset($extrafields->attributes[$elementtype][
'label']) && is_array($extrafields->attributes[$elementtype][
'label']) && count($extrafields->attributes[$elementtype][
'label']))
625 foreach ($extrafields->attributes[$elementtype][
'label'] as $key => $label)
627 $key =
'options_'.$key;
628 if (isset($thirdparty[$key])) {
629 $object->array_options[$key] = $thirdparty[$key];
636 $result = $object->update($thirdparty[
'id'], $fuser);
642 if ((!$error) && ($objectfound))
646 'result'=>array(
'result_code'=>
'OK',
'result_label'=>
''),
650 elseif ($objectfound)
655 $errorlabel = $object->error;
658 $errorcode =
'NOT_FOUND';
659 $errorlabel =
'Thirdparty id='.$thirdparty[
'id'].
' cannot be found';
665 $objectresp = array(
'result'=>array(
'result_code' => $errorcode,
'result_label' => $errorlabel));
684 dol_syslog(
"Function: getListOfThirdParties login=".$authentication[
'login']);
686 if ($authentication[
'entity']) $conf->entity = $authentication[
'entity'];
689 $objectresp = array();
690 $arraythirdparties = array();
692 $errorcode =
''; $errorlabel =
'';
699 $sql =
"SELECT s.rowid as socRowid, s.nom as ref, s.ref_ext, s.address, s.zip, s.town, c.label as country, s.phone, s.fax, s.url, extra.*";
700 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
701 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as c ON s.fk_pays = c.rowid";
702 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe_extrafields as extra ON s.rowid=fk_object";
704 $sql .=
" WHERE entity=".$conf->entity;
705 foreach ($filterthirdparty as $key => $val)
707 if ($key ==
'name' && $val !=
'') $sql .=
" AND s.name LIKE '%".$db->escape($val).
"%'";
708 if ($key ==
'client' && (
int) $val > 0) $sql .=
" AND s.client = ".$db->escape($val);
709 if ($key ==
'supplier' && (
int) $val > 0) $sql .=
" AND s.fournisseur = ".$db->escape($val);
710 if ($key ==
'category' && (
int) $val > 0) $sql .=
" AND s.rowid IN (SELECT fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe WHERE fk_categorie=".$db->escape($val).
") ";
712 dol_syslog(
"Function: getListOfThirdParties", LOG_DEBUG);
714 $elementtype =
'societe';
717 $extrafields->fetch_name_optionals_label($elementtype,
true);
720 $resql = $db->query($sql);
723 $num = $db->num_rows(
$resql);
728 $extrafieldsOptions = array();
729 $obj = $db->fetch_object(
$resql);
731 if (isset($extrafields->attributes[$elementtype][
'label']) && is_array($extrafields->attributes[$elementtype][
'label']) && count($extrafields->attributes[$elementtype][
'label']))
733 foreach ($extrafields->attributes[$elementtype][
'label'] as $key => $label)
735 if (isset($obj->{$key})) {
736 $extrafieldsOptions[
'options_'.$key] = $obj->{$key};
741 $arraythirdparties[] = array(
'id'=>$obj->socRowid,
743 'ref_ext'=>$obj->ref_ext,
744 'adress'=>$obj->adress,
747 'country'=>$obj->country,
748 'phone'=>$obj->phone,
752 $arraythirdparties[$i] = array_merge($arraythirdparties[$i], $extrafieldsOptions);
759 $errorcode = $db->lasterrno();
760 $errorlabel = $db->lasterror();
767 'result'=>array(
'result_code' => $errorcode,
'result_label' => $errorlabel),
768 'thirdparties'=>$arraythirdparties
773 'result'=>array(
'result_code' =>
'OK',
'result_label' =>
''),
774 'thirdparties'=>$arraythirdparties
794 dol_syslog(
"Function: deleteThirdParty login=".$authentication[
'login'].
" id=".$id.
" ref=".$ref.
" ref_ext=".$ref_ext);
796 if ($authentication[
'entity']) $conf->entity = $authentication[
'entity'];
799 $objectresp = array();
800 $errorcode =
''; $errorlabel =
'';
804 if (!$error && (($id && $ref) || ($id && $ref_ext) || ($ref && $ref_ext)))
806 dol_syslog(
"Function: deleteThirdParty checkparam");
808 $errorcode =
'BAD_PARAMETERS'; $errorlabel =
"Parameter id, ref and ref_ext can't be both provided. You must choose one or other but not both.";
816 if ($fuser->rights->societe->lire && $fuser->rights->societe->supprimer)
818 $thirdparty =
new Societe($db);
819 $result = $thirdparty->fetch($id, $ref, $ref_ext);
825 $result = $thirdparty->delete($thirdparty->id, $fuser);
831 $objectresp = array(
'result'=>array(
'result_code'=>
'OK',
'result_label'=>
''));
837 $errorlabel = $thirdparty->error;
838 dol_syslog(
"Function: deleteThirdParty cant delete");
843 $errorcode =
'NOT_FOUND'; $errorlabel =
'Object not found for id='.$id.
' nor ref='.$ref.
' nor ref_ext='.$ref_ext;
848 $errorcode =
'PERMISSION_DENIED'; $errorlabel =
'User does not have permission for this request';
854 $objectresp = array(
'result'=>array(
'result_code' => $errorcode,
'result_label' => $errorlabel));
861 $server->service(file_get_contents(
"php://input"));
check_authentication($authentication, &$error, &$errorcode, &$errorlabel)
Check authentication array and set error, errorcode, errorlabel.
deleteThirdParty($authentication, $id= '', $ref= '', $ref_ext= '')
Delete a thirdparty.
dol_now($mode= 'auto')
Return date for now.
updateThirdParty($authentication, $thirdparty)
Update a thirdparty.
createThirdParty($authentication, $thirdparty)
Create a thirdparty.
Class to manage third parties objects (customers, suppliers, prospects...)
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
print
Draft customers invoices.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
getThirdParty($authentication, $id= '', $ref= '', $ref_ext= '')
Get a thirdparty.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
getCountry($searchkey, $withcode= '', $dbtouse=0, $outputlangs= '', $entconv=1, $searchlabel= '')
Return country label, code or id from an id, code or label.
getListOfThirdParties($authentication, $filterthirdparty)
getListOfThirdParties