Contexto
En la versión 20 de Dolibarr, hemos detectado un problema al actualizar las notas (pública y privada) de una factura a través de la API utilizando la ruta PUT /invoice/{id}. Este comportamiento difiere respecto a la versión anterior, donde esta funcionalidad operaba correctamente.
Descripción del problema
Escenario de uso:
Se intenta actualizar las notas pública y privada de una factura mediante una solicitud HTTP PUT hacia la API en la ruta PUT /invoice/{id}.
El payload enviado contiene el campo correspondiente a las notas, por ejemplo:
json
Copiar código
Código: Seleccionar todo
{
"fk_user_author": "10",
"fk_user_valid": "10",
"fk_user_modif": "1",
"datem": 1732790063,
"delivery_date": null,
"ref_client": null,
"ref_customer": null,
"total_ht": "112.00000000",
"total_tva": "23.52000000",
"total_localtax1": "0.00000000",
"total_localtax2": "0.00000000",
"total_ttc": "135.52000000",
"revenuestamp": "0.00000000",
"resteapayer": null,
"paye": "0",
"module_source": null,
"pos_source": null,
"fk_fac_rec_source": null,
"fk_facture_source": null,
"lines": [
{
"fk_facture": "965",
"fk_parent_line": null,
"desc": "",
"ref_ext": "",
"localtax1_type": "3",
"localtax2_type": "1",
"fk_remise_except": null,
"rang": "0",
"fk_fournprice": null,
"pa_ht": "0.00000000",
"marge_tx": "",
"marque_tx": 100,
"tva_npr": null,
"remise_percent": "20",
"batch": "",
"fk_warehouse": "0",
"origin_id": null,
"fk_code_ventilation": 0,
"date_start": "",
"date_end": "",
"situation_percent": "100",
"fk_prev_id": null,
"label": null,
"ref": "P-3",
"libelle": "Producto P3",
"product_type": "0",
"product_ref": "P-3",
"product_label": "Producto P3",
"product_desc": "",
"qty": "1",
"subprice": "110.00000000",
"price": null,
"fk_product": "16",
"vat_src_code": "",
"tva_tx": "21.000",
"localtax1_tx": "0.000",
"localtax2_tx": "0.000",
"remise": null,
"total_ht": "88.00000000",
"total_tva": "18.48000000",
"total_localtax1": "0.00000000",
"total_localtax2": "0.00000000",
"total_ttc": "106.48000000",
"date_start_fill": null,
"date_end_fill": null,
"buy_price_ht": null,
"buyprice": null,
"info_bits": "0",
"special_code": "0",
"fk_user_author": null,
"fk_user_modif": null,
"fk_accounting_account": "0",
"parent_element": "",
"fk_parent_attribute": "",
"id": "1581",
"rowid": "1581",
"fk_unit": null,
"date_debut_prevue": null,
"date_debut_reel": null,
"date_fin_prevue": null,
"date_fin_reel": null,
"weight": null,
"weight_units": null,
"width": null,
"width_units": null,
"height": null,
"height_units": null,
"length": null,
"length_units": null,
"surface": null,
"surface_units": null,
"volume": null,
"volume_units": null,
"multilangs": null,
"description": "",
"product": null,
"product_barcode": null,
"fk_product_type": "0",
"duree": null,
"multicurrency_subprice": "110.00000000",
"multicurrency_total_ht": "88.00000000",
"multicurrency_total_tva": "18.48000000",
"multicurrency_total_ttc": "106.48000000",
"module": null,
"entity": null,
"import_key": null,
"array_options": [],
"array_languages": null,
"contacts_ids": null,
"linkedObjectsIds": null,
"origin_type": null,
"statut": null,
"status": null,
"state_id": null,
"region_id": null,
"demand_reason_id": null,
"transport_mode_id": null,
"shipping_method": null,
"multicurrency_tx": null,
"multicurrency_total_localtax1": null,
"multicurrency_total_localtax2": null,
"last_main_doc": null,
"fk_account": null,
"lines": null,
"actiontypecode": null,
"date_creation": null,
"date_validation": null,
"date_modification": null,
"tms": null,
"date_cloture": null,
"user_author": null,
"user_creation": null,
"user_creation_id": null,
"user_valid": null,
"user_validation": null,
"user_validation_id": null,
"user_closing_id": null,
"user_modification": null,
"user_modification_id": null,
"fk_user_creat": null,
"specimen": 0,
"extraparams": [],
"cond_reglement_supplier_id": null,
"deposit_percent": null,
"retained_warranty_fk_cond_reglement": null,
"warehouse_id": null
},
{
"fk_facture": "965",
"fk_parent_line": null,
"desc": "",
"ref_ext": "",
"localtax1_type": "3",
"localtax2_type": "1",
"fk_remise_except": null,
"rang": "0",
"fk_fournprice": null,
"pa_ht": "0.00000000",
"marge_tx": "",
"marque_tx": 100,
"tva_npr": null,
"remise_percent": "20",
"batch": "",
"fk_warehouse": "0",
"origin_id": null,
"fk_code_ventilation": 0,
"date_start": 1730329200,
"date_end": 1761865200,
"situation_percent": "100",
"fk_prev_id": null,
"label": null,
"ref": "S-3P1",
"libelle": "Suscripción 3P1",
"product_type": "1",
"product_ref": "S-3P1",
"product_label": "Suscripción 3P1",
"product_desc": "",
"qty": "1",
"subprice": "30.00000000",
"price": null,
"fk_product": "90",
"vat_src_code": "",
"tva_tx": "21.000",
"localtax1_tx": "0.000",
"localtax2_tx": "0.000",
"remise": null,
"total_ht": "24.00000000",
"total_tva": "5.04000000",
"total_localtax1": "0.00000000",
"total_localtax2": "0.00000000",
"total_ttc": "29.04000000",
"date_start_fill": null,
"date_end_fill": null,
"buy_price_ht": null,
"buyprice": null,
"info_bits": "0",
"special_code": "0",
"fk_user_author": null,
"fk_user_modif": null,
"fk_accounting_account": "0",
"parent_element": "",
"fk_parent_attribute": "",
"id": "1582",
"rowid": "1582",
"fk_unit": null,
"date_debut_prevue": null,
"date_debut_reel": null,
"date_fin_prevue": null,
"date_fin_reel": null,
"weight": null,
"weight_units": null,
"width": null,
"width_units": null,
"height": null,
"height_units": null,
"length": null,
"length_units": null,
"surface": null,
"surface_units": null,
"volume": null,
"volume_units": null,
"multilangs": null,
"description": "",
"product": null,
"product_barcode": null,
"fk_product_type": "1",
"duree": null,
"multicurrency_subprice": "30.00000000",
"multicurrency_total_ht": "24.00000000",
"multicurrency_total_tva": "5.04000000",
"multicurrency_total_ttc": "29.04000000",
"module": null,
"entity": null,
"import_key": null,
"array_options": [],
"array_languages": null,
"contacts_ids": null,
"linkedObjectsIds": null,
"origin_type": null,
"statut": null,
"status": null,
"state_id": null,
"region_id": null,
"demand_reason_id": null,
"transport_mode_id": null,
"shipping_method": null,
"multicurrency_tx": null,
"multicurrency_total_localtax1": null,
"multicurrency_total_localtax2": null,
"last_main_doc": null,
"fk_account": null,
"lines": null,
"actiontypecode": null,
"date_creation": null,
"date_validation": null,
"date_modification": null,
"tms": null,
"date_cloture": null,
"user_author": null,
"user_creation": null,
"user_creation_id": null,
"user_valid": null,
"user_validation": null,
"user_validation_id": null,
"user_closing_id": null,
"user_modification": null,
"user_modification_id": null,
"fk_user_creat": null,
"specimen": 0,
"extraparams": [],
"cond_reglement_supplier_id": null,
"deposit_percent": null,
"retained_warranty_fk_cond_reglement": null,
"warehouse_id": null
}
],
"line": null,
"extraparams": [],
"fac_rec": null,
"date_pointoftax": "",
"situation_cycle_ref": null,
"situation_counter": null,
"situation_final": "0",
"tab_previous_situation_invoice": [],
"tab_next_situation_invoice": [],
"retained_warranty": "0",
"retained_warranty_date_limit": "",
"retained_warranty_fk_cond_reglement": "0",
"availability_id": null,
"date_closing": null,
"source": null,
"remise_percent": null,
"online_payment_url": "https://leontic.com/zxdemo/public/payment/newpayment.php?source=invoice&ref=FA2410-0023",
"title": null,
"type": "0",
"subtype": null,
"fk_soc": null,
"socid": "22",
"date": 1730329200,
"date_lim_reglement": 1730329200,
"cond_reglement_id": "1",
"cond_reglement_code": "RECEP",
"cond_reglement_label": null,
"cond_reglement_doc": "Réception de facture",
"mode_reglement_id": "3",
"mode_reglement_code": "PRE",
"totaldeposits": null,
"totalcreditnotes": null,
"sumpayed": null,
"sumpayed_multicurrency": null,
"sumdeposit": null,
"sumdeposit_multicurrency": null,
"sumcreditnote": null,
"sumcreditnote_multicurrency": null,
"remaintopay": "135.52",
"stripechargedone": null,
"stripechargeerror": null,
"description": null,
"close_code": null,
"close_note": null,
"postactionmessages": null,
"module": null,
"id": "965",
"entity": "1",
"import_key": null,
"array_options": [],
"array_languages": null,
"contacts_ids": [],
"linkedObjectsIds": {
"commande": {
"1397": "768"
}
},
"fk_project": null,
"contact_id": null,
"user": null,
"origin_type": null,
"origin_id": null,
"ref": "FA2410-0023",
"ref_ext": null,
"statut": "1",
"status": "1",
"country_id": null,
"country_code": null,
"state_id": null,
"region_id": null,
"demand_reason_id": null,
"transport_mode_id": null,
"shipping_method_id": null,
"shipping_method": null,
"fk_multicurrency": "0",
"multicurrency_code": "EUR",
"multicurrency_tx": "1.00000000",
"multicurrency_total_ht": "112.00000000",
"multicurrency_total_tva": "23.52000000",
"multicurrency_total_ttc": "135.52000000",
"multicurrency_total_localtax1": null,
"multicurrency_total_localtax2": null,
"last_main_doc": "facture/FA2410-0023/FA2410-0023.pdf",
"fk_account": null,
"note_public": "NEW tooo PUBLIC",
"note_private": "NEW tooo PRIVATE",
"actiontypecode": null,
"name": null,
"lastname": null,
"firstname": null,
"civility_id": null,
"date_creation": 1730371423,
"date_validation": 1730371423,
"date_modification": 1732790063,
"tms": null,
"date_cloture": null,
"user_author": null,
"user_creation": null,
"user_creation_id": "10",
"user_valid": null,
"user_validation": null,
"user_validation_id": "10",
"user_closing_id": null,
"user_modification": null,
"user_modification_id": "1",
"fk_user_creat": null,
"specimen": 0,
"product": null,
"cond_reglement_supplier_id": null,
"deposit_percent": null,
"warehouse_id": null,
"fk_incoterms": "0",
"label_incoterms": null,
"location_incoterms": ""
}
Código: Seleccionar todo
{
"note_public": "Nota pública actualizada",
"note_private": "Nota privada actualizada"
}
Comportamiento observado:
La solicitud es aceptada (código HTTP 200), pero las notas no se actualizan en la base de datos al enviar toda la factura entera.
Este problema ocurre únicamente desde la API.
Comportamiento esperado:
Las notas deberían actualizarse correctamente, como sucedía en la versión previa
Desde la interfaz web:
La funcionalidad opera correctamente. Las notas se actualizan sin inconvenientes desde la interfaz web.