예제 #1
0
파일: note.php 프로젝트: ADDAdev/Dolibarr
    $socid = $user->societe_id;
}
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
$object = new FactureFournisseur($db);
$object->fetch($id, $ref);
$permissionnote = $user->rights->fournisseur->facture->creer;
// Used by the include of actions_setnotes.inc.php
/*
 * Actions
 */
include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php';
// Must be include, not includ_once
// Set label
if ($action == 'setlabel' && $user->rights->fournisseur->facture->creer) {
    $object->label = $_POST['label'];
    $result = $object->update($user);
    if ($result < 0) {
        dol_print_error($db);
    }
}
/*
 * View
 */
$form = new Form($db);
llxHeader();
if ($object->id > 0) {
    $object->fetch_thirdparty();
    $head = facturefourn_prepare_head($object);
    $titre = $langs->trans('SupplierInvoice');
    dol_fiche_head($head, 'note', $titre, 0, 'bill');
    print '<table class="border" width="100%">';
예제 #2
0
// Set supplier ref
if (($_POST['action'] == 'setref_supplier' || $_POST['action'] == 'set_ref_supplier') && $user->rights->fournisseur->facture->creer)
{
    $facturefourn = new FactureFournisseur($db);
    $facturefourn->fetch($facid);
    $result=$facturefourn->set_ref_supplier($user, $_POST['ref_supplier']);
    $_GET['facid']=$facid;
}

// Set supplier ref
if (($_POST['action'] == 'setlabel') && $user->rights->fournisseur->facture->creer)
{
    $facturefourn = new FactureFournisseur($db);
    $facturefourn->fetch($facid);
    $facturefourn->label=$_POST['label'];
    $result=$facturefourn->update($user);
    if ($result < 0) dol_print_error($db);
    $_GET['facid']=$facid;
}

if($_GET['action'] == 'deletepaiement')
{
    $facfou = new FactureFournisseur($db);
    $facfou->fetch($_GET['facid']);
    if ($facfou->statut == 1 && $facfou->paye == 0 && $user->societe_id == 0)
    {
        $paiementfourn = new PaiementFourn($db);
        $paiementfourn->fetch($_GET['paiement_id']);
        $paiementfourn->delete();
    }
}