#!/usr/bin/env php
***** create_invoice.php (1.7) *****
Dolibarr has detected a technical error.
This is information that can help diagnostic:
Date: 20241223090142
Dolibarr: 3.9.1
Level of features: 0
PHP: 5.6.40
Server: Apache
OS: Linux webm080.cluster005.gra.hosting.ovh.net 5.15.80-ovh-vps-grsec-zfs-classid #1 SMP Wed Nov 30 08:49:06 UTC 2022 x86_64
UserAgent: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Requested Url: /dolibarr/dev/examples/create_invoice.php
Referer:
Menu manager:
Database type manager: mysqli
Request for last database access in error: INSERT INTO llx_facture ( facnumber, entity, ref_ext, type, fk_soc, datec, remise_absolue, remise_percent, datef, note_private, note_public, ref_client, ref_int, fk_account, fk_facture_source, fk_user_author, fk_projet, fk_cond_reglement, fk_mode_reglement, date_lim_reglement, model_pdf, situation_cycle_ref, situation_counter, situation_final, fk_incoterms, location_incoterms) VALUES ('(PROV)', 1, null, '0', '4', '20241223090142', NULL, NULL, '20241223090142', null, null, null, null, NULL, null, '1', null, 1, 0, '20241223090142', '', null, null, 0, 0, '')
Return code for last database access in error: DB_ERROR_1452
Information for last database access in error: Cannot add or update a child row: a foreign key constraint fails (`fabemdisrt`.`llx_facture`, CONSTRAINT `fk_facture_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`) ON DELETE RESTRICT ON UPDATE RESTRICT)
Message: Cannot add or update a child row: a foreign key constraint fails (`fabemdisrt`.`llx_facture`, CONSTRAINT `fk_facture_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`) ON DELETE RESTRICT ON UPDATE RESTRICT)
--- end error code=1