Fix error management

This commit is contained in:
Laurent Destailleur
2022-01-09 13:50:10 +01:00
parent eddc2a1a26
commit fcfb6a55f4

View File

@@ -2395,18 +2395,23 @@ if ($action == 'create') {
$productstatic = new Product($db);
$object->fetch($id, $ref);
$result = $object->fetch_thirdparty();
if ($result < 0) {
dol_print_error($db);
$result = $object->fetch($id, $ref);
if ($result <= 0) {
$langs->load("errors");
print $langs->trans("ErrorRecordNotFound");
llxFooter();
$db->close();
exit;
}
$societe = new Fournisseur($db);
$result = $societe->fetch($object->socid);
$result = $object->fetch_thirdparty();
if ($result < 0) {
dol_print_error($db);
dol_print_error($db, $object->error, $object->errors);
exit;
}
$societe = $object->thirdparty;
$totalpaye = $object->getSommePaiement();
$totalcreditnotes = $object->getSumCreditNotesUsed();
$totaldeposits = $object->getSumDepositsUsed();