336 if ($this->element ===
'facture') {
337 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
340 if (
$object->fetch($this->fk_object) > 0) {
343 $this->error = (string) (((
int) $this->error) + 1);
346 if ($this->element ===
'invoice_supplier') {
347 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
350 if (
$object->fetch($this->fk_object) > 0) {
353 $this->error = (string) (((
int) $this->error) + 1);
355 } elseif ($this->element ===
'payment') {
356 require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
359 if (
$object->fetch($this->fk_object) > 0) {
362 $this->error = (string) (((
int) $this->error) + 1);
364 } elseif ($this->element ===
'payment_supplier') {
365 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/paiementfourn.class.php';
368 if (
$object->fetch($this->fk_object) > 0) {
371 $this->error = (string) (((
int) $this->error) + 1);
373 } elseif ($this->element ===
'payment_donation') {
374 require_once DOL_DOCUMENT_ROOT.
'/don/class/paymentdonation.class.php';
377 if (
$object->fetch($this->fk_object) > 0) {
380 $this->error = (string) (((
int) $this->error) + 1);
382 } elseif ($this->element ===
'payment_various') {
383 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/paymentvarious.class.php';
386 if (
$object->fetch($this->fk_object) > 0) {
389 $this->error = (string) (((
int) $this->error) + 1);
391 } elseif ($this->element ===
'don' || $this->element ===
'donation') {
392 require_once DOL_DOCUMENT_ROOT.
'/don/class/don.class.php';
395 if (
$object->fetch($this->fk_object) > 0) {
398 $this->error = (string) (((
int) $this->error) + 1);
400 } elseif ($this->element ===
'subscription') {
401 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/subscription.class.php';
404 if (
$object->fetch($this->fk_object) > 0) {
407 $this->error = (string) (((
int) $this->error) + 1);
409 } elseif ($this->element ===
'cashcontrol') {
410 require_once DOL_DOCUMENT_ROOT.
'/compta/cashcontrol/class/cashcontrol.class.php';
413 if (
$object->fetch($this->fk_object) > 0) {
416 $this->error = (string) (((
int) $this->error) + 1);
418 } elseif ($this->element ===
'stockmouvement') {
419 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/mouvementstock.class.php';
422 if (
$object->fetch($this->fk_object) > 0) {
425 $this->error = (string) (((
int) $this->error) + 1);
427 } elseif ($this->element ===
'project') {
428 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
431 if (
$object->fetch($this->fk_object) > 0) {
434 $this->error = (string) (((
int) $this->error) + 1);
436 } elseif ($this->action ==
'BLOCKEDLOG_EXPORT') {
437 return '<i class="opacitymedium">'.$langs->trans(
"logBLOCKEDLOG_EXPORT").
'</i>';
438 } elseif ($this->action ==
'MODULE_SET') {
439 return '<i class="opacitymedium">'.$langs->trans(
"BlockedLogEnabled").
'</i>';
440 } elseif ($this->action ==
'MODULE_RESET') {
441 if ($this->signature ==
'0000000000') {
442 return '<i class="opacitymedium">'.$langs->trans(
"BlockedLogDisabled").
'</i>';
444 return '<i class="opacitymedium">'.$langs->trans(
"BlockedLogDisabledBis").
'</i>';
448 return '<i class="opacitymedium">'.$langs->trans(
'ImpossibleToReloadObject', $this->element, $this->fk_object).
'</i>';
492 global $langs, $user,
$mysoc;
494 if (is_object($fuser)) {
501 $this->action = $action;
503 $this->amounts_taxexcl = $amounts_taxexcl;
504 $this->amounts = $amounts;
506 if (
$object->element ==
'payment' ||
$object->element ==
'payment_supplier') {
507 '@phan-var-force Paiement|PaiementFourn $object';
509 } elseif (
$object->element ==
'payment_salary') {
510 '@phan-var-force PaymentSalary $object';
511 $this->date_object =
$object->datev;
512 } elseif (
$object->element ==
'payment_donation' ||
$object->element ==
'payment_various') {
513 '@phan-var-force PaymentDonation $object';
515 } elseif (
$object->element ==
'subscription') {
516 '@phan-var-force Subscription $object';
517 $this->date_object =
$object->dateh;
518 } elseif (
$object->element ==
'cashcontrol') {
520 '@phan-var-force CashControl $object';
521 $this->date_object =
$object->date_creation;
522 } elseif (property_exists(
$object,
'date')) {
524 $this->date_object =
$object->date;
525 } elseif (property_exists(
$object,
'datem')) {
527 $this->date_object =
$object->datem;
531 if (
$object->element ==
'invoice_supplier') {
532 '@phan-var-force FactureFournisseur $object';
535 $invoice->fetch(
$object->fk_facture_source);
536 if ($invoice->id > 0) {
537 $this->linktype =
'credit_note_of';
538 $this->linktoref = $invoice->ref;
543 if (
$object->element ==
'facture') {
544 '@phan-var-force Facture $object';
546 $invoice =
new Facture($this->db);
547 $invoice->fetch(
$object->fk_facture_source);
548 if ($invoice->id > 0) {
549 $this->linktype =
'credit_note_of';
550 $this->linktoref = $invoice->ref;
552 $this->module_source = (string) $invoice->module_source;
559 $this->element =
$object->element;
561 $this->fk_object =
$object->id;
564 if (empty(
$object->thirdparty) && method_exists(
$object,
'fetch_thirdparty')) {
570 $this->object_data =
new stdClass();
573 $arrayoffieldstoexclude = array(
574 'table_element',
'fields',
575 'ref_previous',
'ref_next',
576 'origin',
'origin_id',
577 'oldcopy',
'picto',
'error',
'errors',
578 'model_pdf',
'modelpdf',
'last_main_doc',
'civility_id',
'contact',
'contact_id',
579 'table_element_line',
'ismultientitymanaged',
'isextrafieldmanaged',
589 'fk_delivery_address',
591 'restrictiononfksoc',
596 if ($this->element ==
'cashcontrol') {
597 $arrayoffieldstoexclude = array_merge($arrayoffieldstoexclude, array(
598 'name',
'lastname',
'firstname',
'region',
'region_id',
'region_code',
'state',
'state_id',
'state_code',
'country',
'country_id',
'country_code',
599 'total_ht',
'total_tva',
'total_ttc',
'total_localtax1',
'total_localtax2',
600 'barcode_type',
'barcode_type_code',
'barcode_type_label',
'barcode_type_coder',
'mode_reglement_id',
'cond_reglement_id',
'mode_reglement',
'cond_reglement',
'shipping_method_id',
601 'extraparams',
'fk_incoterms',
'fk_user_creat',
'fk_user_valid',
'label_incoterms',
'location_incoterms',
'lines',
'nb',
'tms',
'comments',
'array_options',
'warnings',
602 'opening',
'status',
'date_valid'
608 $addthirdpartyatpaymentlevel = 0;
609 if (!empty(
$object->thirdparty) && !in_array($this->element, array(
'payment',
'payment_supplier'))) {
610 $addthirdpartyatpaymentlevel = 1;
613 if (!empty(
$object->thirdparty) && !$addthirdpartyatpaymentlevel) {
614 $this->object_data->thirdparty =
new stdClass();
616 foreach (
$object->thirdparty as $key => $value) {
617 if (in_array($key, $arrayoffieldstoexclude)) {
621 if (!in_array($key, array(
622 'name',
'name_alias',
'ref_ext',
'address',
'zip',
'town',
'state_code',
'country_code',
'idprof1',
'idprof2',
'idprof3',
'idprof4',
'idprof5',
'idprof6',
'phone',
'fax',
'email',
'barcode',
623 'tva_intra',
'tva_assuj',
'localtax1_assuj',
'localtax2_assuj',
'managers',
'capital',
'typent_code',
'forme_juridique_code',
'code_client',
'code_fournisseur'
628 $valuequalifiedforstorage =
false;
629 if (!is_object($value)) {
630 if (empty($value) && in_array($key, array(
'country_code',
'idprof1',
'idprof2',
'tva_intra'))) {
631 $valuequalifiedforstorage =
true;
632 $value = (string) $value;
634 if (!is_null($value) && empty($value) && in_array($key, array(
'tva_assuj',
'localtax1_assuj',
'localtax2_assuj'))) {
635 $valuequalifiedforstorage =
true;
637 if (!is_null($value) && (string) $value !==
'') {
638 $valuequalifiedforstorage =
true;
642 if ($valuequalifiedforstorage) {
643 $this->object_data->thirdparty->$key = $value;
649 if (!empty(
$mysoc) && !in_array(
$object->element, array(
'cashcontrol'))) {
650 $this->object_data->mycompany =
new stdClass();
652 foreach (
$mysoc as $key => $value) {
653 if (in_array($key, $arrayoffieldstoexclude)) {
657 if (!in_array($key, array(
658 'name',
'name_alias',
'ref_ext',
'address',
'zip',
'town',
'state_code',
'country_code',
'idprof1',
'idprof2',
'idprof3',
'idprof4',
'idprof5',
'idprof6',
'phone',
'fax',
'email',
'barcode',
659 'tva_assuj',
'tva_intra',
'localtax1_assuj',
'localtax1_value',
'localtax2_assuj',
'localtax2_value',
'managers',
'capital',
'typent_code',
'forme_juridique_code',
'code_client',
'code_fournisseur'
664 $valuequalifiedforstorage =
false;
665 if (!is_object($value)) {
666 if (empty($value) && in_array($key, array(
'country_code',
'idprof1',
'idprof2',
'tva_intra'))) {
667 $valuequalifiedforstorage =
true;
668 $value = (string) $value;
670 if (!is_null($value) && empty($value) && in_array($key, array(
'tva_assuj',
'localtax1_assuj',
'localtax2_assuj'))) {
671 $valuequalifiedforstorage =
true;
673 if (!is_null($value) && (string) $value !==
'') {
674 $valuequalifiedforstorage =
true;
678 if ($valuequalifiedforstorage) {
679 $this->object_data->mycompany->$key = $value;
686 $this->fk_user = $user->id;
687 $this->user_fullname = $user->getFullName($langs);
691 if ($this->element ==
'facture') {
692 '@phan-var-force Facture $object';
693 $this->module_source = (string)
$object->module_source;
695 foreach (
$object as $key => $value) {
696 if (in_array($key, $arrayoffieldstoexclude)) {
700 if (!in_array($key, array(
701 'ref',
'ref_client',
'ref_supplier',
'date',
'datef',
'datev',
'type',
703 'total_ht',
'total_tva',
'total_ttc',
'localtax1',
'localtax2',
704 'revenuestamp',
'datepointoftax',
'note_public',
706 'module_source',
'pos_source',
'pos_print_counter',
'email_sent_counter'
710 if ($key ==
'lines') {
712 foreach ($value as $tmpline) {
714 foreach ($tmpline as $keyline => $valueline) {
715 if (!in_array($keyline, array(
716 'ref',
'product_type',
'product_label',
718 'vat_src_code',
'tva_tx',
'localtax1_tx',
'localtax2_tx',
719 'total_ht',
'total_tva',
'total_ttc',
'total_localtax1',
'total_localtax2',
720 'multicurrency_code',
'multicurrency_total_ht',
'multicurrency_total_tva',
'multicurrency_total_ttc',
721 'info_bits',
'special_code',
726 if (empty($this->object_data->invoiceline[$lineid]) || !is_object($this->object_data->invoiceline[$lineid])) {
727 $this->object_data->invoiceline[$lineid] =
new stdClass();
730 $valuequalifiedforstorage =
false;
731 if (!is_object($valueline)) {
732 if (!is_null($valueline) && empty($valueline) && in_array($key, array(
'tva_tx',
'localtax1_tx',
'localtax2_tx',
'total_ht',
'total_tva',
'total_ttc',
'total_localtax1',
'total_localtax2'))) {
733 $valuequalifiedforstorage =
true;
735 if (!is_null($valueline) && (
string) $valueline !==
'') {
736 $valuequalifiedforstorage =
true;
739 if ($keyline ==
'product_label' && empty($valueline)) {
741 $valuequalifiedforstorage =
true;
744 if ($valuequalifiedforstorage) {
745 $this->object_data->invoiceline[$lineid]->$keyline = $valueline;
750 $valuequalifiedforstorage =
false;
751 if (!is_object($value)) {
752 if (empty($value) && in_array($key, array(
'pos_source',
'module_source'))) {
753 $valuequalifiedforstorage =
true;
754 $value = (string) $value;
756 if (!is_null($value) && empty($value) && in_array($key, array(
'total_ht',
'total_tva',
'total_ttc',
'localtax1',
'localtax2',
'pos_print_counter',
'email_sent_counter'))) {
757 $valuequalifiedforstorage =
true;
759 if (!is_null($value) && (string) $value !==
'') {
760 $valuequalifiedforstorage =
true;
764 if ($valuequalifiedforstorage) {
765 $this->object_data->$key = $value;
771 $this->object_data->ref =
$object->newref;
775 if ($action ==
'BILL_SENTBYMAIL') {
776 $this->object_data->action_email_sent = array(
777 "email_from" =>
$object->context[
'email_from'],
778 "email_to" =>
$object->context[
'email_to'],
779 "email_msgid" =>
$object->context[
'email_msgid']
782 } elseif ($this->element ==
'invoice_supplier') {
783 '@phan-var-force FactureFournisseur $object';
784 foreach (
$object as $key => $value) {
785 if (in_array($key, $arrayoffieldstoexclude)) {
789 if (!in_array($key, array(
790 'ref',
'ref_client',
'ref_supplier',
'date',
'datef',
'type',
'total_ht',
'total_tva',
'total_ttc',
'localtax1',
'localtax2',
'revenuestamp',
'datepointoftax',
'note_public'
795 $valuequalifiedforstorage =
false;
796 if (!is_object($value)) {
797 if (empty($value) && in_array($key, array(
'pos_source',
'module_source'))) {
798 $valuequalifiedforstorage =
true;
799 $value = (string) $value;
801 if (!is_null($value) && empty($value) && in_array($key, array(
'total_ht',
'total_tva',
'total_ttc',
'localtax1',
'localtax2',
'pos_print_counter',
'email_sent_counter'))) {
802 $valuequalifiedforstorage =
true;
804 if (!is_null($value) && (string) $value !==
'') {
805 $valuequalifiedforstorage =
true;
809 if ($valuequalifiedforstorage) {
810 $this->object_data->$key = $value;
815 $this->object_data->ref =
$object->newref;
817 } elseif ($this->element ==
'payment' || $this->element ==
'payment_supplier' || $this->element ==
'payment_donation' || $this->element ==
'payment_various') {
818 '@phan-var-force Paiement|PaiementFourn|PaymentDonation|PaymentVarious $object';
822 $this->object_data->ref =
$object->ref;
823 $this->object_data->date = $datepayment;
824 $this->object_data->type_code =
dol_getIdFromCode($this->db, $paymenttypeid,
'c_paiement',
'id',
'code');
826 if (!empty(
$object->num_payment)) {
827 $this->object_data->payment_num =
$object->num_payment;
829 if (!empty(
$object->note_private)) {
830 $this->object_data->note_private =
$object->note_private;
837 $this->linktype = $this->element;
838 $this->linktoref =
'';
843 $originofpayment =
null;
844 $paymentpartnumber = 0;
845 foreach (
$object->amounts as $objid => $amount) {
846 if (empty($amount)) {
850 $totalamount += $amount;
853 if ($this->element ==
'payment_supplier') {
854 include_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
856 } elseif ($this->element ==
'payment') {
857 include_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
858 $tmpobject =
new Facture($this->db);
859 } elseif ($this->element ==
'payment_donation') {
860 include_once DOL_DOCUMENT_ROOT.
'/don/class/don.class.php';
861 $tmpobject =
new Don($this->db);
862 } elseif ($this->element ==
'payment_various') {
863 include_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/paymentvarious.class.php';
867 if (!is_object($tmpobject)) {
871 $result = $tmpobject->fetch($objid);
874 $this->error = $tmpobject->error;
875 $this->errors = $tmpobject->errors;
876 dol_syslog(
"Failed to fetch object with id ".$objid, LOG_ERR);
880 $this->linktoref .= ($this->linktoref ?
',' :
'').$tmpobject->ref;
882 if (property_exists($tmpobject,
'module_source')) {
883 if (is_null($originofpayment)) {
884 $originofpayment = $tmpobject->module_source;
885 } elseif ($originofpayment != $tmpobject->module_source) {
886 $originofpayment =
'mix';
888 $originofpayment = (string) $tmpobject->module_source;
893 $paymentpart->amount = $amount;
897 if ($addthirdpartyatpaymentlevel) {
898 $result = $tmpobject->fetch_thirdparty();
900 $this->error =
'Failed to fetch thirdparty for object with id '.$tmpobject->id;
901 $this->errors[] = $this->error;
902 dol_syslog(
"Failed to fetch thirdparty for object with id ".$tmpobject->id, LOG_ERR);
904 } elseif ($result < 0) {
905 $this->error = $tmpobject->error;
906 $this->errors = $tmpobject->errors;
910 $paymentpart->thirdparty =
new stdClass();
911 foreach ($tmpobject->thirdparty as $key => $value) {
912 if (in_array($key, $arrayoffieldstoexclude)) {
916 if (!in_array($key, array(
917 'name',
'name_alias',
'ref_ext',
'address',
'zip',
'town',
'state_code',
'country_code',
'idprof1',
'idprof2',
'idprof3',
'idprof4',
'idprof5',
'idprof6',
'phone',
'fax',
'email',
'barcode',
918 'tva_intra',
'tva_assuj',
'localtax1_assuj',
'localtax1_value',
'localtax2_assuj',
'localtax2_value',
'managers',
'capital',
'typent_code',
'forme_juridique_code',
'code_client',
'code_fournisseur'
922 if (!is_object($value) && !is_null($value) && $value !==
'') {
923 $paymentpart->thirdparty->$key = $value;
929 if ($this->element ==
'payment_donation') {
930 $paymentpart->donation =
new stdClass();
931 } elseif ($this->element ==
'payment_various') {
932 $paymentpart->various =
new stdClass();
934 $paymentpart->invoice =
new stdClass();
937 if ($this->element !=
'payment_various') {
938 foreach ($tmpobject as $key => $value) {
939 if (in_array($key, $arrayoffieldstoexclude)) {
943 if (!in_array($key, array(
944 'ref',
'ref_client',
'ref_supplier',
'date',
'datef',
'type',
'total_ht',
'total_tva',
'total_ttc',
'localtax1',
'localtax2',
'revenuestamp',
'datepointoftax',
'note_public',
945 'pos_source',
'module_source',
'pos_print_counter',
'email_sent_counter'
950 $valuequalifiedforstorage =
false;
951 if (!is_object($value)) {
952 if (empty($value) && in_array($key, array(
'pos_source',
'module_source'))) {
953 $valuequalifiedforstorage =
true;
954 $value = (string) $value;
956 if (!is_null($value) && empty($value) && in_array($key, array(
'total_ht',
'total_tva',
'total_ttc',
'localtax1',
'localtax2',
'pos_print_counter',
'email_sent_counter'))) {
957 $valuequalifiedforstorage =
true;
959 if (!is_null($value) && (string) $value !==
'') {
960 $valuequalifiedforstorage =
true;
964 if ($valuequalifiedforstorage) {
965 if ($this->element ==
'payment_donation') {
966 $paymentpart->donation->$key = $value;
967 } elseif ($this->element ==
'payment_various') {
968 $paymentpart->various->$key = $value;
970 $paymentpart->invoice->$key = $value;
975 $paymentpartnumber++;
976 $this->object_data->payment_part[$paymentpartnumber] = $paymentpart;
980 $this->module_source = (string) $originofpayment;
981 } elseif (!empty(
$object->amount)) {
982 $totalamount =
$object->amount;
985 $this->object_data->amount = $totalamount;
988 $this->object_data->ref =
$object->newref;
990 } elseif ($this->element ==
'payment_salary') {
991 '@phan-var-force PaymentSalary $object';
992 $this->object_data->amounts = array(
$object->amount);
995 $this->object_data->ref =
$object->newref;
997 } elseif ($this->element ==
'subscription') {
998 '@phan-var-force Subscription $object';
999 foreach (
$object as $key => $value) {
1000 if (in_array($key, $arrayoffieldstoexclude)) {
1003 if (!in_array($key, array(
1004 'id',
'datec',
'dateh',
'datef',
'fk_adherent',
'amount',
'import_key',
'statut',
'note'
1008 if (!is_object($value) && !is_null($value) && $value !==
'') {
1009 $this->object_data->$key = $value;
1013 if (!empty(
$object->newref)) {
1014 $this->object_data->ref =
$object->newref;
1016 } elseif ($this->element ==
'stockmouvement') {
1017 '@phan-var-force StockTransfer $object';
1018 foreach (
$object as $key => $value) {
1019 if (in_array($key, $arrayoffieldstoexclude)) {
1022 if (!is_object($value) && !is_null($value) && $value !==
'') {
1023 $this->object_data->$key = $value;
1027 if (
$object->element ==
'cashcontrol') {
1028 $this->module_source = (string)
$object->posmodule;
1033 foreach (
$object as $key => $value) {
1034 if (in_array($key, $arrayoffieldstoexclude)) {
1037 if (!is_object($value) && !is_null($value) && $value !==
'') {
1038 $this->object_data->$key = $value;
1042 if (!empty(
$object->newref)) {
1043 $this->object_data->ref =
$object->newref;
1049 $this->object_data = json_decode(json_encode($this->object_data, JSON_FORCE_OBJECT),
false);
1185 public function create($user, $forcesignature =
'')
1187 global $conf, $langs,
$mysoc;
1189 $langs->load(
'blockedlog');
1192 $this->amounts = (float) $this->amounts;
1194 dol_syslog(get_class($this).
'::create action='.$this->action.
' fk_user='.$this->fk_user.
' user_fullname='.$this->user_fullname, LOG_DEBUG);
1197 if (!isset($this->amounts)) {
1198 $langs->load(
"errors");
1199 $this->error = $langs->trans(
"ErrorBlockLogNeedAmountsValue");
1204 if (empty($this->element)) {
1205 $langs->load(
"errors");
1206 $this->error = $langs->trans(
"ErrorBlockLogNeedElement");
1211 if (empty($this->object_data)) {
1212 $langs->load(
"errors");
1213 $this->error = $langs->trans(
"ErrorBlockLogNeedObject");
1218 if (empty($this->action)) {
1219 $langs->load(
"errors");
1220 $this->error = $langs->trans(
"ErrorBadParameterWhenCallingCreateOfBlockedLog");
1224 if (empty($this->fk_user)) {
1225 $this->user_fullname =
'(Anonymous)';
1228 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
1232 $this->date_creation =
dol_now();
1234 $this->object_version = DOL_VERSION;
1236 $this->object_format =
'V1';
1250 $this->error = $e->getMessage();
1254 $this->db->rollback();
1258 if ($forcesignature) {
1259 $this->signature = $forcesignature;
1263 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"blockedlog (";
1264 $sql .=
" date_creation,";
1266 $sql .=
" module_source,";
1267 $sql .=
" amounts_taxexcl,";
1268 $sql .=
" amounts,";
1269 $sql .=
" signature,";
1270 $sql .=
" element,";
1271 $sql .=
" fk_object,";
1272 $sql .=
" date_object,";
1273 $sql .=
" ref_object,";
1274 $sql .=
" linktoref,";
1275 $sql .=
" linktype,";
1276 $sql .=
" object_data,";
1277 $sql .=
" object_version,";
1278 $sql .=
" object_format,";
1279 $sql .=
" certified,";
1280 $sql .=
" fk_user,";
1281 $sql .=
" user_fullname,";
1283 $sql .=
" debuginfo";
1284 $sql .=
") VALUES (";
1285 $sql .=
"'".$this->db->idate($this->date_creation).
"',";
1286 $sql .=
"'".$this->db->escape($this->action).
"',";
1287 $sql .=
"'".$this->db->escape((
string) $this->module_source).
"',";
1288 $sql .= (is_null($this->amounts_taxexcl) ?
"null" : (float) $this->amounts_taxexcl).
",";
1289 $sql .= (float) $this->amounts.
",";
1290 $sql .=
"'".$this->db->escape($this->signature).
"',";
1291 $sql .=
"'".$this->db->escape($this->element).
"',";
1292 $sql .= (int) $this->fk_object.
",";
1293 $sql .=
"'".$this->db->idate($this->date_object).
"',";
1294 $sql .=
"'".$this->db->escape($this->ref_object).
"',";
1295 $sql .= ($this->linktoref ?
"'".$this->db->escape($this->linktoref).
"'" :
"null").
",";
1296 $sql .= ($this->linktoref ?
"'".$this->db->escape($this->linktype).
"'" :
"null").
",";
1298 $sql .=
"'".$this->db->escape($this->object_version).
"',";
1299 $sql .=
"'".$this->db->escape($this->object_format).
"',";
1301 $sql .= $this->fk_user.
",";
1302 $sql .=
"'".$this->db->escape($this->user_fullname).
"',";
1303 $sql .= ($this->entity ? $this->entity : $conf->entity).
",";
1304 $sql .=
"'".$this->db->escape($this->debuginfo).
"'";
1315 $res = $this->db->query($sql);
1317 $id = $this->db->last_insert_id(MAIN_DB_PREFIX.
"blockedlog");
1322 $this->db->commit();
1324 include_once DOL_DOCUMENT_ROOT.
'/blockedlog/lib/blockedlog.lib.php';
1340 $this->db->rollback();
1344 $this->error = $this->db->error();
1345 $this->db->rollback();