Work on v6 look and feel
This commit is contained in:
parent
915a74a85f
commit
216bce608d
@ -92,36 +92,46 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
// Initialize technical object to manage context to save list fields
|
// Initialize technical object to manage context to save list fields
|
||||||
$contextpage='banktransactionlist'.(empty($object->ref)?'':'-'.$object->id);
|
$contextpage='banktransactionlist'.(empty($object->ref)?'':'-'.$object->id);
|
||||||
/*
|
|
||||||
*ZIP creation
|
|
||||||
*/
|
|
||||||
if($action=="dl" && $num>0 && isset($_SESSION["releve"][$num])){
|
|
||||||
unset($zip);
|
|
||||||
$log='';
|
|
||||||
$filearray=$_SESSION["releve"][$num];
|
|
||||||
$zipname = $num.'.zip';
|
|
||||||
$zip = new ZipArchive;
|
|
||||||
$zip->open($zipname, ZipArchive::OVERWRITE);
|
|
||||||
foreach ($filearray as $key=> $files) {
|
|
||||||
if(is_array($files)){
|
|
||||||
foreach ($files as $file) {
|
|
||||||
$zip->addFile($file["fullname"],$file["name"]);//
|
|
||||||
$log.=$key.','.$file["name"]."\n";
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
$log.=$key.','.$langs->trans("Nofile")."\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$zip->addFromString('log.csv', $log);
|
|
||||||
$zip->close();
|
|
||||||
|
|
||||||
///Then download the zipped file.
|
|
||||||
header('Content-Type: application/zip');
|
// ZIP creation
|
||||||
header('Content-disposition: attachment; filename='.$zipname);
|
if ($action=="dl" && $numref > 0)
|
||||||
header('Content-Length: ' . filesize($zipname));
|
{
|
||||||
readfile($zipname);
|
// TODO Replace this with a standard builddoc action that use a document generation module to build the ZIP
|
||||||
|
$log = '';
|
||||||
|
|
||||||
|
getAttachedFiles($db, $numref); // Build array $_SESSION["releve"][$numref] with all files to includes
|
||||||
|
|
||||||
|
$filearray = $_SESSION["releve"][$numref];
|
||||||
|
$zipname = $numref . '.zip';
|
||||||
|
|
||||||
|
$zip = new ZipArchive();
|
||||||
|
$zip->open($zipname, ZipArchive::OVERWRITE);
|
||||||
|
foreach ($filearray as $key => $files) {
|
||||||
|
if (is_array($files)) {
|
||||||
|
foreach ($files as $file) {
|
||||||
|
$zip->addFile($file["fullname"], $file["name"]); //
|
||||||
|
$log .= $key . ',' . $file["name"] . "\n";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$log .= $key . ',' . $langs->trans("Nofile") . "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$zip->addFromString('log '.$numref.'.csv', $log);
|
||||||
|
$zip->close();
|
||||||
|
|
||||||
|
// /Then download the zipped file.
|
||||||
|
header('Content-Type: application/zip');
|
||||||
|
header('Content-disposition: attachment; filename=' . $zipname);
|
||||||
|
header('Content-Length: ' . filesize($zipname));
|
||||||
|
|
||||||
|
readfile($zipname);
|
||||||
|
|
||||||
|
unset($_SESSION["releve"][$numref]);
|
||||||
|
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
unset($_SESSION["releve"][$num]);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -151,9 +161,7 @@ if ($id > 0) $param.='&id='.urlencode($id);
|
|||||||
|
|
||||||
if (empty($numref))
|
if (empty($numref))
|
||||||
{
|
{
|
||||||
/*
|
// List of all standing receipts
|
||||||
* Vue liste tous releves confondus
|
|
||||||
*/
|
|
||||||
$sql = "SELECT DISTINCT(b.num_releve) as numr";
|
$sql = "SELECT DISTINCT(b.num_releve) as numr";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||||
$sql.= " WHERE b.fk_account = ".$object->id;
|
$sql.= " WHERE b.fk_account = ".$object->id;
|
||||||
@ -470,6 +478,14 @@ else
|
|||||||
$paymentvatstatic->ref=$langs->trans("Payment");
|
$paymentvatstatic->ref=$langs->trans("Payment");
|
||||||
print ' '.$paymentvatstatic->getNomUrl(1);
|
print ' '.$paymentvatstatic->getNomUrl(1);
|
||||||
}
|
}
|
||||||
|
elseif ($links[$key]['type']=='payment_salary')
|
||||||
|
{
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/compta/salaries/card.php?id='.$links[$key]['url_id'].'">';
|
||||||
|
print ' '.img_object($langs->trans('ShowPayment'),'payment').' ';
|
||||||
|
print $langs->trans("Payment");
|
||||||
|
print '</a>';
|
||||||
|
$newline=0;
|
||||||
|
}
|
||||||
elseif ($links[$key]['type']=='banktransfert') {
|
elseif ($links[$key]['type']=='banktransfert') {
|
||||||
// Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail.
|
// Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail.
|
||||||
if ($objp->amount > 0)
|
if ($objp->amount > 0)
|
||||||
@ -512,6 +528,13 @@ else
|
|||||||
print '</a>';
|
print '</a>';
|
||||||
$newline=0;
|
$newline=0;
|
||||||
}
|
}
|
||||||
|
elseif ($links[$key]['type']=='user') {
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/user/card.php?rowid='.$links[$key]['url_id'].'">';
|
||||||
|
print img_object($langs->trans('ShowUser'),'user').' ';
|
||||||
|
print $links[$key]['label'];
|
||||||
|
print '</a>';
|
||||||
|
$newline=0;
|
||||||
|
}
|
||||||
elseif ($links[$key]['type']=='sc') {
|
elseif ($links[$key]['type']=='sc') {
|
||||||
print '<a href="'.DOL_URL_ROOT.'/compta/sociales/card.php?id='.$links[$key]['url_id'].'">';
|
print '<a href="'.DOL_URL_ROOT.'/compta/sociales/card.php?id='.$links[$key]['url_id'].'">';
|
||||||
print img_object($langs->trans('ShowBill'),'bill').' ';
|
print img_object($langs->trans('ShowBill'),'bill').' ';
|
||||||
@ -555,7 +578,6 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print Get_attach_files($db,$objp->rowid,$num,$objp->label);
|
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
if ($objp->amount < 0)
|
if ($objp->amount < 0)
|
||||||
@ -598,9 +620,13 @@ else
|
|||||||
print "</div>";
|
print "</div>";
|
||||||
|
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
// download button
|
|
||||||
echo '<a href="releve.php?num='.$num.'&account='.$id.'&action=dl" class="butAction" name="Send" >'.$langs->trans('DownloadFile')." </a>\n";
|
|
||||||
|
|
||||||
|
// Add a download button
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // Started a rewrite to make this feature more Dolibarr compliant. Still need dev to be completed.
|
||||||
|
{
|
||||||
|
// TODO Replace this with standard box to generate document.
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/compta/bank/releve.php?num='.$numref.'&account='.$id.'&action=dl" class="butAction" name="Send" >'.$langs->trans('DownloadPackageWithAllDocuments')." </a>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -608,102 +634,102 @@ llxFooter();
|
|||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
/*Function to generate the HTML code used to show the file name & download link attached to the Item covered by the bank line
|
|
||||||
* @param $db Object database object
|
|
||||||
* @param $bankId int bank line id
|
|
||||||
* @param $num int bank statement
|
/**
|
||||||
* @param $label string label used to optimise the sql querry
|
* Function to generate the HTML code used to show the file name & download link attached to the Item covered by the bank line
|
||||||
*
|
*
|
||||||
|
* @param DoliDB $db database object
|
||||||
|
* @param int $bankId bank line id
|
||||||
|
* @param int $num bank statement
|
||||||
|
* @param string $label label used to optimise the sql querry
|
||||||
*/
|
*/
|
||||||
function Get_attach_files($db, $bankId,$num,$label=''){
|
function getAttachedFiles($db, $numref, $label='')
|
||||||
$out='';
|
{
|
||||||
global$conf;
|
$out = '';
|
||||||
$sql='SELECT u.url_id, u.type,ff.rowid as id , ff.`ref` AS reff, f.facnumber AS `ref`,';
|
global $conf;
|
||||||
$sql.=' e.`ref` AS refe, sp.rowid AS ids, d.rowid AS idd';
|
$sql = 'SELECT u.url_id, u.type,ff.rowid as id , ff.`ref` AS reff, f.facnumber AS `ref`,';
|
||||||
$sql.=' FROM '.MAIN_DB_PREFIX.'bank_url AS u';
|
$sql .= ' e.`ref` AS refe, sp.rowid AS ids, d.rowid AS idd';
|
||||||
if ( !empty($label) || $label=='(CustomerInvoicePayment)'){
|
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'bank_url AS u, ' . MAIN_DB_PREFIX . 'bank AS b';
|
||||||
$sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement AS p ON p.fk_bank = u.fk_bank';
|
if (! empty($label) || $label == '(CustomerInvoicePayment)') {
|
||||||
$sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture AS pf ON pf.fk_paiement = p.rowid';
|
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'paiement AS p ON p.fk_bank = u.fk_bank';
|
||||||
$sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'facture AS f ON f.rowid = pf.fk_facture';
|
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'paiement_facture AS pf ON pf.fk_paiement = p.rowid';
|
||||||
|
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'facture AS f ON f.rowid = pf.fk_facture';
|
||||||
}
|
}
|
||||||
if( !empty($label) || $label=='(SupplierInvoicePayment)'){
|
if (! empty($label) || $label == '(SupplierInvoicePayment)') {
|
||||||
//invoice suplier (SupplierInvoicePayment)
|
// invoice suplier (SupplierInvoicePayment)
|
||||||
$sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn AS fp ON fp.fk_bank = u.fk_bank';
|
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'paiementfourn AS fp ON fp.fk_bank = u.fk_bank';
|
||||||
$sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn AS fpf ON fpf.fk_paiementfourn = fp.rowid';
|
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'paiementfourn_facturefourn AS fpf ON fpf.fk_paiementfourn = fp.rowid';
|
||||||
$sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn AS ff ON ff.rowid = fpf.fk_facturefourn';
|
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'facture_fourn AS ff ON ff.rowid = fpf.fk_facturefourn';
|
||||||
}
|
}
|
||||||
if( !empty($label) || $label=='(ExpenseReportPayment)'){
|
if (! empty($label) || $label == '(ExpenseReportPayment)') {
|
||||||
//EXPENSEs (ExpenseReportPayment)
|
// EXPENSEs (ExpenseReportPayment)
|
||||||
$sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'payment_expensereport AS ep ON ep.fk_bank = u.fk_bank';
|
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'payment_expensereport AS ep ON ep.fk_bank = u.fk_bank';
|
||||||
$sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'expensereport AS e ON e.rowid = ep.fk_expensereport';
|
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'expensereport AS e ON e.rowid = ep.fk_expensereport';
|
||||||
}
|
}
|
||||||
if( !empty($label) || $label=='(DonationPayment)'){
|
if (! empty($label) || $label == '(DonationPayment)') {
|
||||||
//donation
|
// donation
|
||||||
$sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'payment_donation AS dp ON dp.fk_bank = u.fk_bank';
|
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'payment_donation AS dp ON dp.fk_bank = u.fk_bank';
|
||||||
$sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'don AS d ON d.rowid = dp.fk_donation';
|
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'don AS d ON d.rowid = dp.fk_donation';
|
||||||
}
|
}
|
||||||
if( !empty($label) || $label=='(SalaryPayment)'){
|
if (! empty($label) || $label == '(SalaryPayment)') {
|
||||||
//loan
|
// loan
|
||||||
// $sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'payment_loan AS lp ON lp.fk_bank = u.fk_bank';
|
// $sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'payment_loan AS lp ON lp.fk_bank = u.fk_bank';
|
||||||
//salary
|
// salary
|
||||||
$sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'payment_salary AS sp ON sp.fk_bank = u.fk_bank';
|
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'payment_salary AS sp ON sp.fk_bank = u.fk_bank';
|
||||||
}
|
}
|
||||||
//END SQL
|
// END SQL
|
||||||
$sql.=" WHERE u.fk_bank in('".$bankId."')AND u.type in ('payment','payment_supplier','payment_expensereport','payment_salary','payment_donation' )";
|
$sql .= " WHERE u.fk_bank = b.rowid AND u.type in ('payment','payment_supplier','payment_expensereport','payment_salary','payment_donation' )";
|
||||||
$resd = $db->query($sql);
|
$resd = $db->query($sql);
|
||||||
$files=array();
|
$files = array();
|
||||||
$link='';
|
$link = '';
|
||||||
if ($resd)
|
if ($resd) {
|
||||||
{
|
$numd = $db->num_rows($resd);
|
||||||
$numd = $db->num_rows($resd);
|
$upload_dir = '';
|
||||||
$upload_dir ='';
|
$i = 0;
|
||||||
$i=0;
|
if ($numd > 0)
|
||||||
if($numd>0)
|
{
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
$objd = $db->fetch_object($resd);
|
$objd = $db->fetch_object($resd);
|
||||||
|
|
||||||
switch($objd->type){
|
switch ($objd->type) {
|
||||||
case "payment":
|
case "payment":
|
||||||
$subdir=dol_sanitizeFileName($objd->ref);
|
$subdir = dol_sanitizeFileName($objd->ref);
|
||||||
$upload_dir = $conf->facture->dir_output.'/'.$subdir;
|
$upload_dir = $conf->facture->dir_output . '/' . $subdir;
|
||||||
$link="../../document.php?modulepart=facture&file=".str_replace('/','%2F',$subdir).'%2F';
|
$link = DOL_URL_ROOT."/document.php?modulepart=facture&file=" . str_replace('/', '%2F', $subdir) . '%2F';
|
||||||
break;
|
break;
|
||||||
|
case "payment_supplier":
|
||||||
case "payment_supplier":
|
$subdir = get_exdir($objd->id, 2, 0, 0, $objd, 'invoice_supplier') . $objd->reff;
|
||||||
$subdir=get_exdir($objd->id,2,0,0,$objd,'invoice_supplier').$objd->reff;
|
$upload_dir = $conf->fournisseur->facture->dir_output . '/' . $subdir;
|
||||||
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.$subdir;
|
$link = DOL_URL_ROOT."/document.php?modulepart=facture_fournisseur&file=" . str_replace('/', '%2F', $subdir) . '%2F';
|
||||||
$link="../../document.php?modulepart=facture_fournisseur&file=".str_replace('/','%2F',$subdir).'%2F';
|
break;
|
||||||
break;
|
case "payment_expensereport":
|
||||||
case "payment_expensereport":
|
$subdir = dol_sanitizeFileName($objd->refe);
|
||||||
$subdir=dol_sanitizeFileName($objd->refe);
|
$upload_dir = $conf->expensereport->dir_output . '/' . $subdir;
|
||||||
$upload_dir = $conf->expensereport->dir_output.'/'.$subdir;
|
$link = DOL_URL_ROOT."/document.php?modulepart=expensereport&file=" . str_replace('/', '%2F', $subdir) . '%2F';
|
||||||
$link="../../document.php?modulepart=expensereport&file=".str_replace('/','%2F',$subdir).'%2F';
|
break;
|
||||||
break;
|
case "payment_salary":
|
||||||
case "payment_salary":
|
$subdir = dol_sanitizeFileName($objd->ids);
|
||||||
$subdir=dol_sanitizeFileName($objd->ids);
|
$upload_dir = $conf->salaries->dir_output . '/' . $subdir;
|
||||||
$upload_dir = $conf->salaries->dir_output.'/'.$subdir;
|
$link = DOL_URL_ROOT."/document.php?modulepart=salaries&file=" . str_replace('/', '%2F', $subdir) . '%2F';
|
||||||
$link="../../document.php?modulepart=salaries&file=".str_replace('/','%2F',$subdir).'%2F';
|
break;
|
||||||
break;
|
case "payment_donation":
|
||||||
case "payment_donation":
|
$subdir = get_exdir(null, 2, 0, 1, $objd, 'donation') . '/' . dol_sanitizeFileName($objd->idd);
|
||||||
$subdir=get_exdir(null,2,0,1,$objd,'donation'). '/'. dol_sanitizeFileName($objd->idd);
|
$upload_dir = $conf->don->dir_output . '/' . $subdir;
|
||||||
$upload_dir = $conf->don->dir_output . '/' . $subdir;
|
$link = DOL_URL_ROOT."/document.php?modulepart=don&file=" . str_replace('/', '%2F', $subdir) . '%2F';
|
||||||
$link="../../document.php?modulepart=don&file=".str_replace('/','%2F',$subdir).'%2F';
|
break;
|
||||||
break;
|
default:
|
||||||
default:
|
break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($upload_dir)){
|
if (! empty($upload_dir))
|
||||||
$files=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$','',SORT_ASC,1);
|
{
|
||||||
foreach ($files as $key => $file){
|
$files = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview\.png)$', '', SORT_ASC, 1);
|
||||||
$out.= '<br><a href="'.$link.$file['name'].'">'.$file['name'].'</a>';
|
$_SESSION["releve"][$numref][] = $files;
|
||||||
}
|
|
||||||
$_SESSION["releve"][$num][]=$files;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$db->free($resd);
|
|
||||||
return $out;
|
$db->free($resd);
|
||||||
|
return $out;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,6 +37,7 @@ class Paiement extends CommonObject
|
|||||||
{
|
{
|
||||||
public $element='payment';
|
public $element='payment';
|
||||||
public $table_element='paiement';
|
public $table_element='paiement';
|
||||||
|
public $picto = 'payment';
|
||||||
|
|
||||||
var $facid;
|
var $facid;
|
||||||
var $datepaye;
|
var $datepaye;
|
||||||
@ -1016,7 +1017,7 @@ class Paiement extends CommonObject
|
|||||||
global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
|
global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
|
||||||
|
|
||||||
$langs->load('compta');
|
$langs->load('compta');
|
||||||
if ($mode == 0)
|
/*if ($mode == 0)
|
||||||
{
|
{
|
||||||
if ($status == 0) return $langs->trans('ToValidate');
|
if ($status == 0) return $langs->trans('ToValidate');
|
||||||
if ($status == 1) return $langs->trans('Validated');
|
if ($status == 1) return $langs->trans('Validated');
|
||||||
@ -1046,7 +1047,12 @@ class Paiement extends CommonObject
|
|||||||
if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
|
if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
|
||||||
if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
|
if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
|
||||||
}
|
}
|
||||||
return $langs->trans('Unknown');
|
if ($mode == 6)
|
||||||
|
{
|
||||||
|
if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
|
||||||
|
if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
|
||||||
|
}*/
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -202,11 +202,7 @@ if ($id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
// Create
|
||||||
/* */
|
|
||||||
/* create mode */
|
|
||||||
/* */
|
|
||||||
/* ************************************************************************** */
|
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
$year_current = strftime("%Y",dol_now());
|
$year_current = strftime("%Y",dol_now());
|
||||||
@ -332,19 +328,19 @@ if ($id)
|
|||||||
|
|
||||||
$head=salaries_prepare_head($object);
|
$head=salaries_prepare_head($object);
|
||||||
|
|
||||||
dol_fiche_head($head, 'card', $langs->trans("SalaryPayment"), 0, 'payment');
|
dol_fiche_head($head, 'card', $langs->trans("SalaryPayment"), -1, 'payment');
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/salaries/index.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/salaries/index.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
print "<tr>";
|
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
|
||||||
print '<td class="titlefield">'.$langs->trans("Ref").'</td><td colspan="3">';
|
|
||||||
print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
|
print '<div class="fichecenter">';
|
||||||
print '</td></tr>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Employee
|
// Employee
|
||||||
print '<tr><td>'.$langs->trans("Employee").'</td><td>';
|
print '<tr><td class="titlefield">'.$langs->trans("Employee").'</td><td>';
|
||||||
$usersal=new User($db);
|
$usersal=new User($db);
|
||||||
$usersal->fetch($object->fk_user);
|
$usersal->fetch($object->fk_user);
|
||||||
print $usersal->getNomUrl(1);
|
print $usersal->getNomUrl(1);
|
||||||
@ -395,6 +391,8 @@ if ($id)
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -33,20 +33,21 @@ class PaymentSalary extends CommonObject
|
|||||||
{
|
{
|
||||||
//public $element='payment_salary'; //!< Id that identify managed objects
|
//public $element='payment_salary'; //!< Id that identify managed objects
|
||||||
//public $table_element='payment_salary'; //!< Name of table without prefix where object is stored
|
//public $table_element='payment_salary'; //!< Name of table without prefix where object is stored
|
||||||
|
public $picto='payment';
|
||||||
|
|
||||||
var $tms;
|
public $tms;
|
||||||
var $fk_user;
|
public $fk_user;
|
||||||
var $datep;
|
public $datep;
|
||||||
var $datev;
|
public $datev;
|
||||||
var $amount;
|
public $amount;
|
||||||
var $type_payment;
|
public $type_payment;
|
||||||
var $num_payment;
|
public $num_payment;
|
||||||
var $label;
|
public $label;
|
||||||
var $datesp;
|
public $datesp;
|
||||||
var $dateep;
|
public $dateep;
|
||||||
var $fk_bank;
|
public $fk_bank;
|
||||||
var $fk_user_author;
|
public $fk_user_author;
|
||||||
var $fk_user_modif;
|
public $fk_user_modif;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -547,4 +548,66 @@ class PaymentSalary extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee)
|
||||||
|
*
|
||||||
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
|
* @return string Libelle
|
||||||
|
*/
|
||||||
|
function getLibStatut($mode=0)
|
||||||
|
{
|
||||||
|
return $this->LibStatut($this->statut,$mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renvoi le libelle d'un statut donne
|
||||||
|
*
|
||||||
|
* @param int $status Statut
|
||||||
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
|
* @return string Libelle du statut
|
||||||
|
*/
|
||||||
|
function LibStatut($status,$mode=0)
|
||||||
|
{
|
||||||
|
global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
|
||||||
|
|
||||||
|
$langs->load('compta');
|
||||||
|
/*if ($mode == 0)
|
||||||
|
{
|
||||||
|
if ($status == 0) return $langs->trans('ToValidate');
|
||||||
|
if ($status == 1) return $langs->trans('Validated');
|
||||||
|
}
|
||||||
|
if ($mode == 1)
|
||||||
|
{
|
||||||
|
if ($status == 0) return $langs->trans('ToValidate');
|
||||||
|
if ($status == 1) return $langs->trans('Validated');
|
||||||
|
}
|
||||||
|
if ($mode == 2)
|
||||||
|
{
|
||||||
|
if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate');
|
||||||
|
if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated');
|
||||||
|
}
|
||||||
|
if ($mode == 3)
|
||||||
|
{
|
||||||
|
if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1');
|
||||||
|
if ($status == 1) return img_picto($langs->trans('Validated'),'statut4');
|
||||||
|
}
|
||||||
|
if ($mode == 4)
|
||||||
|
{
|
||||||
|
if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate');
|
||||||
|
if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated');
|
||||||
|
}
|
||||||
|
if ($mode == 5)
|
||||||
|
{
|
||||||
|
if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
|
||||||
|
if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
|
||||||
|
}
|
||||||
|
if ($mode == 6)
|
||||||
|
{
|
||||||
|
if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
|
||||||
|
if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
|
||||||
|
}*/
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,6 +36,7 @@ class PaiementFourn extends Paiement
|
|||||||
{
|
{
|
||||||
public $element='payment_supplier';
|
public $element='payment_supplier';
|
||||||
public $table_element='paiementfourn';
|
public $table_element='paiementfourn';
|
||||||
|
public $picto = 'payment';
|
||||||
|
|
||||||
var $statut; //Status of payment. 0 = unvalidated; 1 = validated
|
var $statut; //Status of payment. 0 = unvalidated; 1 = validated
|
||||||
// fk_paiement dans llx_paiement est l'id du type de paiement (7 pour CHQ, ...)
|
// fk_paiement dans llx_paiement est l'id du type de paiement (7 pour CHQ, ...)
|
||||||
@ -486,7 +487,7 @@ class PaiementFourn extends Paiement
|
|||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$langs->load('compta');
|
$langs->load('compta');
|
||||||
if ($mode == 0)
|
/*if ($mode == 0)
|
||||||
{
|
{
|
||||||
if ($status == 0) return $langs->trans('ToValidate');
|
if ($status == 0) return $langs->trans('ToValidate');
|
||||||
if ($status == 1) return $langs->trans('Validated');
|
if ($status == 1) return $langs->trans('Validated');
|
||||||
@ -516,7 +517,12 @@ class PaiementFourn extends Paiement
|
|||||||
if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
|
if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
|
||||||
if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
|
if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
|
||||||
}
|
}
|
||||||
return $langs->trans('Unknown');
|
if ($mode == 6)
|
||||||
|
{
|
||||||
|
if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
|
||||||
|
if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
|
||||||
|
}*/
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -179,7 +179,7 @@ $formfile = new FormFile($db);
|
|||||||
|
|
||||||
$head = payment_supplier_prepare_head($object);
|
$head = payment_supplier_prepare_head($object);
|
||||||
|
|
||||||
dol_fiche_head($head, 'payment', $langs->trans('SupplierPayment'), 0, 'payment');
|
dol_fiche_head($head, 'payment', $langs->trans('SupplierPayment'), -1, 'payment');
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
@ -201,15 +201,23 @@ if ($result > 0)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$linkback = '<a href="' . DOL_URL_ROOT . '/fourn/facture/paiement.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||||
|
|
||||||
|
|
||||||
|
dol_banner_tab($object,'id',$linkback,1,'rowid','ref');
|
||||||
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print '<tr>';
|
/*print '<tr>';
|
||||||
print '<td width="20%" colspan="2">'.$langs->trans('Ref').'</td><td colspan="3">';
|
print '<td width="20%" colspan="2">'.$langs->trans('Ref').'</td><td colspan="3">';
|
||||||
print $form->showrefnav($object,'id','',1,'rowid','ref');
|
print $form->showrefnav($object,'id','',1,'rowid','ref');
|
||||||
print '</td></tr>';
|
print '</td></tr>';*/
|
||||||
|
|
||||||
// Date payment
|
// Date payment
|
||||||
print '<tr><td colspan="2">'.$form->editfieldkey("Date",'datep',$object->date,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td colspan="3">';
|
print '<tr><td class="titlefield" colspan="2">'.$form->editfieldkey("Date",'datep',$object->date,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td colspan="3">';
|
||||||
print $form->editfieldval("Date",'datep',$object->date,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'datepicker','',null,$langs->trans('PaymentDateUpdateSucceeded'));
|
print $form->editfieldval("Date",'datep',$object->date,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'datepicker','',null,$langs->trans('PaymentDateUpdateSucceeded'));
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -270,6 +278,8 @@ if ($result > 0)
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user