Error management
This commit is contained in:
parent
a881307f01
commit
5cb43e1521
@ -89,9 +89,6 @@ if ($_POST['action'] == 'confirm_valide' && $_POST['confirm'] == 'yes' && $user-
|
||||
|
||||
llxHeader();
|
||||
|
||||
$paiement = new PaiementFourn($db);
|
||||
$paiement->fetch($_GET['id']);
|
||||
|
||||
$html = new Form($db);
|
||||
|
||||
$h=0;
|
||||
@ -108,246 +105,260 @@ $h++;
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans('SupplierPayment'), 0, 'payment');
|
||||
|
||||
/*
|
||||
* Confirmation de la suppression du paiement
|
||||
*/
|
||||
if ($_GET['action'] == 'delete')
|
||||
$paiement = new PaiementFourn($db);
|
||||
$result=$paiement->fetch($_GET['id']);
|
||||
if ($result > 0)
|
||||
{
|
||||
$ret=$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete');
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
|
||||
/*
|
||||
* Confirmation de la validation du paiement
|
||||
*/
|
||||
if ($_GET['action'] == 'valide')
|
||||
{
|
||||
$ret=$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide');
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
|
||||
if (!empty($_POST['action']) && $_POST['action'] == 'update_num' && !empty($_POST['new_num']))
|
||||
{
|
||||
$res = $paiement->update_num($_POST['new_num']);
|
||||
if ($res === 0) {
|
||||
$mesg = '<div class="ok">'.$langs->trans('PaymentNumberUpdateSucceeded').'</div>';
|
||||
} else {
|
||||
$mesg = '<div class="error">'.$langs->trans('PaymentNumberUpdateFailed').'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_POST['action']) && $_POST['action'] == 'update_date' && !empty($_POST['reday']))
|
||||
{
|
||||
$datepaye = dol_mktime(12, 0 , 0,
|
||||
$_POST['remonth'],
|
||||
$_POST['reday'],
|
||||
$_POST['reyear']);
|
||||
$res = $paiement->update_date($datepaye);
|
||||
if ($res === 0) {
|
||||
$mesg = '<div class="ok">'.$langs->trans('PaymentDateUpdateSucceeded').'</div>';
|
||||
} else {
|
||||
$mesg = '<div class="error">'.$langs->trans('PaymentDateUpdateFailed').'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr>';
|
||||
print '<td valign="top" width="20%" colspan="2">'.$langs->trans('Ref').'</td><td colspan="3">'.$paiement->id.'</td></tr>';
|
||||
|
||||
//switch through edition options for date (only available when statut is -not 1- (=validated))
|
||||
if (empty($_GET['action']) || $_GET['action']!='edit_date')
|
||||
{
|
||||
print '<tr><td colspan="2">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td nowrap="nowrap">';
|
||||
print $langs->trans('Date');
|
||||
print '</td>';
|
||||
if ($paiement->statut == 0 && $_GET['action'] != 'edit_date') print '<td align="right"><a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$paiement->id.'&action=edit_date">'.img_edit($langs->trans('Modify')).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td>';
|
||||
print '<td colspan="3">'.dol_print_date($paiement->date,'day').'</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr>';
|
||||
print '<td valign="top" colspan="2">'.$langs->trans('Date').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<form name="formsoc" method="post" action="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$paiement->id.'"><input type="hidden" name="action" value="update_date" />';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
if (!empty($_POST['remonth']) && !empty($_POST['reday']) && !empty($_POST['reyear']))
|
||||
$sel_date=dol_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||
else
|
||||
$sel_date=$paiement->date;
|
||||
$html->select_date($sel_date,'','','','',"addpaiement");
|
||||
print '<input type="submit" class="button" name="submit" value="'.$langs->trans('Validate').'" />';
|
||||
print '</form>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '<tr><td valign="top" colspan="2">'.$langs->trans('Type').'</td><td colspan="3">'.$paiement->type_libelle.'</td></tr>';
|
||||
|
||||
//switch through edition options for number (only available when statut is -not 1- (=validated))
|
||||
if (empty($_GET['action']) || $_GET['action'] != 'edit_num')
|
||||
{
|
||||
print '<tr><td colspan="2">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td nowrap="nowrap">';
|
||||
print $langs->trans('Numero');
|
||||
print '</td>';
|
||||
if ($paiement->statut == 0 && $_GET['action'] != 'edit_num') print '<td align="right"><a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$paiement->id.'&action=edit_num">'.img_edit($langs->trans('Modify')).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td>';
|
||||
print '<td colspan="3">'.$paiement->numero.'</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr>';
|
||||
print '<td valign="top" colspan="2">'.$langs->trans('Numero').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<form name="formsoc" method="post" action="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$paiement->id.'"><input type="hidden" name="action" value="update_num" />';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
if (!empty($_POST['new_num']))
|
||||
$num = $this->db->escape($_POST['new_num']);
|
||||
else
|
||||
$num = $paiement->numero;
|
||||
print '<input type="text" name="new_num" value="'.$num.'"/>';
|
||||
print '<input type="submit" class="button" name="submit" value="'.$langs->trans('Validate').'" />';
|
||||
print '</form></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '<tr><td valign="top" colspan="2">'.$langs->trans('Amount').'</td><td colspan="3">'.price($paiement->montant).' '.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
|
||||
|
||||
if ($conf->global->BILL_ADD_PAYMENT_VALIDATION)
|
||||
{
|
||||
print '<tr><td valign="top" colspan="2">'.$langs->trans('Status').'</td><td colspan="3">'.$paiement->getLibStatut(4).'</td></tr>';
|
||||
}
|
||||
|
||||
print '<tr><td valign="top" colspan="2">'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($paiement->note).'</td></tr>';
|
||||
|
||||
if ($conf->banque->enabled)
|
||||
{
|
||||
if ($paiement->bank_account)
|
||||
/*
|
||||
* Confirmation de la suppression du paiement
|
||||
*/
|
||||
if ($_GET['action'] == 'delete')
|
||||
{
|
||||
// Si compte renseigne, on affiche libelle
|
||||
$bank=new Account($db);
|
||||
$bank->fetch($paiement->bank_account);
|
||||
$ret=$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete');
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
|
||||
$bankline=new AccountLine($db);
|
||||
$bankline->fetch($paiement->bank_line);
|
||||
/*
|
||||
* Confirmation de la validation du paiement
|
||||
*/
|
||||
if ($_GET['action'] == 'valide')
|
||||
{
|
||||
$ret=$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide');
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
|
||||
if (!empty($_POST['action']) && $_POST['action'] == 'update_num' && !empty($_POST['new_num']))
|
||||
{
|
||||
$res = $paiement->update_num($_POST['new_num']);
|
||||
if ($res === 0) {
|
||||
$mesg = '<div class="ok">'.$langs->trans('PaymentNumberUpdateSucceeded').'</div>';
|
||||
} else {
|
||||
$mesg = '<div class="error">'.$langs->trans('PaymentNumberUpdateFailed').'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_POST['action']) && $_POST['action'] == 'update_date' && !empty($_POST['reday']))
|
||||
{
|
||||
$datepaye = dol_mktime(12, 0 , 0,
|
||||
$_POST['remonth'],
|
||||
$_POST['reday'],
|
||||
$_POST['reyear']);
|
||||
$res = $paiement->update_date($datepaye);
|
||||
if ($res === 0) {
|
||||
$mesg = '<div class="ok">'.$langs->trans('PaymentDateUpdateSucceeded').'</div>';
|
||||
} else {
|
||||
$mesg = '<div class="error">'.$langs->trans('PaymentDateUpdateFailed').'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr>';
|
||||
print '<td valign="top" width="20%" colspan="2">'.$langs->trans('Ref').'</td><td colspan="3">'.$paiement->id.'</td></tr>';
|
||||
|
||||
//switch through edition options for date (only available when statut is -not 1- (=validated))
|
||||
if (empty($_GET['action']) || $_GET['action']!='edit_date')
|
||||
{
|
||||
print '<tr><td colspan="2">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td nowrap="nowrap">';
|
||||
print $langs->trans('Date');
|
||||
print '</td>';
|
||||
if ($paiement->statut == 0 && $_GET['action'] != 'edit_date') print '<td align="right"><a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$paiement->id.'&action=edit_date">'.img_edit($langs->trans('Modify')).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td>';
|
||||
print '<td colspan="3">'.dol_print_date($paiement->date,'day').'</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr>';
|
||||
print '<td valign="top" colspan="2">'.$langs->trans('BankAccount').'</td>';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/bank/account.php?account='.$bank->id.'">'.img_object($langs->trans('ShowAccount'),'account').' '.$bank->label.'</a></td>';
|
||||
print '<td>'.$langs->trans('BankLineConciliated').'</td><td>'.yn($bankline->rappro).'</td>';
|
||||
print '<td valign="top" colspan="2">'.$langs->trans('Date').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<form name="formsoc" method="post" action="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$paiement->id.'"><input type="hidden" name="action" value="update_date" />';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
if (!empty($_POST['remonth']) && !empty($_POST['reday']) && !empty($_POST['reyear']))
|
||||
$sel_date=dol_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||
else
|
||||
$sel_date=$paiement->date;
|
||||
$html->select_date($sel_date,'','','','',"addpaiement");
|
||||
print '<input type="submit" class="button" name="submit" value="'.$langs->trans('Validate').'" />';
|
||||
print '</form>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '<tr><td valign="top" colspan="2">'.$langs->trans('Type').'</td><td colspan="3">'.$paiement->type_libelle.'</td></tr>';
|
||||
|
||||
if ($mesg) print '<br>'.$mesg;
|
||||
|
||||
print '<br>';
|
||||
|
||||
/**
|
||||
* Liste des factures
|
||||
*/
|
||||
$allow_delete = 1 ;
|
||||
$sql = 'SELECT f.rowid as ref, f.facnumber as ref_supplier, f.total_ttc, pf.amount, f.rowid as facid, f.paye, f.fk_statut, s.nom, s.rowid as socid';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf,'.MAIN_DB_PREFIX.'facture_fourn as f,'.MAIN_DB_PREFIX.'societe as s';
|
||||
$sql .= ' WHERE pf.fk_facturefourn = f.rowid AND f.fk_soc = s.rowid';
|
||||
$sql .= ' AND pf.fk_paiementfourn = '.$paiement->id;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$i = 0;
|
||||
$total = 0;
|
||||
print '<b>'.$langs->trans("Invoices").'</b><br>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans('Ref').'</td>';
|
||||
print '<td>'.$langs->trans('RefSupplier').'</td>';
|
||||
print '<td>'.$langs->trans('Company').'</td>';
|
||||
print '<td align="right">'.$langs->trans('ExpectedToPay').'</td>';
|
||||
print '<td align="center">'.$langs->trans('Status').'</td>';
|
||||
print '<td align="right">'.$langs->trans('PayedByThisPayment').'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
if ($num > 0)
|
||||
//switch through edition options for number (only available when statut is -not 1- (=validated))
|
||||
if (empty($_GET['action']) || $_GET['action'] != 'edit_num')
|
||||
{
|
||||
$var=True;
|
||||
print '<tr><td colspan="2">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td nowrap="nowrap">';
|
||||
print $langs->trans('Numero');
|
||||
print '</td>';
|
||||
if ($paiement->statut == 0 && $_GET['action'] != 'edit_num') print '<td align="right"><a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$paiement->id.'&action=edit_num">'.img_edit($langs->trans('Modify')).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td>';
|
||||
print '<td colspan="3">'.$paiement->numero.'</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr>';
|
||||
print '<td valign="top" colspan="2">'.$langs->trans('Numero').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<form name="formsoc" method="post" action="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$paiement->id.'"><input type="hidden" name="action" value="update_num" />';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
if (!empty($_POST['new_num']))
|
||||
$num = $this->db->escape($_POST['new_num']);
|
||||
else
|
||||
$num = $paiement->numero;
|
||||
print '<input type="text" name="new_num" value="'.$num.'"/>';
|
||||
print '<input type="submit" class="button" name="submit" value="'.$langs->trans('Validate').'" />';
|
||||
print '</form></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '<tr><td valign="top" colspan="2">'.$langs->trans('Amount').'</td><td colspan="3">'.price($paiement->montant).' '.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
|
||||
|
||||
$facturestatic=new FactureFournisseur($db);
|
||||
if ($conf->global->BILL_ADD_PAYMENT_VALIDATION)
|
||||
{
|
||||
print '<tr><td valign="top" colspan="2">'.$langs->trans('Status').'</td><td colspan="3">'.$paiement->getLibStatut(4).'</td></tr>';
|
||||
}
|
||||
|
||||
while ($i < $num)
|
||||
print '<tr><td valign="top" colspan="2">'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($paiement->note).'</td></tr>';
|
||||
|
||||
if ($conf->banque->enabled)
|
||||
{
|
||||
if ($paiement->bank_account)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
// Ref
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$objp->facid.'">'.img_object($langs->trans('ShowBill'),'bill').' ';
|
||||
print $objp->ref;
|
||||
print "</a></td>\n";
|
||||
// Ref supplier
|
||||
print '<td>'.$objp->ref_supplier."</td>\n";
|
||||
// Third party
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'),'company').' '.$objp->nom.'</a></td>';
|
||||
// Expected to pay
|
||||
print '<td align="right">'.price($objp->total_ttc).'</td>';
|
||||
// Status
|
||||
print '<td align="center">'.$facturestatic->LibStatut($objp->paye,$objp->fk_statut,2,1).'</td>';
|
||||
// Payed
|
||||
print '<td align="right">'.price($objp->amount).'</td>';
|
||||
print "</tr>\n";
|
||||
if ($objp->paye == 1)
|
||||
{
|
||||
$allow_delete = 0;
|
||||
}
|
||||
$total = $total + $objp->amount;
|
||||
$i++;
|
||||
// Si compte renseigne, on affiche libelle
|
||||
$bank=new Account($db);
|
||||
$bank->fetch($paiement->bank_account);
|
||||
|
||||
$bankline=new AccountLine($db);
|
||||
$bankline->fetch($paiement->bank_line);
|
||||
|
||||
print '<tr>';
|
||||
print '<td valign="top" colspan="2">'.$langs->trans('BankAccount').'</td>';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/bank/account.php?account='.$bank->id.'">'.img_object($langs->trans('ShowAccount'),'account').' '.$bank->label.'</a></td>';
|
||||
print '<td>'.$langs->trans('BankLineConciliated').'</td><td>'.yn($bankline->rappro).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
$var=!$var;
|
||||
|
||||
print "</table>\n";
|
||||
$db->free($resql);
|
||||
print '</table>';
|
||||
|
||||
if ($mesg) print '<br>'.$mesg;
|
||||
|
||||
print '<br>';
|
||||
|
||||
/**
|
||||
* Liste des factures
|
||||
*/
|
||||
$allow_delete = 1 ;
|
||||
$sql = 'SELECT f.rowid as ref, f.facnumber as ref_supplier, f.total_ttc, pf.amount, f.rowid as facid, f.paye, f.fk_statut, s.nom, s.rowid as socid';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf,'.MAIN_DB_PREFIX.'facture_fourn as f,'.MAIN_DB_PREFIX.'societe as s';
|
||||
$sql .= ' WHERE pf.fk_facturefourn = f.rowid AND f.fk_soc = s.rowid';
|
||||
$sql .= ' AND pf.fk_paiementfourn = '.$paiement->id;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$i = 0;
|
||||
$total = 0;
|
||||
print '<b>'.$langs->trans("Invoices").'</b><br>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans('Ref').'</td>';
|
||||
print '<td>'.$langs->trans('RefSupplier').'</td>';
|
||||
print '<td>'.$langs->trans('Company').'</td>';
|
||||
print '<td align="right">'.$langs->trans('ExpectedToPay').'</td>';
|
||||
print '<td align="center">'.$langs->trans('Status').'</td>';
|
||||
print '<td align="right">'.$langs->trans('PayedByThisPayment').'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
$var=True;
|
||||
|
||||
$facturestatic=new FactureFournisseur($db);
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
// Ref
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$objp->facid.'">'.img_object($langs->trans('ShowBill'),'bill').' ';
|
||||
print $objp->ref;
|
||||
print "</a></td>\n";
|
||||
// Ref supplier
|
||||
print '<td>'.$objp->ref_supplier."</td>\n";
|
||||
// Third party
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'),'company').' '.$objp->nom.'</a></td>';
|
||||
// Expected to pay
|
||||
print '<td align="right">'.price($objp->total_ttc).'</td>';
|
||||
// Status
|
||||
print '<td align="center">'.$facturestatic->LibStatut($objp->paye,$objp->fk_statut,2,1).'</td>';
|
||||
// Payed
|
||||
print '<td align="right">'.price($objp->amount).'</td>';
|
||||
print "</tr>\n";
|
||||
if ($objp->paye == 1)
|
||||
{
|
||||
$allow_delete = 0;
|
||||
}
|
||||
$total = $total + $objp->amount;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$var=!$var;
|
||||
|
||||
print "</table>\n";
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
/*
|
||||
* Boutons Actions
|
||||
*/
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
if ($conf->global->BILL_ADD_PAYMENT_VALIDATION)
|
||||
{
|
||||
if ($user->societe_id == 0 && $paiement->statut == 0 && $_GET['action'] == '')
|
||||
{
|
||||
if ($user->rights->fournisseur->facture->valider)
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$_GET['id'].'&action=valide">'.$langs->trans('Valid').'</a>';
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($user->societe_id == 0 && $allow_delete && $paiement->statut == 0 && $_GET['action'] == '')
|
||||
{
|
||||
if ($user->rights->fournisseur->facture->supprimer)
|
||||
{
|
||||
print '<a class="butActionDelete" href="fiche.php?id='.$_GET['id'].'&action=delete">'.$langs->trans('Delete').'</a>';
|
||||
|
||||
}
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
$langs->load("errors");
|
||||
print $langs->trans("ErrorRecordNotFound");
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
/*
|
||||
* Boutons Actions
|
||||
*/
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
if ($conf->global->BILL_ADD_PAYMENT_VALIDATION)
|
||||
{
|
||||
if ($user->societe_id == 0 && $paiement->statut == 0 && $_GET['action'] == '')
|
||||
{
|
||||
if ($user->rights->fournisseur->facture->valider)
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$_GET['id'].'&action=valide">'.$langs->trans('Valid').'</a>';
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($user->societe_id == 0 && $allow_delete && $paiement->statut == 0 && $_GET['action'] == '')
|
||||
{
|
||||
if ($user->rights->fournisseur->facture->supprimer)
|
||||
{
|
||||
print '<a class="butActionDelete" href="fiche.php?id='.$_GET['id'].'&action=delete">'.$langs->trans('Delete').'</a>';
|
||||
|
||||
}
|
||||
}
|
||||
print '</div>';
|
||||
dol_fiche_end();
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user