Miscellaneous fixes
This commit is contained in:
parent
645eee57db
commit
35d80aa209
@ -53,6 +53,7 @@ $langs->load("other");
|
|||||||
// Get parameters
|
// Get parameters
|
||||||
$id = GETPOST('id','int');
|
$id = GETPOST('id','int');
|
||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
|
$cancel = GETPOST('cancel');
|
||||||
$backtopage = GETPOST('backtopage');
|
$backtopage = GETPOST('backtopage');
|
||||||
$myparam = GETPOST('myparam','alpha');
|
$myparam = GETPOST('myparam','alpha');
|
||||||
|
|
||||||
@ -95,6 +96,18 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
|||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
|
if ($cancel)
|
||||||
|
{
|
||||||
|
if ($action != 'addlink')
|
||||||
|
{
|
||||||
|
$urltogo=$backtopage?$backtopage:dol_buildpath('/mymodule/list.php',1);
|
||||||
|
header("Location: ".$urltogo);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
if ($id > 0 || ! empty($ref)) $ret = $object->fetch($id,$ref);
|
||||||
|
$action='';
|
||||||
|
}
|
||||||
|
|
||||||
// Action to add record
|
// Action to add record
|
||||||
if ($action == 'add')
|
if ($action == 'add')
|
||||||
{
|
{
|
||||||
@ -140,11 +153,8 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cancel
|
|
||||||
if ($action == 'update' && GETPOST('cancel')) $action='view';
|
|
||||||
|
|
||||||
// Action to update record
|
// Action to update record
|
||||||
if ($action == 'update' && ! GETPOST('cancel'))
|
if ($action == 'update')
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
|
|||||||
@ -99,7 +99,6 @@ $permissiondellink = $user->rights->commande->creer; // Used by the include of
|
|||||||
$permissionedit = $user->rights->commande->creer; // Used by the include of actions_lineupdown.inc.php
|
$permissionedit = $user->rights->commande->creer; // Used by the include of actions_lineupdown.inc.php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
@ -110,8 +109,18 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
|||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
if ($cancel) $action='';
|
if ($cancel)
|
||||||
|
{
|
||||||
|
if ($action != 'addlink')
|
||||||
|
{
|
||||||
|
$urltogo=$backtopage?$backtopage:dol_buildpath('/commande/list.php',1);
|
||||||
|
header("Location: ".$urltogo);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
if ($id > 0 || ! empty($ref)) $ret = $object->fetch($id,$ref);
|
||||||
|
$action='';
|
||||||
|
}
|
||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
|
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
|
||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
|
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
|
||||||
@ -1725,7 +1734,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input type="submit" class="button" name="bouton" value="' . $langs->trans('CreateDraft') . '">';
|
print '<input type="submit" class="button" name="bouton" value="' . $langs->trans('CreateDraft') . '">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="button" class="button" value="' . $langs->trans("Cancel") . '" onClick="javascript:history.go(-1)">';
|
print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
@ -134,7 +134,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
|||||||
$sql.= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,";
|
$sql.= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,";
|
||||||
$sql.= " pc.rowid as pid, pc.datep, pc.amount as totalpaye, pc.num_paiement as num_payment, pc.fk_bank,";
|
$sql.= " pc.rowid as pid, pc.datep, pc.amount as totalpaye, pc.num_paiement as num_payment, pc.fk_bank,";
|
||||||
$sql.= " pct.code as payment_code,";
|
$sql.= " pct.code as payment_code,";
|
||||||
$sql.= " ba.rowid as bid, ba.label as blabel";
|
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX."chargesociales as cs";
|
$sql.= " ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
|
||||||
@ -205,6 +205,10 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
|||||||
{
|
{
|
||||||
//$accountstatic->fetch($obj->fk_bank);
|
//$accountstatic->fetch($obj->fk_bank);
|
||||||
$accountstatic->id=$obj->bid;
|
$accountstatic->id=$obj->bid;
|
||||||
|
$accountstatic->ref=$obj->bref;
|
||||||
|
$accountstatic->number=$obj->bnumber;
|
||||||
|
$accountstatic->accountancy_number=$obj->account_number;
|
||||||
|
$accountstatic->accountancy_journal=$obj->accountancy_journal;
|
||||||
$accountstatic->label=$obj->blabel;
|
$accountstatic->label=$obj->blabel;
|
||||||
print $accountstatic->getNomUrl(1);
|
print $accountstatic->getNomUrl(1);
|
||||||
}
|
}
|
||||||
@ -249,8 +253,13 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans("VATPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');
|
print load_fiche_titre($langs->trans("VATPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');
|
||||||
|
|
||||||
$sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm";
|
$sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm, pv.fk_bank,";
|
||||||
|
$sql.= " pct.code as payment_code,";
|
||||||
|
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."tva as pv";
|
$sql.= " FROM ".MAIN_DB_PREFIX."tva as pv";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pv.fk_bank = b.rowid";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pv.fk_typepayment = pct.id";
|
||||||
$sql.= " WHERE pv.entity = ".$conf->entity;
|
$sql.= " WHERE pv.entity = ".$conf->entity;
|
||||||
if ($year > 0)
|
if ($year > 0)
|
||||||
{
|
{
|
||||||
@ -273,6 +282,8 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
|||||||
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pv.rowid","",$param,'',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pv.rowid","",$param,'',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"pct.code","",$param,'',$sortfield,$sortorder);
|
||||||
|
if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$var=1;
|
$var=1;
|
||||||
@ -295,15 +306,45 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
|||||||
$tva_static->ref=$obj->rowid;
|
$tva_static->ref=$obj->rowid;
|
||||||
print '<td align="left">'.$tva_static->getNomUrl(1)."</td>\n";
|
print '<td align="left">'.$tva_static->getNomUrl(1)."</td>\n";
|
||||||
|
|
||||||
|
// Date
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($obj->dm),'day')."</td>\n";
|
print '<td align="center">'.dol_print_date($db->jdate($obj->dm),'day')."</td>\n";
|
||||||
print '<td align="right">'.price($obj->amount)."</td>";
|
|
||||||
|
// Type payment
|
||||||
|
print '<td>';
|
||||||
|
if ($obj->payment_code) print $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
|
||||||
|
print $obj->num_payment.'</td>';
|
||||||
|
|
||||||
|
// Account
|
||||||
|
if (! empty($conf->banque->enabled))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
if ($obj->fk_bank > 0)
|
||||||
|
{
|
||||||
|
//$accountstatic->fetch($obj->fk_bank);
|
||||||
|
$accountstatic->id=$obj->bid;
|
||||||
|
$accountstatic->ref=$obj->bref;
|
||||||
|
$accountstatic->number=$obj->bnumber;
|
||||||
|
$accountstatic->accountancy_number=$obj->account_number;
|
||||||
|
$accountstatic->accountancy_journal=$obj->accountancy_journal;
|
||||||
|
$accountstatic->label=$obj->blabel;
|
||||||
|
print $accountstatic->getNomUrl(1);
|
||||||
|
}
|
||||||
|
else print ' ';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Paid
|
||||||
|
print '<td align="right">'.price($obj->amount)."</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").'</td>';
|
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").'</td>';
|
||||||
print '<td align="right">'.price($total).'</td>';
|
print '<td align="right">'.price($total).'</td>';
|
||||||
print '<td colspan="2"> </td>';
|
print '<td> </td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td> </td>';
|
||||||
print '<td align="right">'.price($total)."</td>";
|
print '<td align="right">'.price($total)."</td>";
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
@ -426,8 +467,14 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
|
|||||||
|
|
||||||
print_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');
|
print_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');
|
||||||
|
|
||||||
$sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, u.salary as current_salary";
|
$sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, s.fk_bank, u.salary as current_salary,";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s, ".MAIN_DB_PREFIX."user as u";
|
$sql.= " pct.code as payment_code,";
|
||||||
|
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON s.fk_typepayment = pct.id";
|
||||||
|
$sql.= " , ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql.= " WHERE s.entity IN (".getEntity('user',1).")";
|
$sql.= " WHERE s.entity IN (".getEntity('user',1).")";
|
||||||
$sql.= " AND u.rowid = s.fk_user";
|
$sql.= " AND u.rowid = s.fk_user";
|
||||||
if ($year > 0)
|
if ($year > 0)
|
||||||
@ -449,6 +496,8 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
|
|||||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"pct.code","",$param,'',$sortfield,$sortorder);
|
||||||
|
if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$var=1;
|
$var=1;
|
||||||
@ -470,13 +519,40 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
|
|||||||
$sal_static->ref=$obj->rowid;
|
$sal_static->ref=$obj->rowid;
|
||||||
print '<td align="left">'.$sal_static->getNomUrl(1)."</td>\n";
|
print '<td align="left">'.$sal_static->getNomUrl(1)."</td>\n";
|
||||||
|
|
||||||
|
// Date
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($obj->datep),'day')."</td>\n";
|
print '<td align="center">'.dol_print_date($db->jdate($obj->datep),'day')."</td>\n";
|
||||||
|
|
||||||
|
// Type payment
|
||||||
|
print '<td>';
|
||||||
|
if ($obj->payment_code) print $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
|
||||||
|
print $obj->num_payment.'</td>';
|
||||||
|
|
||||||
|
// Account
|
||||||
|
if (! empty($conf->banque->enabled))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
if ($obj->fk_bank > 0)
|
||||||
|
{
|
||||||
|
//$accountstatic->fetch($obj->fk_bank);
|
||||||
|
$accountstatic->id=$obj->bid;
|
||||||
|
$accountstatic->ref=$obj->bref;
|
||||||
|
$accountstatic->number=$obj->bnumber;
|
||||||
|
$accountstatic->accountancy_number=$obj->account_number;
|
||||||
|
$accountstatic->accountancy_journal=$obj->accountancy_journal;
|
||||||
|
$accountstatic->label=$obj->blabel;
|
||||||
|
print $accountstatic->getNomUrl(1);
|
||||||
|
}
|
||||||
|
else print ' ';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Paid
|
||||||
print '<td align="right">'.price($obj->amount)."</td>";
|
print '<td align="right">'.price($obj->amount)."</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print '<tr class="liste_total"><td colspan="4">'.$langs->trans("Total").'</td>';
|
print '<tr class="liste_total"><td colspan="6">'.$langs->trans("Total").'</td>';
|
||||||
print '<td align="right">'.price($total)."</td>";
|
print '<td align="right">'.price($total)."</td>";
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
|
|||||||
@ -47,8 +47,17 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
|||||||
<td align="center"><?php echo dol_print_date($objectlink->date,'day'); ?></td>
|
<td align="center"><?php echo dol_print_date($objectlink->date,'day'); ?></td>
|
||||||
<td align="right"><?php
|
<td align="right"><?php
|
||||||
if ($user->rights->facture->lire) {
|
if ($user->rights->facture->lire) {
|
||||||
$total = $total + $objectlink->total_ht;
|
$sign = 1;
|
||||||
echo price($objectlink->total_ht);
|
if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = -1;
|
||||||
|
if ($objectlink->statut != 3) // If not abandonned
|
||||||
|
{
|
||||||
|
$total = $total + $sign * $objectlink->total_ht;
|
||||||
|
echo price($objectlink->total_ht);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
echo '<strike>'.price($objectlink->total_ht).'</strike>';
|
||||||
|
}
|
||||||
} ?></td>
|
} ?></td>
|
||||||
<td align="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
<td align="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||||
<td align="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_delete($langs->transnoentitiesnoconv("RemoveLink")); ?></a></td>
|
<td align="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_delete($langs->transnoentitiesnoconv("RemoveLink")); ?></a></td>
|
||||||
|
|||||||
@ -93,7 +93,7 @@ $accountstatic = new Account($db);
|
|||||||
|
|
||||||
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary as current_salary, u.fk_soc as fk_soc,";
|
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary as current_salary, u.fk_soc as fk_soc,";
|
||||||
$sql.= " s.rowid, s.fk_user, s.amount, s.salary, s.label, s.datep as datep, s.datev as datev, s.fk_typepayment as type, s.num_payment, s.fk_bank,";
|
$sql.= " s.rowid, s.fk_user, s.amount, s.salary, s.label, s.datep as datep, s.datev as datev, s.fk_typepayment as type, s.num_payment, s.fk_bank,";
|
||||||
$sql.= " ba.rowid as bid, ba.label as blabel,";
|
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel,";
|
||||||
$sql.= " pst.code as payment_code";
|
$sql.= " pst.code as payment_code";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON s.fk_typepayment = pst.id";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON s.fk_typepayment = pst.id";
|
||||||
@ -230,8 +230,12 @@ if ($result)
|
|||||||
{
|
{
|
||||||
//$accountstatic->fetch($obj->fk_bank);
|
//$accountstatic->fetch($obj->fk_bank);
|
||||||
$accountstatic->id=$obj->bid;
|
$accountstatic->id=$obj->bid;
|
||||||
|
$accountstatic->ref=$obj->bref;
|
||||||
|
$accountstatic->number=$obj->bnumber;
|
||||||
|
$accountstatic->accountancy_number=$obj->account_number;
|
||||||
|
$accountstatic->accountancy_journal=$obj->accountancy_journal;
|
||||||
$accountstatic->label=$obj->blabel;
|
$accountstatic->label=$obj->blabel;
|
||||||
print $accountstatic->getNomUrl(1);
|
print $accountstatic->getNomUrl(1);
|
||||||
}
|
}
|
||||||
else print ' ';
|
else print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -89,7 +89,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader();
|
llxHeader('', $langs->trans("VATPayments"));
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formother=new FormOther($db);
|
$formother=new FormOther($db);
|
||||||
@ -97,7 +97,7 @@ $tva_static = new Tva($db);
|
|||||||
$accountstatic = new Account($db);
|
$accountstatic = new Account($db);
|
||||||
|
|
||||||
$sql = "SELECT t.rowid, t.amount, t.label, t.datev as dv, t.datep as dp, t.fk_typepayment as type, t.num_payment, t.fk_bank, pst.code as payment_code,";
|
$sql = "SELECT t.rowid, t.amount, t.label, t.datev as dv, t.datep as dp, t.fk_typepayment as type, t.num_payment, t.fk_bank, pst.code as payment_code,";
|
||||||
$sql.= " ba.rowid as bid, ba.label as blabel";
|
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."tva as t";
|
$sql.= " FROM ".MAIN_DB_PREFIX."tva as t";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON t.fk_typepayment = pst.id";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON t.fk_typepayment = pst.id";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON t.fk_bank = b.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON t.fk_bank = b.rowid";
|
||||||
@ -228,6 +228,10 @@ if ($result)
|
|||||||
{
|
{
|
||||||
//$accountstatic->fetch($obj->fk_bank);
|
//$accountstatic->fetch($obj->fk_bank);
|
||||||
$accountstatic->id=$obj->bid;
|
$accountstatic->id=$obj->bid;
|
||||||
|
$accountstatic->ref=$obj->bref;
|
||||||
|
$accountstatic->number=$obj->bnumber;
|
||||||
|
$accountstatic->accountancy_number=$obj->account_number;
|
||||||
|
$accountstatic->accountancy_journal=$obj->accountancy_journal;
|
||||||
$accountstatic->label=$obj->blabel;
|
$accountstatic->label=$obj->blabel;
|
||||||
print $accountstatic->getNomUrl(1);
|
print $accountstatic->getNomUrl(1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,8 +47,17 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
|||||||
<td align="center"><?php echo dol_print_date($objectlink->date,'day'); ?></td>
|
<td align="center"><?php echo dol_print_date($objectlink->date,'day'); ?></td>
|
||||||
<td align="right"><?php
|
<td align="right"><?php
|
||||||
if ($user->rights->fournisseur->facture->lire) {
|
if ($user->rights->fournisseur->facture->lire) {
|
||||||
$total = $total + $objectlink->total_ht;
|
$sign = 1;
|
||||||
echo price($objectlink->total_ht);
|
if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = -1;
|
||||||
|
if ($objectlink->statut != 3) // If not abandonned
|
||||||
|
{
|
||||||
|
$total = $total + $sign * $objectlink->total_ht;
|
||||||
|
echo price($objectlink->total_ht);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
echo '<strike>'.price($objectlink->total_ht).'</strike>';
|
||||||
|
}
|
||||||
} ?></td>
|
} ?></td>
|
||||||
<td align="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
<td align="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||||
<td align="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_delete($langs->transnoentitiesnoconv("RemoveLink")); ?></a></td>
|
<td align="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_delete($langs->transnoentitiesnoconv("RemoveLink")); ?></a></td>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user