New: Add bank account on payment list of invoice card.
This commit is contained in:
parent
aa9648288c
commit
dc09960143
@ -11,6 +11,8 @@ For users:
|
|||||||
- New: Monaco is like France for default vat calculation
|
- New: Monaco is like France for default vat calculation
|
||||||
- New: Can list elements (invoices, orders or proposals on a particular
|
- New: Can list elements (invoices, orders or proposals on a particular
|
||||||
user contact). This allow to view a "basket" of its elements.
|
user contact). This allow to view a "basket" of its elements.
|
||||||
|
- New: Add bank account on payment list of invoice card.
|
||||||
|
- New: Cloning project allow to clones task, notes, files, contacts.
|
||||||
- New: Enhance default style.
|
- New: Enhance default style.
|
||||||
|
|
||||||
For developers:
|
For developers:
|
||||||
|
|||||||
@ -1584,6 +1584,7 @@ llxHeader('',$langs->trans('Bill'),'EN:Customers_Invoices|FR:Factures_Clients|ES
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$htmlother = new FormOther($db);
|
$htmlother = new FormOther($db);
|
||||||
$formfile = new FormFile($db);
|
$formfile = new FormFile($db);
|
||||||
|
$bankaccountstatic=new Account($db);
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
|
|
||||||
@ -2520,8 +2521,9 @@ else
|
|||||||
* List of payments
|
* List of payments
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$nbrows=8;
|
$nbrows=8; $nbcols=2;
|
||||||
if ($conf->projet->enabled) $nbrows++;
|
if ($conf->projet->enabled) $nbrows++;
|
||||||
|
if ($conf->banque->enabled) $nbcols++;
|
||||||
|
|
||||||
//Local taxes
|
//Local taxes
|
||||||
if ($mysoc->pays_code=='ES')
|
if ($mysoc->pays_code=='ES')
|
||||||
@ -2538,6 +2540,7 @@ else
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.($object->type == 2 ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).'</td>';
|
print '<td>'.($object->type == 2 ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).'</td>';
|
||||||
print '<td>'.$langs->trans('Type').'</td>';
|
print '<td>'.$langs->trans('Type').'</td>';
|
||||||
|
if ($conf->banque->enabled) print '<td align="right">'.$langs->trans('BankAccount').'</td>';
|
||||||
print '<td align="right">'.$langs->trans('Amount').'</td>';
|
print '<td align="right">'.$langs->trans('Amount').'</td>';
|
||||||
print '<td width="18"> </td>';
|
print '<td width="18"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -2545,12 +2548,15 @@ else
|
|||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
// Payments already done (from payment on this invoice)
|
// Payments already done (from payment on this invoice)
|
||||||
$sql = 'SELECT p.datep as dp, p.num_paiement, p.rowid,';
|
$sql = 'SELECT p.datep as dp, p.num_paiement, p.rowid, p.fk_bank,';
|
||||||
$sql.= ' c.code as payment_code, c.libelle as payment_label,';
|
$sql.= ' c.code as payment_code, c.libelle as payment_label,';
|
||||||
$sql.= ' pf.amount';
|
$sql.= ' pf.amount,';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p, '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiement_facture as pf';
|
$sql.= ' ba.rowid as baid, ba.ref, ba.label';
|
||||||
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiement_facture as pf, '.MAIN_DB_PREFIX.'paiement as p';
|
||||||
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid';
|
||||||
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid';
|
||||||
$sql.= ' WHERE pf.fk_facture = '.$object->id.' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid';
|
$sql.= ' WHERE pf.fk_facture = '.$object->id.' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid';
|
||||||
$sql.= ' ORDER BY dp, tms';
|
$sql.= ' ORDER BY p.datep, p.tms';
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@ -2559,6 +2565,8 @@ else
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
if ($object->type != 2)
|
if ($object->type != 2)
|
||||||
|
{
|
||||||
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
@ -2569,12 +2577,26 @@ else
|
|||||||
print dol_print_date($db->jdate($objp->dp),'day').'</a></td>';
|
print dol_print_date($db->jdate($objp->dp),'day').'</a></td>';
|
||||||
$label=($langs->trans("PaymentType".$objp->payment_code)!=("PaymentType".$objp->payment_code))?$langs->trans("PaymentType".$objp->payment_code):$objp->payment_label;
|
$label=($langs->trans("PaymentType".$objp->payment_code)!=("PaymentType".$objp->payment_code))?$langs->trans("PaymentType".$objp->payment_code):$objp->payment_label;
|
||||||
print '<td>'.$label.' '.$objp->num_paiement.'</td>';
|
print '<td>'.$label.' '.$objp->num_paiement.'</td>';
|
||||||
|
if ($conf->banque->enabled)
|
||||||
|
{
|
||||||
|
$bankaccountstatic->id=$objp->baid;
|
||||||
|
$bankaccountstatic->ref=$objp->ref;
|
||||||
|
$bankaccountstatic->label=$objp->ref;
|
||||||
|
print '<td align="right">';
|
||||||
|
print $bankaccountstatic->getNomUrl(1,'transactions');
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
print '<td align="right">'.price($objp->amount).'</td>';
|
print '<td align="right">'.price($objp->amount).'</td>';
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<tr '.$bc[$var].'><td colspan="'.$nbcols.'">'.$langs->trans("None").'</td><td></td><td></td></tr>';
|
||||||
|
}
|
||||||
|
}
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2585,7 +2607,7 @@ else
|
|||||||
if ($object->type != 2)
|
if ($object->type != 2)
|
||||||
{
|
{
|
||||||
// Total already paid
|
// Total already paid
|
||||||
print '<tr><td colspan="2" align="right">';
|
print '<tr><td colspan="'.$nbcols.'" align="right">';
|
||||||
if ($object->type != 3) print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits');
|
if ($object->type != 3) print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits');
|
||||||
else print $langs->trans('AlreadyPaid');
|
else print $langs->trans('AlreadyPaid');
|
||||||
print ' :</td><td align="right">'.price($totalpaye).'</td><td> </td></tr>';
|
print ' :</td><td align="right">'.price($totalpaye).'</td><td> </td></tr>';
|
||||||
@ -2609,7 +2631,7 @@ else
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
$invoice->fetch($obj->fk_facture_source);
|
$invoice->fetch($obj->fk_facture_source);
|
||||||
print '<tr><td colspan="2" align="right">';
|
print '<tr><td colspan="'.$nbcols.'" align="right">';
|
||||||
if ($invoice->type == 2) print $langs->trans("CreditNote").' ';
|
if ($invoice->type == 2) print $langs->trans("CreditNote").' ';
|
||||||
if ($invoice->type == 3) print $langs->trans("Deposit").' ';
|
if ($invoice->type == 3) print $langs->trans("Deposit").' ';
|
||||||
print $invoice->getNomUrl(0);
|
print $invoice->getNomUrl(0);
|
||||||
@ -2631,7 +2653,7 @@ else
|
|||||||
// Paye partiellement 'escompte'
|
// Paye partiellement 'escompte'
|
||||||
if (($object->statut == 2 || $object->statut == 3) && $object->close_code == 'discount_vat')
|
if (($object->statut == 2 || $object->statut == 3) && $object->close_code == 'discount_vat')
|
||||||
{
|
{
|
||||||
print '<tr><td colspan="2" align="right" nowrap="1">';
|
print '<tr><td colspan="'.$nbcols.'" align="right" nowrap="1">';
|
||||||
print $form->textwithpicto($langs->trans("Escompte").':',$langs->trans("HelpEscompte"),-1);
|
print $form->textwithpicto($langs->trans("Escompte").':',$langs->trans("HelpEscompte"),-1);
|
||||||
print '</td><td align="right">'.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).'</td><td> </td></tr>';
|
print '</td><td align="right">'.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).'</td><td> </td></tr>';
|
||||||
$resteapayeraffiche=0;
|
$resteapayeraffiche=0;
|
||||||
@ -2639,7 +2661,7 @@ else
|
|||||||
// Paye partiellement ou Abandon 'badcustomer'
|
// Paye partiellement ou Abandon 'badcustomer'
|
||||||
if (($object->statut == 2 || $object->statut == 3) && $object->close_code == 'badcustomer')
|
if (($object->statut == 2 || $object->statut == 3) && $object->close_code == 'badcustomer')
|
||||||
{
|
{
|
||||||
print '<tr><td colspan="2" align="right" nowrap="1">';
|
print '<tr><td colspan="'.$nbcols.'" align="right" nowrap="1">';
|
||||||
print $form->textwithpicto($langs->trans("Abandoned").':',$langs->trans("HelpAbandonBadCustomer"),-1);
|
print $form->textwithpicto($langs->trans("Abandoned").':',$langs->trans("HelpAbandonBadCustomer"),-1);
|
||||||
print '</td><td align="right">'.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).'</td><td> </td></tr>';
|
print '</td><td align="right">'.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).'</td><td> </td></tr>';
|
||||||
//$resteapayeraffiche=0;
|
//$resteapayeraffiche=0;
|
||||||
@ -2647,7 +2669,7 @@ else
|
|||||||
// Paye partiellement ou Abandon 'product_returned'
|
// Paye partiellement ou Abandon 'product_returned'
|
||||||
if (($object->statut == 2 || $object->statut == 3) && $object->close_code == 'product_returned')
|
if (($object->statut == 2 || $object->statut == 3) && $object->close_code == 'product_returned')
|
||||||
{
|
{
|
||||||
print '<tr><td colspan="2" align="right" nowrap="1">';
|
print '<tr><td colspan="'.$nbcols.'" align="right" nowrap="1">';
|
||||||
print $form->textwithpicto($langs->trans("ProductReturned").':',$langs->trans("HelpAbandonProductReturned"),-1);
|
print $form->textwithpicto($langs->trans("ProductReturned").':',$langs->trans("HelpAbandonProductReturned"),-1);
|
||||||
print '</td><td align="right">'.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).'</td><td> </td></tr>';
|
print '</td><td align="right">'.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).'</td><td> </td></tr>';
|
||||||
$resteapayeraffiche=0;
|
$resteapayeraffiche=0;
|
||||||
@ -2655,7 +2677,7 @@ else
|
|||||||
// Paye partiellement ou Abandon 'abandon'
|
// Paye partiellement ou Abandon 'abandon'
|
||||||
if (($object->statut == 2 || $object->statut == 3) && $object->close_code == 'abandon')
|
if (($object->statut == 2 || $object->statut == 3) && $object->close_code == 'abandon')
|
||||||
{
|
{
|
||||||
print '<tr><td colspan="2" align="right" nowrap="1">';
|
print '<tr><td colspan="'.$nbcols.'" align="right" nowrap="1">';
|
||||||
$text=$langs->trans("HelpAbandonOther");
|
$text=$langs->trans("HelpAbandonOther");
|
||||||
if ($object->close_note) $text.='<br><br><b>'.$langs->trans("Reason").'</b>:'.$object->close_note;
|
if ($object->close_note) $text.='<br><br><b>'.$langs->trans("Reason").'</b>:'.$object->close_note;
|
||||||
print $form->textwithpicto($langs->trans("Abandoned").':',$text,-1);
|
print $form->textwithpicto($langs->trans("Abandoned").':',$text,-1);
|
||||||
@ -2664,10 +2686,10 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Billed
|
// Billed
|
||||||
print '<tr><td colspan="2" align="right">'.$langs->trans("Billed").' :</td><td align="right" style="border: 1px solid;">'.price($object->total_ttc).'</td><td> </td></tr>';
|
print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans("Billed").' :</td><td align="right" style="border: 1px solid;">'.price($object->total_ttc).'</td><td> </td></tr>';
|
||||||
|
|
||||||
// Remainder to pay
|
// Remainder to pay
|
||||||
print '<tr><td colspan="2" align="right">';
|
print '<tr><td colspan="'.$nbcols.'" align="right">';
|
||||||
if ($resteapayeraffiche >= 0) print $langs->trans('RemainderToPay');
|
if ($resteapayeraffiche >= 0) print $langs->trans('RemainderToPay');
|
||||||
else print $langs->trans('ExcessReceived');
|
else print $langs->trans('ExcessReceived');
|
||||||
print ' :</td>';
|
print ' :</td>';
|
||||||
@ -2677,7 +2699,7 @@ else
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Sold credit note
|
// Sold credit note
|
||||||
print '<tr><td colspan="2" align="right">'.$langs->trans('TotalTTC').' :</td>';
|
print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('TotalTTC').' :</td>';
|
||||||
print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price(abs($object->total_ttc)).'</b></td><td> </td></tr>';
|
print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price(abs($object->total_ttc)).'</b></td><td> </td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -257,7 +257,7 @@ class PaiementFourn extends Paiement
|
|||||||
{
|
{
|
||||||
if (count($billsarray))
|
if (count($billsarray))
|
||||||
{
|
{
|
||||||
$this->error='Impossible de supprimer un paiement portant sur au moins une facture a l\'etat paye';
|
$this->error='Can\'t delete a payment shared by at least one invoice with status payed';
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -285,11 +285,13 @@ class PaiementFourn extends Paiement
|
|||||||
// Efface la ligne de paiement (dans paiement_facture et paiement)
|
// Efface la ligne de paiement (dans paiement_facture et paiement)
|
||||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'paiementfourn_facturefourn';
|
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'paiementfourn_facturefourn';
|
||||||
$sql.= ' WHERE fk_paiementfourn = '.$this->id;
|
$sql.= ' WHERE fk_paiementfourn = '.$this->id;
|
||||||
|
dol_syslog("sql=".$sql);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'paiementfourn';
|
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'paiementfourn';
|
||||||
$sql.= ' WHERE rowid = '.$this->id;
|
$sql.= ' WHERE rowid = '.$this->id;
|
||||||
|
dol_syslog("sql=".$sql);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if (! $result)
|
if (! $result)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -198,14 +198,15 @@ elseif ($action == 'setnote' && $user->rights->fournisseur->facture->creer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete payment
|
// Delete payment
|
||||||
elseif($action == 'deletepaiement')
|
elseif ($action == 'deletepaiement')
|
||||||
{
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
if ($object->statut == 1 && $object->paye == 0 && $user->societe_id == 0)
|
if ($object->statut == 1 && $object->paye == 0 && $user->societe_id == 0)
|
||||||
{
|
{
|
||||||
$paiementfourn = new PaiementFourn($db);
|
$paiementfourn = new PaiementFourn($db);
|
||||||
$paiementfourn->fetch($_GET['paiement_id']);
|
$paiementfourn->fetch(GETPOST('paiement_id'));
|
||||||
$paiementfourn->delete();
|
$result=$paiementfourn->delete();
|
||||||
|
if ($result < 0) $mesg='<div class="error">'.$paiementfourn->error.'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -899,6 +900,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
|
|||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formfile = new FormFile($db);
|
$formfile = new FormFile($db);
|
||||||
|
$bankaccountstatic=new Account($db);
|
||||||
|
|
||||||
llxHeader('','','');
|
llxHeader('','','');
|
||||||
|
|
||||||
@ -1258,9 +1260,7 @@ else
|
|||||||
if ($ret == 'html') print '<br>';
|
if ($ret == 'html') print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Confirmation de la suppression de la facture fournisseur
|
||||||
* Confirmation de la suppression de la facture fournisseur
|
|
||||||
*/
|
|
||||||
if ($action == 'delete')
|
if ($action == 'delete')
|
||||||
{
|
{
|
||||||
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1);
|
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1);
|
||||||
@ -1268,8 +1268,8 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Facture
|
* Invoice
|
||||||
*/
|
*/
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
@ -1335,8 +1335,9 @@ else
|
|||||||
/*
|
/*
|
||||||
* List of payments
|
* List of payments
|
||||||
*/
|
*/
|
||||||
$nbrows=7;
|
$nbrows=7; $nbcols=2;
|
||||||
if ($conf->projet->enabled) $nbrows++;
|
if ($conf->projet->enabled) $nbrows++;
|
||||||
|
if ($conf->banque->enabled) $nbcols++;
|
||||||
|
|
||||||
// Local taxes
|
// Local taxes
|
||||||
if ($mysoc->country_code=='ES')
|
if ($mysoc->country_code=='ES')
|
||||||
@ -1347,14 +1348,17 @@ else
|
|||||||
|
|
||||||
print '<td rowspan="'.$nbrows.'" valign="top">';
|
print '<td rowspan="'.$nbrows.'" valign="top">';
|
||||||
|
|
||||||
// TODO move to DAO class
|
$sql = 'SELECT p.datep as dp, p.num_paiement, p.rowid, p.fk_bank,';
|
||||||
$sql = 'SELECT datep as dp, pf.amount,';
|
$sql.= ' c.libelle as paiement_type,';
|
||||||
$sql .= ' c.libelle as paiement_type, p.num_paiement, p.rowid';
|
$sql.= ' pf.amount,';
|
||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p';
|
$sql.= ' ba.rowid as baid, ba.ref, ba.label';
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p';
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_paiementfourn = p.rowid';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid';
|
||||||
$sql .= ' WHERE pf.fk_facturefourn = '.$object->id;
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid';
|
||||||
$sql .= ' ORDER BY dp DESC';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id';
|
||||||
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_paiementfourn = p.rowid';
|
||||||
|
$sql.= ' WHERE pf.fk_facturefourn = '.$object->id;
|
||||||
|
$sql.= ' ORDER BY p.datep, p.tms';
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@ -1365,23 +1369,35 @@ else
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans('Payments').'</td>';
|
print '<td>'.$langs->trans('Payments').'</td>';
|
||||||
print '<td>'.$langs->trans('Type').'</td>';
|
print '<td>'.$langs->trans('Type').'</td>';
|
||||||
|
if ($conf->banque->enabled) print '<td align="right">'.$langs->trans('BankAccount').'</td>';
|
||||||
print '<td align="right">'.$langs->trans('Amount').'</td>';
|
print '<td align="right">'.$langs->trans('Amount').'</td>';
|
||||||
print '<td width="18"> </td>';
|
print '<td width="18"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$var=True;
|
$var=true;
|
||||||
|
if ($num > 0)
|
||||||
|
{
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td nowrap><a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans('ShowPayment'),'payment').' '.dol_print_date($db->jdate($objp->dp),'day')."</a></td>\n";
|
print '<td nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans('ShowPayment'),'payment').' '.dol_print_date($db->jdate($objp->dp),'day')."</a></td>\n";
|
||||||
print '<td>'.$objp->paiement_type.' '.$objp->num_paiement.'</td>';
|
print '<td>'.$objp->paiement_type.' '.$objp->num_paiement.'</td>';
|
||||||
|
if ($conf->banque->enabled)
|
||||||
|
{
|
||||||
|
$bankaccountstatic->id=$objp->baid;
|
||||||
|
$bankaccountstatic->ref=$objp->ref;
|
||||||
|
$bankaccountstatic->label=$objp->ref;
|
||||||
|
print '<td align="right">';
|
||||||
|
print $bankaccountstatic->getNomUrl(1,'transactions');
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
print '<td align="right">'.price($objp->amount).'</td>';
|
print '<td align="right">'.price($objp->amount).'</td>';
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if ($object->statut == 1 && $object->paye == 0 && $user->societe_id == 0)
|
if ($object->statut == 1 && $object->paye == 0 && $user->societe_id == 0)
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deletepaiement&paiement_id='.$objp->rowid.'">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deletepaiement&paiement_id='.$objp->rowid.'">';
|
||||||
print img_delete();
|
print img_delete();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
@ -1390,16 +1406,21 @@ else
|
|||||||
$totalpaye += $objp->amount;
|
$totalpaye += $objp->amount;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<tr '.$bc[$var].'><td colspan="'.$nbcols.'">'.$langs->trans("None").'</td><td></td><td></td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
if ($object->paye == 0)
|
if ($object->paye == 0)
|
||||||
{
|
{
|
||||||
print '<tr><td colspan="2" align="right">'.$langs->trans('AlreadyPaid').' :</td><td align="right"><b>'.price($totalpaye).'</b></td></tr>';
|
print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('AlreadyPaid').' :</td><td align="right"><b>'.price($totalpaye).'</b></td><td></td></tr>';
|
||||||
print '<tr><td colspan="2" align="right">'.$langs->trans("Billed").' :</td><td align="right" style="border: 1px solid;">'.price($object->total_ttc).'</td></tr>';
|
print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans("Billed").' :</td><td align="right" style="border: 1px solid;">'.price($object->total_ttc).'</td><td></td></tr>';
|
||||||
|
|
||||||
$resteapayer = $object->total_ttc - $totalpaye;
|
$resteapayer = $object->total_ttc - $totalpaye;
|
||||||
|
|
||||||
print '<tr><td colspan="2" align="right">'.$langs->trans('RemainderToPay').' :</td>';
|
print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('RemainderToPay').' :</td>';
|
||||||
print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($resteapayer).'</b></td></tr>';
|
print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($resteapayer).'</b></td><td></td></tr>';
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
@ -1420,7 +1441,7 @@ else
|
|||||||
// Due date
|
// Due date
|
||||||
print '<tr><td>'.$form->editfieldkey("DateMaxPayment",'date_lim_reglement',$object->date_echeance,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() <= 0),'datepicker').'</td><td colspan="3">';
|
print '<tr><td>'.$form->editfieldkey("DateMaxPayment",'date_lim_reglement',$object->date_echeance,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() <= 0),'datepicker').'</td><td colspan="3">';
|
||||||
print $form->editfieldval("DateMaxPayment",'date_lim_reglement',$object->date_echeance,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() <= 0),'datepicker');
|
print $form->editfieldval("DateMaxPayment",'date_lim_reglement',$object->date_echeance,$object,($object->statut<2 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() <= 0),'datepicker');
|
||||||
if ((empty($action) || $action == 'view') && $object->statut < 2 && $object->date_echeance && $object->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_warning($langs->trans('Late'));
|
if ($action != 'editdate_li_reglement' && $object->statut < 2 && $object->date_echeance && $object->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_warning($langs->trans('Late'));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user