Make a useless state of payment validation optionnal

This commit is contained in:
Laurent Destailleur 2008-10-29 10:37:36 +00:00
parent f5d4446bec
commit 5f957884d1
6 changed files with 252 additions and 237 deletions

View File

@ -145,7 +145,7 @@ if ($_GET['action'] == 'delete')
if ($_GET['action'] == 'valide')
{
$facid = $_GET['facid'];
$html->form_confirm('fiche.php?id='.$paiement->id.'&facid='.$facid, $langs->trans("ValidatePayment"), 'Etes-vous sûr de vouloir valider ce règlement, auncune modification n\'est possible une fois le règlement validé ?', 'confirm_valide');
$html->form_confirm('fiche.php?id='.$paiement->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide');
print '<br>';
}
@ -267,12 +267,14 @@ print '</div>';
print '<div class="tabsAction">';
if ($user->societe_id == 0 && $paiement->statut == 0 && $_GET['action'] == '')
if ($conf->global->BILL_ADD_PAYMENT_VALIDATION)
{
if ($user->rights->facture->paiement)
if ($user->societe_id == 0 && $paiement->statut == 0 && $_GET['action'] == '')
{
print '<a class="butAction" href="fiche.php?id='.$_GET['id'].'&amp;facid='.$objp->facid.'&amp;action=valide">'.$langs->trans('Valid').'</a>';
if ($user->rights->facture->paiement)
{
print '<a class="butAction" href="fiche.php?id='.$_GET['id'].'&amp;facid='.$objp->facid.'&amp;action=valide">'.$langs->trans('Valid').'</a>';
}
}
}
if ($user->societe_id == 0 && $allow_delete && $_GET['action'] == '')
@ -282,6 +284,7 @@ if ($user->societe_id == 0 && $allow_delete && $_GET['action'] == '')
print '<a class="butActionDelete" href="fiche.php?id='.$_GET['id'].'&amp;action=delete">'.$langs->trans('Delete').'</a>';
}
}
print '</div>';
$db->close();

View File

@ -317,9 +317,11 @@ if ($_POST['action'] == 'classin')
$facture->setProject($_POST['projetid']);
}
/*
* Affichage page
* View
*/
$addons='';
llxHeader('','', $addons);

View File

@ -100,7 +100,7 @@ if ($action == 'add_paiement')
$mesg = '<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('Amount')).'</div>';
$error++;
}
*/
*/
if (! $error)
{
@ -182,7 +182,7 @@ if ($action == 'add_paiement')
}
/*
* Affichage
* View
*/
llxHeader();
@ -199,6 +199,9 @@ if ($action == 'create' || $action == 'add_paiement')
$facture = new FactureFournisseur($db);
$facture->fetch($facid);
$datefacture=dolibarr_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
$dateinvoice=($datefacture==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0):$datefacture);
$sql = 'SELECT s.nom, s.rowid as socid,';
$sql.= ' f.rowid as ref, f.facnumber, f.amount, f.total_ttc as total';
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
@ -213,134 +216,130 @@ if ($action == 'create' || $action == 'add_paiement')
$num = $db->num_rows($resql);
if ($num)
{
$obj = $db->fetch_object($resql);
$total = $obj->total;
$obj = $db->fetch_object($resql);
$total = $obj->total;
print_fiche_titre($langs->trans('DoPayment'));
print '<form name="addpaiement" action="paiement.php" method="post">';
print '<input type="hidden" name="action" value="add_paiement">';
print '<input type="hidden" name="facid" value="'.$facid.'">';
print '<input type="hidden" name="facnumber" value="'.$obj->facnumber.'">';
print '<input type="hidden" name="socid" value="'.$obj->socid.'">';
print '<input type="hidden" name="societe" value="'.$obj->nom.'">';
print_fiche_titre($langs->trans('DoPayment'));
print '<form name="addpaiement" action="paiement.php" method="post">';
print '<input type="hidden" name="action" value="add_paiement">';
print '<input type="hidden" name="facid" value="'.$facid.'">';
print '<input type="hidden" name="facnumber" value="'.$obj->facnumber.'">';
print '<input type="hidden" name="socid" value="'.$obj->socid.'">';
print '<input type="hidden" name="societe" value="'.$obj->nom.'">';
print '<table class="border" width="100%">';
print '<table class="border" width="100%">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans('Payment').'</td>';
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="2">'.$obj->nom.'</td></tr>';
print '<tr><td>'.$langs->trans('Date').'</td><td>';
if (!empty($_POST['remonth']) && !empty($_POST['reday']) && !empty($_POST['reyear']))
$sel_date=mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
else
$sel_date='';
$html->select_date($sel_date,'','','','',"addpaiement");
print '</td>';
print '<td>'.$langs->trans('Comments').'</td></tr>';
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
$html->select_types_paiements(empty($_POST['paiementid'])?'':$_POST['paiementid'],'paiementid');
print '</td>';
print '<td rowspan="3" valign="top">';
print '<textarea name="comment" wrap="soft" cols="40" rows="4">'.(empty($_POST['comment'])?'':$_POST['comment']).'</textarea></td></tr>';
print '<tr><td>'.$langs->trans('Numero').'</td><td><input name="num_paiement" type="text" value="'.(empty($_POST['num_paiement'])?'':$_POST['num_paiement']).'"></td></tr>';
if ($conf->banque->enabled)
{
print '<tr><td>'.$langs->trans('Account').'</td><td>';
$html->select_comptes(empty($_POST['accountid'])?'':$_POST['accountid'],'accountid',0,'',1);
print '</td></tr>';
}
else
{
print '<tr><td colspan="2">&nbsp;</td></tr>';
}
/*
* Autres factures impayees
*/
$sql = 'SELECT f.rowid as facid,f.rowid as ref,f.facnumber,f.total_ttc,'.$db->pdate('f.datef').' as df';
$sql .= ', sum(pf.amount) as am';
$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
$sql .= ' WHERE f.fk_soc = '.$facture->socid;
$sql .= ' AND f.paye = 0';
$sql .= ' AND f.fk_statut = 1'; // Statut=0 => non validee, Statut=2 => annulee
$sql .= ' GROUP BY f.facnumber';
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
if ($num > 0)
{
$i = 0;
print '<tr><td colspan="3">';
print $langs->trans('Invoices').'<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 align="center">'.$langs->trans('Date').'</td>';
print '<td align="right">'.$langs->trans('AmountTTC').'</td>';
print '<td align="right">'.$langs->trans('AlreadyPayed').'</td>';
print '<td align="right">'.$langs->trans('RemainderToPay').'</td>';
print '<td align="center">'.$langs->trans('Amount').'</td>';
print '</tr>';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans('Payment').'</td>';
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="2">'.$obj->nom.'</td></tr>';
print '<tr><td>'.$langs->trans('Date').'</td><td>';
$html->select_date($dateinvoice,'','','','',"addpaiement");
print '</td>';
print '<td>'.$langs->trans('Comments').'</td></tr>';
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
$html->select_types_paiements(empty($_POST['paiementid'])?'':$_POST['paiementid'],'paiementid');
print '</td>';
print '<td rowspan="3" valign="top">';
print '<textarea name="comment" wrap="soft" cols="60" rows="'._ROWS_3.'">'.(empty($_POST['comment'])?'':$_POST['comment']).'</textarea></td></tr>';
print '<tr><td>'.$langs->trans('Numero').'</td><td><input name="num_paiement" type="text" value="'.(empty($_POST['num_paiement'])?'':$_POST['num_paiement']).'"></td></tr>';
if ($conf->banque->enabled)
{
print '<tr><td>'.$langs->trans('Account').'</td><td>';
$html->select_comptes(empty($_POST['accountid'])?'':$_POST['accountid'],'accountid',0,'',1);
print '</td></tr>';
}
else
{
print '<tr><td colspan="2">&nbsp;</td></tr>';
}
/*
* Autres factures impayees
*/
$sql = 'SELECT f.rowid as facid,f.rowid as ref,f.facnumber,f.total_ttc,'.$db->pdate('f.datef').' as df';
$sql .= ', sum(pf.amount) as am';
$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
$sql .= ' WHERE f.fk_soc = '.$facture->socid;
$sql .= ' AND f.paye = 0';
$sql .= ' AND f.fk_statut = 1'; // Statut=0 => non validee, Statut=2 => annulee
$sql .= ' GROUP BY f.facnumber';
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
if ($num > 0)
{
$i = 0;
print '<tr><td colspan="3">';
print $langs->trans('Invoices').'<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 align="center">'.$langs->trans('Date').'</td>';
print '<td align="right">'.$langs->trans('AmountTTC').'</td>';
print '<td align="right">'.$langs->trans('AlreadyPayed').'</td>';
print '<td align="right">'.$langs->trans('RemainderToPay').'</td>';
print '<td align="center">'.$langs->trans('Amount').'</td>';
print '</tr>';
$var=True;
$total=0;
$totalrecu=0;
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td><a href="fiche.php?facid='.$objp->facid.'">'.img_object($langs->trans('ShowBill'),'bill').' '.$objp->ref;
print '</a></td>';
print '<td>'.$objp->facnumber.'</td>';
if ($objp->df > 0 )
{
print '<td align="center">';
print dolibarr_print_date($objp->df).'</td>';
}
else
{
print '<td align="center"><b>!!!</b></td>';
}
print '<td align="right">'.price($objp->total_ttc).'</td>';
print '<td align="right">'.price($objp->am).'</td>';
print '<td align="right">'.price($objp->total_ttc - $objp->am).'</td>';
print '<td align="center">';
$namef = 'amount_'.$objp->facid;
print '<input type="text" size="8" name="'.$namef.'">';
print "</td></tr>\n";
$total+=$objp->total;
$total_ttc+=$objp->total_ttc;
$totalrecu+=$objp->am;
$i++;
}
if ($i > 1)
{
// Print total
print '<tr class="liste_total">';
print '<td colspan="3" align="left">'.$langs->trans('TotalTTC').':</td>';
print '<td align="right"><b>'.price($total_ttc).'</b></td>';
print '<td align="right"><b>'.price($totalrecu).'</b></td>';
print '<td align="right"><b>'.price($total_ttc - $totalrecu).'</b></td>';
print '<td align="center">&nbsp;</td>';
print "</tr>\n";
}
print "</table></td></tr>\n";
}
$db->free($resql);
}
else
{
dolibarr_print_error($db);
}
$var=True;
$total=0;
$totalrecu=0;
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td><a href="fiche.php?facid='.$objp->facid.'">'.img_object($langs->trans('ShowBill'),'bill').' '.$objp->ref;
print '</a></td>';
print '<td>'.$objp->facnumber.'</td>';
if ($objp->df > 0 )
{
print '<td align="center">';
print dolibarr_print_date($objp->df).'</td>';
}
else
{
print '<td align="center"><b>!!!</b></td>';
}
print '<td align="right">'.price($objp->total_ttc).'</td>';
print '<td align="right">'.price($objp->am).'</td>';
print '<td align="right">'.price($objp->total_ttc - $objp->am).'</td>';
print '<td align="center">';
$namef = 'amount_'.$objp->facid;
print '<input type="text" size="8" name="'.$namef.'">';
print "</td></tr>\n";
$total+=$objp->total;
$total_ttc+=$objp->total_ttc;
$totalrecu+=$objp->am;
$i++;
}
if ($i > 1)
{
// Print total
print '<tr class="liste_total">';
print '<td colspan="3" align="left">'.$langs->trans('TotalTTC').':</td>';
print '<td align="right"><b>'.price($total_ttc).'</b></td>';
print '<td align="right"><b>'.price($totalrecu).'</b></td>';
print '<td align="right"><b>'.price($total_ttc - $totalrecu).'</b></td>';
print '<td align="center">&nbsp;</td>';
print "</tr>\n";
}
print "</table></td></tr>\n";
}
$db->free($resql);
}
else
{
dolibarr_print_error($db);
}
/*
*
*/
print '<tr><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans('Save').'"></td></tr>';
print '</table>';
print '</form>';
/*
*
*/
print '<tr><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans('Save').'"></td></tr>';
print '</table>';
print '</form>';
}
}
}

View File

@ -19,12 +19,12 @@
*/
/**
\file htdocs/fourn/paiement/fiche.php
\ingroup facture, fournisseur
\brief Onglet paiement d'un paiement fournisseur
\remarks Fichier presque identique a compta/paiement/fiche.php
\version $Id$
*/
\file htdocs/fourn/paiement/fiche.php
\ingroup facture, fournisseur
\brief Onglet paiement d'un paiement fournisseur
\remarks Fichier presque identique a compta/paiement/fiche.php
\version $Id$
*/
require('./pre.inc.php');
@ -43,7 +43,7 @@ $mesg='';
/*
* Actions
*/
if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes' && $user->rights->fournisseur->facture->supprimer)
{
$db->begin();
@ -53,14 +53,14 @@ if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes' && $user-
$result = $paiement->delete();
if ($result > 0)
{
$db->commit();
Header('Location: '.DOL_URL_ROOT.'/fourn/facture/paiement.php');
exit;
$db->commit();
Header('Location: '.DOL_URL_ROOT.'/fourn/facture/paiement.php');
exit;
}
else
{
$mesg='<div class="error">'.$paiement->error.'</div>';
$db->rollback();
$db->rollback();
}
}
@ -72,14 +72,14 @@ if ($_POST['action'] == 'confirm_valide' && $_POST['confirm'] == 'yes' && $user-
$paiement->id = $_GET['id'];
if ($paiement->valide() >= 0)
{
$db->commit();
$db->commit();
Header('Location: fiche.php?id='.$paiement->id);
exit;
exit;
}
else
{
$mesg='<div class="error">'.$paiement->error.'</div>';
$db->rollback();
$db->rollback();
}
}
@ -114,7 +114,7 @@ dolibarr_fiche_head($head, $hselected, $langs->trans('SupplierPayment'));
*/
if ($_GET['action'] == 'delete')
{
$html->form_confirm('fiche.php?id='.$paiement->id, 'Supprimer le paiement', 'Etes-vous sûr de vouloir supprimer ce paiement ?', 'confirm_delete');
$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete');
print '<br>';
}
@ -123,32 +123,32 @@ if ($_GET['action'] == 'delete')
*/
if ($_GET['action'] == 'valide')
{
$html->form_confirm('fiche.php?id='.$paiement->id, 'Valider le paiement', 'Etes-vous sûr de vouloir valider ce paiment, auncune modification n\'est possible une fois le paiement validé ?', 'confirm_valide');
$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide');
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 ($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 = dolibarr_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>';
}
$datepaye = dolibarr_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>';
}
}
@ -158,84 +158,90 @@ print '<tr>';
print '<td valign="top" width="140" colspan="2">'.$langs->trans('Ref').'</td><td colspan="3">'.$paiement->id.'</td></tr>';
if ($conf->banque->enabled)
{
if ($paiement->bank_account)
{
// Si compte renseigné, on affiche libelle
$bank=new Account($db);
$bank->fetch($paiement->bank_account);
if ($paiement->bank_account)
{
// Si compte renseigné, on affiche libelle
$bank=new Account($db);
$bank->fetch($paiement->bank_account);
$bankline=new AccountLine($db);
$bankline->fetch($paiement->bank_line);
$bankline=new AccountLine($db);
$bankline->fetch($paiement->bank_line);
print '<tr>';
print '<td valign="top" width="140" 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>';
}
print '<tr>';
print '<td valign="top" width="140" 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>';
}
}
//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">'.dolibarr_print_date($paiement->date,'day').'</td></tr>';
}
else
{
print '<tr>';
print '<td valign="top" width="140" 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" />';
if (!empty($_POST['remonth']) && !empty($_POST['reday']) && !empty($_POST['reyear']))
$sel_date=dolibarr_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>';
}
//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">'.dolibarr_print_date($paiement->date,'day').'</td></tr>';
}
else
{
print '<tr>';
print '<td valign="top" width="140" 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" />';
if (!empty($_POST['remonth']) && !empty($_POST['reday']) && !empty($_POST['reyear']))
$sel_date=dolibarr_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>';
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" width="140" 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" />';
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>';
}
//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" width="140" 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" />';
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).'&nbsp;'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
print '<tr><td valign="top" colspan="2">'.$langs->trans('Status').'</td><td colspan="3">'.$paiement->getLibStatut(4).'</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>';
print '</table>';
if ($mesg) print '<br>'.$mesg;
@ -271,8 +277,8 @@ if ($resql)
{
$var=True;
$facturestatic=new FactureFournisseur($db);
$facturestatic=new FactureFournisseur($db);
while ($i < $num)
{
$objp = $db->fetch_object($resql);
@ -312,12 +318,15 @@ print '</div>';
*/
print '<div class="tabsAction">';
if ($user->societe_id == 0 && $paiement->statut == 0 && $_GET['action'] == '')
if ($conf->global->BILL_ADD_PAYMENT_VALIDATION)
{
if ($user->rights->fournisseur->facture->valider)
if ($user->societe_id == 0 && $paiement->statut == 0 && $_GET['action'] == '')
{
print '<a class="butAction" href="fiche.php?id='.$_GET['id'].'&amp;action=valide">'.$langs->trans('Valid').'</a>';
if ($user->rights->fournisseur->facture->valider)
{
print '<a class="butAction" href="fiche.php?id='.$_GET['id'].'&amp;action=valide">'.$langs->trans('Valid').'</a>';
}
}
}
if ($user->societe_id == 0 && $allow_delete && $paiement->statut == 0 && $_GET['action'] == '')

View File

@ -148,6 +148,7 @@ ConfirmClassifyPayedPartiallyReasonOtherDesc=Use this choice if all other does n
ConfirmClassifyAbandonReasonOther=Other
ConfirmClassifyAbandonReasonOtherDesc=This choice will be used in all other cases. For example because you plan to create a replacing invoice.
ConfirmCustomerPayment=Do you confirm this paiement input for <b>%s</b> %s ?
ConfirmValidatePayment=Etes-vous sur de vouloir valider ce paiment, auncune modification n'est possible une fois le paiement validé ?
ValidateBill=Validate invoice
NumberOfBills=Nb of invoices
NumberOfBillsByMonthHT=Nb of invoices by month (net of tax)

View File

@ -148,6 +148,7 @@ ConfirmClassifyPayedPartiallyReasonOtherDesc=Ce choix sera celui dans tout autre
ConfirmClassifyAbandonReasonOther=Autre
ConfirmClassifyAbandonReasonOtherDesc=Ce choix sera celui dans tout autre cas. Par exemple suite à intention de créer une facture de remplacement.
ConfirmCustomerPayment=Confirmez-vous la saisie de ce réglement de <b>%s</b> %s ?
ConfirmValidatePayment=Etes-vous sur de vouloir valider ce paiment, auncune modification n'est possible une fois le paiement validé ?
ValidateBill=Valider facture
NumberOfBills=Nb de factures
NumberOfBillsByMonth=Nb de factures par mois