예제 #1
0
		{
			dol_print_error($db, "result=$result");
			$db->rollback();
		}
	} else
	{
		dol_print_error($db);
	}
}

// Efface un contact
if ($_GET["action"] == 'deleteline' && $user->rights->fournisseur->facture->creer)
{
	$facture = new FactureFournisseur($db);
	$facture->fetch($_GET["facid"]);
	$result = $facture->delete_contact($_GET["lineid"]);

	if ($result >= 0)
	{
		Header("Location: contact.php?facid=".$facture->id);
		exit;
	}
	else {
		dol_print_error($db);
	}
}


/*
 * View
 */
예제 #2
0
            setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
        } else {
            setEventMessages($object->error, $object->errors, 'errors');
        }
    }
} else {
    if ($action == 'swapstatut' && $user->rights->fournisseur->facture->creer) {
        if ($object->fetch($id)) {
            $result = $object->swapContactStatus(GETPOST('ligne'));
        } else {
            dol_print_error($db);
        }
    } else {
        if ($action == 'deletecontact' && $user->rights->fournisseur->facture->creer) {
            $object->fetch($id);
            $result = $object->delete_contact($_GET["lineid"]);
            if ($result >= 0) {
                header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
                exit;
            } else {
                dol_print_error($db);
            }
        }
    }
}
/*
 * View
 */
llxHeader('', $langs->trans("Bill"), "Facture");
$form = new Form($db);
$formcompany = new FormCompany($db);