Make a useless state of payment validation optionnal
This commit is contained in:
parent
f5d4446bec
commit
5f957884d1
@ -145,7 +145,7 @@ if ($_GET['action'] == 'delete')
|
|||||||
if ($_GET['action'] == 'valide')
|
if ($_GET['action'] == 'valide')
|
||||||
{
|
{
|
||||||
$facid = $_GET['facid'];
|
$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>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -267,12 +267,14 @@ print '</div>';
|
|||||||
|
|
||||||
print '<div class="tabsAction">';
|
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'].'&facid='.$objp->facid.'&action=valide">'.$langs->trans('Valid').'</a>';
|
if ($user->rights->facture->paiement)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="fiche.php?id='.$_GET['id'].'&facid='.$objp->facid.'&action=valide">'.$langs->trans('Valid').'</a>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($user->societe_id == 0 && $allow_delete && $_GET['action'] == '')
|
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'].'&action=delete">'.$langs->trans('Delete').'</a>';
|
print '<a class="butActionDelete" href="fiche.php?id='.$_GET['id'].'&action=delete">'.$langs->trans('Delete').'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -317,9 +317,11 @@ if ($_POST['action'] == 'classin')
|
|||||||
$facture->setProject($_POST['projetid']);
|
$facture->setProject($_POST['projetid']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Affichage page
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$addons='';
|
$addons='';
|
||||||
llxHeader('','', $addons);
|
llxHeader('','', $addons);
|
||||||
|
|
||||||
|
|||||||
@ -100,7 +100,7 @@ if ($action == 'add_paiement')
|
|||||||
$mesg = '<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('Amount')).'</div>';
|
$mesg = '<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('Amount')).'</div>';
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@ -182,7 +182,7 @@ if ($action == 'add_paiement')
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Affichage
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
@ -199,6 +199,9 @@ if ($action == 'create' || $action == 'add_paiement')
|
|||||||
$facture = new FactureFournisseur($db);
|
$facture = new FactureFournisseur($db);
|
||||||
$facture->fetch($facid);
|
$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 = 'SELECT s.nom, s.rowid as socid,';
|
||||||
$sql.= ' f.rowid as ref, f.facnumber, f.amount, f.total_ttc as total';
|
$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 ";
|
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);
|
$num = $db->num_rows($resql);
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
$total = $obj->total;
|
$total = $obj->total;
|
||||||
|
|
||||||
print_fiche_titre($langs->trans('DoPayment'));
|
print_fiche_titre($langs->trans('DoPayment'));
|
||||||
print '<form name="addpaiement" action="paiement.php" method="post">';
|
print '<form name="addpaiement" action="paiement.php" method="post">';
|
||||||
print '<input type="hidden" name="action" value="add_paiement">';
|
print '<input type="hidden" name="action" value="add_paiement">';
|
||||||
print '<input type="hidden" name="facid" value="'.$facid.'">';
|
print '<input type="hidden" name="facid" value="'.$facid.'">';
|
||||||
print '<input type="hidden" name="facnumber" value="'.$obj->facnumber.'">';
|
print '<input type="hidden" name="facnumber" value="'.$obj->facnumber.'">';
|
||||||
print '<input type="hidden" name="socid" value="'.$obj->socid.'">';
|
print '<input type="hidden" name="socid" value="'.$obj->socid.'">';
|
||||||
print '<input type="hidden" name="societe" value="'.$obj->nom.'">';
|
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 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('Company').'</td><td colspan="2">'.$obj->nom.'</td></tr>';
|
||||||
print '<tr><td>'.$langs->trans('Date').'</td><td>';
|
print '<tr><td>'.$langs->trans('Date').'</td><td>';
|
||||||
if (!empty($_POST['remonth']) && !empty($_POST['reday']) && !empty($_POST['reyear']))
|
$html->select_date($dateinvoice,'','','','',"addpaiement");
|
||||||
$sel_date=mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
print '</td>';
|
||||||
else
|
print '<td>'.$langs->trans('Comments').'</td></tr>';
|
||||||
$sel_date='';
|
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
|
||||||
$html->select_date($sel_date,'','','','',"addpaiement");
|
$html->select_types_paiements(empty($_POST['paiementid'])?'':$_POST['paiementid'],'paiementid');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>'.$langs->trans('Comments').'</td></tr>';
|
print '<td rowspan="3" valign="top">';
|
||||||
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
|
print '<textarea name="comment" wrap="soft" cols="60" rows="'._ROWS_3.'">'.(empty($_POST['comment'])?'':$_POST['comment']).'</textarea></td></tr>';
|
||||||
$html->select_types_paiements(empty($_POST['paiementid'])?'':$_POST['paiementid'],'paiementid');
|
print '<tr><td>'.$langs->trans('Numero').'</td><td><input name="num_paiement" type="text" value="'.(empty($_POST['num_paiement'])?'':$_POST['num_paiement']).'"></td></tr>';
|
||||||
print '</td>';
|
if ($conf->banque->enabled)
|
||||||
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('Account').'</td><td>';
|
||||||
print '<tr><td>'.$langs->trans('Numero').'</td><td><input name="num_paiement" type="text" value="'.(empty($_POST['num_paiement'])?'':$_POST['num_paiement']).'"></td></tr>';
|
$html->select_comptes(empty($_POST['accountid'])?'':$_POST['accountid'],'accountid',0,'',1);
|
||||||
if ($conf->banque->enabled)
|
print '</td></tr>';
|
||||||
{
|
}
|
||||||
print '<tr><td>'.$langs->trans('Account').'</td><td>';
|
else
|
||||||
$html->select_comptes(empty($_POST['accountid'])?'':$_POST['accountid'],'accountid',0,'',1);
|
{
|
||||||
print '</td></tr>';
|
print '<tr><td colspan="2"> </td></tr>';
|
||||||
}
|
}
|
||||||
else
|
/*
|
||||||
{
|
* Autres factures impayees
|
||||||
print '<tr><td colspan="2"> </td></tr>';
|
*/
|
||||||
}
|
$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';
|
||||||
* Autres factures impayees
|
$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 = 'SELECT f.rowid as facid,f.rowid as ref,f.facnumber,f.total_ttc,'.$db->pdate('f.datef').' as df';
|
$sql .= ' WHERE f.fk_soc = '.$facture->socid;
|
||||||
$sql .= ', sum(pf.amount) as am';
|
$sql .= ' AND f.paye = 0';
|
||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
|
$sql .= ' AND f.fk_statut = 1'; // Statut=0 => non validee, Statut=2 => annulee
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
|
$sql .= ' GROUP BY f.facnumber';
|
||||||
$sql .= ' WHERE f.fk_soc = '.$facture->socid;
|
$resql = $db->query($sql);
|
||||||
$sql .= ' AND f.paye = 0';
|
if ($resql)
|
||||||
$sql .= ' AND f.fk_statut = 1'; // Statut=0 => non validee, Statut=2 => annulee
|
{
|
||||||
$sql .= ' GROUP BY f.facnumber';
|
$num = $db->num_rows($resql);
|
||||||
$resql = $db->query($sql);
|
if ($num > 0)
|
||||||
if ($resql)
|
{
|
||||||
{
|
$i = 0;
|
||||||
$num = $db->num_rows($resql);
|
print '<tr><td colspan="3">';
|
||||||
if ($num > 0)
|
print $langs->trans('Invoices').'<br>';
|
||||||
{
|
print '<table class="noborder" width="100%">';
|
||||||
$i = 0;
|
print '<tr class="liste_titre">';
|
||||||
print '<tr><td colspan="3">';
|
print '<td>'.$langs->trans('Ref').'</td>';
|
||||||
print $langs->trans('Invoices').'<br>';
|
print '<td>'.$langs->trans('RefSupplier').'</td>';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<td align="center">'.$langs->trans('Date').'</td>';
|
||||||
print '<tr class="liste_titre">';
|
print '<td align="right">'.$langs->trans('AmountTTC').'</td>';
|
||||||
print '<td>'.$langs->trans('Ref').'</td>';
|
print '<td align="right">'.$langs->trans('AlreadyPayed').'</td>';
|
||||||
print '<td>'.$langs->trans('RefSupplier').'</td>';
|
print '<td align="right">'.$langs->trans('RemainderToPay').'</td>';
|
||||||
print '<td align="center">'.$langs->trans('Date').'</td>';
|
print '<td align="center">'.$langs->trans('Amount').'</td>';
|
||||||
print '<td align="right">'.$langs->trans('AmountTTC').'</td>';
|
print '</tr>';
|
||||||
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;
|
$var=True;
|
||||||
$total=0;
|
$total=0;
|
||||||
$totalrecu=0;
|
$totalrecu=0;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td><a href="fiche.php?facid='.$objp->facid.'">'.img_object($langs->trans('ShowBill'),'bill').' '.$objp->ref;
|
print '<td><a href="fiche.php?facid='.$objp->facid.'">'.img_object($langs->trans('ShowBill'),'bill').' '.$objp->ref;
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
print '<td>'.$objp->facnumber.'</td>';
|
print '<td>'.$objp->facnumber.'</td>';
|
||||||
if ($objp->df > 0 )
|
if ($objp->df > 0 )
|
||||||
{
|
{
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print dolibarr_print_date($objp->df).'</td>';
|
print dolibarr_print_date($objp->df).'</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td align="center"><b>!!!</b></td>';
|
print '<td align="center"><b>!!!</b></td>';
|
||||||
}
|
}
|
||||||
print '<td align="right">'.price($objp->total_ttc).'</td>';
|
print '<td align="right">'.price($objp->total_ttc).'</td>';
|
||||||
print '<td align="right">'.price($objp->am).'</td>';
|
print '<td align="right">'.price($objp->am).'</td>';
|
||||||
print '<td align="right">'.price($objp->total_ttc - $objp->am).'</td>';
|
print '<td align="right">'.price($objp->total_ttc - $objp->am).'</td>';
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
$namef = 'amount_'.$objp->facid;
|
$namef = 'amount_'.$objp->facid;
|
||||||
print '<input type="text" size="8" name="'.$namef.'">';
|
print '<input type="text" size="8" name="'.$namef.'">';
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
$total+=$objp->total;
|
$total+=$objp->total;
|
||||||
$total_ttc+=$objp->total_ttc;
|
$total_ttc+=$objp->total_ttc;
|
||||||
$totalrecu+=$objp->am;
|
$totalrecu+=$objp->am;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
if ($i > 1)
|
if ($i > 1)
|
||||||
{
|
{
|
||||||
// Print total
|
// Print total
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total">';
|
||||||
print '<td colspan="3" align="left">'.$langs->trans('TotalTTC').':</td>';
|
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($total_ttc).'</b></td>';
|
||||||
print '<td align="right"><b>'.price($totalrecu).'</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="right"><b>'.price($total_ttc - $totalrecu).'</b></td>';
|
||||||
print '<td align="center"> </td>';
|
print '<td align="center"> </td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
print "</table></td></tr>\n";
|
print "</table></td></tr>\n";
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
print '<tr><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans('Save').'"></td></tr>';
|
print '<tr><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans('Save').'"></td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,12 +19,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/fourn/paiement/fiche.php
|
\file htdocs/fourn/paiement/fiche.php
|
||||||
\ingroup facture, fournisseur
|
\ingroup facture, fournisseur
|
||||||
\brief Onglet paiement d'un paiement fournisseur
|
\brief Onglet paiement d'un paiement fournisseur
|
||||||
\remarks Fichier presque identique a compta/paiement/fiche.php
|
\remarks Fichier presque identique a compta/paiement/fiche.php
|
||||||
\version $Id$
|
\version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
require('./pre.inc.php');
|
require('./pre.inc.php');
|
||||||
@ -43,7 +43,7 @@ $mesg='';
|
|||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes' && $user->rights->fournisseur->facture->supprimer)
|
if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes' && $user->rights->fournisseur->facture->supprimer)
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
@ -53,14 +53,14 @@ if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes' && $user-
|
|||||||
$result = $paiement->delete();
|
$result = $paiement->delete();
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
Header('Location: '.DOL_URL_ROOT.'/fourn/facture/paiement.php');
|
Header('Location: '.DOL_URL_ROOT.'/fourn/facture/paiement.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mesg='<div class="error">'.$paiement->error.'</div>';
|
$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'];
|
$paiement->id = $_GET['id'];
|
||||||
if ($paiement->valide() >= 0)
|
if ($paiement->valide() >= 0)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
Header('Location: fiche.php?id='.$paiement->id);
|
Header('Location: fiche.php?id='.$paiement->id);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mesg='<div class="error">'.$paiement->error.'</div>';
|
$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')
|
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>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,32 +123,32 @@ if ($_GET['action'] == 'delete')
|
|||||||
*/
|
*/
|
||||||
if ($_GET['action'] == 'valide')
|
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>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_POST['action']) && $_POST['action'] == 'update_num' && !empty($_POST['new_num']))
|
if (!empty($_POST['action']) && $_POST['action'] == 'update_num' && !empty($_POST['new_num']))
|
||||||
{
|
{
|
||||||
$res = $paiement->update_num($_POST['new_num']);
|
$res = $paiement->update_num($_POST['new_num']);
|
||||||
if ($res === 0) {
|
if ($res === 0) {
|
||||||
$mesg = '<div class="ok">'.$langs->trans('PaymentNumberUpdateSucceeded').'</div>';
|
$mesg = '<div class="ok">'.$langs->trans('PaymentNumberUpdateSucceeded').'</div>';
|
||||||
} else {
|
} else {
|
||||||
$mesg = '<div class="error">'.$langs->trans('PaymentNumberUpdateFailed').'</div>';
|
$mesg = '<div class="error">'.$langs->trans('PaymentNumberUpdateFailed').'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_POST['action']) && $_POST['action'] == 'update_date' && !empty($_POST['reday']))
|
if (!empty($_POST['action']) && $_POST['action'] == 'update_date' && !empty($_POST['reday']))
|
||||||
{
|
{
|
||||||
$datepaye = dolibarr_mktime(12, 0 , 0,
|
$datepaye = dolibarr_mktime(12, 0 , 0,
|
||||||
$_POST['remonth'],
|
$_POST['remonth'],
|
||||||
$_POST['reday'],
|
$_POST['reday'],
|
||||||
$_POST['reyear']);
|
$_POST['reyear']);
|
||||||
$res = $paiement->update_date($datepaye);
|
$res = $paiement->update_date($datepaye);
|
||||||
if ($res === 0) {
|
if ($res === 0) {
|
||||||
$mesg = '<div class="ok">'.$langs->trans('PaymentDateUpdateSucceeded').'</div>';
|
$mesg = '<div class="ok">'.$langs->trans('PaymentDateUpdateSucceeded').'</div>';
|
||||||
} else {
|
} else {
|
||||||
$mesg = '<div class="error">'.$langs->trans('PaymentDateUpdateFailed').'</div>';
|
$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>';
|
print '<td valign="top" width="140" colspan="2">'.$langs->trans('Ref').'</td><td colspan="3">'.$paiement->id.'</td></tr>';
|
||||||
if ($conf->banque->enabled)
|
if ($conf->banque->enabled)
|
||||||
{
|
{
|
||||||
if ($paiement->bank_account)
|
if ($paiement->bank_account)
|
||||||
{
|
{
|
||||||
// Si compte renseigné, on affiche libelle
|
// Si compte renseigné, on affiche libelle
|
||||||
$bank=new Account($db);
|
$bank=new Account($db);
|
||||||
$bank->fetch($paiement->bank_account);
|
$bank->fetch($paiement->bank_account);
|
||||||
|
|
||||||
$bankline=new AccountLine($db);
|
$bankline=new AccountLine($db);
|
||||||
$bankline->fetch($paiement->bank_line);
|
$bankline->fetch($paiement->bank_line);
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td valign="top" width="140" colspan="2">'.$langs->trans('BankAccount').'</td>';
|
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><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>'.$langs->trans('BankLineConciliated').'</td><td>'.yn($bankline->rappro).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//switch through edition options for date (only available when statut is -not 1- (=validated))
|
//switch through edition options for date (only available when statut is -not 1- (=validated))
|
||||||
if (empty($_GET['action']) || $_GET['action']!='edit_date')
|
if (empty($_GET['action']) || $_GET['action']!='edit_date')
|
||||||
{
|
{
|
||||||
print '<tr><td colspan="2">';
|
print '<tr><td colspan="2">';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td nowrap="nowrap">';
|
print '<table class="nobordernopadding" width="100%"><tr><td nowrap="nowrap">';
|
||||||
print $langs->trans('Date');
|
print $langs->trans('Date');
|
||||||
print '</td>';
|
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>';
|
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 '</tr></table>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td colspan="3">'.dolibarr_print_date($paiement->date,'day').'</td></tr>';
|
print '<td colspan="3">'.dolibarr_print_date($paiement->date,'day').'</td></tr>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td valign="top" width="140" colspan="2">'.$langs->trans('Date').'</td>';
|
print '<td valign="top" width="140" colspan="2">'.$langs->trans('Date').'</td>';
|
||||||
print '<td colspan="3">';
|
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 '<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']))
|
if (!empty($_POST['remonth']) && !empty($_POST['reday']) && !empty($_POST['reyear']))
|
||||||
$sel_date=dolibarr_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
$sel_date=dolibarr_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||||
else
|
else
|
||||||
$sel_date=$paiement->date;
|
$sel_date=$paiement->date;
|
||||||
$html->select_date($sel_date,'','','','',"addpaiement");
|
$html->select_date($sel_date,'','','','',"addpaiement");
|
||||||
print '<input type="submit" class="button" name="submit" value="'.$langs->trans('Validate').'" />';
|
print '<input type="submit" class="button" name="submit" value="'.$langs->trans('Validate').'" />';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
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))
|
//switch through edition options for number (only available when statut is -not 1- (=validated))
|
||||||
if (empty($_GET['action']) || $_GET['action'] != 'edit_num')
|
if (empty($_GET['action']) || $_GET['action'] != 'edit_num')
|
||||||
{
|
{
|
||||||
print '<tr><td colspan="2">';
|
print '<tr><td colspan="2">';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td nowrap="nowrap">';
|
print '<table class="nobordernopadding" width="100%"><tr><td nowrap="nowrap">';
|
||||||
print $langs->trans('Numero');
|
print $langs->trans('Numero');
|
||||||
print '</td>';
|
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>';
|
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 '</tr></table>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td colspan="3">'.$paiement->numero.'</td></tr>';
|
print '<td colspan="3">'.$paiement->numero.'</td></tr>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td valign="top" width="140" colspan="2">'.$langs->trans('Numero').'</td>';
|
print '<td valign="top" width="140" colspan="2">'.$langs->trans('Numero').'</td>';
|
||||||
print '<td colspan="3">';
|
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 '<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']))
|
if (!empty($_POST['new_num']))
|
||||||
$num = $this->db->escape($_POST['new_num']);
|
$num = $this->db->escape($_POST['new_num']);
|
||||||
else
|
else
|
||||||
$num = $paiement->numero;
|
$num = $paiement->numero;
|
||||||
print '<input type="text" name="new_num" value="'.$num.'"/>';
|
print '<input type="text" name="new_num" value="'.$num.'"/>';
|
||||||
print '<input type="submit" class="button" name="submit" value="'.$langs->trans('Validate').'" />';
|
print '<input type="submit" class="button" name="submit" value="'.$langs->trans('Validate').'" />';
|
||||||
print '</form></td>';
|
print '</form></td>';
|
||||||
print '</tr>';
|
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>';
|
print '<tr><td valign="top" colspan="2">'.$langs->trans('Amount').'</td><td colspan="3">'.price($paiement->montant).' '.$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 '<tr><td valign="top" colspan="2">'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($paiement->note).'</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
if ($mesg) print '<br>'.$mesg;
|
if ($mesg) print '<br>'.$mesg;
|
||||||
@ -271,8 +277,8 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
$var=True;
|
$var=True;
|
||||||
|
|
||||||
$facturestatic=new FactureFournisseur($db);
|
$facturestatic=new FactureFournisseur($db);
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
@ -312,12 +318,15 @@ print '</div>';
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
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'].'&action=valide">'.$langs->trans('Valid').'</a>';
|
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->societe_id == 0 && $allow_delete && $paiement->statut == 0 && $_GET['action'] == '')
|
||||||
|
|||||||
@ -148,6 +148,7 @@ ConfirmClassifyPayedPartiallyReasonOtherDesc=Use this choice if all other does n
|
|||||||
ConfirmClassifyAbandonReasonOther=Other
|
ConfirmClassifyAbandonReasonOther=Other
|
||||||
ConfirmClassifyAbandonReasonOtherDesc=This choice will be used in all other cases. For example because you plan to create a replacing invoice.
|
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 ?
|
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
|
ValidateBill=Validate invoice
|
||||||
NumberOfBills=Nb of invoices
|
NumberOfBills=Nb of invoices
|
||||||
NumberOfBillsByMonthHT=Nb of invoices by month (net of tax)
|
NumberOfBillsByMonthHT=Nb of invoices by month (net of tax)
|
||||||
|
|||||||
@ -148,6 +148,7 @@ ConfirmClassifyPayedPartiallyReasonOtherDesc=Ce choix sera celui dans tout autre
|
|||||||
ConfirmClassifyAbandonReasonOther=Autre
|
ConfirmClassifyAbandonReasonOther=Autre
|
||||||
ConfirmClassifyAbandonReasonOtherDesc=Ce choix sera celui dans tout autre cas. Par exemple suite à intention de créer une facture de remplacement.
|
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 ?
|
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
|
ValidateBill=Valider facture
|
||||||
NumberOfBills=Nb de factures
|
NumberOfBills=Nb de factures
|
||||||
NumberOfBillsByMonth=Nb de factures par mois
|
NumberOfBillsByMonth=Nb de factures par mois
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user