Merge branch 'develop' of github.com:Dolibarr/dolibarr into theme_top_menu
This commit is contained in:
commit
5d7118340b
@ -15,7 +15,7 @@ WARNING:
|
||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||
* Method GetUrlTrackingStatus were renamed into getUrlTrackingStatus for consistency with naming rules.
|
||||
* API getListOfCivility has been renamed into getListOfCivilities for consistency with naming rules.
|
||||
|
||||
* Deprecated function img_phone as been removed. You can use img_picto(..., 'call|call_out') instead.;
|
||||
|
||||
|
||||
***** ChangeLog for 9.0.1 compared to 9.0.0 *****
|
||||
|
||||
@ -53,97 +53,104 @@ $error=0;
|
||||
// List of sql to execute
|
||||
$sqls=array(
|
||||
'user'=>array(
|
||||
'DELETE FROM '.MAIN_DB_PREFIX."user_rights WHERE fk_user IN (SELECT rowid FROM ".MAIN_DB_PREFIX."user WHERE admin = 0 and login != 'admin')",
|
||||
'DELETE FROM '.MAIN_DB_PREFIX."user WHERE admin = 0 and login != 'admin'",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."user_rights WHERE fk_user IN (SELECT rowid FROM ".MAIN_DB_PREFIX."user WHERE admin = 0 and login != 'admin') AND fk_user IN (select rowid FROM ".MAIN_DB_PREFIX."user where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."user WHERE admin = 0 and login != 'admin' AND datec < '__DATE__'",
|
||||
),
|
||||
'bank'=>array(
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'bank_account',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'bank_class',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'bank_url',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'bank',
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid IN (SELECT rowid FROM ".MAIN_DB_PREFIX."bank WHERE datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."bank_url WHERE fk_bank IN (SELECT rowid FROM ".MAIN_DB_PREFIX."bank WHERE datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."bank WHERE datec < '__DATE__'",
|
||||
),
|
||||
'bankaccount'=>array(
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."bank_account WHERE datec < '__DATE__'",
|
||||
),
|
||||
'contract'=>array(
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'contratdet',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'contrat',
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."contratdet_extrafields WHERE fk_object IN (select rowid FROM ".MAIN_DB_PREFIX."contratdet WHERE fk_contrat IN (select rowid FROM ".MAIN_DB_PREFIX."contrat where date < '__DATE__'))",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."contratdet WHERE fk_contrat IN (select rowid FROM ".MAIN_DB_PREFIX."contrat where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."contrat_extrafields WHERE fk_object IN (select rowid FROM ".MAIN_DB_PREFIX."contrat where date < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."contrat WHERE datec < '__DATE__'",
|
||||
),
|
||||
'invoice'=>array(
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'paiement_facture',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'facture_rec',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'facturedet',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'facture WHERE fk_facture_source IS NOT NULL',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'facture',
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."societe_remise_except where fk_facture_source IN (select rowid FROM ".MAIN_DB_PREFIX."facture where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."societe_remise_except where fk_facture IN (select rowid FROM ".MAIN_DB_PREFIX."facture where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."societe_remise_except where fk_facture_line IN (select rowid FROM ".MAIN_DB_PREFIX."facturedet as fd WHERE fd.fk_facture IN (select rowid from ".MAIN_DB_PREFIX."facture where datec < '__DATE__'))",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."paiement_facture where fk_facture IN (select rowid FROM ".MAIN_DB_PREFIX."facture where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."facture_rec where datec < '__DATE__'",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."facturedet WHERE fk_facture IN (select rowid FROM ".MAIN_DB_PREFIX."facture where datec < '__DATE__')",
|
||||
"UPDATE ".MAIN_DB_PREFIX."facture SET fk_facture_source = NULL WHERE fk_facture_source IN (select f2.rowid FROM (select * from ".MAIN_DB_PREFIX."facture) as f2 where f2.datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."facture where datec < '__DATE__'",
|
||||
),
|
||||
'proposal'=>array(
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'propaldet',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'propal',
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE fk_propal IN (select rowid FROM ".MAIN_DB_PREFIX."propal where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."propal WHERE datec < '__DATE__'",
|
||||
),
|
||||
'supplier_proposal'=>array(
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'supplier_proposaldet',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'supplier_proposal',
|
||||
"supplier_proposal"=>array(
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."supplier_proposaldet WHERE fk_supplier_proposal IN (select rowid FROM ".MAIN_DB_PREFIX."propal where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."supplier_proposal where datec < '__DATE__'",
|
||||
),
|
||||
'supplier_order'=>array(
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'commande_fournisseur',
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."commande_fournisseurdet WHERE fk_commande IN (select rowid FROM ".MAIN_DB_PREFIX."commande_fournisseur where date_creation < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."commande_fournisseur where date_creation < '__DATE__'",
|
||||
),
|
||||
'supplier_invoice'=>array(
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn',
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."facture_fourn_det WHERE fk_facture_fourn IN (select rowid FROM ".MAIN_DB_PREFIX."facture_fourn where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."facture_fourn where datec < '__DATE__'",
|
||||
),
|
||||
'delivery'=>array(
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'livraisondet',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'livraison',
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."livraisondet WHERE fk_livraison IN (select rowid FROM ".MAIN_DB_PREFIX."livraison where date_creation < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."livraison where date_creation < '__DATE__'",
|
||||
),
|
||||
'shipment'=>array(
|
||||
'@delivery',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'expeditiondet_batch',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'expeditiondet_extrafields',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'expeditiondet',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'expedition_extrafields',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'expedition',
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."expeditiondet_batch WHERE fk_expeditiondet IN (select rowid FROM ".MAIN_DB_PREFIX."expeditiondet WHERE fk_expedition IN (select rowid FROM ".MAIN_DB_PREFIX."expedition where date_creation < '__DATE__'))",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."expeditiondet_extrafields WHERE fk_object IN (select rowid FROM ".MAIN_DB_PREFIX."expeditiondet WHERE fk_expedition IN (select rowid FROM ".MAIN_DB_PREFIX."expedition where date_creation < '__DATE__'))",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."expeditiondet WHERE fk_expedition IN (select rowid FROM ".MAIN_DB_PREFIX."expedition where date_creation < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."expedition_extrafields WHERE fk_object IN (select rowid FROM ".MAIN_DB_PREFIX."expedition where date_creation < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."expedition where date_creation < '__DATE__'",
|
||||
),
|
||||
'order'=>array(
|
||||
'@shipment',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'commandedet',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'commande',
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."commandedet WHERE fk_commande IN (select rowid FROM ".MAIN_DB_PREFIX."commande where date_creation < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."commande where date_creation < '__DATE__'",
|
||||
),
|
||||
'intervention'=>array(
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'fichinterdet',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'fichinter',
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."fichinterdet WHERE fk_fichinter IN (select rowid FROM ".MAIN_DB_PREFIX."fichinter where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."fichinter where datec < '__DATE__'",
|
||||
),
|
||||
'product'=>array(
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'categorie_product',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'product_lang',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'product_price',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'product_fournisseur_price',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'product_batch',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'product_stock',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'product_lot',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'product',
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."categorie_product WHERE fk_product IN (select rowid FROM ".MAIN_DB_PREFIX."product where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."product_lang WHERE fk_product IN (select rowid FROM ".MAIN_DB_PREFIX."product where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."product_price_by_qty WHERE fk_product_price IN (select rowid FROM ".MAIN_DB_PREFIX."product_price where fk_product IN (select rowid FROM ".MAIN_DB_PREFIX."product where datec < '__DATE__'))",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."product_price WHERE fk_product IN (select rowid FROM ".MAIN_DB_PREFIX."product where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price WHERE fk_product IN (select rowid FROM ".MAIN_DB_PREFIX."product where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."product_batch WHERE fk_product_stock IN (select rowid FROM ".MAIN_DB_PREFIX."product_stock where fk_product IN (select rowid FROM ".MAIN_DB_PREFIX."product where datec < '__DATE__'))",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."product_stock WHERE fk_product IN (select rowid FROM ".MAIN_DB_PREFIX."product where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."product_lot WHERE fk_product IN (select rowid FROM ".MAIN_DB_PREFIX."product where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."product where datec < '__DATE__'",
|
||||
),
|
||||
'project'=>array(
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'projet_task_time',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'projet_task',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'projet',
|
||||
// TODO set fk_project to null on object that refer to project
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."projet_task_time WHERE fk_task IN (select rowid FROM ".MAIN_DB_PREFIX."projet_task WHERE fk_projet IN (select rowid FROM ".MAIN_DB_PREFIX."projet where datec < '__DATE__'))",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."projet_task WHERE fk_projet IN (select rowid FROM ".MAIN_DB_PREFIX."projet where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."projet where datec < '__DATE__'",
|
||||
),
|
||||
'contact'=>array(
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'categorie_contact',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'socpeople',
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."categorie_contact WHERE fk_socpeople IN (select rowid FROM ".MAIN_DB_PREFIX."socpeople where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."socpeople where datec < '__DATE__'",
|
||||
),
|
||||
'thirdparty'=>array(
|
||||
'@contact',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'cabinetmed_cons',
|
||||
'UPDATE '.MAIN_DB_PREFIX.'adherent SET fk_soc = NULL',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'categorie_fournisseur',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'categorie_societe',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'societe_remise_except',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'societe_rib',
|
||||
'DELETE FROM '.MAIN_DB_PREFIX.'societe',
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."cabinetmed_cons WHERE fk_soc IN (select rowid FROM ".MAIN_DB_PREFIX."societe where datec < '__DATE__')",
|
||||
"UPDATE ".MAIN_DB_PREFIX."adherent SET fk_soc = NULL WHERE fk_soc IN (select rowid FROM ".MAIN_DB_PREFIX."societe where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."categorie_fournisseur WHERE fk_soc IN (select rowid FROM ".MAIN_DB_PREFIX."societe where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."categorie_societe WHERE fk_soc IN (select rowid FROM ".MAIN_DB_PREFIX."societe where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."societe_remise_except WHERE fk_soc IN (select rowid FROM ".MAIN_DB_PREFIX."societe where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."societe_rib WHERE fk_soc IN (select rowid FROM ".MAIN_DB_PREFIX."societe where datec < '__DATE__')",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."societe where datec < '__DATE__'",
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Main
|
||||
*/
|
||||
@ -154,27 +161,37 @@ dol_syslog($script_file." launched with arg ".implode(',', $argv));
|
||||
|
||||
$mode = $argv[1];
|
||||
$option = $argv[2];
|
||||
$date = $argv[3];
|
||||
|
||||
if (empty($mode) || ! in_array($mode, array('test','confirm'))) {
|
||||
print "Usage: $script_file (test|confirm) (all|option) [dbtype dbhost dbuser dbpassword dbname dbport]\n";
|
||||
print "Usage: $script_file (test|confirm) (all|option) (all|YYYY-MM-DD) [dbtype dbhost dbuser dbpassword dbname dbport]\n";
|
||||
print "\n";
|
||||
print "option can be ".implode(',', array_keys($sqls))."\n";
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (empty($option) || ! in_array($option, array_merge(array('all'), array_keys($sqls))) ) {
|
||||
print "Usage: $script_file (test|confirm) (all|option) [dbtype dbhost dbuser dbpassword dbname dbport]\n";
|
||||
print "Usage: $script_file (test|confirm) (all|option) (all|YYYY-MM-DD) [dbtype dbhost dbuser dbpassword dbname dbport]\n";
|
||||
print "\n";
|
||||
print "option can be ".implode(',', array_keys($sqls))."\n";
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (empty($date) || (! preg_match('/\d\d\d\d\-\d\d\-\d\d$/', $date) && $date != 'all')) {
|
||||
print "Usage: $script_file (test|confirm) (all|option) (all|YYYY-MM-DD) [dbtype dbhost dbuser dbpassword dbname dbport]\n";
|
||||
print "\n";
|
||||
print "date can be 'all' or 'YYYY-MM-DD' to delete record before YYYY-MM-DD\n";
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if ($date == 'all') $date = '2199-01-01';
|
||||
|
||||
// Replace database handler
|
||||
if (! empty($argv[3]))
|
||||
if (! empty($argv[4]))
|
||||
{
|
||||
$db->close();
|
||||
unset($db);
|
||||
$db=getDoliDBInstance($argv[3], $argv[4], $argv[5], $argv[6], $argv[7], $argv[8]);
|
||||
$db=getDoliDBInstance($argv[4], $argv[5], $argv[6], $argv[7], $argv[8], $argv[9]);
|
||||
$user=new User($db);
|
||||
}
|
||||
|
||||
@ -189,6 +206,7 @@ if (! $ret > 0)
|
||||
|
||||
|
||||
print "Purge all data for this database:\n";
|
||||
print "Before = ".$date."\n";
|
||||
print "Server = ".$db->database_host."\n";
|
||||
print "Database name = ".$db->database_name."\n";
|
||||
print "Database port = ".$db->database_port."\n";
|
||||
@ -206,9 +224,10 @@ if (! $confirmed)
|
||||
* Process sql requests of a family
|
||||
*
|
||||
* @param string $family Name of family key of array $sqls
|
||||
* @param string $date Date value
|
||||
* @return int -1 if KO, 1 if OK
|
||||
*/
|
||||
function processfamily($family)
|
||||
function processfamily($family, $date)
|
||||
{
|
||||
global $db, $sqls;
|
||||
|
||||
@ -218,11 +237,14 @@ function processfamily($family)
|
||||
if (preg_match('/^@/', $sql))
|
||||
{
|
||||
$newfamily=preg_replace('/@/', '', $sql);
|
||||
processfamily($newfamily);
|
||||
processfamily($newfamily, $date);
|
||||
continue;
|
||||
}
|
||||
|
||||
$sql = preg_replace('/__DATE__/', $date, $sql);
|
||||
|
||||
print "Run sql: ".$sql."\n";
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
@ -255,7 +277,7 @@ foreach($sqls as $family => $familysql)
|
||||
if ($family != $oldfamily) print "Process action for family ".$family."\n";
|
||||
$oldfamily = $family;
|
||||
|
||||
$result=processfamily($family);
|
||||
$result=processfamily($family, $date);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
@ -265,7 +287,7 @@ foreach($sqls as $family => $familysql)
|
||||
|
||||
if ($error || $mode != 'confirm')
|
||||
{
|
||||
print "Rollback any changes.\n";
|
||||
print "\nRollback any changes.\n";
|
||||
$db->rollback();
|
||||
}
|
||||
else
|
||||
|
||||
2
dev/resources/dbmodel/README
Normal file
2
dev/resources/dbmodel/README
Normal file
@ -0,0 +1,2 @@
|
||||
This directory contains the file with the graphical database structure.
|
||||
It can be read with MySQL Workbench software.
|
||||
@ -428,4 +428,5 @@
|
||||
<rule ref="PSR2.Files.EndFileNewline.TooMany" />
|
||||
<rule ref="PSR2.Files.EndFileNewline.NoneFound" />
|
||||
<rule ref="PSR2.Methods.FunctionCallSignature.SpaceBeforeOpenBracket" />
|
||||
<rule ref="PSR2.Classes.PropertyDeclaration.VarUsed" />
|
||||
</ruleset>
|
||||
|
||||
@ -183,6 +183,10 @@ if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! emp
|
||||
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $arraychoices['bankviainvoice']=$langs->trans("MoreActionBankViaInvoice");
|
||||
print '<td>';
|
||||
print $form->selectarray('ADHERENT_BANK_USE', $arraychoices, $conf->global->ADHERENT_BANK_USE, 0);
|
||||
if ($conf->global->ADHERENT_BANK_USE == 'bankdirect' || $conf->global->ADHERENT_BANK_USE == 'bankviainvoice')
|
||||
{
|
||||
print '<br><div style="padding-top: 5px;"><span class="opacitymedium">'.$langs->trans("ABankAccountMustBeDefinedOnPaymentModeSetup").'</span></div>';
|
||||
}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -249,13 +249,14 @@ $form=new Form($db);
|
||||
llxHeader('', $langs->trans("MembersCards"));
|
||||
|
||||
print load_fiche_titre($langs->trans("LinkToGeneratedPages"));
|
||||
print '<br>';
|
||||
|
||||
print $langs->trans("LinkToGeneratedPagesDesc").'<br>';
|
||||
print '<span class="opacitymedium">'.$langs->trans("LinkToGeneratedPagesDesc").'</span><br>';
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_errors($mesg);
|
||||
|
||||
print '<br>';
|
||||
|
||||
print img_picto('', 'puce').' '.$langs->trans("DocForAllMembersCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' ';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="foruserid" value="all">';
|
||||
@ -272,7 +273,8 @@ asort($arrayoflabels);
|
||||
print $form->selectarray('model', $arrayoflabels, (GETPOST('model')?GETPOST('model'):$conf->global->ADHERENT_CARD_TYPE), 1, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
print '<br><input class="button" type="submit" value="'.$langs->trans("BuildDoc").'">';
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
print img_picto('', 'puce').' '.$langs->trans("DocForOneMemberCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' ';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
@ -290,7 +292,8 @@ print $form->selectarray('model', $arrayoflabels, (GETPOST('model')?GETPOST('mod
|
||||
print '<br>'.$langs->trans("Login").': <input size="10" type="text" name="foruserlogin" value="'.GETPOST('foruserlogin').'">';
|
||||
print '<br><input class="button" type="submit" value="'.$langs->trans("BuildDoc").'">';
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
print img_picto('', 'puce').' '.$langs->trans("DocForLabels", $conf->global->ADHERENT_ETIQUETTE_TYPE).' ';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
@ -307,7 +310,6 @@ asort($arrayoflabels);
|
||||
print $form->selectarray('modellabel', $arrayoflabels, (GETPOST('modellabel')?GETPOST('modellabel'):$conf->global->ADHERENT_ETIQUETTE_TYPE), 1, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
print '<br><input class="button" type="submit" value="'.$langs->trans("BuildDoc").'">';
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
||||
@ -572,6 +572,22 @@ class Adherent extends CommonObject
|
||||
$sql.= ", fk_user_mod = ".($user->id>0?$user->id:'null'); // Can be null because member can be create by a guest
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
|
||||
// If we change the type of membership, we set also label of new type
|
||||
if (! empty($this->oldcopy) && $this->typeid != $this->oldcopy->typeid)
|
||||
{
|
||||
$sql2 = "SELECT libelle as label";
|
||||
$sql2.= " FROM ".MAIN_DB_PREFIX."adherent_type";
|
||||
$sql2.= " WHERE rowid = ".$this->typeid;
|
||||
$resql2 = $this->db->query($sql2);
|
||||
if ($resql2)
|
||||
{
|
||||
while ($obj=$this->db->fetch_object($resql2))
|
||||
{
|
||||
$this->type=$obj->label;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this)."::update update member", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@ -58,15 +58,16 @@ llxHeader('', $langs->trans("MembersStatisticsByProperties"), '', '', 0, 0, arra
|
||||
|
||||
$title=$langs->trans("MembersStatisticsByProperties");
|
||||
|
||||
print load_fiche_titre($title, $mesg);
|
||||
print load_fiche_titre($title, '');
|
||||
|
||||
dol_mkdir($dir);
|
||||
|
||||
$tab='byproperties';
|
||||
|
||||
$data = array();
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, d.morphy as code";
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, d.morphy as code";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
||||
$sql.=" WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql.=" AND d.statut = 1";
|
||||
$sql.=" GROUP BY d.morphy";
|
||||
@ -87,7 +88,7 @@ if ($resql)
|
||||
if ($obj->code == 'phy') $foundphy++;
|
||||
if ($obj->code == 'mor') $foundmor++;
|
||||
|
||||
$data[]=array('label'=>$obj->code, 'nb'=>$obj->nb, 'lastdate'=>$db->jdate($obj->lastdate));
|
||||
$data[]=array('label'=>$obj->code, 'nb'=>$obj->nb, 'lastdate'=>$db->jdate($obj->lastdate), 'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate));
|
||||
|
||||
$i++;
|
||||
}
|
||||
@ -120,22 +121,21 @@ print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Nature").'</td>';
|
||||
print '<td class="right">'.$langs->trans("NbOfMembers").'</td>';
|
||||
print '<td align="center">'.$langs->trans("LastMemberDate").'</td>';
|
||||
print '<td align="center">'.$langs->trans("LatestSubscriptionDate").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
if (! $foundphy) $data[]=array('label'=>'phy','nb'=>'0','lastdate'=>'');
|
||||
if (! $foundmor) $data[]=array('label'=>'mor','nb'=>'0','lastdate'=>'');
|
||||
if (! $foundphy) $data[]=array('label'=>'phy','nb'=>'0','lastdate'=>'', 'lastsubscriptiondate'=>'');
|
||||
if (! $foundmor) $data[]=array('label'=>'mor','nb'=>'0','lastdate'=>'', 'lastsubscriptiondate'=>'');
|
||||
|
||||
$oldyear=0;
|
||||
foreach ($data as $val)
|
||||
{
|
||||
$year = $val['year'];
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$memberstatic->getmorphylib($val['label']).'</td>';
|
||||
print '<td class="right">'.$val['nb'].'</td>';
|
||||
print '<td align="center">'.dol_print_date($val['lastdate'], 'dayhour').'</td>';
|
||||
print '<td align="center">'.dol_print_date($val['lastsubscriptiondate'], 'dayhour').'</td>';
|
||||
print '</tr>';
|
||||
$oldyear=$year;
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -77,8 +77,10 @@ if ($mode)
|
||||
$tab='statscountry';
|
||||
|
||||
$data = array();
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, c.code, c.label";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, c.code, c.label";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
||||
$sql.=" WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql.=" AND d.statut = 1";
|
||||
$sql.=" GROUP BY c.label, c.code";
|
||||
@ -92,10 +94,12 @@ if ($mode)
|
||||
$tab='statsstate';
|
||||
|
||||
$data = array();
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, co.code, co.label, c.nom as label2"; //
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid";
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, co.code, co.label, c.nom as label2"; //
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_country as co on d.country = co.rowid";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
||||
$sql.=" WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql.=" AND d.statut = 1";
|
||||
$sql.=" GROUP BY co.label, co.code, c.nom";
|
||||
@ -108,10 +112,12 @@ if ($mode)
|
||||
$tab='statsregion'; //onglet
|
||||
|
||||
$data = array(); //tableau de donnée
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, co.code, co.label, r.nom as label2";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid";
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, co.code, co.label, r.nom as label2";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_country as co on d.country = co.rowid";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
||||
$sql.=" WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql.=" AND d.statut = 1";
|
||||
$sql.=" GROUP BY co.label, co.code, r.nom"; //+
|
||||
@ -124,9 +130,10 @@ if ($mode)
|
||||
$tab='statstown';
|
||||
|
||||
$data = array();
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, c.code, c.label, d.town as label2";
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, c.code, c.label, d.town as label2";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
||||
$sql.=" WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql.=" AND d.statut = 1";
|
||||
$sql.=" GROUP BY c.label, c.code, d.town";
|
||||
@ -154,7 +161,8 @@ if ($mode)
|
||||
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code)!="Country".$obj->code)?$langsen->transnoentitiesnoconv("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))),
|
||||
'code'=>$obj->code,
|
||||
'nb'=>$obj->nb,
|
||||
'lastdate'=>$db->jdate($obj->lastdate)
|
||||
'lastdate'=>$db->jdate($obj->lastdate),
|
||||
'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
|
||||
);
|
||||
}
|
||||
if ($mode == 'memberbyregion') //+
|
||||
@ -164,7 +172,8 @@ if ($mode)
|
||||
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code)!="Country".$obj->code)?$langsen->transnoentitiesnoconv("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))),
|
||||
'label2'=>($obj->label2?$obj->label2:$langs->trans("Unknown")),
|
||||
'nb'=>$obj->nb,
|
||||
'lastdate'=>$db->jdate($obj->lastdate)
|
||||
'lastdate'=>$db->jdate($obj->lastdate),
|
||||
'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
|
||||
);
|
||||
}
|
||||
if ($mode == 'memberbystate')
|
||||
@ -173,7 +182,8 @@ if ($mode)
|
||||
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code)!="Country".$obj->code)?$langsen->transnoentitiesnoconv("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))),
|
||||
'label2'=>($obj->label2?$obj->label2:$langs->trans("Unknown")),
|
||||
'nb'=>$obj->nb,
|
||||
'lastdate'=>$db->jdate($obj->lastdate)
|
||||
'lastdate'=>$db->jdate($obj->lastdate),
|
||||
'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
|
||||
);
|
||||
}
|
||||
if ($mode == 'memberbytown')
|
||||
@ -182,7 +192,8 @@ if ($mode)
|
||||
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code)!="Country".$obj->code)?$langsen->transnoentitiesnoconv("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))),
|
||||
'label2'=>($obj->label2?$obj->label2:$langs->trans("Unknown")),
|
||||
'nb'=>$obj->nb,
|
||||
'lastdate'=>$db->jdate($obj->lastdate)
|
||||
'lastdate'=>$db->jdate($obj->lastdate),
|
||||
'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
|
||||
);
|
||||
}
|
||||
|
||||
@ -289,9 +300,9 @@ if ($mode)
|
||||
if ($label2) print '<td align="center">'.$label2.'</td>';
|
||||
print '<td class="right">'.$langs->trans("NbOfMembers").'</td>';
|
||||
print '<td align="center">'.$langs->trans("LastMemberDate").'</td>';
|
||||
print '<td align="center">'.$langs->trans("LatestSubscriptionDate").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$oldyear=0;
|
||||
foreach ($data as $val)
|
||||
{
|
||||
$year = $val['year'];
|
||||
@ -300,8 +311,8 @@ if ($mode)
|
||||
if ($label2) print '<td align="center">'.$val['label2'].'</td>';
|
||||
print '<td class="right">'.$val['nb'].'</td>';
|
||||
print '<td align="center">'.dol_print_date($val['lastdate'], 'dayhour').'</td>';
|
||||
print '<td align="center">'.dol_print_date($val['lastsubscriptiondate'], 'dayhour').'</td>';
|
||||
print '</tr>';
|
||||
$oldyear=$year;
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -44,7 +44,12 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
if ($action == 'setbarcodeproducton')
|
||||
{
|
||||
$res=dolibarr_set_const($db, "BARCODE_PRODUCT_ADDON_NUM", GETPOST('value'), 'chaine', 0, '', $conf->entity);
|
||||
$barcodenumberingmodule = GETPOST('value', 'alpha');
|
||||
$res=dolibarr_set_const($db, "BARCODE_PRODUCT_ADDON_NUM", $barcodenumberingmodule, 'chaine', 0, '', $conf->entity);
|
||||
if ($barcodenumberingmodule == 'mod_barcode_product_standard' && empty($conf->global->BARCODE_STANDARD_PRODUCT_MASK))
|
||||
{
|
||||
$res=dolibarr_set_const($db, "BARCODE_STANDARD_PRODUCT_MASK", '020{000000000}', 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
}
|
||||
elseif ($action == 'setbarcodeproductoff')
|
||||
{
|
||||
@ -406,13 +411,13 @@ if ($conf->produit->enabled)
|
||||
|
||||
if ($conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file")
|
||||
{
|
||||
print '<td class="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproductoff&value='.$file.'">';
|
||||
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproductoff&value='.$file.'">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td class="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproducton&value='.$file.'">';
|
||||
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproducton&value='.$file.'">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
|
||||
@ -1912,7 +1912,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
print '<td><input type="text" class="flat minwidth75" value="'.price((! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')).'" name="'.$fieldlist[$field].'"></td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {
|
||||
print '<td class="maxxxx"><input type="text" class="flat minwidth75" value="'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'"></td>';
|
||||
print '<td class="maxxxx"><input type="text" class="flat minwidth75 maxwidth100" value="'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'"></td>';
|
||||
}
|
||||
elseif ($fieldlist[$field]=='unit') {
|
||||
print '<td>';
|
||||
|
||||
@ -339,8 +339,8 @@ if (! $error && $xml)
|
||||
$out.='<td>'.$i.'</td>' . "\n";
|
||||
$out.='<td>'.$file['filename'];
|
||||
if (! preg_match('/^win/i', PHP_OS)) {
|
||||
$htmltext=$langs->trans("YouCanDeleteFileOnServerWith", 'rm '.DOL_DOCUMENT_ROOT.'/'.$file['filename']);
|
||||
$out.=' '.$form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'helprm');
|
||||
$htmltext=$langs->trans("YouCanDeleteFileOnServerWith", 'rm '.DOL_DOCUMENT_ROOT.$file['filename']); // The slash is included int file['filename']
|
||||
$out.=' '.$form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'helprm'.$i);
|
||||
}
|
||||
$out.='</td>' . "\n";
|
||||
$out.='<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2019 Maxime Kohlhaas <maxime@atm-consulting.fr>
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2019 Maxime Kohlhaas <maxime@atm-consulting.fr>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -23,21 +24,7 @@
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
$res=0;
|
||||
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
|
||||
if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
|
||||
while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
|
||||
if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php";
|
||||
if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php";
|
||||
// Try main.inc.php using relative path
|
||||
if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
|
||||
if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
|
||||
if (! $res) die("Include of main fails");
|
||||
|
||||
global $langs, $user;
|
||||
|
||||
require '../../main.inc.php';
|
||||
// Libraries
|
||||
require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php";
|
||||
require_once '../lib/bom.lib.php';
|
||||
@ -62,11 +49,7 @@ $arrayofparameters=array(
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
if ((float) DOL_VERSION >= 6)
|
||||
{
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
}
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
/*
|
||||
* View
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -17,50 +17,17 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file bom_card.php
|
||||
* \file htdocs/bom/bom_card.php
|
||||
* \ingroup bom
|
||||
* \brief Page to create/edit/view bom
|
||||
*/
|
||||
|
||||
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db
|
||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Do not load object $user
|
||||
//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); // Do not load object $mysoc
|
||||
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Do not load object $langs
|
||||
//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check injection attack on GET parameters
|
||||
//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check injection attack on POST parameters
|
||||
//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
|
||||
//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
|
||||
//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data
|
||||
//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu
|
||||
//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php
|
||||
//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library
|
||||
//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
|
||||
//if (! defined('NOIPCHECK')) define('NOIPCHECK','1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
|
||||
//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT','auto'); // Force lang to a particular value
|
||||
//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE','aloginmodule'); // Force authentication handler
|
||||
//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN',1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
|
||||
//if (! defined("FORCECSP")) define('FORCECSP','none'); // Disable all Content Security Policies
|
||||
|
||||
|
||||
// Load Dolibarr environment
|
||||
$res=0;
|
||||
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
|
||||
if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
|
||||
while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
|
||||
if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php";
|
||||
if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php";
|
||||
// Try main.inc.php using relative path
|
||||
if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php";
|
||||
if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
|
||||
if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
|
||||
if (! $res) die("Include of main fails");
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
dol_include_once('/bom/class/bom.class.php');
|
||||
dol_include_once('/bom/lib/bom_bom.lib.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom_bom.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("mrp","other"));
|
||||
@ -75,7 +42,7 @@ $contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'bomcard
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
|
||||
// Initialize technical objects
|
||||
$object=new BillOfMaterials($db);
|
||||
$object=new BOM($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('bomcard', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||
@ -119,10 +86,10 @@ if (empty($reshook))
|
||||
|
||||
$permissiontoadd = $user->rights->bom->write;
|
||||
$permissiontodelete = $user->rights->bom->delete || ($permissiontoadd && $object->status == 0);
|
||||
$backurlforlist = dol_buildpath('/bom/bom_list.php', 1);
|
||||
$backurlforlist = DOL_URL_ROOT.'/bom/bom_list.php';
|
||||
if (empty($backtopage)) {
|
||||
if (empty($id)) $backtopage = $backurlforlist;
|
||||
else $backtopage = dol_buildpath('/bom/bom_card.php', 1).($id > 0 ? $id : '__ID__');
|
||||
else $backtopage = DOL_URL_ROOT.'/bom/bom_card.php?id='.$id;
|
||||
}
|
||||
$triggermodname = 'BILLOFMATERIALS_BILLOFMATERIALS_MODIFY'; // Name of trigger action code to execute when we modify record
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -23,26 +23,13 @@
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
$res=0;
|
||||
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
|
||||
if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
|
||||
while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
|
||||
if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php";
|
||||
if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php";
|
||||
// Try main.inc.php using relative path
|
||||
if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php";
|
||||
if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
|
||||
if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
|
||||
if (! $res) die("Include of main fails");
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
dol_include_once('/bom/class/bom.class.php');
|
||||
dol_include_once('/bom/lib/bom_bom.lib.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom_bom.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("mrp","companies","other","mails"));
|
||||
|
||||
@ -17,49 +17,16 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file bom_list.php
|
||||
* \file htdocs/bom/bom_list.php
|
||||
* \ingroup bom
|
||||
* \brief List page for bom
|
||||
*/
|
||||
|
||||
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db
|
||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Do not load object $user
|
||||
//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); // Do not load object $mysoc
|
||||
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Do not load object $langs
|
||||
//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check injection attack on GET parameters
|
||||
//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check injection attack on POST parameters
|
||||
//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
|
||||
//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
|
||||
//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data
|
||||
//if (! defined('NOIPCHECK')) define('NOIPCHECK','1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
|
||||
//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu
|
||||
//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php
|
||||
//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library
|
||||
//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session)
|
||||
//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT','auto'); // Force lang to a particular value
|
||||
//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE','aloginmodule'); // Force authentication handler
|
||||
//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN',1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
|
||||
//if (! defined("XFRAMEOPTIONS_ALLOWALL")) define('XFRAMEOPTIONS_ALLOWALL',1); // Do not add the HTTP header 'X-Frame-Options: SAMEORIGIN' but 'X-Frame-Options: ALLOWALL'
|
||||
|
||||
// Load Dolibarr environment
|
||||
$res=0;
|
||||
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
|
||||
if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
|
||||
while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
|
||||
if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php";
|
||||
if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php";
|
||||
// Try main.inc.php using relative path
|
||||
if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php";
|
||||
if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
|
||||
if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
|
||||
if (! $res) die("Include of main fails");
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
dol_include_once('/bom/class/bom.class.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("mrp", "other"));
|
||||
@ -89,7 +56,7 @@ $pagenext = $page + 1;
|
||||
//if (! $sortorder) $sortorder="DESC";
|
||||
|
||||
// Initialize technical objects
|
||||
$object = new BillOfMaterials($db);
|
||||
$object = new BOM($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction = $conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('bomlist')); // Note that conf->hooks_modules contains array
|
||||
@ -179,7 +146,7 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
// Mass actions
|
||||
$objectclass='BillOfMaterials';
|
||||
$objectclass='BOM';
|
||||
$objectlabel='BillOfMaterials';
|
||||
$permtoread = $user->rights->bom->read;
|
||||
$permtodelete = $user->rights->bom->delete;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -23,22 +23,9 @@
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
$res=0;
|
||||
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
|
||||
if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
|
||||
while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
|
||||
if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php";
|
||||
if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php";
|
||||
// Try main.inc.php using relative path
|
||||
if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php";
|
||||
if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
|
||||
if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
|
||||
if (! $res) die("Include of main fails");
|
||||
|
||||
dol_include_once('/bom/class/bom.class.php');
|
||||
dol_include_once('/bom/lib/bom_bom.lib.php');
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom_bom.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("mrp","companies"));
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2019 Maxime Kohlhaas <maxime@atm-consulting.fr>
|
||||
/* Copyright (C) 2019 Maxime Kohlhaas <maxime@atm-consulting.fr>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -16,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file bom/lib/bom.lib.php
|
||||
* \file htdocs/bom/lib/bom.lib.php
|
||||
* \ingroup bom
|
||||
* \brief Library files with common functions for BillOfMaterials
|
||||
*/
|
||||
@ -40,7 +41,7 @@ function bomAdminPrepareHead()
|
||||
$head[$h][2] = 'settings';
|
||||
$h++;
|
||||
|
||||
/*$head[$h][0] = dol_buildpath("/bom/admin/about.php", 1);
|
||||
/*$head[$h][0] = DOL_URL_ROOT."/bom/admin/about.php";
|
||||
$head[$h][1] = $langs->trans("About");
|
||||
$head[$h][2] = 'about';
|
||||
$h++;
|
||||
@ -77,7 +78,7 @@ function bomPrepareHead($object)
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = dol_buildpath("/bom/bom_card.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT."/bom/bom_card.php?id=".$object->id;
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
@ -87,7 +88,7 @@ function bomPrepareHead($object)
|
||||
$nbNote = 0;
|
||||
if (!empty($object->note_private)) $nbNote++;
|
||||
if (!empty($object->note_public)) $nbNote++;
|
||||
$head[$h][0] = dol_buildpath('/bom/bom_note.php', 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/bom/bom_note.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans('Notes');
|
||||
if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>';
|
||||
$head[$h][2] = 'note';
|
||||
@ -99,13 +100,13 @@ function bomPrepareHead($object)
|
||||
$upload_dir = $conf->bom->dir_output . "/bom/" . dol_sanitizeFileName($object->ref);
|
||||
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
||||
$nbLinks=Link::count($db, $object->element, $object->id);
|
||||
$head[$h][0] = dol_buildpath("/bom/bom_document.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/bom/bom_document.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>';
|
||||
$head[$h][2] = 'document';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = dol_buildpath("/bom/bom_agenda.php", 1).'?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/bom/bom_agenda.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Events");
|
||||
$head[$h][2] = 'agenda';
|
||||
$h++;
|
||||
|
||||
@ -747,7 +747,7 @@ class Categorie extends CommonObject
|
||||
* @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member')
|
||||
* @param int $onlyids Return only ids of objects (consume less memory)
|
||||
* @return array|int -1 if KO, array of instance of object if OK
|
||||
* @see containsObject
|
||||
* @see containsObject()
|
||||
*/
|
||||
public function getObjectsInCateg($type, $onlyids = 0)
|
||||
{
|
||||
@ -794,7 +794,7 @@ class Categorie extends CommonObject
|
||||
* @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member')
|
||||
* @param int $object_id Id of the object to search
|
||||
* @return int Number of occurrences
|
||||
* @see getObjectsInCateg
|
||||
* @see getObjectsInCateg()
|
||||
*/
|
||||
public function containsObject($type, $object_id)
|
||||
{
|
||||
|
||||
@ -81,6 +81,7 @@ if ($cancel)
|
||||
// Action mise a jour d'une categorie
|
||||
if ($action == 'update' && $user->rights->categorie->creer)
|
||||
{
|
||||
$object->oldcopy = dol_clone($object);
|
||||
$object->label = $label;
|
||||
$object->description = dol_htmlcleanlastbr($description);
|
||||
$object->color = $color;
|
||||
|
||||
@ -160,6 +160,10 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
|
||||
{
|
||||
if ($id > 0) {
|
||||
$object->fetch($id);
|
||||
if (!empty($object->socpeopleassigned)) {
|
||||
reset($object->socpeopleassigned);
|
||||
$object->contactid = key($object->socpeopleassigned);
|
||||
}
|
||||
$result = $object->createFromClone(GETPOST('fk_userowner'), GETPOST('socid'));
|
||||
if ($result > 0) {
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result);
|
||||
@ -431,6 +435,10 @@ if ($action == 'update')
|
||||
$object->socpeopleassigned = array();
|
||||
foreach ($socpeopleassigned as $cid) $object->socpeopleassigned[$cid] = array('id' => $cid);
|
||||
$object->contactid = GETPOST("contactid", 'int');
|
||||
if (empty($object->contactid) && !empty($object->socpeopleassigned)) {
|
||||
reset($object->socpeopleassigned);
|
||||
$object->contactid = key($object->socpeopleassigned);
|
||||
}
|
||||
$object->fk_project = GETPOST("projectid", 'int');
|
||||
$object->note = GETPOST("note", "none"); // deprecated
|
||||
$object->note_private= GETPOST("note", "none");
|
||||
|
||||
@ -270,7 +270,7 @@ class ActionComm extends CommonObject
|
||||
$this->userassigned[$tmpid]=array('id'=>$tmpid, 'transparency'=>$this->transparency);
|
||||
}
|
||||
|
||||
if (is_object($this->contact) && isset($this->contact->id) && $this->contact->id > 0 && ! ($this->contactid > 0)) $this->contactid = $this->contact->id; // For backward compatibility. Using this->contact->xx is deprecated
|
||||
//if (is_object($this->contact) && isset($this->contact->id) && $this->contact->id > 0 && ! ($this->contactid > 0)) $this->contactid = $this->contact->id; // For backward compatibility. Using this->contact->xx is deprecated
|
||||
|
||||
|
||||
$userownerid=$this->userownerid;
|
||||
@ -656,7 +656,7 @@ class ActionComm extends CommonObject
|
||||
$this->fk_project = $obj->fk_project; // To have fetch_project method working
|
||||
|
||||
$this->societe->id = $obj->fk_soc; // deprecated
|
||||
$this->contact->id = $obj->fk_contact; // deprecated
|
||||
//$this->contact->id = $obj->fk_contact; // deprecated
|
||||
|
||||
$this->fk_element = $obj->elementid;
|
||||
$this->elementid = $obj->elementid;
|
||||
@ -867,7 +867,7 @@ class ActionComm extends CommonObject
|
||||
}
|
||||
|
||||
$socid=($this->socid?$this->socid:((isset($this->societe->id) && $this->societe->id > 0) ? $this->societe->id : 0));
|
||||
$contactid=($this->contactid?$this->contactid:((isset($this->contact->id) && $this->contact->id > 0) ? $this->contact->id : 0));
|
||||
$contactid=($this->contactid?$this->contactid:0);
|
||||
$userownerid=($this->userownerid?$this->userownerid:0);
|
||||
$userdoneid=($this->userdoneid?$this->userdoneid:0);
|
||||
|
||||
|
||||
@ -3526,13 +3526,13 @@ class Propal extends CommonObject
|
||||
if ($option == '') {
|
||||
$url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id. $get_params;
|
||||
}
|
||||
if ($option == 'compta') { // deprecated
|
||||
elseif ($option == 'compta') { // deprecated
|
||||
$url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id. $get_params;
|
||||
}
|
||||
if ($option == 'expedition') {
|
||||
elseif ($option == 'expedition') {
|
||||
$url = DOL_URL_ROOT.'/expedition/propal.php?id='.$this->id. $get_params;
|
||||
}
|
||||
if ($option == 'document') {
|
||||
elseif ($option == 'document') {
|
||||
$url = DOL_URL_ROOT.'/comm/propal/document.php?id='.$this->id. $get_params;
|
||||
}
|
||||
|
||||
@ -3646,68 +3646,68 @@ class PropaleLigne extends CommonObjectLine
|
||||
*/
|
||||
public $table_element='propaldet';
|
||||
|
||||
var $oldline;
|
||||
public $oldline;
|
||||
|
||||
// From llx_propaldet
|
||||
var $fk_propal;
|
||||
var $fk_parent_line;
|
||||
var $desc; // Description ligne
|
||||
var $fk_product; // Id produit predefini
|
||||
public $fk_propal;
|
||||
public $fk_parent_line;
|
||||
public $desc; // Description ligne
|
||||
public $fk_product; // Id produit predefini
|
||||
/**
|
||||
* @deprecated
|
||||
* @see product_type
|
||||
*/
|
||||
var $fk_product_type;
|
||||
public $fk_product_type;
|
||||
/**
|
||||
* Product type.
|
||||
* @var int
|
||||
* @see Product::TYPE_PRODUCT, Product::TYPE_SERVICE
|
||||
*/
|
||||
var $product_type = Product::TYPE_PRODUCT;
|
||||
public $product_type = Product::TYPE_PRODUCT;
|
||||
|
||||
var $qty;
|
||||
var $tva_tx;
|
||||
var $subprice;
|
||||
var $remise_percent;
|
||||
var $fk_remise_except;
|
||||
public $qty;
|
||||
public $tva_tx;
|
||||
public $subprice;
|
||||
public $remise_percent;
|
||||
public $fk_remise_except;
|
||||
|
||||
var $rang = 0;
|
||||
public $rang = 0;
|
||||
|
||||
var $fk_fournprice;
|
||||
var $pa_ht;
|
||||
var $marge_tx;
|
||||
var $marque_tx;
|
||||
public $fk_fournprice;
|
||||
public $pa_ht;
|
||||
public $marge_tx;
|
||||
public $marque_tx;
|
||||
|
||||
var $special_code; // Tag for special lines (exlusive tags)
|
||||
public $special_code; // Tag for special lines (exlusive tags)
|
||||
// 1: frais de port
|
||||
// 2: ecotaxe
|
||||
// 3: option line (when qty = 0)
|
||||
|
||||
var $info_bits = 0; // Liste d'options cumulables:
|
||||
public $info_bits = 0; // Liste d'options cumulables:
|
||||
// Bit 0: 0 si TVA normal - 1 si TVA NPR
|
||||
// Bit 1: 0 ligne normale - 1 si ligne de remise fixe
|
||||
|
||||
var $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne
|
||||
var $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne
|
||||
var $total_ttc; // Total TTC de la ligne toute quantite et incluant la remise ligne
|
||||
public $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne
|
||||
public $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne
|
||||
public $total_ttc; // Total TTC de la ligne toute quantite et incluant la remise ligne
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @see $remise_percent, $fk_remise_except
|
||||
*/
|
||||
var $remise;
|
||||
public $remise;
|
||||
/**
|
||||
* @deprecated
|
||||
* @see subprice
|
||||
*/
|
||||
var $price;
|
||||
public $price;
|
||||
|
||||
// From llx_product
|
||||
/**
|
||||
* @deprecated
|
||||
* @see product_ref
|
||||
*/
|
||||
var $ref;
|
||||
public $ref;
|
||||
/**
|
||||
* Product reference
|
||||
* @var string
|
||||
@ -3717,7 +3717,7 @@ class PropaleLigne extends CommonObjectLine
|
||||
* @deprecated
|
||||
* @see product_label
|
||||
*/
|
||||
var $libelle;
|
||||
public $libelle;
|
||||
/**
|
||||
* Product label
|
||||
* @var string
|
||||
@ -3729,25 +3729,25 @@ class PropaleLigne extends CommonObjectLine
|
||||
*/
|
||||
public $product_desc;
|
||||
|
||||
var $localtax1_tx; // Local tax 1
|
||||
var $localtax2_tx; // Local tax 2
|
||||
var $localtax1_type; // Local tax 1 type
|
||||
var $localtax2_type; // Local tax 2 type
|
||||
var $total_localtax1; // Line total local tax 1
|
||||
var $total_localtax2; // Line total local tax 2
|
||||
public $localtax1_tx; // Local tax 1
|
||||
public $localtax2_tx; // Local tax 2
|
||||
public $localtax1_type; // Local tax 1 type
|
||||
public $localtax2_type; // Local tax 2 type
|
||||
public $total_localtax1; // Line total local tax 1
|
||||
public $total_localtax2; // Line total local tax 2
|
||||
|
||||
var $date_start;
|
||||
var $date_end;
|
||||
public $date_start;
|
||||
public $date_end;
|
||||
|
||||
var $skip_update_total; // Skip update price total for special lines
|
||||
public $skip_update_total; // Skip update price total for special lines
|
||||
|
||||
// Multicurrency
|
||||
var $fk_multicurrency;
|
||||
var $multicurrency_code;
|
||||
var $multicurrency_subprice;
|
||||
var $multicurrency_total_ht;
|
||||
var $multicurrency_total_tva;
|
||||
var $multicurrency_total_ttc;
|
||||
public $fk_multicurrency;
|
||||
public $multicurrency_code;
|
||||
public $multicurrency_subprice;
|
||||
public $multicurrency_total_ht;
|
||||
public $multicurrency_total_tva;
|
||||
public $multicurrency_total_ttc;
|
||||
|
||||
/**
|
||||
* Class line Contructor
|
||||
|
||||
@ -25,15 +25,14 @@ require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
|
||||
$langs->loadLangs(array("accountancy","bills"));
|
||||
$langs->loadLangs(array("accountancy", "bills", "companies"));
|
||||
|
||||
$date_start =GETPOST('date_start', 'alpha');
|
||||
$date_startDay= GETPOST('date_startday', 'int');
|
||||
@ -49,7 +48,7 @@ $date_stop=($date_stopDay)?dol_mktime(0, 0, 0, $date_stopMonth, $date_stopDay, $
|
||||
$action =GETPOST('action', 'alpha');
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('comptafileslist','globallist'));
|
||||
$hookmanager->initHooks(array('comptafileslist', 'globallist'));
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||
@ -92,7 +91,7 @@ $filesarray=array();
|
||||
$result=false;
|
||||
if(($action=="searchfiles" || $action=="dl" ) && $date_start && $date_stop) {
|
||||
$wheretail=" '".$db->idate($date_start)."' AND '".$db->idate($date_stop)."'";
|
||||
$sql="SELECT rowid as id, ref as ref,paye as paid, total_ttc, fk_soc, datef as date, 'Invoice' as item FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql="SELECT rowid as id, ref as ref, paye as paid, total_ttc, fk_soc, datef as date, 'Invoice' as item FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.=" WHERE datef between ".$wheretail;
|
||||
$sql.=" AND entity IN (".($entity==1?'0,1':$entity).')';
|
||||
$sql.=" AND fk_statut <> ".Facture::STATUS_DRAFT;
|
||||
@ -189,6 +188,7 @@ if(($action=="searchfiles" || $action=="dl" ) && $date_start && $date_stop) {
|
||||
//var_dump($upload_dir);
|
||||
if (count($files) < 1)
|
||||
{
|
||||
$nofile['id']=$objd->id;
|
||||
$nofile['date']=$db->idate($objd->date);
|
||||
$nofile['paid']=$objd->paid;
|
||||
$nofile['amount']=$objd->total_ttc;
|
||||
@ -202,6 +202,7 @@ if(($action=="searchfiles" || $action=="dl" ) && $date_start && $date_stop) {
|
||||
{
|
||||
foreach ($files as $key => $file)
|
||||
{
|
||||
$file['id']=$objd->id;
|
||||
$file['date']=$db->idate($objd->date);
|
||||
$file['paid']=$objd->paid;
|
||||
$file['amount']=$objd->total_ttc;
|
||||
@ -236,6 +237,12 @@ if(($action=="searchfiles" || $action=="dl" ) && $date_start && $date_stop) {
|
||||
|
||||
if ($result && $action == "dl")
|
||||
{
|
||||
if (! extension_loaded('zip'))
|
||||
{
|
||||
setEventMessages('PHPZIPExtentionNotLoaded', null, 'errors');
|
||||
exit;
|
||||
}
|
||||
|
||||
$dirfortmpfile = ($conf->accounting->dir_temp ? $conf->accounting->dir_temp : $conf->compta->dir_temp);
|
||||
|
||||
dol_mkdir($dirfortmpfile);
|
||||
@ -412,11 +419,11 @@ if (!empty($date_start) && !empty($date_stop))
|
||||
//if (!empty($data['fk_facture'])) $html_class = 'facid-'.$data['fk_facture'];
|
||||
//elseif (!empty($data['fk_paiement'])) $html_class = 'payid-'.$data['fk_paiement'];
|
||||
print '<tr class="oddeven '.$html_class.'">';
|
||||
print "<td align=\"center\">";
|
||||
print "<td class=\"center\">";
|
||||
print dol_print_date($data['date'], 'day');
|
||||
print "</td>\n";
|
||||
print '<td aling="left">'.$langs->trans($data['item']).'</td>';
|
||||
print '<td aling="left">'.$data['ref'].'</td>';
|
||||
print '<td class="left">'.$langs->trans($data['item']).'</td>';
|
||||
print '<td class="left">'.$data['ref'].'</td>';
|
||||
|
||||
// File link
|
||||
print '<td><a href='.DOL_URL_ROOT.'/'.$data['link'].">".$data['name']."</a></td>\n";
|
||||
|
||||
@ -1131,7 +1131,7 @@ if (empty($reshook))
|
||||
// Source facture
|
||||
$object->fac_rec = GETPOST('fac_rec', 'int');
|
||||
|
||||
$id = $object->create($user); // This include recopy of links from recurring invoice and invoice lines
|
||||
$id = $object->create($user); // This include recopy of links from recurring invoice and recurring invoice lines
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -723,7 +723,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
/*
|
||||
* Insert lines of predefined invoices
|
||||
* Insert lines of template invoices
|
||||
*/
|
||||
if (! $error && $this->fac_rec > 0)
|
||||
{
|
||||
@ -749,7 +749,32 @@ class Facture extends CommonInvoice
|
||||
$localtax1_tx = $_facrec->lines[$i]->localtax1_tx;
|
||||
$localtax2_tx = $_facrec->lines[$i]->localtax2_tx;
|
||||
|
||||
$result_insert = $this->addline(
|
||||
$fk_product_fournisseur_price = empty($_facrec->lines[$i]->fk_product_fournisseur_price)?null:$_facrec->lines[$i]->fk_product_fournisseur_price;
|
||||
$buyprice = empty($_facrec->lines[$i]->buyprice)?0:$_facrec->lines[$i]->buyprice;
|
||||
// If buyprice not defined from template invoice, we try to guess the best value
|
||||
if (! $buyprice && $_facrec->lines[$i]->fk_product > 0)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
$producttmp = new ProductFournisseur($this->db);
|
||||
$producttmp->fetch($_facrec->lines[$i]->fk_product);
|
||||
|
||||
// If margin module defined on costprice, we try the costprice
|
||||
// If not defined or if module margin defined and pmp and stock module enabled, we try pmp price
|
||||
// else we get the best supplier price
|
||||
if ($conf->global->MARGIN_TYPE == 'costprice' && ! empty($producttmp->cost_price)) $buyprice = $producttmp->cost_price;
|
||||
elseif (! empty($conf->stock->enabled) && ($conf->global->MARGIN_TYPE == 'costprice' || $conf->global->MARGIN_TYPE == 'pmp') && ! empty($producttmp->pmp)) $buyprice = $producttmp->pmp;
|
||||
else {
|
||||
if ($producttmp->find_min_price_product_fournisseur($_facrec->lines[$i]->fk_product) > 0)
|
||||
{
|
||||
if ($producttmp->product_fourn_price_id > 0)
|
||||
{
|
||||
$buyprice = price2num($producttmp->fourn_unitprice * (1 - $producttmp->fourn_remise_percent/100) + $producttmp->fourn_remise, 'MU');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$result_insert = $this->addline(
|
||||
$_facrec->lines[$i]->desc,
|
||||
$_facrec->lines[$i]->subprice,
|
||||
$_facrec->lines[$i]->qty,
|
||||
@ -771,8 +796,8 @@ class Facture extends CommonInvoice
|
||||
'',
|
||||
0,
|
||||
0,
|
||||
null,
|
||||
0,
|
||||
$fk_product_fournisseur_price,
|
||||
$buyprice,
|
||||
$_facrec->lines[$i]->label,
|
||||
empty($_facrec->lines[$i]->array_options)?null:$_facrec->lines[$i]->array_options,
|
||||
$_facrec->lines[$i]->situation_percent,
|
||||
@ -4244,7 +4269,6 @@ class Facture extends CommonInvoice
|
||||
* Checks if the invoice is the last in its cycle
|
||||
*
|
||||
* @return bool Last of the cycle status
|
||||
*
|
||||
*/
|
||||
public function is_last_in_cycle()
|
||||
{
|
||||
@ -4273,9 +4297,9 @@ class Facture extends CommonInvoice
|
||||
/**
|
||||
* Function used to replace a thirdparty id with another one.
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param int $origin_id Old thirdparty id
|
||||
* @param int $dest_id New thirdparty id
|
||||
* @param DoliDB $db Database handler
|
||||
* @param int $origin_id Old third-party id
|
||||
* @param int $dest_id New third-party id
|
||||
* @return bool
|
||||
*/
|
||||
public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id)
|
||||
@ -4365,13 +4389,13 @@ class FactureLigne extends CommonInvoiceLine
|
||||
// From llx_product
|
||||
/**
|
||||
* @deprecated
|
||||
* @see product_ref
|
||||
* @see $product_ref
|
||||
*/
|
||||
public $ref; // Product ref (deprecated)
|
||||
public $product_ref; // Product ref
|
||||
/**
|
||||
* @deprecated
|
||||
* @see product_label
|
||||
* @see $product_label
|
||||
*/
|
||||
public $libelle; // Product label (deprecated)
|
||||
public $product_label; // Product label
|
||||
|
||||
@ -252,22 +252,22 @@ if ($id > 0)
|
||||
|
||||
print '<tr class="oddeven '.$html_class.'">';
|
||||
|
||||
print "<td align=\"center\">";
|
||||
print "<td class=\"center\">";
|
||||
if (!empty($data['fk_facture'])) print dol_print_date($data['date'], 'day');
|
||||
elseif (!empty($data['fk_paiement'])) print dol_print_date($data['date'], 'dayhour');
|
||||
print "</td>\n";
|
||||
|
||||
print '<td>'.$data['link']."</td>\n";
|
||||
|
||||
print '<td aling="left">'.$data['status'].'</td>';
|
||||
print '<td class="left">'.$data['status'].'</td>';
|
||||
|
||||
print '<td class="right">'.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."</td>\n";
|
||||
|
||||
|
||||
$totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0;
|
||||
|
||||
|
||||
print '<td class="right">'.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."</td>\n";
|
||||
$totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']);
|
||||
|
||||
|
||||
// Balance
|
||||
print '<td class="right">'.price($data['balance'])."</td>\n";
|
||||
|
||||
|
||||
@ -122,14 +122,14 @@ class PaymentSocialContribution extends CommonObject
|
||||
}
|
||||
|
||||
// Clean parameters
|
||||
if (isset($this->fk_charge)) $this->fk_charge=trim($this->fk_charge);
|
||||
if (isset($this->fk_charge)) $this->fk_charge= (int) $this->fk_charge;
|
||||
if (isset($this->amount)) $this->amount=trim($this->amount);
|
||||
if (isset($this->fk_typepaiement)) $this->fk_typepaiement=trim($this->fk_typepaiement);
|
||||
if (isset($this->fk_typepaiement)) $this->fk_typepaiement= (int) $this->fk_typepaiement;
|
||||
if (isset($this->num_paiement)) $this->num_paiement=trim($this->num_paiement);
|
||||
if (isset($this->note)) $this->note=trim($this->note);
|
||||
if (isset($this->fk_bank)) $this->fk_bank=trim($this->fk_bank);
|
||||
if (isset($this->fk_user_creat)) $this->fk_user_creat=trim($this->fk_user_creat);
|
||||
if (isset($this->fk_user_modif)) $this->fk_user_modif=trim($this->fk_user_modif);
|
||||
if (isset($this->fk_bank)) $this->fk_bank= (int) $this->fk_bank;
|
||||
if (isset($this->fk_user_creat)) $this->fk_user_creat= (int) $this->fk_user_creat;
|
||||
if (isset($this->fk_user_modif)) $this->fk_user_modif= (int) $this->fk_user_modif;
|
||||
|
||||
$totalamount = 0;
|
||||
foreach ($this->amounts as $key => $value) // How payment is dispatch
|
||||
@ -299,14 +299,14 @@ class PaymentSocialContribution extends CommonObject
|
||||
|
||||
// Clean parameters
|
||||
|
||||
if (isset($this->fk_charge)) $this->fk_charge=trim($this->fk_charge);
|
||||
if (isset($this->fk_charge)) $this->fk_charge= (int) $this->fk_charge;
|
||||
if (isset($this->amount)) $this->amount=trim($this->amount);
|
||||
if (isset($this->fk_typepaiement)) $this->fk_typepaiement=trim($this->fk_typepaiement);
|
||||
if (isset($this->fk_typepaiement)) $this->fk_typepaiement= (int) $this->fk_typepaiement;
|
||||
if (isset($this->num_paiement)) $this->num_paiement=trim($this->num_paiement);
|
||||
if (isset($this->note)) $this->note=trim($this->note);
|
||||
if (isset($this->fk_bank)) $this->fk_bank=trim($this->fk_bank);
|
||||
if (isset($this->fk_user_creat)) $this->fk_user_creat=trim($this->fk_user_creat);
|
||||
if (isset($this->fk_user_modif)) $this->fk_user_modif=trim($this->fk_user_modif);
|
||||
if (isset($this->fk_bank)) $this->fk_bank= (int) $this->fk_bank;
|
||||
if (isset($this->fk_user_creat)) $this->fk_user_creat= (int) $this->fk_user_creat;
|
||||
if (isset($this->fk_user_modif)) $this->fk_user_modif= (int) $this->fk_user_modif;
|
||||
|
||||
|
||||
|
||||
@ -337,10 +337,10 @@ class PaymentSocialContribution extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if (! $notrigger)
|
||||
{
|
||||
//if (! $error)
|
||||
//{
|
||||
// if (! $notrigger)
|
||||
// {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
@ -350,8 +350,8 @@ class PaymentSocialContribution extends CommonObject
|
||||
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
}
|
||||
// }
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
@ -478,13 +478,6 @@ class PaymentSocialContribution extends CommonObject
|
||||
{
|
||||
$this->error=$object->error;
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
@ -913,6 +913,7 @@ class Contrat extends CommonObject
|
||||
$sql.= ", ".(!empty($this->ref_ext)?("'".$this->db->escape($this->ref_ext)."'"):"NULL");
|
||||
$sql.= ")";
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
if ($resql)
|
||||
{
|
||||
$error=0;
|
||||
@ -930,8 +931,8 @@ class Contrat extends CommonObject
|
||||
{
|
||||
$modCodeContract = new $module();
|
||||
|
||||
if (!empty($modCodeContract->code_auto)) {
|
||||
// Update ref
|
||||
if (! empty($modCodeContract->code_auto)) {
|
||||
// Force the ref to a draft value if numbering module is an automatic numbering
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id;
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
@ -940,9 +941,6 @@ class Contrat extends CommonObject
|
||||
$this->ref="(PROV".$this->id.")";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
$this->error='Failed to get PROV number';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
// Submit file/link
|
||||
if (GETPOST('sendit', 'alpha') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
if (! empty($_FILES))
|
||||
if (! empty($_FILES))
|
||||
{
|
||||
if (is_array($_FILES['userfile']['tmp_name'])) $userfiles=$_FILES['userfile']['tmp_name'];
|
||||
else $userfiles=array($_FILES['userfile']['tmp_name']);
|
||||
|
||||
@ -397,7 +397,8 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box
|
||||
$orders = array();
|
||||
$i = 0;
|
||||
|
||||
$dirwidget=array_merge(array('/core/boxes/'));
|
||||
//$dirwidget=array_merge(array('/core/boxes/'), $conf->modules_parts['widgets']);
|
||||
$dirwidget=array('/core/boxes/'); // $conf->modules_parts['widgets'] is not required
|
||||
if (is_array($forcedirwidget))
|
||||
{
|
||||
$dirwidget=$forcedirwidget;
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) Dan Potter
|
||||
* Copyright (C) Eric Seigne
|
||||
* Copyright (C) 2000-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) Dan Potter
|
||||
* Copyright (C) Eric Seigne
|
||||
* Copyright (C) 2000-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -1429,7 +1430,7 @@ class CMailFile
|
||||
* Return a formatted address string for SMTP protocol
|
||||
*
|
||||
* @param string $address Example: 'John Doe <john@doe.com>, Alan Smith <alan@smith.com>' or 'john@doe.com, alan@smith.com'
|
||||
* @param int $format 0=auto, 1=emails with <>, 2=emails without <>, 3=auto + label between "
|
||||
* @param int $format 0=auto, 1=emails with <>, 2=emails without <>, 3=auto + label between ", 4 label or email, 5 mailto link
|
||||
* @param int $encode 0=No encode name, 1=Encode name to RFC2822
|
||||
* @param int $maxnumberofemail 0=No limit. Otherwise, maximum number of emails returned ($address may contains several email separated with ','). Add '...' if there is more.
|
||||
* @return string If format 0: '<john@doe.com>' or 'John Doe <john@doe.com>' or '=?UTF-8?B?Sm9obiBEb2U=?= <john@doe.com>'
|
||||
@ -1437,6 +1438,7 @@ class CMailFile
|
||||
* If format 2: 'john@doe.com'
|
||||
* If format 3: '<john@doe.com>' or '"John Doe" <john@doe.com>' or '"=?UTF-8?B?Sm9obiBEb2U=?=" <john@doe.com>'
|
||||
* If format 4: 'John Doe' or 'john@doe.com' if no label exists
|
||||
* If format 5: <a href="mailto:john@doe.com">John Doe</a> or <a href="mailto:john@doe.com">john@doe.com</a> if no label exists
|
||||
*/
|
||||
public static function getValidAddress($address, $format, $encode = 0, $maxnumberofemail = 0)
|
||||
{
|
||||
@ -1466,6 +1468,10 @@ class CMailFile
|
||||
$i++;
|
||||
|
||||
$newemail='';
|
||||
if ($format == 5) {
|
||||
$newemail = $name?$name:$email;
|
||||
$newemail = '<a href="mailto:'.$email.'">'.$newemail.'</a>';
|
||||
}
|
||||
if ($format == 4)
|
||||
{
|
||||
$newemail = $name?$name:$email;
|
||||
|
||||
@ -6378,6 +6378,7 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
if (($mode == 'create' || $mode == 'edit') && abs($visibility) != 1 && abs($visibility) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
|
||||
elseif($mode == 'view' && empty($visibility)) continue;
|
||||
if (empty($perms)) continue;
|
||||
|
||||
// Load language if required
|
||||
|
||||
@ -82,7 +82,7 @@ abstract class CommonOrderLine extends CommonObjectLine
|
||||
* @deprecated
|
||||
* @see subprice
|
||||
*/
|
||||
var $price;
|
||||
public $price;
|
||||
|
||||
/**
|
||||
* Unit price before taxes
|
||||
|
||||
@ -109,7 +109,7 @@ class Ctypent // extends CommonObject
|
||||
$sql.= " ".(! isset($this->id)?'NULL':"'".$this->db->escape($this->id)."'").",";
|
||||
$sql.= " ".(! isset($this->code)?'NULL':"'".$this->db->escape($this->code)."'").",";
|
||||
$sql.= " ".(! isset($this->libelle)?'NULL':"'".$this->db->escape($this->libelle)."'").",";
|
||||
$sql.= " ".(! isset($this->active)?'NULL':"'".$this->db->active($this->active)."'").",";
|
||||
$sql.= " ".(! isset($this->active)?'NULL':"'".$this->db->escape($this->active)."'").",";
|
||||
$sql.= " ".(! isset($this->module)?'NULL':"'".$this->db->escape($this->module)."'")."";
|
||||
|
||||
|
||||
|
||||
@ -553,11 +553,11 @@ class Form
|
||||
{
|
||||
if ($type == 'info' || $type == 'help') return $text;
|
||||
}
|
||||
// If info or help with smartphone, show only text (tooltip on lick does not works with dialog on smaprtphone)
|
||||
if (! empty($conf->dol_no_mouse_hover) && ! empty($tooltiptrigger))
|
||||
{
|
||||
if ($type == 'info' || $type == 'help') return $text;
|
||||
}
|
||||
// If info or help with smartphone, show only text (tooltip on click does not works with dialog on smaprtphone)
|
||||
//if (! empty($conf->dol_no_mouse_hover) && ! empty($tooltiptrigger))
|
||||
//{
|
||||
//if ($type == 'info' || $type == 'help') return '<a href="'..'">'.$text.''</a>';
|
||||
//}
|
||||
|
||||
$img='';
|
||||
if ($type == 'info') $img = img_help(0, $alt);
|
||||
@ -2747,23 +2747,23 @@ class Form
|
||||
}
|
||||
if ($objp->quantity == 1)
|
||||
{
|
||||
$opt.= price($objp->fprice, 1, $langs, 0, 0, -1, $conf->currency)."/";
|
||||
$outval.= price($objp->fprice, 0, $langs, 0, 0, -1, $conf->currency)."/";
|
||||
$opt.= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE)?(1 - $objp->remise_percent / 100):1), 1, $langs, 0, 0, -1, $conf->currency)."/";
|
||||
$outval.= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE)?(1 - $objp->remise_percent / 100):1), 0, $langs, 0, 0, -1, $conf->currency)."/";
|
||||
$opt.= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
|
||||
$outval.=$langs->transnoentities("Unit");
|
||||
}
|
||||
else
|
||||
{
|
||||
$opt.= price($objp->fprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
|
||||
$outval.= price($objp->fprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
|
||||
$opt.= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE)?(1 - $objp->remise_percent / 100):1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
|
||||
$outval.= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE)?(1 - $objp->remise_percent / 100):1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
|
||||
$opt.= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
|
||||
$outval.= ' '.$langs->transnoentities("Units");
|
||||
}
|
||||
|
||||
if ($objp->quantity >= 1)
|
||||
{
|
||||
$opt.=" (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
|
||||
$outval.=" (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
|
||||
$opt.=" (".price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE)?(1 - $objp->remise_percent / 100):1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
|
||||
$outval.=" (".price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE)?(1 - $objp->remise_percent / 100):1), 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
|
||||
}
|
||||
if ($objp->remise_percent >= 1)
|
||||
{
|
||||
@ -2854,7 +2854,7 @@ class Form
|
||||
$langs->load('stocks');
|
||||
|
||||
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration, pfp.fk_soc,";
|
||||
$sql.= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.unitprice,";
|
||||
$sql.= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,";
|
||||
$sql.= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
|
||||
@ -2914,7 +2914,7 @@ class Form
|
||||
}
|
||||
if ($objp->quantity == 1)
|
||||
{
|
||||
$opt.= price($objp->fprice, 1, $langs, 0, 0, -1, $conf->currency)."/";
|
||||
$opt.= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE)?(1 - $objp->remise_percent / 100):1), 1, $langs, 0, 0, -1, $conf->currency)."/";
|
||||
}
|
||||
|
||||
$opt.= $objp->quantity.' ';
|
||||
@ -2930,7 +2930,7 @@ class Form
|
||||
if ($objp->quantity > 1)
|
||||
{
|
||||
$opt.=" - ";
|
||||
$opt.= price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit");
|
||||
$opt.= price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE)?(1 - $objp->remise_percent / 100):1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit");
|
||||
}
|
||||
if ($objp->duration) $opt .= " - ".$objp->duration;
|
||||
$opt .= "</option>\n";
|
||||
@ -6651,7 +6651,7 @@ class Form
|
||||
$objp = $this->db->fetch_object($resqllist);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td aling="left">';
|
||||
print '<td class="left">';
|
||||
print '<input type="radio" name="idtolinkto" value=' . $objp->rowid . '>';
|
||||
print '</td>';
|
||||
print '<td class="center">' . $objp->ref . '</td>';
|
||||
|
||||
@ -62,7 +62,9 @@ class FormAdmin
|
||||
public function select_language($selected = '', $htmlname = 'lang_id', $showauto = 0, $filter = null, $showempty = '', $showwarning = 0, $disabled = 0, $morecss = '', $showcode = 0, $forcecombo = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
global $conf, $langs;
|
||||
|
||||
if (!empty($conf->global->MAIN_DEFAULT_LANGUAGE_FILTER)) $filter[$conf->global->MAIN_DEFAULT_LANGUAGE_FILTER] = 1;
|
||||
|
||||
$langs_available=$langs->get_available_languages(DOL_DOCUMENT_ROOT, 12);
|
||||
|
||||
|
||||
@ -77,9 +77,10 @@ class FormFile
|
||||
* @param string $htmlname Name and id of HTML form ('formuserfile' by default, 'formuserfileecm' when used to upload a file in ECM)
|
||||
* @param string $accept Specifies the types of files accepted (This is not a security check but an user interface facility. eg '.pdf,image/*' or '.png,.jpg' or 'video/*')
|
||||
* @param string $sectiondir If upload must be done inside a particular directory (is sectiondir defined, sectionid must not be)
|
||||
* @param int $usewithoutform 0=Default, 1=Disable <form> and style to use in existing area
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function form_attach_new_file($url, $title = '', $addcancel = 0, $sectionid = 0, $perm = 1, $size = 50, $object = '', $options = '', $useajax = 1, $savingdocmask = '', $linkfiles = 1, $htmlname = 'formuserfile', $accept = '', $sectiondir = '')
|
||||
public function form_attach_new_file($url, $title = '', $addcancel = 0, $sectionid = 0, $perm = 1, $size = 50, $object = '', $options = '', $useajax = 1, $savingdocmask = '', $linkfiles = 1, $htmlname = 'formuserfile', $accept = '', $sectiondir = '', $usewithoutform = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs, $hookmanager;
|
||||
@ -114,10 +115,13 @@ class FormFile
|
||||
if (empty($title)) $title=$langs->trans("AttachANewFile");
|
||||
if ($title != 'none') $out.=load_fiche_titre($title, null, null);
|
||||
|
||||
$out .= '<form name="'.$htmlname.'" id="'.$htmlname.'" action="'.$url.'" enctype="multipart/form-data" method="POST">';
|
||||
$out .= '<input type="hidden" id="'.$htmlname.'_section_dir" name="section_dir" value="'.$sectiondir.'">';
|
||||
$out .= '<input type="hidden" id="'.$htmlname.'_section_id" name="section_id" value="'.$sectionid.'">';
|
||||
$out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
if (empty($usewithoutform))
|
||||
{
|
||||
$out .= '<form name="'.$htmlname.'" id="'.$htmlname.'" action="'.$url.'" enctype="multipart/form-data" method="POST">';
|
||||
$out .= '<input type="hidden" id="'.$htmlname.'_section_dir" name="section_dir" value="'.$sectiondir.'">';
|
||||
$out .= '<input type="hidden" id="'.$htmlname.'_section_id" name="section_id" value="'.$sectionid.'">';
|
||||
$out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
}
|
||||
|
||||
$out .= '<table width="100%" class="nobordernopadding">';
|
||||
$out .= '<tr>';
|
||||
@ -176,13 +180,7 @@ class FormFile
|
||||
if ($savingdocmask)
|
||||
{
|
||||
//add a global variable for disable the auto renaming on upload
|
||||
if (! empty($conf->global->MAIN_DOC_UPLOAD_NOT_RENAME_BY_DEFAULT))
|
||||
{
|
||||
$rename='';
|
||||
}
|
||||
else {
|
||||
$rename='checked';
|
||||
}
|
||||
$rename=(empty($conf->global->MAIN_DOC_UPLOAD_NOT_RENAME_BY_DEFAULT)?'checked':'');
|
||||
|
||||
$out .= '<tr>';
|
||||
if (! empty($options)) $out .= '<td>'.$options.'</td>';
|
||||
@ -194,8 +192,11 @@ class FormFile
|
||||
|
||||
$out .= "</table>";
|
||||
|
||||
$out .= '</form>';
|
||||
if (empty($sectionid)) $out .= '<br>';
|
||||
if (empty($usewithoutform))
|
||||
{
|
||||
$out .= '</form>';
|
||||
if (empty($sectionid)) $out .= '<br>';
|
||||
}
|
||||
|
||||
$out .= "\n<!-- End form attach new file -->\n";
|
||||
|
||||
@ -205,12 +206,16 @@ class FormFile
|
||||
$langs->load('link');
|
||||
$title = $langs->trans("LinkANewFile");
|
||||
$out .= load_fiche_titre($title, null, null);
|
||||
$out .= '<form name="'.$htmlname.'_link" id="'.$htmlname.'_link" action="'.$url.'" method="POST">';
|
||||
$out .= '<input type="hidden" id="'.$htmlname.'_link_section_dir" name="link_section_dir" value="">';
|
||||
$out .= '<input type="hidden" id="'.$htmlname.'_link_section_id" name="link_section_id" value="'.$sectionid.'">';
|
||||
$out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
$out .= '<div class="valignmiddle" >';
|
||||
if (empty($usewithoutform))
|
||||
{
|
||||
$out .= '<form name="'.$htmlname.'_link" id="'.$htmlname.'_link" action="'.$url.'" method="POST">';
|
||||
$out .= '<input type="hidden" id="'.$htmlname.'_link_section_dir" name="link_section_dir" value="">';
|
||||
$out .= '<input type="hidden" id="'.$htmlname.'_link_section_id" name="link_section_id" value="'.$sectionid.'">';
|
||||
$out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
}
|
||||
|
||||
$out .= '<div class="valignmiddle">';
|
||||
$out .= '<div class="inline-block" style="padding-right: 10px;">';
|
||||
if (! empty($conf->global->OPTIMIZEFORTEXTBROWSER)) $out .= '<label for="link">'.$langs->trans("URLToLink") . ':</label> ';
|
||||
$out .= '<input type="text" name="link" class="flat minwidth400imp" id="link" placeholder="'.dol_escape_htmltag($langs->trans("URLToLink")).'">';
|
||||
@ -227,8 +232,11 @@ class FormFile
|
||||
$out .= '>';
|
||||
$out .= '</div>';
|
||||
$out .= '</div>';
|
||||
$out .= '<div class="clearboth"></div>';
|
||||
$out .= '</form><br>';
|
||||
if (empty($usewithoutform))
|
||||
{
|
||||
$out .= '<div class="clearboth"></div>';
|
||||
$out .= '</form><br>';
|
||||
}
|
||||
|
||||
$out .= "\n<!-- End form link new url -->\n";
|
||||
}
|
||||
@ -237,7 +245,7 @@ class FormFile
|
||||
$res = $hookmanager->executeHooks('formattachOptions', $parameters, $object);
|
||||
if (empty($res))
|
||||
{
|
||||
print '<div class="attacharea attacharea'.$htmlname.'">';
|
||||
print '<div class="'.($usewithoutform?'inline-block valignmiddle':'attacharea attacharea'.$htmlname).'">';
|
||||
print $out;
|
||||
print '</div>';
|
||||
}
|
||||
@ -682,6 +690,7 @@ class FormFile
|
||||
// Model
|
||||
if (! empty($modellist))
|
||||
{
|
||||
asort($modellist);
|
||||
$out.= '<span class="hideonsmartphone">'.$langs->trans('Model').' </span>';
|
||||
if (is_array($modellist) && count($modellist) == 1) // If there is only one element
|
||||
{
|
||||
|
||||
@ -29,9 +29,9 @@
|
||||
*/
|
||||
abstract class Stats
|
||||
{
|
||||
protected $db;
|
||||
var $_lastfetchdate=array(); // Dates of cache file read by methods
|
||||
var $cachefilesuffix=''; // Suffix to add to name of cache file (to avoid file name conflicts)
|
||||
protected $db;
|
||||
protected $lastfetchdate=array(); // Dates of cache file read by methods
|
||||
public $cachefilesuffix=''; // Suffix to add to name of cache file (to avoid file name conflicts)
|
||||
|
||||
/**
|
||||
* Return nb of elements by month for several years
|
||||
@ -70,7 +70,7 @@ abstract class Stats
|
||||
{
|
||||
$foundintocache=1;
|
||||
|
||||
$this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$filedate;
|
||||
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__]=$filedate;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -117,7 +117,7 @@ abstract class Stats
|
||||
if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK;
|
||||
@chmod($newpathofdestfile, octdec($newmask));
|
||||
|
||||
$this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$nowgmt;
|
||||
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__]=$nowgmt;
|
||||
}
|
||||
|
||||
// return array(array('Month',val1,val2,val3),...)
|
||||
@ -164,7 +164,7 @@ abstract class Stats
|
||||
{
|
||||
$foundintocache=1;
|
||||
|
||||
$this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$filedate;
|
||||
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__]=$filedate;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -215,7 +215,7 @@ abstract class Stats
|
||||
@chmod($newpathofdestfile, octdec($newmask));
|
||||
}
|
||||
else dol_syslog("Failed to write cache file", LOG_ERR);
|
||||
$this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$nowgmt;
|
||||
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__]=$nowgmt;
|
||||
}
|
||||
|
||||
return $data;
|
||||
@ -290,7 +290,7 @@ abstract class Stats
|
||||
{
|
||||
$foundintocache=1;
|
||||
|
||||
$this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$filedate;
|
||||
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__]=$filedate;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -323,7 +323,7 @@ abstract class Stats
|
||||
if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK;
|
||||
@chmod($newpathofdestfile, octdec($newmask));
|
||||
}
|
||||
$this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$nowgmt;
|
||||
$this->lastfetchdate[get_class($this).'_'.__FUNCTION__]=$nowgmt;
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
||||
@ -171,7 +171,7 @@ class Translate
|
||||
* @param int $forcelangdir To force a different lang directory
|
||||
* @param int $loadfromfileonly 1=Do not load overwritten translation from file or old conf.
|
||||
* @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK
|
||||
* @see loadLangs
|
||||
* @see loadLangs()
|
||||
*/
|
||||
public function load($domain, $alt = 0, $stopafterdirection = 0, $forcelangdir = '', $loadfromfileonly = 0)
|
||||
{
|
||||
@ -831,12 +831,12 @@ class Translate
|
||||
* same number (this module is not provided by default as it use non GPL source code).
|
||||
*
|
||||
* @param int $number Number to encode in full text
|
||||
* @param int $isamount 1=It's an amount, 0=it's just a number
|
||||
* @param string $isamount ''=it's just a number, '1'=It's an amount (default currency), 'currencycode'=It's an amount (foreign currency)
|
||||
* @return string Label translated in UTF8 (but without entities)
|
||||
* 10 if setDefaultLang was en_US => ten
|
||||
* 123 if setDefaultLang was fr_FR => cent vingt trois
|
||||
*/
|
||||
public function getLabelFromNumber($number, $isamount = 0)
|
||||
public function getLabelFromNumber($number, $isamount = '')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -877,7 +877,7 @@ class Translate
|
||||
* @param string $keyforselect Use another value than the translation key for the where into select
|
||||
* @param int $filteronentity Use a filter on entity
|
||||
* @return string Label in UTF8 (but without entities)
|
||||
* @see dol_getIdFromCode
|
||||
* @see dol_getIdFromCode()
|
||||
*/
|
||||
public function getLabelFromKey($db, $key, $tablename, $fieldkey, $fieldlabel, $keyforselect = '', $filteronentity = 0)
|
||||
{
|
||||
|
||||
@ -257,6 +257,7 @@ class DoliDBMysqli extends DoliDB
|
||||
$query = trim($query);
|
||||
|
||||
if (! in_array($query, array('BEGIN','COMMIT','ROLLBACK'))) dol_syslog('sql='.$query, LOG_DEBUG);
|
||||
if (empty($query)) return false; // Return false = error if empty request
|
||||
|
||||
if (! $this->database_name)
|
||||
{
|
||||
|
||||
@ -43,37 +43,40 @@ else header('Cache-Control: no-cache');
|
||||
|
||||
|
||||
// Wrapper to show tooltips (html or onclick popup)
|
||||
print "\n/* JS CODE TO ENABLE Tooltips on all object with class classfortooltip */\n";
|
||||
print "jQuery(document).ready(function () {\n";
|
||||
|
||||
if (empty($conf->dol_no_mouse_hover))
|
||||
{
|
||||
print "\n/* JS CODE TO ENABLE Tooltips on all object with class classfortooltip */\n";
|
||||
print '
|
||||
jQuery(document).ready(function () {
|
||||
jQuery(".classfortooltip").tooltip({
|
||||
show: { collision: "flipfit", effect:\'toggle\', delay:50 },
|
||||
hide: { delay: 50 },
|
||||
tooltipClass: "mytooltip",
|
||||
content: function () {
|
||||
return $(this).prop(\'title\'); /* To force to get title as is */
|
||||
}
|
||||
});
|
||||
jQuery(".classfortooltiponclicktext").dialog(
|
||||
{ closeOnEscape: true, classes: { "ui-dialog": "highlight" },
|
||||
maxHeight: window.innerHeight-60, width: '.($conf->browser->layout == 'phone' ? 400 : 700).',
|
||||
modal: true,
|
||||
autoOpen: false }).css("z-index: 5000");
|
||||
jQuery(".classfortooltiponclick").click(function () {
|
||||
console.log("We click on tooltip for element with dolid="+$(this).attr(\'dolid\'));
|
||||
if ($(this).attr(\'dolid\'))
|
||||
{
|
||||
obj=$("#idfortooltiponclick_"+$(this).attr(\'dolid\')); /* obj is a div component */
|
||||
obj.dialog("open");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
' . "\n";
|
||||
print 'jQuery(".classfortooltip").tooltip({
|
||||
show: { collision: "flipfit", effect:\'toggle\', delay:50 },
|
||||
hide: { delay: 50 },
|
||||
tooltipClass: "mytooltip",
|
||||
content: function () {
|
||||
return $(this).prop(\'title\'); /* To force to get title as is */
|
||||
}
|
||||
});'."\n";
|
||||
}
|
||||
|
||||
print '
|
||||
jQuery(".classfortooltiponclicktext").dialog(
|
||||
{ closeOnEscape: true, classes: { "ui-dialog": "highlight" },
|
||||
maxHeight: window.innerHeight-60, width: '.($conf->browser->layout == 'phone' ? max($_SESSION['dol_screenwidth']-20, 320) : 700).',
|
||||
modal: true,
|
||||
autoOpen: false }).css("z-index: 5000");
|
||||
jQuery(".classfortooltiponclick").click(function () {
|
||||
console.log("We click on tooltip for element with dolid="+$(this).attr(\'dolid\'));
|
||||
if ($(this).attr(\'dolid\'))
|
||||
{
|
||||
obj=$("#idfortooltiponclick_"+$(this).attr(\'dolid\')); /* obj is a div component */
|
||||
obj.dialog("open");
|
||||
return false;
|
||||
}
|
||||
});'."\n";
|
||||
|
||||
print "});\n";
|
||||
|
||||
|
||||
// Wrapper to manage dropdown
|
||||
if (! defined('JS_JQUERY_DISABLE_DROPDOWN'))
|
||||
{
|
||||
|
||||
@ -816,7 +816,7 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton,
|
||||
|
||||
|
||||
/**
|
||||
* Function to output a dialog bog for copy/paste
|
||||
* Function to output a dialog box for copy/paste
|
||||
*
|
||||
* @param string text Text to put into copy/paste area
|
||||
* @param string text2 Text to put under the copy/paste area
|
||||
|
||||
@ -145,7 +145,7 @@ function length_accounta($accounta)
|
||||
* @param string $period Period of report
|
||||
* @param string $periodlink Link to switch period
|
||||
* @param string $description Description
|
||||
* @param timestamp|integer $builddate Date generation
|
||||
* @param integer $builddate Date of generation
|
||||
* @param string $exportlink Link for export or ''
|
||||
* @param array $moreparam Array with list of params to add into form
|
||||
* @param string $calcmode Calculation mode
|
||||
|
||||
@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
|
||||
*
|
||||
* @param array $versionarray Tableau de version (vermajeur,vermineur,autre)
|
||||
* @return string Chaine version
|
||||
* @see versioncompare
|
||||
* @see versioncompare()
|
||||
*/
|
||||
function versiontostring($versionarray)
|
||||
{
|
||||
@ -55,7 +55,7 @@ function versiontostring($versionarray)
|
||||
* @return int -4,-3,-2,-1 if versionarray1<versionarray2 (value depends on level of difference)
|
||||
* 0 if same
|
||||
* 1,2,3,4 if versionarray1>versionarray2 (value depends on level of difference)
|
||||
* @see versiontostring
|
||||
* @see versiontostring()
|
||||
*/
|
||||
function versioncompare($versionarray1, $versionarray2)
|
||||
{
|
||||
@ -432,7 +432,7 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle
|
||||
* @param int $entity Multi company id, -1 for all entities
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*
|
||||
* @see dolibarr_get_const, dolibarr_set_const, dol_set_user_param
|
||||
* @see dolibarr_get_const(), dolibarr_set_const(), dol_set_user_param()
|
||||
*/
|
||||
function dolibarr_del_const($db, $name, $entity = 1)
|
||||
{
|
||||
@ -472,7 +472,7 @@ function dolibarr_del_const($db, $name, $entity = 1)
|
||||
* @param int $entity Multi company id
|
||||
* @return string Valeur de la constante
|
||||
*
|
||||
* @see dolibarr_del_const, dolibarr_set_const, dol_set_user_param
|
||||
* @see dolibarr_del_const(), dolibarr_set_const(), dol_set_user_param()
|
||||
*/
|
||||
function dolibarr_get_const($db, $name, $entity = 1)
|
||||
{
|
||||
@ -507,7 +507,7 @@ function dolibarr_get_const($db, $name, $entity = 1)
|
||||
* @param int $entity Multi company id (0 means all entities)
|
||||
* @return int -1 if KO, 1 if OK
|
||||
*
|
||||
* @see dolibarr_del_const, dolibarr_get_const, dol_set_user_param
|
||||
* @see dolibarr_del_const(), dolibarr_get_const(), dol_set_user_param()
|
||||
*/
|
||||
function dolibarr_set_const($db, $name, $value, $type = 'chaine', $visible = 0, $note = '', $entity = 1)
|
||||
{
|
||||
|
||||
@ -369,7 +369,7 @@ function ajax_dialog($title, $message, $w = 350, $h = 150)
|
||||
* @param int $forcefocus Force focus on field
|
||||
* @param string $widthTypeOfAutocomplete 'resolve' or 'off'
|
||||
* @return string Return html string to convert a select field into a combo, or '' if feature has been disabled for some reason.
|
||||
* @see selectArrayAjax of html.form.class
|
||||
* @see selectArrayAjax() of html.form.class
|
||||
*/
|
||||
function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete = 0, $forcefocus = 0, $widthTypeOfAutocomplete = 'resolve')
|
||||
{
|
||||
|
||||
@ -149,7 +149,7 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit)
|
||||
* @param int $iMinutes Minutes
|
||||
* @param int $iSeconds Seconds
|
||||
* @return int Time into seconds
|
||||
* @see convertSecondToTime
|
||||
* @see convertSecondToTime()
|
||||
*/
|
||||
function convertTime2Seconds($iHours = 0, $iMinutes = 0, $iSeconds = 0)
|
||||
{
|
||||
@ -177,7 +177,7 @@ function convertTime2Seconds($iHours = 0, $iMinutes = 0, $iSeconds = 0)
|
||||
* @param int $lengthOfWeek Length of week (default 7)
|
||||
* @return string Formated text of duration
|
||||
* Example: 0 return 00:00, 3600 return 1:00, 86400 return 1d, 90000 return 1 Day 01:00
|
||||
* @see convertTime2Seconds
|
||||
* @see convertTime2Seconds()
|
||||
*/
|
||||
function convertSecondToTime($iSecond, $format = 'all', $lengthOfDay = 86400, $lengthOfWeek = 7)
|
||||
{
|
||||
@ -325,7 +325,7 @@ function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date)
|
||||
* @return int Date as a timestamp
|
||||
* 19700101020000 -> 7200 with gm=1
|
||||
*
|
||||
* @see dol_print_date, dol_mktime, dol_getdate
|
||||
* @see dol_print_date(), dol_mktime(), dol_getdate()
|
||||
*/
|
||||
function dol_stringtotime($string, $gm = 1)
|
||||
{
|
||||
@ -603,7 +603,7 @@ function dol_get_first_day_week($day, $month, $year, $gm = false)
|
||||
* @param string $countrycode Country code
|
||||
* @param int $lastday Last day is included, 0: no, 1:yes
|
||||
* @return int Nombre de jours feries
|
||||
* @see num_between_day, num_open_day
|
||||
* @see num_between_day(), num_open_day()
|
||||
*/
|
||||
function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR', $lastday = 0)
|
||||
{
|
||||
@ -809,7 +809,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR',
|
||||
// Easter sunday
|
||||
|
||||
// Monday after easter
|
||||
$date_eastermonday = mktime(
|
||||
$date_eastermonday = mktime(
|
||||
date("H", $date_paques),
|
||||
date("i", $date_paques),
|
||||
date("s", $date_paques),
|
||||
@ -895,7 +895,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR',
|
||||
* @param int $timestampEnd Timestamp end UTC
|
||||
* @param int $lastday Last day is included, 0: no, 1:yes
|
||||
* @return int Number of days
|
||||
* @see also num_public_holiday, num_open_day
|
||||
* @seealso num_public_holiday(), num_open_day()
|
||||
*/
|
||||
function num_between_day($timestampStart, $timestampEnd, $lastday = 0)
|
||||
{
|
||||
@ -925,7 +925,7 @@ function num_between_day($timestampStart, $timestampEnd, $lastday = 0)
|
||||
* @param int $halfday Tag to define half day when holiday start and end
|
||||
* @param string $country_code Country code (company country code if not defined)
|
||||
* @return int Number of days or hours
|
||||
* @see also num_between_day, num_public_holiday
|
||||
* @seealso num_between_day(), num_public_holiday()
|
||||
*/
|
||||
function num_open_day($timestampStart, $timestampEnd, $inhour = 0, $lastday = 0, $halfday = 0, $country_code = '')
|
||||
{
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
/**
|
||||
* Return line description translated in outputlangs and encoded into UTF8
|
||||
*
|
||||
* @param Line $line Current line number (0 = first line, 1 = second line, ...)
|
||||
* @param Object $line Object of line
|
||||
* @param Translate $outputlangs Object langs for output
|
||||
* @param int $hideref Hide reference
|
||||
* @param int $hidedesc Hide description
|
||||
|
||||
@ -43,7 +43,7 @@ function donation_admin_prepare_head()
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'donation_admin');
|
||||
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT . '/don/admin/donation_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFields");
|
||||
$head[$h][2] = 'attributes';
|
||||
@ -57,7 +57,7 @@ function donation_admin_prepare_head()
|
||||
/**
|
||||
* Prepare array with list of tabs
|
||||
*
|
||||
* @param Donation $object Donation
|
||||
* @param Don $object Donation
|
||||
* @return array Array of tabs to show
|
||||
*/
|
||||
function donation_prepare_head($object)
|
||||
@ -97,7 +97,7 @@ function donation_prepare_head($object)
|
||||
if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>';
|
||||
$head[$h][2] = 'note';
|
||||
$h++;
|
||||
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT . '/don/info.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("Info");
|
||||
$head[$h][2] = 'info';
|
||||
|
||||
@ -55,7 +55,7 @@ function dol_basename($pathfile)
|
||||
* @param string $relativename For recursive purpose only. Must be "" at first call.
|
||||
* @param string $donotfollowsymlinks Do not follow symbolic links
|
||||
* @return array Array of array('name'=>'xxx','fullname'=>'/abc/xxx','date'=>'yyy','size'=>99,'type'=>'dir|file',...)
|
||||
* @see dol_dir_list_indatabase
|
||||
* @see dol_dir_list_in_database()
|
||||
*/
|
||||
function dol_dir_list($path, $types = "all", $recursive = 0, $filter = "", $excludefilter = null, $sortcriteria = "name", $sortorder = SORT_ASC, $mode = 0, $nohook = 0, $relativename = "", $donotfollowsymlinks = 0)
|
||||
{
|
||||
@ -225,7 +225,7 @@ function dol_dir_list($path, $types = "all", $recursive = 0, $filter = "", $excl
|
||||
* @param string $sortorder Sort order (SORT_ASC, SORT_DESC)
|
||||
* @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like description
|
||||
* @return array Array of array('name'=>'xxx','fullname'=>'/abc/xxx','type'=>'dir|file',...)
|
||||
* @see dol_dir_list
|
||||
* @see dol_dir_list()
|
||||
*/
|
||||
function dol_dir_list_in_database($path, $filter = "", $excludefilter = null, $sortcriteria = "name", $sortorder = SORT_ASC, $mode = 0)
|
||||
{
|
||||
@ -443,6 +443,18 @@ function dol_is_dir($folder)
|
||||
else return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if path is empty
|
||||
*
|
||||
* @param string $dir Path of Directory
|
||||
* @return boolean True or false
|
||||
*/
|
||||
function dol_is_dir_empty($dir)
|
||||
{
|
||||
if (!is_readable($dir)) return false;
|
||||
return (count(scandir($dir)) == 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if path is a file
|
||||
*
|
||||
@ -516,7 +528,7 @@ function dol_dir_is_emtpy($folder)
|
||||
*
|
||||
* @param string $file Filename
|
||||
* @return int <0 if KO, Number of lines in files if OK
|
||||
* @see dol_nboflines
|
||||
* @see dol_nboflines()
|
||||
*/
|
||||
function dol_count_nb_of_line($file)
|
||||
{
|
||||
@ -577,7 +589,7 @@ function dol_filemtime($pathoffile)
|
||||
* @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666'
|
||||
* @param int $indexdatabase 1=index new file into database.
|
||||
* @return int <0 if error, 0 if nothing done (dest file already exists), >0 if OK
|
||||
* @see dol_copy dolReplaceRegExInFile
|
||||
* @see dol_copy() dolReplaceRegExInFile()
|
||||
*/
|
||||
function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask = 0, $indexdatabase = 0)
|
||||
{
|
||||
@ -647,7 +659,7 @@ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask
|
||||
* @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666'
|
||||
* @param int $indexdatabase Index new file into database.
|
||||
* @return int <0 if error, 0 if nothing done (dest file already exists), >0 if OK
|
||||
* @see dol_copy dolReplaceInFile
|
||||
* @see dol_copy() dolReplaceInFile()
|
||||
*/
|
||||
function dolReplaceRegExInFile($srcfile, $arrayreplacement, $destfile = '', $newmask = 0, $indexdatabase = 0)
|
||||
{
|
||||
@ -662,7 +674,7 @@ function dolReplaceRegExInFile($srcfile, $arrayreplacement, $destfile = '', $new
|
||||
* @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666'
|
||||
* @param int $overwriteifexists Overwrite file if exists (1 by default)
|
||||
* @return int <0 if error, 0 if nothing done (dest file already exists and overwriteifexists=0), >0 if OK
|
||||
* @see dol_delete_file
|
||||
* @see dol_delete_file() dolCopyDir()
|
||||
*/
|
||||
function dol_copy($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1)
|
||||
{
|
||||
@ -718,7 +730,7 @@ function dol_copy($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1)
|
||||
* @param int $overwriteifexists Overwrite file if exists (1 by default)
|
||||
* @param array $arrayreplacement Array to use to replace filenames with another one during the copy (works only on file names, not on directory names).
|
||||
* @return int <0 if error, 0 if nothing done (all files already exists and overwriteifexists=0), >0 if OK
|
||||
* @see dol_copy
|
||||
* @see dol_copy()
|
||||
*/
|
||||
function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayreplacement = null)
|
||||
{
|
||||
@ -810,7 +822,7 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayrep
|
||||
* @param int $testvirus Do an antivirus test. Move is canceled if a virus is found.
|
||||
* @param int $indexdatabase Index new file into database.
|
||||
* @return boolean True if OK, false if KO
|
||||
* @see dol_move_uploaded_file
|
||||
* @see dol_move_uploaded_file()
|
||||
*/
|
||||
function dol_move($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $testvirus = 0, $indexdatabase = 1)
|
||||
{
|
||||
@ -992,7 +1004,7 @@ function dolCheckVirus($src_file)
|
||||
* @param int $nohook Disable all hooks
|
||||
* @param string $varfiles _FILES var name
|
||||
* @return int >0 if OK, <0 or string if KO
|
||||
* @see dol_move
|
||||
* @see dol_move()
|
||||
*/
|
||||
function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan = 0, $uploaderrorcode = 0, $nohook = 0, $varfiles = 'addedfile')
|
||||
{
|
||||
@ -1046,7 +1058,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
|
||||
$checkvirusarray=dolCheckVirus($src_file);
|
||||
if (count($checkvirusarray))
|
||||
{
|
||||
dol_syslog('Files.lib::dol_move_uploaded_file File "'.$src_file.'" (target name "'.$dest_file.'") KO with antivirus: result='.$result.' errors='.join(',', $checkvirusarray), LOG_WARNING);
|
||||
dol_syslog('Files.lib::dol_move_uploaded_file File "'.$src_file.'" (target name "'.$dest_file.'") KO with antivirus: errors='.join(',', $checkvirusarray), LOG_WARNING);
|
||||
return 'ErrorFileIsInfectedWithAVirus: '.join(',', $checkvirusarray);
|
||||
}
|
||||
}
|
||||
@ -1135,7 +1147,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
|
||||
* @param boolean $allowdotdot Allow to delete file path with .. inside. Never use this, it is reserved for migration purpose.
|
||||
* @param int $indexdatabase Try to remove also index entries.
|
||||
* @return boolean True if no error (file is deleted or if glob is used and there's nothing to delete), False if error
|
||||
* @see dol_delete_dir
|
||||
* @see dol_delete_dir()
|
||||
*/
|
||||
function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0, $object = null, $allowdotdot = false, $indexdatabase = 1)
|
||||
{
|
||||
@ -1245,7 +1257,7 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0,
|
||||
* @param string $dir Directory to delete
|
||||
* @param int $nophperrors Disable all PHP output errors
|
||||
* @return boolean True if success, false if error
|
||||
* @see dol_delete_file dol_copy
|
||||
* @see dol_delete_file() dolCopyDir()
|
||||
*/
|
||||
function dol_delete_dir($dir, $nophperrors = 0)
|
||||
{
|
||||
@ -1320,7 +1332,7 @@ function dol_delete_dir_recursive($dir, $count = 0, $nophperrors = 0, $onlysub =
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return int 0 if error, 1 if OK
|
||||
* @see dol_convert_file
|
||||
* @see dol_convert_file()
|
||||
*/
|
||||
function dol_delete_preview($object)
|
||||
{
|
||||
@ -2105,7 +2117,7 @@ function dol_most_recent_file($dir, $regexfilter = '', $excludefilter = array('(
|
||||
* @param string $refname Ref of object to check permission for external users (autodetect if not provided)
|
||||
* @param string $mode Check permission for 'read' or 'write'
|
||||
* @return mixed Array with access information : 'accessallowed' & 'sqlprotectagainstexternals' & 'original_file' (as a full path name)
|
||||
* @see restrictedArea
|
||||
* @see restrictedArea()
|
||||
*/
|
||||
function dol_check_secure_access_document($modulepart, $original_file, $entity, $fuser = '', $refname = '', $mode = 'read')
|
||||
{
|
||||
@ -2124,6 +2136,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
||||
if ($modulepart == 'users') $modulepart='user';
|
||||
|
||||
dol_syslog('modulepart='.$modulepart.' original_file='.$original_file.' entity='.$entity);
|
||||
|
||||
// We define $accessallowed and $sqlprotectagainstexternals
|
||||
$accessallowed=0;
|
||||
$sqlprotectagainstexternals='';
|
||||
@ -2132,8 +2145,6 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
||||
// Find the subdirectory name as the reference. For exemple original_file='10/myfile.pdf' -> refname='10'
|
||||
if (empty($refname)) $refname=basename(dirname($original_file)."/");
|
||||
|
||||
$relative_original_file = $original_file;
|
||||
|
||||
// Define possible keys to use for permission check
|
||||
$lire='lire'; $read='read'; $download='download';
|
||||
if ($mode == 'write')
|
||||
@ -2654,7 +2665,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
||||
}
|
||||
if (! empty($conf->productbatch->enabled)) $original_file=$conf->productbatch->multidir_output[$entity].'/'.$original_file;
|
||||
}
|
||||
|
||||
|
||||
// Wrapping for stock movements
|
||||
elseif ($modulepart == 'movement' || $modulepart == 'mouvement')
|
||||
{
|
||||
|
||||
@ -784,7 +784,7 @@ function dol_size($size, $type = '')
|
||||
* @param int $unaccent 1=Remove also accent (default), 0 do not remove them
|
||||
* @return string String cleaned (a-zA-Z_)
|
||||
*
|
||||
* @see dol_string_nospecial, dol_string_unaccent, dol_sanitizePathName
|
||||
* @see dol_string_nospecial(), dol_string_unaccent(), dol_sanitizePathName()
|
||||
*/
|
||||
function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1)
|
||||
{
|
||||
@ -800,7 +800,7 @@ function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1)
|
||||
* @param int $unaccent 1=Remove also accent (default), 0 do not remove them
|
||||
* @return string String cleaned (a-zA-Z_)
|
||||
*
|
||||
* @see dol_string_nospecial, dol_string_unaccent, dol_sanitizeFileName
|
||||
* @see dol_string_nospecial(), dol_string_unaccent(), dol_sanitizeFileName()
|
||||
*/
|
||||
function dol_sanitizePathName($str, $newstr = '_', $unaccent = 1)
|
||||
{
|
||||
@ -814,7 +814,7 @@ function dol_sanitizePathName($str, $newstr = '_', $unaccent = 1)
|
||||
* @param string $str String to clean
|
||||
* @return string Cleaned string
|
||||
*
|
||||
* @see dol_sanitizeFilename, dol_string_nospecial
|
||||
* @see dol_sanitizeFilename(), dol_string_nospecial()
|
||||
*/
|
||||
function dol_string_unaccent($str)
|
||||
{
|
||||
@ -872,7 +872,7 @@ $string = strtr(
|
||||
* @param array $badcharstoreplace List of forbidden characters
|
||||
* @return string Cleaned string
|
||||
*
|
||||
* @see dol_sanitizeFilename, dol_string_unaccent
|
||||
* @see dol_sanitizeFilename(), dol_string_unaccent()
|
||||
*/
|
||||
function dol_string_nospecial($str, $newstr = '_', $badcharstoreplace = '')
|
||||
{
|
||||
@ -925,7 +925,7 @@ function dol_escape_js($stringtoescape, $mode = 0, $noescapebackslashn = 0)
|
||||
* @param int $keepb 1=Preserve b tags (otherwise, remove them)
|
||||
* @param int $keepn 1=Preserve \r\n strings (otherwise, replace them with escaped value)
|
||||
* @return string Escaped string
|
||||
* @see dol_string_nohtmltag, dol_string_nospecial, dol_string_unaccent
|
||||
* @see dol_string_nohtmltag(), dol_string_nospecial(), dol_string_unaccent()
|
||||
*/
|
||||
function dol_escape_htmltag($stringtoescape, $keepb = 0, $keepn = 0)
|
||||
{
|
||||
@ -1604,7 +1604,7 @@ function dol_bc($var, $moreclass = '')
|
||||
* @param Translate $outputlangs Object lang that contains language for text translation.
|
||||
* @param int $mode 0=Standard output, 1=Remove address
|
||||
* @return string Formated string
|
||||
* @see dol_print_address
|
||||
* @see dol_print_address()
|
||||
*/
|
||||
function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs = '', $mode = 0)
|
||||
{
|
||||
@ -1707,7 +1707,7 @@ function dol_strftime($fmt, $ts = false, $is_gmt = false)
|
||||
* @param boolean $encodetooutput false=no convert into output pagecode
|
||||
* @return string Formated date or '' if time is null
|
||||
*
|
||||
* @see dol_mktime, dol_stringtotime, dol_getdate
|
||||
* @see dol_mktime(), dol_stringtotime(), dol_getdate()
|
||||
*/
|
||||
function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlangs = '', $encodetooutput = false)
|
||||
{
|
||||
@ -1884,7 +1884,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang
|
||||
* 'yday' => floor($secsInYear/$_day_power),
|
||||
* 'leap' => $leaf,
|
||||
* 'ndays' => $ndays
|
||||
* @see dol_print_date, dol_stringtotime, dol_mktime
|
||||
* @see dol_print_date(), dol_stringtotime(), dol_mktime()
|
||||
*/
|
||||
function dol_getdate($timestamp, $fast = false)
|
||||
{
|
||||
@ -1923,7 +1923,7 @@ function dol_getdate($timestamp, $fast = false)
|
||||
* 'tz,TimeZone' = use specified timezone
|
||||
* @param int $check 0=No check on parameters (Can use day 32, etc...)
|
||||
* @return int|string Date as a timestamp, '' or false if error
|
||||
* @see dol_print_date, dol_stringtotime, dol_getdate
|
||||
* @see dol_print_date(), dol_stringtotime(), dol_getdate()
|
||||
*/
|
||||
function dol_mktime($hour, $minute, $second, $month, $day, $year, $gm = false, $check = 1)
|
||||
{
|
||||
@ -2711,7 +2711,7 @@ function dol_user_country()
|
||||
* @param int $noprint No output. Result is the function return
|
||||
* @param string $charfornl Char to use instead of nl2br. '' means we use a standad nl2br.
|
||||
* @return string|void Nothing if noprint is 0, formatted address if noprint is 1
|
||||
* @see dol_format_address
|
||||
* @see dol_format_address()
|
||||
*/
|
||||
function dol_print_address($address, $htmlid, $mode, $id, $noprint = 0, $charfornl = '')
|
||||
{
|
||||
@ -3614,30 +3614,6 @@ function img_mime($file, $titlealt = '', $morecss = '')
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show phone logo.
|
||||
* Use img_picto instead.
|
||||
*
|
||||
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
|
||||
* @param int $option Option
|
||||
* @return string Return img tag
|
||||
* @deprecated
|
||||
* @see img_picto
|
||||
*/
|
||||
function img_phone($titlealt = 'default', $option = 0)
|
||||
{
|
||||
dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING);
|
||||
|
||||
global $conf,$langs;
|
||||
|
||||
if ($titlealt == 'default') $titlealt = $langs->trans('Call');
|
||||
|
||||
if ($option == 1) $img = 'call';
|
||||
else $img = 'call_out';
|
||||
|
||||
return img_picto($titlealt, $img);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show search logo
|
||||
*
|
||||
@ -3713,7 +3689,7 @@ function info_admin($text, $infoonimgalt = 0, $nodiv = 0, $admin = '1', $morecss
|
||||
* @param mixed $error String or array of errors strings to show
|
||||
* @param array $errors Array of errors
|
||||
* @return void
|
||||
* @see dol_htmloutput_errors
|
||||
* @see dol_htmloutput_errors()
|
||||
*/
|
||||
function dol_print_error($db = '', $error = '', $errors = null)
|
||||
{
|
||||
@ -4009,7 +3985,7 @@ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin
|
||||
* @param string $title Title to show
|
||||
* @return string Title to show
|
||||
* @deprecated Use load_fiche_titre instead
|
||||
* @see load_fiche_titre
|
||||
* @see load_fiche_titre()
|
||||
*/
|
||||
function print_titre($title)
|
||||
{
|
||||
@ -4045,7 +4021,7 @@ function print_fiche_titre($title, $mesg = '', $picto = 'title_generic.png', $pi
|
||||
* @param string $morecssontable More css on table
|
||||
* @param string $morehtmlcenter Added message to show on center
|
||||
* @return string
|
||||
* @see print_barre_liste
|
||||
* @see print_barre_liste()
|
||||
*/
|
||||
function load_fiche_titre($titre, $morehtmlright = '', $picto = 'title_generic.png', $pictoisfullpath = 0, $id = '', $morecssontable = '', $morehtmlcenter = '')
|
||||
{
|
||||
@ -4431,7 +4407,7 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
|
||||
* @param int $alreadysqlnb Put 1 if you know that content is already universal format number
|
||||
* @return string Amount with universal numeric format (Example: '99.99999') or unchanged text if conversion fails. If amount is null or '', it returns ''.
|
||||
*
|
||||
* @see price Opposite function of price2num
|
||||
* @see price() Opposite function of price2num
|
||||
*/
|
||||
function price2num($amount, $rounding = '', $alreadysqlnb = 0)
|
||||
{
|
||||
@ -4572,7 +4548,7 @@ function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round
|
||||
* @param Societe $thirdparty_seller Object of selling third party ($mysoc if not defined)
|
||||
* @param int $vatnpr If vat rate is NPR or not
|
||||
* @return mixed 0 if not found, localtax rate if found
|
||||
* @see get_default_tva
|
||||
* @see get_default_tva()
|
||||
*/
|
||||
function get_localtax($vatrate, $local, $thirdparty_buyer = "", $thirdparty_seller = "", $vatnpr = 0)
|
||||
{
|
||||
@ -4762,7 +4738,7 @@ function get_localtax_by_third($local)
|
||||
* @param Societe $seller Company object
|
||||
* @param int $firstparamisid 1 if first param is id into table (use this if you can)
|
||||
* @return array array('rowid'=> , 'code'=> ...)
|
||||
* @see getLocalTaxesFromRate
|
||||
* @see getLocalTaxesFromRate()
|
||||
*/
|
||||
function getTaxesFromId($vatrate, $buyer = null, $seller = null, $firstparamisid = 1)
|
||||
{
|
||||
@ -4818,7 +4794,7 @@ function getTaxesFromId($vatrate, $buyer = null, $seller = null, $firstparamisid
|
||||
* @param Societe $seller Company object
|
||||
* @param int $firstparamisid 1 if first param is ID into table instead of Rate+code (use this if you can)
|
||||
* @return array array(localtax_type1(1-6/0 if not found), rate localtax1, localtax_type2, rate localtax2, accountancycodecust, accountancycodesupp)
|
||||
* @see getTaxesFromId
|
||||
* @see getTaxesFromId()
|
||||
*/
|
||||
function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisid = 0)
|
||||
{
|
||||
@ -4876,7 +4852,7 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi
|
||||
* @param Societe $thirdparty_seller Thirdparty with a ->country_code defined (FR, US, IT, ...)
|
||||
* @param int $idprodfournprice Id product_fournisseur_price (for "supplier" proposal/order/invoice)
|
||||
* @return float|string Vat rate to use with format 5.0 or '5.0 (XXX)'
|
||||
* @see get_product_localtax_for_country
|
||||
* @see get_product_localtax_for_country()
|
||||
*/
|
||||
function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice = 0)
|
||||
{
|
||||
@ -4953,7 +4929,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr
|
||||
* @param int $local 1 for localtax1, 2 for localtax 2
|
||||
* @param Societe $thirdparty_seller Thirdparty with a ->country_code defined (FR, US, IT, ...)
|
||||
* @return int <0 if KO, Vat rate if OK
|
||||
* @see get_product_vat_for_country
|
||||
* @see get_product_vat_for_country()
|
||||
*/
|
||||
function get_product_localtax_for_country($idprod, $local, $thirdparty_seller)
|
||||
{
|
||||
@ -5026,7 +5002,7 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller)
|
||||
* @param int $idprod Id product
|
||||
* @param int $idprodfournprice Id product_fournisseur_price (for supplier order/invoice)
|
||||
* @return float|string Vat rate to use with format 5.0 or '5.0 (XXX)', -1 if we can't guess it
|
||||
* @see get_default_npr, get_default_localtax
|
||||
* @see get_default_npr(), get_default_localtax()
|
||||
*/
|
||||
function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, $idprod = 0, $idprodfournprice = 0)
|
||||
{
|
||||
@ -5113,7 +5089,7 @@ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer,
|
||||
* @param int $idprod Id product
|
||||
* @param int $idprodfournprice Id supplier price for product
|
||||
* @return float 0 or 1
|
||||
* @see get_default_tva, get_default_localtax
|
||||
* @see get_default_tva(), get_default_localtax()
|
||||
*/
|
||||
function get_default_npr(Societe $thirdparty_seller, Societe $thirdparty_buyer, $idprod = 0, $idprodfournprice = 0)
|
||||
{
|
||||
@ -5150,7 +5126,7 @@ function get_default_npr(Societe $thirdparty_seller, Societe $thirdparty_buyer,
|
||||
* @param int $local Localtax to process (1 or 2)
|
||||
* @param int $idprod Id product
|
||||
* @return integer localtax, -1 si ne peut etre determine
|
||||
* @see get_default_tva, get_default_npr
|
||||
* @see get_default_tva(), get_default_npr()
|
||||
*/
|
||||
function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $idprod = 0)
|
||||
{
|
||||
@ -5371,7 +5347,7 @@ function picto_required()
|
||||
* @param integer $strip_tags 0=Use internal strip, 1=Use strip_tags() php function (bugged when text contains a < char that is not for a html tag)
|
||||
* @return string String cleaned
|
||||
*
|
||||
* @see dol_escape_htmltag strip_tags dol_string_onlythesehtmltags dol_string_neverthesehtmltags
|
||||
* @see dol_escape_htmltag() strip_tags() dol_string_onlythesehtmltags() dol_string_neverthesehtmltags()
|
||||
*/
|
||||
function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto = 'UTF-8', $strip_tags = 0)
|
||||
{
|
||||
@ -5409,7 +5385,7 @@ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto =
|
||||
* @param string $stringtoclean String to clean
|
||||
* @return string String cleaned
|
||||
*
|
||||
* @see dol_escape_htmltag strip_tags dol_string_nohtmltag dol_string_neverthesehtmltags
|
||||
* @see dol_escape_htmltag() strip_tags() dol_string_nohtmltag() dol_string_neverthesehtmltags()
|
||||
*/
|
||||
function dol_string_onlythesehtmltags($stringtoclean)
|
||||
{
|
||||
@ -5435,7 +5411,7 @@ function dol_string_onlythesehtmltags($stringtoclean)
|
||||
* @param array $disallowed_tags Array of tags not allowed
|
||||
* @return string String cleaned
|
||||
*
|
||||
* @see dol_escape_htmltag strip_tags dol_string_nohtmltag dol_string_onlythesehtmltags
|
||||
* @see dol_escape_htmltag() strip_tags() dol_string_nohtmltag() dol_string_onlythesehtmltags()
|
||||
*/
|
||||
function dol_string_neverthesehtmltags($stringtoclean, $disallowed_tags = array('textarea'))
|
||||
{
|
||||
@ -5454,10 +5430,11 @@ function dol_string_neverthesehtmltags($stringtoclean, $disallowed_tags = array(
|
||||
*
|
||||
* @param string $text Input text
|
||||
* @param int $nboflines Nb of lines to get (default is 1 = first line only)
|
||||
* @param string $charset Charset of $text string (UTF-8 by default)
|
||||
* @return string Output text
|
||||
* @see dol_nboflines_bis, dol_string_nohtmltag, dol_escape_htmltag
|
||||
* @see dol_nboflines_bis(), dol_string_nohtmltag(), dol_escape_htmltag()
|
||||
*/
|
||||
function dolGetFirstLineOfText($text, $nboflines = 1)
|
||||
function dolGetFirstLineOfText($text, $nboflines = 1, $charset = 'UTF-8')
|
||||
{
|
||||
if ($nboflines == 1)
|
||||
{
|
||||
@ -5513,7 +5490,7 @@ function dolGetFirstLineOfText($text, $nboflines = 1)
|
||||
* @param int $nl2brmode 0=Adding br before \n, 1=Replacing \n by br
|
||||
* @param bool $forxml false=Use <br>, true=Use <br />
|
||||
* @return string String encoded
|
||||
* @see dol_nboflines, dolGetFirstLineOfText
|
||||
* @see dol_nboflines(), dolGetFirstLineOfText()
|
||||
*/
|
||||
function dol_nl2br($stringtoencode, $nl2brmode = 0, $forxml = false)
|
||||
{
|
||||
@ -5650,7 +5627,7 @@ function dol_string_is_good_iso($s)
|
||||
* @param string $s String to check
|
||||
* @param int $maxchar Not yet used
|
||||
* @return int Number of lines
|
||||
* @see dol_nboflines_bis, dolGetFirstLineOfText
|
||||
* @see dol_nboflines_bis(), dolGetFirstLineOfText()
|
||||
*/
|
||||
function dol_nboflines($s, $maxchar = 0)
|
||||
{
|
||||
@ -5669,7 +5646,7 @@ function dol_nboflines($s, $maxchar = 0)
|
||||
* @param int $maxlinesize Largeur de ligne en caracteres (ou 0 si pas de limite - defaut)
|
||||
* @param string $charset Give the charset used to encode the $text variable in memory.
|
||||
* @return int Number of lines
|
||||
* @see dol_nboflines, dolGetFirstLineOfText
|
||||
* @see dol_nboflines(), dolGetFirstLineOfText()
|
||||
*/
|
||||
function dol_nboflines_bis($text, $maxlinesize = 0, $charset = 'UTF-8')
|
||||
{
|
||||
@ -5724,7 +5701,7 @@ function dol_microtime_float()
|
||||
* @param string $msg Content to check
|
||||
* @param int $option 0=Full detection, 1=Fast check
|
||||
* @return boolean true/false
|
||||
* @see dol_concatdesc
|
||||
* @see dol_concatdesc()
|
||||
*/
|
||||
function dol_textishtml($msg, $option = 0)
|
||||
{
|
||||
@ -5766,22 +5743,22 @@ function dol_textishtml($msg, $option = 0)
|
||||
* @param bool $forxml false=Use <br>instead of \n if html content detected, true=Use <br /> instead of \n if html content detected
|
||||
* @param bool $invert invert order of description lines if CONF CHANGE_ORDER_CONCAT_DESCRIPTION is active
|
||||
* @return string Text 1 + new line + Text2
|
||||
* @see dol_textishtml
|
||||
* @see dol_textishtml()
|
||||
*/
|
||||
function dol_concatdesc($text1, $text2, $forxml = false, $invert = false)
|
||||
{
|
||||
if (!empty($invert))
|
||||
{
|
||||
$tmp = $text1;
|
||||
$text1 = $text2;
|
||||
$text2 = $tmp;
|
||||
}
|
||||
if (!empty($invert))
|
||||
{
|
||||
$tmp = $text1;
|
||||
$text1 = $text2;
|
||||
$text2 = $tmp;
|
||||
}
|
||||
|
||||
$ret='';
|
||||
$ret.= (! dol_textishtml($text1) && dol_textishtml($text2))?dol_nl2br($text1, 0, $forxml):$text1;
|
||||
$ret.= (! empty($text1) && ! empty($text2)) ? ((dol_textishtml($text1) || dol_textishtml($text2))?($forxml?"<br \>\n":"<br>\n") : "\n") : "";
|
||||
$ret.= (dol_textishtml($text1) && ! dol_textishtml($text2))?dol_nl2br($text2, 0, $forxml):$text2;
|
||||
return $ret;
|
||||
$ret='';
|
||||
$ret.= (! dol_textishtml($text1) && dol_textishtml($text2))?dol_nl2br($text1, 0, $forxml):$text1;
|
||||
$ret.= (! empty($text1) && ! empty($text2)) ? ((dol_textishtml($text1) || dol_textishtml($text2))?($forxml?"<br \>\n":"<br>\n") : "\n") : "";
|
||||
$ret.= (dol_textishtml($text1) && ! dol_textishtml($text2))?dol_nl2br($text2, 0, $forxml):$text2;
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
@ -5794,7 +5771,7 @@ function dol_concatdesc($text1, $text2, $forxml = false, $invert = false)
|
||||
* @param array $exclude Array of family keys we want to exclude. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...)
|
||||
* @param Object $object Object for keys on object
|
||||
* @return array Array of substitutions
|
||||
* @see setSubstitFromObject
|
||||
* @see setSubstitFromObject()
|
||||
*/
|
||||
function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $object = null)
|
||||
{
|
||||
@ -6087,7 +6064,7 @@ $substitutionarray=array_merge($substitutionarray, array(
|
||||
$tmp4=dol_get_next_day($tmp['mday'], $tmp['mon'], $tmp['year']);
|
||||
$tmp5=dol_get_next_month($tmp['mon'], $tmp['year']);
|
||||
|
||||
$substitutionarray=array_merge($substitutionarray, array(
|
||||
$substitutionarray=array_merge($substitutionarray, array(
|
||||
'__DAY__' => (string) $tmp['mday'],
|
||||
'__DAY_TEXT__' => $outputlangs->trans('Day'.$tmp['wday']), // Monday
|
||||
'__DAY_TEXT_SHORT__' => $outputlangs->trans($tmp['weekday'].'Min'), // Mon
|
||||
@ -6132,7 +6109,7 @@ $substitutionarray=array_merge($substitutionarray, array(
|
||||
* @param array $substitutionarray Array with key->val to substitute. Example: array('__MYKEY__' => 'MyVal', ...)
|
||||
* @param Translate $outputlangs Output language
|
||||
* @return string Output string after substitutions
|
||||
* @see complete_substitutions_array, getCommonSubstitutionArray
|
||||
* @see complete_substitutions_array(), getCommonSubstitutionArray()
|
||||
*/
|
||||
function make_substitutions($text, $substitutionarray, $outputlangs = null)
|
||||
{
|
||||
@ -6195,7 +6172,7 @@ function make_substitutions($text, $substitutionarray, $outputlangs = null)
|
||||
* @param mixed $parameters Add more parameters (useful to pass product lines)
|
||||
* @param string $callfunc What is the name of the custom function that will be called? (default: completesubstitutionarray)
|
||||
* @return void
|
||||
* @see make_substitutions
|
||||
* @see make_substitutions()
|
||||
*/
|
||||
function complete_substitutions_array(&$substitutionarray, $outputlangs, $object = null, $parameters = null, $callfunc = "completesubstitutionarray")
|
||||
{
|
||||
@ -6339,7 +6316,7 @@ function dolGetFirstLastname($firstname, $lastname, $nameorder = -1)
|
||||
* @param mixed $mesgs Message string or array
|
||||
* @param string $style Which style to use ('mesgs' by default, 'warnings', 'errors')
|
||||
* @return void
|
||||
* @see dol_htmloutput_events
|
||||
* @see dol_htmloutput_events()
|
||||
*/
|
||||
function setEventMessage($mesgs, $style = 'mesgs')
|
||||
{
|
||||
@ -6365,7 +6342,7 @@ function setEventMessage($mesgs, $style = 'mesgs')
|
||||
* @param array $mesgs Message array
|
||||
* @param string $style Which style to use ('mesgs' by default, 'warnings', 'errors')
|
||||
* @return void
|
||||
* @see dol_htmloutput_events
|
||||
* @see dol_htmloutput_events()
|
||||
*/
|
||||
function setEventMessages($mesg, $mesgs, $style = 'mesgs')
|
||||
{
|
||||
@ -6392,7 +6369,7 @@ function setEventMessages($mesg, $mesgs, $style = 'mesgs')
|
||||
*
|
||||
* @param int $disabledoutputofmessages Clear all messages stored into session without diplaying them
|
||||
* @return void
|
||||
* @see dol_htmloutput_mesg
|
||||
* @see dol_htmloutput_mesg()
|
||||
*/
|
||||
function dol_htmloutput_events($disabledoutputofmessages = 0)
|
||||
{
|
||||
@ -6425,9 +6402,9 @@ function dol_htmloutput_events($disabledoutputofmessages = 0)
|
||||
* @param int $keepembedded Set to 1 in error message must be kept embedded into its html place (this disable jnotify)
|
||||
* @return string Return html output
|
||||
*
|
||||
* @see dol_print_error
|
||||
* @see dol_htmloutput_errors
|
||||
* @see setEventMessages
|
||||
* @see dol_print_error()
|
||||
* @see dol_htmloutput_errors()
|
||||
* @see setEventMessages()
|
||||
*/
|
||||
function get_htmloutput_mesg($mesgstring = '', $mesgarray = '', $style = 'ok', $keepembedded = 0)
|
||||
{
|
||||
@ -6502,8 +6479,8 @@ function get_htmloutput_mesg($mesgstring = '', $mesgarray = '', $style = 'ok', $
|
||||
* @param int $keepembedded Set to 1 in error message must be kept embedded into its html place (this disable jnotify)
|
||||
* @return string Return html output
|
||||
*
|
||||
* @see dol_print_error
|
||||
* @see dol_htmloutput_mesg
|
||||
* @see dol_print_error()
|
||||
* @see dol_htmloutput_mesg()
|
||||
*/
|
||||
function get_htmloutput_errors($mesgstring = '', $mesgarray = array(), $keepembedded = 0)
|
||||
{
|
||||
@ -6519,9 +6496,9 @@ function get_htmloutput_errors($mesgstring = '', $mesgarray = array(), $keepembe
|
||||
* @param int $keepembedded Set to 1 if message must be kept embedded into its html place (this disable jnotify)
|
||||
* @return void
|
||||
*
|
||||
* @see dol_print_error
|
||||
* @see dol_htmloutput_errors
|
||||
* @see setEventMessages
|
||||
* @see dol_print_error()
|
||||
* @see dol_htmloutput_errors()
|
||||
* @see setEventMessages()
|
||||
*/
|
||||
function dol_htmloutput_mesg($mesgstring = '', $mesgarray = array(), $style = 'ok', $keepembedded = 0)
|
||||
{
|
||||
@ -6574,8 +6551,8 @@ function dol_htmloutput_mesg($mesgstring = '', $mesgarray = array(), $style = 'o
|
||||
* @param int $keepembedded Set to 1 in error message must be kept embedded into its html place (this disable jnotify)
|
||||
* @return void
|
||||
*
|
||||
* @see dol_print_error
|
||||
* @see dol_htmloutput_mesg
|
||||
* @see dol_print_error()
|
||||
* @see dol_htmloutput_mesg()
|
||||
*/
|
||||
function dol_htmloutput_errors($mesgstring = '', $mesgarray = array(), $keepembedded = 0)
|
||||
{
|
||||
@ -7692,7 +7669,7 @@ function ajax_autoselect($htmlname, $addlink = '')
|
||||
* @param string $default Default mime type if extension not found in known list
|
||||
* @param int $mode 0=Return full mime, 1=otherwise short mime string, 2=image for mime type, 3=source language, 4=css of font fa
|
||||
* @return string Return a mime type family (text/xxx, application/xxx, image/xxx, audio, video, archive)
|
||||
* @see image_format_supported (images.lib.php)
|
||||
* @see image_format_supported() from images.lib.php
|
||||
*/
|
||||
function dol_mimetype($file, $default = 'application/octet-stream', $mode = 0)
|
||||
{
|
||||
|
||||
@ -1453,7 +1453,7 @@ function weight_convert($weight, &$from_unit, $to_unit)
|
||||
* @param array $tab Array (key=>value) with all parameters to save
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*
|
||||
* @see dolibarr_get_const, dolibarr_set_const, dolibarr_del_const
|
||||
* @see dolibarr_get_const(), dolibarr_set_const(), dolibarr_del_const()
|
||||
*/
|
||||
function dol_set_user_param($db, $conf, &$user, $tab)
|
||||
{
|
||||
@ -1553,7 +1553,7 @@ function version_os()
|
||||
* Return PHP version
|
||||
*
|
||||
* @return string PHP version
|
||||
* @see versionphparray
|
||||
* @see versionphparray()
|
||||
*/
|
||||
function version_php()
|
||||
{
|
||||
@ -1564,7 +1564,7 @@ function version_php()
|
||||
* Return Dolibarr version
|
||||
*
|
||||
* @return string Dolibarr version
|
||||
* @see versiondolibarrarray
|
||||
* @see versiondolibarrarray()
|
||||
*/
|
||||
function version_dolibarr()
|
||||
{
|
||||
@ -2137,7 +2137,7 @@ function getElementProperties($element_type)
|
||||
*
|
||||
* @param int $element_id Element id
|
||||
* @param string $element_type Element type
|
||||
* @param ref $element_ref Element ref (Use this if element_id but not both)
|
||||
* @param string $element_ref Element ref (Use this or element_id but not both)
|
||||
* @return int|object object || 0 || -1 if error
|
||||
*/
|
||||
function fetchObjectByElement($element_id, $element_type, $element_ref = '')
|
||||
@ -2167,7 +2167,7 @@ function fetchObjectByElement($element_id, $element_type, $element_ref = '')
|
||||
* @param array $arraycolor Array
|
||||
* @param string $colorifnotfound Color code to return if entry not defined or not a RGB format
|
||||
* @return string RGB hex value (without # before). For example: 'FF00FF', '01FF02'
|
||||
* @see colorStringToArray
|
||||
* @see colorStringToArray()
|
||||
*/
|
||||
function colorArrayToHex($arraycolor, $colorifnotfound = '888888')
|
||||
{
|
||||
@ -2184,11 +2184,12 @@ function colorArrayToHex($arraycolor, $colorifnotfound = '888888')
|
||||
* @param string $stringcolor String with hex (FFFFFF) or comma RGB ('255,255,255')
|
||||
* @param array $colorifnotfound Color code array to return if entry not defined
|
||||
* @return string RGB hex value (without # before). For example: FF00FF
|
||||
* @see colorArrayToHex
|
||||
* @see colorArrayToHex()
|
||||
*/
|
||||
function colorStringToArray($stringcolor, $colorifnotfound = array(88,88,88))
|
||||
{
|
||||
if (is_array($stringcolor)) return $stringcolor; // If already into correct output format, we return as is
|
||||
$reg=array();
|
||||
$tmp=preg_match('/^#?([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])$/', $stringcolor, $reg);
|
||||
if (! $tmp)
|
||||
{
|
||||
|
||||
@ -139,10 +139,10 @@ function dol_convertToWord($num, $langs, $currency = false, $centimes = false)
|
||||
* Function to return number or amount in text.
|
||||
*
|
||||
* @deprecated
|
||||
* @param float $numero Number to convert
|
||||
* @param Lang $langs Language
|
||||
* @param string $numorcurrency 'number' or 'amount'
|
||||
* @return string Text of the number or -1 in case TOO LONG (more than 1000000000000.99)
|
||||
* @param float $numero Number to convert
|
||||
* @param Translate $langs Language
|
||||
* @param string $numorcurrency 'number' or 'amount'
|
||||
* @return string Text of the number or -1 in case TOO LONG (more than 1000000000000.99)
|
||||
*/
|
||||
function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
|
||||
{
|
||||
|
||||
@ -36,10 +36,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
* @param string $diroutputpdf Dir to output file
|
||||
* @param string $newlangid Lang id
|
||||
* @param array $filter Array with filters
|
||||
* @param date $dateafterdate Invoice after date
|
||||
* @param date $datebeforedate Invoice before date
|
||||
* @param date $paymentdateafter Payment after date (must includes hour)
|
||||
* @param date $paymentdatebefore Payment before date (must includes hour)
|
||||
* @param integer $dateafterdate Invoice after date
|
||||
* @param integer $datebeforedate Invoice before date
|
||||
* @param integer $paymentdateafter Payment after date (must includes hour)
|
||||
* @param integer $paymentdatebefore Payment before date (must includes hour)
|
||||
* @param int $usestdout Add information onto standard output
|
||||
* @param int $regenerate ''=Use existing PDF files, 'nameofpdf'=Regenerate all PDF files using the template
|
||||
* @param string $filesuffix Suffix to add into file name of generated PDF
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
* @param string $addfieldentry Array of the field entry to add array('key'=>,'type'=>,''label'=>,'visible'=>,'enabled'=>,'position'=>,'notnull'=>','index'=>,'searchall'=>,'comment'=>,'help'=>,'isameasure')
|
||||
* @param string $delfieldentry Id of field to remove
|
||||
* @return int|object <=0 if KO, Object if OK
|
||||
* @see rebuildObjectSql
|
||||
* @see rebuildObjectSql()
|
||||
*/
|
||||
function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = '', $addfieldentry = array(), $delfieldentry = '')
|
||||
{
|
||||
@ -208,7 +208,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
|
||||
* @param string $readdir Directory source (use $destdir when not defined)
|
||||
* @param Object $object If object was already loaded/known, it is pass to avaoid another include and new.
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
* @see rebuildObjectClass
|
||||
* @see rebuildObjectClass()
|
||||
*/
|
||||
function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '', $object = null)
|
||||
{
|
||||
|
||||
@ -264,7 +264,7 @@ function pdf_getHeightForLogo($logo, $url = false)
|
||||
* @param TCPDF $pdf PDF initialized object
|
||||
* @param string $htmlcontent HTML Contect
|
||||
* @return int Height
|
||||
* @see getStringHeight
|
||||
* @see getStringHeight()
|
||||
*/
|
||||
function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent)
|
||||
{
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
* @param string $period Period of report
|
||||
* @param string $periodlink Link to switch period
|
||||
* @param string $description Description
|
||||
* @param timestamp|integer $builddate Date generation
|
||||
* @param integer $builddate Date generation
|
||||
* @param string $exportlink Link for export or ''
|
||||
* @param array $moreparam Array with list of params to add into form
|
||||
* @param string $calcmode Calculation mode
|
||||
@ -42,12 +42,12 @@ function report_header($reportname, $notused, $period, $periodlink, $description
|
||||
{
|
||||
global $langs;
|
||||
|
||||
if (empty($hselected)) $hselected='report';
|
||||
|
||||
print "\n\n<!-- start banner of report -->\n";
|
||||
|
||||
if(! empty($varlink)) $varlink = '?'.$varlink;
|
||||
|
||||
$head = array();
|
||||
|
||||
$h=0;
|
||||
$head[$h][0] = $_SERVER["PHP_SELF"].$varlink;
|
||||
$head[$h][1] = $langs->trans("Report");
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
* @param string $chain string to encode
|
||||
* @param string $key rule to use for delta ('0', '1' or 'myownkey')
|
||||
* @return string encoded string
|
||||
* @see dol_decode
|
||||
* @see dol_decode()
|
||||
*/
|
||||
function dol_encode($chain, $key = '1')
|
||||
{
|
||||
@ -68,7 +68,7 @@ function dol_encode($chain, $key = '1')
|
||||
* @param string $chain string to decode
|
||||
* @param string $key rule to use for delta ('0', '1' or 'myownkey')
|
||||
* @return string decoded string
|
||||
* @see dol_encode
|
||||
* @see dol_encode()
|
||||
*/
|
||||
function dol_decode($chain, $key = '1')
|
||||
{
|
||||
@ -176,7 +176,7 @@ function dol_verifyHash($chain, $hash, $type = '0')
|
||||
* @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional)
|
||||
* @param int $isdraft 1=The object with id=$objectid is a draft
|
||||
* @return int Always 1, die process if not allowed
|
||||
* @see dol_check_secure_access_document
|
||||
* @see dol_check_secure_access_document()
|
||||
*/
|
||||
function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid', $isdraft = 0)
|
||||
{
|
||||
@ -431,7 +431,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
|
||||
* @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional)
|
||||
* @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional)
|
||||
* @return bool True if user has access, False otherwise
|
||||
* @see restrictedArea
|
||||
* @see restrictedArea()
|
||||
*/
|
||||
function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableandshare = '', $feature2 = '', $dbt_keyfield = '', $dbt_select = 'rowid')
|
||||
{
|
||||
|
||||
@ -446,7 +446,7 @@ function encodedecode_dbpassconf($level = 0)
|
||||
* @param boolean $generic true=Create generic password (32 chars/numbers), false=Use the configured password generation module
|
||||
* @param array $replaceambiguouschars Discard ambigous characters. For example array('I').
|
||||
* @return string New value for password
|
||||
* @see dol_hash
|
||||
* @see dol_hash()
|
||||
*/
|
||||
function getRandomPassword($generic = false, $replaceambiguouschars = null)
|
||||
{
|
||||
|
||||
@ -194,8 +194,8 @@ function user_prepare_head($object)
|
||||
/**
|
||||
* Prepare array with list of tabs
|
||||
*
|
||||
* @param Group $object Object group
|
||||
* @return array Array of tabs
|
||||
* @param UserGroup $object Object group
|
||||
* @return array Array of tabs
|
||||
*/
|
||||
function group_prepare_head($object)
|
||||
{
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
* @param string $content Content to replace
|
||||
* @param int $removephppart 0=Replace PHP sections with a PHP badge. 1=Remove completely PHP sections.
|
||||
* @return boolean True if OK
|
||||
* @see dolWebsiteOutput for function used to replace content in a web server context
|
||||
* @see dolWebsiteOutput() for function used to replace content in a web server context
|
||||
*/
|
||||
function dolWebsiteReplacementOfLinks($website, $content, $removephppart = 0)
|
||||
{
|
||||
@ -139,7 +139,7 @@ function dolStripPhpCode($str, $replacewith = '')
|
||||
*
|
||||
* @param string $content Content string
|
||||
* @return void
|
||||
* @see dolWebsiteReplacementOfLinks for function used to replace content in the backoffice context when USEDOLIBARREDITOR is not on
|
||||
* @see dolWebsiteReplacementOfLinks() for function used to replace content in the backoffice context when USEDOLIBARREDITOR is not on
|
||||
*/
|
||||
function dolWebsiteOutput($content)
|
||||
{
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -65,6 +65,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
$menu->add('#', '', 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname);
|
||||
}
|
||||
|
||||
$menu_arr = array();
|
||||
// Home
|
||||
$menu_arr[] = array(
|
||||
'name' => 'Home',
|
||||
|
||||
@ -95,8 +95,11 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
|
||||
|
||||
$tooltip=$langs->trans("GenericMaskCodes", $langs->transnoentities("BarCode"), $langs->transnoentities("BarCode"));
|
||||
$tooltip.=$langs->trans("GenericMaskCodes3");
|
||||
$tooltip.=$langs->trans("GenericMaskCodes4c");
|
||||
$tooltip.=$langs->trans("GenericMaskCodes5");
|
||||
$tooltip.='<strong>'.$langs->trans("Example").':</strong><br>';
|
||||
$tooltip.='020{000000000} (for internal use)<br>';
|
||||
$tooltip.='9771234{00000} (example of ISSN code with prefix 1234)<br>';
|
||||
$tooltip.='9791234{00000} (example of ISMN code with prefix 1234)<br>';
|
||||
//$tooltip.=$langs->trans("GenericMaskCodes5");
|
||||
|
||||
// Mask parameter
|
||||
//$texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("BarCodeModel").'):</td>';
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/modules/export/modules_export.php';
|
||||
|
||||
// avoid timeout for big export
|
||||
set_time_limit(0);
|
||||
|
||||
/**
|
||||
* Class to build export files with format CSV
|
||||
|
||||
@ -420,6 +420,6 @@ class modAgenda extends DolibarrModules
|
||||
$this->export_sql_end[$r] .=' WHERE ac.entity IN ('.getEntity('agenda').')';
|
||||
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.(empty($user)?0:$user->id).' OR ac.fk_soc IS NULL)';
|
||||
if (empty($user->rights->agenda->allactions->read)) $this->export_sql_end[$r] .=' AND acr.fk_element = '.(empty($user)?0:$user->id);
|
||||
$this->export_sql_order[$r] .=' ORDER BY ac.datep';
|
||||
$this->export_sql_order[$r] =' ORDER BY ac.datep';
|
||||
}
|
||||
}
|
||||
|
||||
@ -283,6 +283,8 @@ class modExpedition extends DolibarrModules
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
$keyforselect='expeditiondet'; $keyforelement='shipment_line'; $keyforaliasextra='extra2';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
$keyforselect='product'; $keyforelement='product'; $keyforaliasextra='extraprod';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
|
||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'expedition as c';
|
||||
@ -295,6 +297,7 @@ class modExpedition extends DolibarrModules
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'expeditiondet_extrafields as extra2 ON ed.rowid = extra2.fk_object';
|
||||
$this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'commandedet as cd';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extraprod ON p.rowid = extraprod.fk_object';
|
||||
if ($idcontacts && ! empty($conf->global->SHIPMENT_ADD_CONTACTS_IN_EXPORT))
|
||||
{
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'element_contact as ee ON ee.element_id = cd.fk_commande AND ee.fk_c_type_contact IN ('.$idcontacts.')';
|
||||
|
||||
@ -7,7 +7,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php';
|
||||
*/
|
||||
class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
|
||||
{
|
||||
var $code = 'chromephp';
|
||||
public $code = 'chromephp';
|
||||
|
||||
/**
|
||||
* Return name of logger
|
||||
@ -50,7 +50,7 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
|
||||
|
||||
return ($this->isActive() == 1)?'':$langs->trans('ClassNotFoundIntoPathWarning', 'ChromePhp.class.php');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Is the module active ?
|
||||
*
|
||||
@ -159,7 +159,7 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
|
||||
$res = @include_once 'ChromePhp.php';
|
||||
if (! $res) $res=@include_once 'ChromePhp.class.php';
|
||||
set_include_path($oldinclude);
|
||||
|
||||
|
||||
ob_start(); // To be sure headers are not flushed until all page is completely processed
|
||||
if ($content['level'] == LOG_ERR) ChromePhp::error($content['message']);
|
||||
elseif ($content['level'] == LOG_WARNING) ChromePhp::warn($content['message']);
|
||||
|
||||
@ -7,8 +7,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php';
|
||||
*/
|
||||
class mod_syslog_file extends LogHandler implements LogHandlerInterface
|
||||
{
|
||||
var $code = 'file';
|
||||
var $lastTime = 0;
|
||||
public $code = 'file';
|
||||
public $lastTime = 0;
|
||||
|
||||
/**
|
||||
* Return name of logger
|
||||
|
||||
@ -7,7 +7,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php';
|
||||
*/
|
||||
class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
|
||||
{
|
||||
var $code = 'syslog';
|
||||
public $code = 'syslog';
|
||||
|
||||
/**
|
||||
* Return name of logger
|
||||
|
||||
@ -263,15 +263,17 @@ else {
|
||||
if ($senderissupplier != 2)
|
||||
{
|
||||
$ajaxoptions=array(
|
||||
'update' => array('qty'=>'qty','remise_percent' => 'discount','idprod' => 'idprod'), // html id tags that will be edited with which ajax json response key
|
||||
'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done
|
||||
'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for example shown we select a disabled option into combo)
|
||||
'update' => array('qty'=>'qty','remise_percent' => 'discount','idprod' => 'idprod'), // html id tags that will be edited with which ajax json response key
|
||||
'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done
|
||||
'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for example shown we select a disabled option into combo)
|
||||
);
|
||||
$alsoproductwithnosupplierprice=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$ajaxoptions = array();
|
||||
$ajaxoptions = array(
|
||||
'update' => array('remise_percent' => 'discount') // html id tags that will be edited with each ajax json response key
|
||||
);
|
||||
$alsoproductwithnosupplierprice=1;
|
||||
}
|
||||
|
||||
|
||||
@ -1207,7 +1207,7 @@ class Cronjob extends CommonObject
|
||||
* Reprogram a job
|
||||
*
|
||||
* @param string $userlogin User login
|
||||
* @param timestamp $now Date returned by dol_now()
|
||||
* @param integer $now Date returned by dol_now()
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function reprogram_jobs($userlogin, $now)
|
||||
|
||||
@ -28,7 +28,7 @@ include_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
|
||||
/**
|
||||
* Class DataPolicy
|
||||
*/
|
||||
Class DataPolicy
|
||||
class DataPolicy
|
||||
{
|
||||
/**
|
||||
* getAllContactNotInformed
|
||||
|
||||
@ -36,6 +36,7 @@ require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/expensereport.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/modules/expensereport/modules_expensereport.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/paymentexpensereport.class.php';
|
||||
@ -106,6 +107,8 @@ $permissiondellink = $user->rights->expensereport->creer; // Used by the includ
|
||||
$permissionedit = $user->rights->expensereport->creer; // Used by the include of actions_lineupdown.inc.php
|
||||
|
||||
|
||||
$upload_dir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
@ -133,11 +136,16 @@ if (empty($reshook))
|
||||
$date='';
|
||||
$comments='';
|
||||
$vatrate='';
|
||||
$value_unit_ht='';
|
||||
$value_unit='';
|
||||
$qty=1;
|
||||
$fk_c_type_fees=-1;
|
||||
}
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
|
||||
|
||||
if (GETPOST('sendit', 'alpha')) $action='';
|
||||
|
||||
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
|
||||
@ -215,7 +223,7 @@ if (empty($reshook))
|
||||
if ($ret < 0) $error++;
|
||||
}
|
||||
|
||||
if (empty($conf->global->EXPENSEREPORT_ALLOW_OVERLAPPING_PERIODS) && $object->periode_existe($fuser, $object->date_debut, $object->date_fin))
|
||||
if (! $error && empty($conf->global->EXPENSEREPORT_ALLOW_OVERLAPPING_PERIODS) && $object->periode_existe($fuser, $object->date_debut, $object->date_fin))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorDoubleDeclaration"), null, 'errors');
|
||||
@ -671,10 +679,6 @@ if (empty($reshook))
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
if ($action == "confirm_refuse" && GETPOST('confirm', 'alpha')=="yes" && $id > 0 && $user->rights->expensereport->approve)
|
||||
{
|
||||
@ -794,10 +798,6 @@ if (empty($reshook))
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
//var_dump($user->id == $object->fk_user_validator);exit;
|
||||
if ($action == "confirm_cancel" && GETPOST('confirm', 'alpha')=="yes" && $id > 0 && $user->rights->expensereport->creer)
|
||||
@ -1084,21 +1084,29 @@ if (empty($reshook))
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
if ($action == "addline" && $user->rights->expensereport->creer)
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
// First save uploaded file
|
||||
if (! empty($_FILES))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// if VAT is not used in Dolibarr, set VAT rate to 0 because VAT rate is necessary.
|
||||
if (empty($vatrate)) $vatrate = "0.000";
|
||||
$vatrate = price2num($vatrate);
|
||||
$tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $vatrate));
|
||||
|
||||
$value_unit_ht=price2num(GETPOST('value_unit_ht', 'alpha'), 'MU');
|
||||
$value_unit=price2num(GETPOST('value_unit', 'alpha'), 'MU');
|
||||
$fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat', 'int');
|
||||
if (empty($value_unit))
|
||||
{
|
||||
$value_unit = price2num($value_unit_ht + ($value_unit_ht * $tmpvat / 100), 'MU');
|
||||
}
|
||||
|
||||
$fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat', 'int');
|
||||
|
||||
$qty = GETPOST('qty', 'int');
|
||||
if (empty($qty)) $qty=1;
|
||||
@ -1110,23 +1118,13 @@ if (empty($reshook))
|
||||
$action='';
|
||||
}
|
||||
|
||||
if ($vatrate < 0 || $vatrate == '')
|
||||
if ((int) $tmpvat < 0 || $tmpvat == '')
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("VAT")), null, 'errors');
|
||||
$action='';
|
||||
}
|
||||
|
||||
/* Projects are never required. To force them, check module forceproject
|
||||
if ($conf->projet->enabled)
|
||||
{
|
||||
if (empty($object_ligne->fk_projet) || $object_ligne->fk_projet==-1)
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Project")), null, 'errors');
|
||||
}
|
||||
}*/
|
||||
|
||||
// Si aucune date n'est rentrée
|
||||
if (empty($date) || $date=="--")
|
||||
{
|
||||
@ -1134,7 +1132,7 @@ if (empty($reshook))
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
|
||||
}
|
||||
// Si aucun prix n'est rentré
|
||||
if ($value_unit==0)
|
||||
if ($value_unit == 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PriceUTTC")), null, 'errors');
|
||||
@ -1153,7 +1151,8 @@ if (empty($reshook))
|
||||
|
||||
// Insert line
|
||||
$result = $object->addline($qty, $value_unit, $fk_c_type_fees, $vatrate, $date, $comments, $fk_projet, $fk_c_exp_tax_cat, $type);
|
||||
if ($result > 0) {
|
||||
if ($result > 0)
|
||||
{
|
||||
$ret = $object->fetch($object->id); // Reload to get new records
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
@ -1171,6 +1170,7 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
unset($qty);
|
||||
unset($value_unit_ht);
|
||||
unset($value_unit);
|
||||
unset($vatrate);
|
||||
unset($comments);
|
||||
@ -1240,12 +1240,18 @@ if (empty($reshook))
|
||||
$projet_id = $fk_projet;
|
||||
$comments = GETPOST('comments', 'none');
|
||||
$qty = GETPOST('qty', 'int');
|
||||
$value_unit = price2num(GETPOST('value_unit', 'alpha'), 'MU');
|
||||
$vatrate = GETPOST('vatrate', 'alpha');
|
||||
|
||||
// if VAT is not used in Dolibarr, set VAT rate to 0 because VAT rate is necessary.
|
||||
if (empty($vatrate)) $vatrate = "0.000";
|
||||
$vatrate = price2num($vatrate);
|
||||
// if VAT is not used in Dolibarr, set VAT rate to 0 because VAT rate is necessary.
|
||||
if (empty($vatrate)) $vatrate = "0.000";
|
||||
$tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $vatrate));
|
||||
|
||||
$value_unit_ht=price2num(GETPOST('value_unit_ht', 'alpha'), 'MU');
|
||||
$value_unit=price2num(GETPOST('value_unit', 'alpha'), 'MU');
|
||||
if (empty($value_unit))
|
||||
{
|
||||
$value_unit = price2num($value_unit_ht + ($value_unit_ht * $tmpvat / 100), 'MU');
|
||||
}
|
||||
|
||||
if (! GETPOST('fk_c_type_fees', 'int') > 0)
|
||||
{
|
||||
@ -1253,7 +1259,7 @@ if (empty($reshook))
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
|
||||
$action='';
|
||||
}
|
||||
if ((int) $vatrate < 0 || $vatrate == '')
|
||||
if ((int) $tmpvat < 0 || $tmpvat == '')
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Vat")), null, 'errors');
|
||||
@ -1742,7 +1748,7 @@ else
|
||||
print '</tr>';
|
||||
|
||||
// User to inform for approval
|
||||
if ($object->fk_statut < 3) // informed
|
||||
if ($object->fk_statut <= ExpenseReport::STATUS_VALIDATED) // informed
|
||||
{
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("VALIDATOR").'</td>'; // approver
|
||||
@ -1760,7 +1766,7 @@ else
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
elseif($object->fk_statut == 4)
|
||||
elseif($object->fk_statut == ExpenseReport::STATUS_CANCELED)
|
||||
{
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("CANCEL_USER").'</span></td>';
|
||||
@ -1854,11 +1860,11 @@ else
|
||||
print '<td class="titlefieldmiddle">'.$langs->trans("AmountHT").'</td>';
|
||||
print '<td class="nowrap amountcard">'.price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).'</td>';
|
||||
$rowspan = 5;
|
||||
if ($object->fk_statut < 3) $rowspan++;
|
||||
elseif($object->fk_statut == 4) $rowspan+=2;
|
||||
if ($object->fk_statut <= ExpenseReport::STATUS_VALIDATED) $rowspan++;
|
||||
elseif($object->fk_statut == ExpenseReport::STATUS_CANCELED) $rowspan+=2;
|
||||
else $rowspan+=2;
|
||||
if ($object->fk_statut==99 || !empty($object->detail_refuse)) $rowspan+=2;
|
||||
if($object->fk_statut==6) $rowspan+=2;
|
||||
if ($object->fk_statut == ExpenseReport::STATUS_REFUSED || !empty($object->detail_refuse)) $rowspan+=2;
|
||||
if ($object->fk_statut == ExpenseReport::STATUS_CLOSED) $rowspan+=2;
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
|
||||
@ -1994,7 +2000,7 @@ else
|
||||
$actiontouse='updateline';
|
||||
if (($object->fk_statut==0 || $object->fk_statut==99) && $action != 'editline') $actiontouse='addline';
|
||||
|
||||
print '<form name="expensereport" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<form name="expensereport" action="'.$_SERVER["PHP_SELF"].'" enctype="multipart/form-data" method="post" >';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="'.$actiontouse.'">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
@ -2016,6 +2022,7 @@ else
|
||||
print '<td style="text-align:center;">'.$langs->trans('Type').'</td>';
|
||||
print '<td style="text-align:left;">'.$langs->trans('Description').'</td>';
|
||||
print '<td style="text-align:right;">'.$langs->trans('VAT').'</td>';
|
||||
print '<td style="text-align:right;">'.$langs->trans('PriceUHT').'</td>';
|
||||
print '<td style="text-align:right;">'.$langs->trans('PriceUTTC').'</td>';
|
||||
print '<td style="text-align:right;">'.$langs->trans('Qty').'</td>';
|
||||
if ($action != 'editline')
|
||||
@ -2071,7 +2078,22 @@ else
|
||||
print '</td>';
|
||||
print '<td style="text-align:left;">'.dol_escape_htmltag($line->comments).'</td>';
|
||||
print '<td style="text-align:right;">'.vatrate($line->vatrate, true).'</td>';
|
||||
// Unit price HT
|
||||
print '<td style="text-align:right;">';
|
||||
if (! empty($line->value_unit_ht))
|
||||
{
|
||||
print price($line->value_unit_ht);
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $line->vatrate));
|
||||
$pricenettoshow = price2num($line->value_unit / (1 + $tmpvat / 100), 'MU');
|
||||
print $pricenettoshow;
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td style="text-align:right;">'.price($line->value_unit).'</td>';
|
||||
|
||||
print '<td style="text-align:right;">'.dol_escape_htmltag($line->qty).'</td>';
|
||||
|
||||
if ($action != 'editline')
|
||||
@ -2081,7 +2103,7 @@ else
|
||||
}
|
||||
|
||||
// Ajout des boutons de modification/suppression
|
||||
if (($object->fk_statut < 2 || $object->fk_statut == 99) && $user->rights->expensereport->creer)
|
||||
if (($object->fk_statut < ExpenseReport::STATUS_VALIDATED || $object->fk_statut == ExpenseReport::STATUS_REFUSED) && $user->rights->expensereport->creer)
|
||||
{
|
||||
print '<td style="text-align:right;" class="nowrap">';
|
||||
|
||||
@ -2137,17 +2159,22 @@ else
|
||||
|
||||
// VAT
|
||||
print '<td style="text-align:right;">';
|
||||
print $form->load_tva('vatrate', (isset($_POST["vatrate"])?$_POST["vatrate"]:$line->vatrate), $mysoc, '');
|
||||
print $form->load_tva('vatrate', (isset($_POST["vatrate"])?$_POST["vatrate"]:$line->vatrate), $mysoc, '', 0, 0, '', false, 1);
|
||||
print '</td>';
|
||||
|
||||
// Unit price
|
||||
print '<td style="text-align:right;">';
|
||||
print '<input type="text" min="0" class="maxwidth100" name="value_unit" value="'.dol_escape_htmltag($line->value_unit).'" />';
|
||||
print '<input type="text" min="0" class="right maxwidth50" id="value_unit_ht" name="value_unit_ht" value="'.dol_escape_htmltag(price2num($line->value_unit_ht)).'" />';
|
||||
print '</td>';
|
||||
|
||||
// Unit price with tax
|
||||
print '<td style="text-align:right;">';
|
||||
print '<input type="text" min="0" class="right maxwidth50" id="value_unit" name="value_unit" value="'.dol_escape_htmltag(price2num($line->value_unit)).'" />';
|
||||
print '</td>';
|
||||
|
||||
// Quantity
|
||||
print '<td style="text-align:right;">';
|
||||
print '<input type="number" min="0" class="maxwidth100" name="qty" value="'.dol_escape_htmltag($line->qty).'" />';
|
||||
print '<input type="number" min="0" class="right maxwidth50" name="qty" value="'.dol_escape_htmltag($line->qty).'" />';
|
||||
print '</td>';
|
||||
|
||||
if ($action != 'editline')
|
||||
@ -2168,8 +2195,62 @@ else
|
||||
}
|
||||
|
||||
// Add a line
|
||||
if (($object->fk_statut==0 || $object->fk_statut==99) && $action != 'editline' && $user->rights->expensereport->creer)
|
||||
if (($object->fk_statut == ExpenseReport::STATUS_DRAFT || $object->fk_statut == ExpenseReport::STATUS_REFUSED) && $action != 'editline' && $user->rights->expensereport->creer)
|
||||
{
|
||||
$colspan = 10;
|
||||
if (! empty($conf->global->MAIN_USE_EXPENSE_IK)) $colspan++;
|
||||
if (! empty($conf->projet->enabled)) $colspan++;
|
||||
if ($action != 'editline') $colspan++;
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="'.$colspan.'" class="liste_titre">';
|
||||
print $langs->trans("UploadANewFileNow");
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td colspan="'.$colspan.'">';
|
||||
|
||||
$modulepart = 'expensereport';
|
||||
$permission = $user->rights->expensereport->creer;
|
||||
|
||||
$formfile=new FormFile($db);
|
||||
|
||||
// We define var to enable the feature to add prefix of uploaded files
|
||||
$savingdocmask='';
|
||||
if (empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX))
|
||||
{
|
||||
//var_dump($modulepart);
|
||||
if (in_array($modulepart, array('facture_fournisseur','commande_fournisseur','facture','commande','propal','supplier_proposal','ficheinter','contract','expedition','project','project_task','expensereport','tax', 'produit', 'product_batch')))
|
||||
{
|
||||
$savingdocmask=dol_sanitizeFileName($object->ref).'-__file__';
|
||||
}
|
||||
/*if (in_array($modulepart,array('member')))
|
||||
{
|
||||
$savingdocmask=$object->login.'___file__';
|
||||
}*/
|
||||
}
|
||||
|
||||
// Show upload form (document and links)
|
||||
$formfile->form_attach_new_file(
|
||||
$_SERVER["PHP_SELF"].'?id='.$object->id,
|
||||
'none',
|
||||
0,
|
||||
0,
|
||||
$permission,
|
||||
$conf->browser->layout == 'phone' ? 40 : 60,
|
||||
$object,
|
||||
'',
|
||||
1,
|
||||
$savingdocmask,
|
||||
0,
|
||||
'formuserfile',
|
||||
'accept',
|
||||
'',
|
||||
1
|
||||
);
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td></td>';
|
||||
print '<td align="center">'.$langs->trans('Date').'</td>';
|
||||
@ -2178,6 +2259,7 @@ else
|
||||
print '<td align="center">'.$langs->trans('Type').'</td>';
|
||||
print '<td>'.$langs->trans('Description').'</td>';
|
||||
print '<td align="right">'.$langs->trans('VAT').'</td>';
|
||||
print '<td align="right">'.$langs->trans('PriceUHT').'</td>';
|
||||
print '<td align="right">'.$langs->trans('PriceUTTC').'</td>';
|
||||
print '<td align="right">'.$langs->trans('Qty').'</td>';
|
||||
print '<td colspan="3"></td>';
|
||||
@ -2185,11 +2267,12 @@ else
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Line number
|
||||
print '<td></td>';
|
||||
|
||||
// Select date
|
||||
print '<td align="center">';
|
||||
print $form->selectDate($date?$date:-1, 'date');
|
||||
print $form->selectDate($date?$date:-1, 'date', 0, 0, 0, '', 1, 1);
|
||||
print '</td>';
|
||||
|
||||
// Select project
|
||||
@ -2200,7 +2283,7 @@ else
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
||||
if (! empty($conf->global->MAIN_USE_EXPENSE_IK))
|
||||
{
|
||||
print '<td class="fk_c_exp_tax_cat">';
|
||||
$params = array('fk_expense' => $object->id);
|
||||
@ -2215,7 +2298,7 @@ else
|
||||
|
||||
// Add comments
|
||||
print '<td>';
|
||||
print '<textarea class="flat_ndf centpercent" name="comments">'.dol_escape_htmltag($comments).'</textarea>';
|
||||
print '<textarea class="flat_ndf centpercent" name="comments" rows="'.ROWS_2.'">'.dol_escape_htmltag($comments).'</textarea>';
|
||||
print '</td>';
|
||||
|
||||
// Select VAT
|
||||
@ -2225,9 +2308,14 @@ else
|
||||
print $form->load_tva('vatrate', ($vatrate!=''?$vatrate:$defaultvat), $mysoc, '', 0, 0, '', false, 1);
|
||||
print '</td>';
|
||||
|
||||
// Unit price
|
||||
// Unit price net
|
||||
print '<td align="right">';
|
||||
print '<input type="text" class="right maxwidth50" name="value_unit" value="'.dol_escape_htmltag($value_unit).'">';
|
||||
print '<input type="text" class="right maxwidth50" id="value_unit_ht" name="value_unit_ht" value="'.dol_escape_htmltag($value_unit_ht).'">';
|
||||
print '</td>';
|
||||
|
||||
// Unit price with tax
|
||||
print '<td align="right">';
|
||||
print '<input type="text" class="right maxwidth50" id="value_unit" name="value_unit" value="'.dol_escape_htmltag($value_unit).'">';
|
||||
print '</td>';
|
||||
|
||||
// Quantity
|
||||
@ -2244,11 +2332,41 @@ else
|
||||
print '<td align="center"><input type="submit" value="'.$langs->trans("Add").'" name="bouton" class="button"></td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
{
|
||||
print '<tr class="oddeven"><td colspan="'.$colspan.'">';
|
||||
print $langs->trans("AttachTheNewLineToTheDocument");
|
||||
|
||||
print '...';
|
||||
|
||||
print '</td></tr>';
|
||||
}
|
||||
} // Fin si c'est payé/validé
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<script javascript>
|
||||
|
||||
/* JQuery for product free or predefined select */
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#value_unit_ht").keyup(function(event) {
|
||||
console.log(event.which); // discard event tag and arrows
|
||||
if (event.which != 9 && (event.which < 37 ||event.which > 40) && jQuery("#value_unit_ht").val() != "") {
|
||||
jQuery("#value_unit").val("");
|
||||
}
|
||||
});
|
||||
jQuery("#value_unit").keyup(function(event) {
|
||||
console.log(event.which); // discard event tag and arrows
|
||||
if (event.which != 9 && (event.which < 37 || event.which > 40) && jQuery("#value_unit").val() != "") {
|
||||
jQuery("#value_unit_ht").val("");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
dol_fiche_end();
|
||||
@ -2286,7 +2404,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
* ET fk_user_author == user courant
|
||||
* Afficher : "Enregistrer" / "Modifier" / "Supprimer"
|
||||
*/
|
||||
if ($user->rights->expensereport->creer && $object->fk_statut==0)
|
||||
if ($user->rights->expensereport->creer && $object->fk_statut == ExpenseReport::STATUS_DRAFT)
|
||||
{
|
||||
if (in_array($object->fk_user_author, $user->getAllChildIds(1)) || !empty($user->rights->expensereport->writeall_advance))
|
||||
{
|
||||
@ -2306,7 +2424,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
* ET fk_user_author == user courant
|
||||
* Afficher : "Enregistrer" / "Modifier" / "Supprimer"
|
||||
*/
|
||||
if($user->rights->expensereport->creer && $object->fk_statut==99)
|
||||
if($user->rights->expensereport->creer && $object->fk_statut == ExpenseReport::STATUS_REFUSED)
|
||||
{
|
||||
if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid)
|
||||
{
|
||||
@ -2320,7 +2438,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->expensereport->to_paid && $object->fk_statut==5)
|
||||
if ($user->rights->expensereport->to_paid && $object->fk_statut == ExpenseReport::STATUS_APPROVED)
|
||||
{
|
||||
if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid)
|
||||
{
|
||||
@ -2334,7 +2452,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
* ET fk_user_validator == user courant
|
||||
* Afficher : "Valider" / "Refuser" / "Supprimer"
|
||||
*/
|
||||
if ($object->fk_statut == 2)
|
||||
if ($object->fk_statut == ExpenseReport::STATUS_VALIDATED)
|
||||
{
|
||||
if (in_array($object->fk_user_author, $user->getAllChildIds(1)))
|
||||
{
|
||||
@ -2343,7 +2461,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->expensereport->approve && $object->fk_statut == 2)
|
||||
if ($user->rights->expensereport->approve && $object->fk_statut == ExpenseReport::STATUS_VALIDATED)
|
||||
{
|
||||
//if($object->fk_user_validator==$user->id)
|
||||
//{
|
||||
@ -2364,13 +2482,13 @@ if ($action != 'create' && $action != 'edit')
|
||||
// If status is Appoved
|
||||
// --------------------
|
||||
|
||||
if ($user->rights->expensereport->approve && $object->fk_statut == 5)
|
||||
if ($user->rights->expensereport->approve && $object->fk_statut == ExpenseReport::STATUS_APPROVED)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=refuse&id='.$object->id.'">'.$langs->trans('Deny').'</a></div>';
|
||||
}
|
||||
|
||||
// If bank module is used
|
||||
if ($user->rights->expensereport->to_paid && ! empty($conf->banque->enabled) && $object->fk_statut == 5)
|
||||
if ($user->rights->expensereport->to_paid && ! empty($conf->banque->enabled) && $object->fk_statut == ExpenseReport::STATUS_APPROVED)
|
||||
{
|
||||
// Pay
|
||||
if ($remaintopay == 0)
|
||||
@ -2384,7 +2502,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
}
|
||||
|
||||
// If bank module is not used
|
||||
if (($user->rights->expensereport->to_paid || empty($conf->banque->enabled)) && $object->fk_statut == 5)
|
||||
if (($user->rights->expensereport->to_paid || empty($conf->banque->enabled)) && $object->fk_statut == ExpenseReport::STATUS_APPROVED)
|
||||
{
|
||||
//if ((round($remaintopay) == 0 || empty($conf->banque->enabled)) && $object->paid == 0)
|
||||
if ($object->paid == 0)
|
||||
@ -2393,14 +2511,14 @@ if ($action != 'create' && $action != 'edit')
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->expensereport->creer && ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) && $object->fk_statut == 5)
|
||||
if ($user->rights->expensereport->creer && ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) && $object->fk_statut == ExpenseReport::STATUS_APPROVED)
|
||||
{
|
||||
// Cancel
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=cancel&id='.$object->id.'">'.$langs->trans('Cancel').'</a></div>';
|
||||
}
|
||||
|
||||
// TODO Replace this. It should be SetUnpaid and should go back to status unpaid not canceled.
|
||||
if (($user->rights->expensereport->approve || $user->rights->expensereport->to_paid) && $object->fk_statut == 6)
|
||||
if (($user->rights->expensereport->approve || $user->rights->expensereport->to_paid) && $object->fk_statut == ExpenseReport::STATUS_CLOSED)
|
||||
{
|
||||
// Cancel
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=cancel&id='.$object->id.'">'.$langs->trans('Cancel').'</a></div>';
|
||||
@ -2412,12 +2530,12 @@ if ($action != 'create' && $action != 'edit')
|
||||
}
|
||||
|
||||
/* If draft, validated, cancel, and user can create, he can always delete its card before it is approved */
|
||||
if ($user->rights->expensereport->creer && $user->id == $object->fk_user_author && $object->fk_statut <= 4)
|
||||
if ($user->rights->expensereport->creer && $user->id == $object->fk_user_author && $object->fk_statut < ExpenseReport::STATUS_APPROVED)
|
||||
{
|
||||
// Delete
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$object->id.'">'.$langs->trans('Delete').'</a></div>';
|
||||
}
|
||||
elseif($user->rights->expensereport->supprimer && $object->fk_statut != 6)
|
||||
elseif($user->rights->expensereport->supprimer && $object->fk_statut != ExpenseReport::STATUS_CLOSED)
|
||||
{
|
||||
// Delete
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$object->id.'">'.$langs->trans('Delete').'</a></div>';
|
||||
|
||||
@ -115,6 +115,11 @@ class ExpenseReport extends CommonObject
|
||||
*/
|
||||
const STATUS_VALIDATED = 2;
|
||||
|
||||
/**
|
||||
* Classified canceled
|
||||
*/
|
||||
const STATUS_CANCELED = 4;
|
||||
|
||||
/**
|
||||
* Classified approved
|
||||
*/
|
||||
@ -160,7 +165,7 @@ class ExpenseReport extends CommonObject
|
||||
*/
|
||||
public function create($user, $notrigger = 0)
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $langs;
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
@ -169,7 +174,7 @@ class ExpenseReport extends CommonObject
|
||||
// Check parameters
|
||||
if (empty($this->date_debut) || empty($this->date_fin))
|
||||
{
|
||||
$this->error='ErrorFieldRequired';
|
||||
$this->error=$langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Date'));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -224,25 +229,30 @@ class ExpenseReport extends CommonObject
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element." SET ref='".$this->db->escape($this->ref)."' WHERE rowid=".$this->id;
|
||||
$resql=$this->db->query($sql);
|
||||
if (!$resql) $error++;
|
||||
|
||||
if (is_array($this->lines) && count($this->lines)>0)
|
||||
if (!$resql)
|
||||
{
|
||||
foreach ($this->lines as $i => $val)
|
||||
{
|
||||
$newndfline=new ExpenseReportLine($this->db);
|
||||
$newndfline=$this->lines[$i];
|
||||
$newndfline->fk_expensereport=$this->id;
|
||||
if ($result >= 0)
|
||||
{
|
||||
$result=$newndfline->insert();
|
||||
}
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->error = $this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if (is_array($this->lines) && count($this->lines)>0)
|
||||
{
|
||||
foreach ($this->lines as $i => $val)
|
||||
{
|
||||
//$newndfline=new ExpenseReportLine($this->db);
|
||||
$newndfline=$this->lines[$i];
|
||||
$newndfline->fk_expensereport=$this->id;
|
||||
$result=$newndfline->insert();
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error = $newndfline->error;
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -1442,12 +1452,12 @@ class ExpenseReport extends CommonObject
|
||||
// phpcs:enable
|
||||
$error = 0;
|
||||
$this->date_cancel = $this->db->idate(gmmktime());
|
||||
if ($this->fk_statut != 4)
|
||||
if ($this->fk_statut != ExpenseReport::STATUS_CANCELED)
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql.= " SET fk_statut = 4, fk_user_cancel = ".$fuser->id;
|
||||
$sql.= " SET fk_statut = ".ExpenseReport::STATUS_CANCELED.", fk_user_cancel = ".$fuser->id;
|
||||
$sql.= ", date_cancel='".$this->db->idate($this->date_cancel)."'";
|
||||
$sql.= " ,detail_cancel='".$this->db->escape($detail)."'";
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
@ -1676,10 +1686,10 @@ class ExpenseReport extends CommonObject
|
||||
/**
|
||||
* addline
|
||||
*
|
||||
* @param real $qty Qty
|
||||
* @param float $qty Qty
|
||||
* @param double $up Value init
|
||||
* @param int $fk_c_type_fees Type payment
|
||||
* @param double $vatrate Vat rate
|
||||
* @param string $vatrate Vat rate (Can be '10' or '10 (ABC)')
|
||||
* @param string $date Date
|
||||
* @param string $comments Description
|
||||
* @param int $fk_project Project id
|
||||
@ -1703,8 +1713,8 @@ class ExpenseReport extends CommonObject
|
||||
if (empty($fk_project)) $fk_project = 0;
|
||||
|
||||
$qty = price2num($qty);
|
||||
if (!preg_match('/\((.*)\)/', $vatrate)) {
|
||||
$vatrate = price2num($vatrate); // $txtva can have format '5.0(XXX)' or '5'
|
||||
if (! preg_match('/\s*\((.*)\)/', $vatrate)) {
|
||||
$vatrate = price2num($vatrate); // $txtva can have format '5.0 (XXX)' or '5'
|
||||
}
|
||||
$up = price2num($up);
|
||||
|
||||
@ -1715,7 +1725,7 @@ class ExpenseReport extends CommonObject
|
||||
$localtaxes_type=getLocalTaxesFromRate($vatrate, 0, $mysoc, $this->thirdparty);
|
||||
|
||||
$vat_src_code = '';
|
||||
if (preg_match('/\((.*)\)/', $vatrate, $reg))
|
||||
if (preg_match('/\s*\((.*)\)/', $vatrate, $reg))
|
||||
{
|
||||
$vat_src_code = $reg[1];
|
||||
$vatrate = preg_replace('/\s*\(.*\)/', '', $vatrate); // Remove code into vatrate.
|
||||
@ -1727,6 +1737,7 @@ class ExpenseReport extends CommonObject
|
||||
$tmp = calcul_price_total($qty, $up, 0, $vatrate, 0, 0, 0, 'TTC', 0, $type, $seller, $localtaxes_type);
|
||||
|
||||
$this->line->value_unit = $up;
|
||||
$this->line->vat_src_code = $vat_src_code;
|
||||
$this->line->vatrate = price2num($vatrate);
|
||||
$this->line->total_ttc = $tmp[2];
|
||||
$this->line->total_ht = $tmp[0];
|
||||
@ -1928,9 +1939,9 @@ class ExpenseReport extends CommonObject
|
||||
* @param int $rowid Line to edit
|
||||
* @param int $type_fees_id Type payment
|
||||
* @param int $projet_id Project id
|
||||
* @param double $vatrate Vat rate. Can be '8.5* (8.5NPROM...)'
|
||||
* @param double $vatrate Vat rate. Can be '8.5' or '8.5* (8.5NPROM...)'
|
||||
* @param string $comments Description
|
||||
* @param real $qty Qty
|
||||
* @param float $qty Qty
|
||||
* @param double $value_unit Value init
|
||||
* @param int $date Date
|
||||
* @param int $expensereport_id Expense report id
|
||||
@ -2554,7 +2565,7 @@ class ExpenseReportLine
|
||||
*/
|
||||
public function insert($notrigger = 0, $fromaddline = false)
|
||||
{
|
||||
global $langs,$user,$conf;
|
||||
global $langs, $user, $conf;
|
||||
|
||||
$error=0;
|
||||
|
||||
@ -2628,10 +2639,10 @@ class ExpenseReportLine
|
||||
/**
|
||||
* Function to get total amount in expense reports for a same rule
|
||||
*
|
||||
* @param ExpenseReportRule $rule object rule to check
|
||||
* @param int $fk_user user author id
|
||||
* @param string $mode day|EX_DAY / month|EX_MON / year|EX_YEA to get amount
|
||||
* @return amount
|
||||
* @param ExpenseReportRule $rule object rule to check
|
||||
* @param int $fk_user user author id
|
||||
* @param string $mode day|EX_DAY / month|EX_MON / year|EX_YEA to get amount
|
||||
* @return amount Amount
|
||||
*/
|
||||
public function getExpAmount(ExpenseReportRule $rule, $fk_user, $mode = 'day')
|
||||
{
|
||||
@ -2644,10 +2655,10 @@ class ExpenseReportLine
|
||||
if (!empty($this->id)) $sql.= ' AND d.rowid <> '.$this->id;
|
||||
$sql .= ' AND d.fk_c_type_fees = '.$rule->fk_c_type_fees;
|
||||
if ($mode == 'day' || $mode == 'EX_DAY') $sql .= ' AND d.date = \''.dol_print_date($this->date, '%Y-%m-%d').'\'';
|
||||
elseif ($mode == 'mon' || $mode == 'EX_MON') $sql .= ' AND DATE_FORMAT(d.date, \'%Y-%m\') = \''.dol_print_date($this->date, '%Y-%m').'\'';
|
||||
elseif ($mode == 'year' || $mode == 'EX_YEA') $sql .= ' AND DATE_FORMAT(d.date, \'%Y\') = \''.dol_print_date($this->date, '%Y').'\'';
|
||||
elseif ($mode == 'mon' || $mode == 'EX_MON') $sql .= ' AND DATE_FORMAT(d.date, \'%Y-%m\') = \''.dol_print_date($this->date, '%Y-%m').'\''; // @TODO DATE_FORMAT is forbidden
|
||||
elseif ($mode == 'year' || $mode == 'EX_YEA') $sql .= ' AND DATE_FORMAT(d.date, \'%Y\') = \''.dol_print_date($this->date, '%Y').'\''; // @TODO DATE_FORMAT is forbidden
|
||||
|
||||
dol_syslog('ExpenseReportLine::getExpAmountByDay sql='.$sql);
|
||||
dol_syslog('ExpenseReportLine::getExpAmount');
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
@ -2664,19 +2675,18 @@ class ExpenseReportLine
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
|
||||
return $amount + $this->total_ttc;
|
||||
}
|
||||
|
||||
/**
|
||||
* update
|
||||
*
|
||||
* @param User $fuser User
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user User
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function update($fuser)
|
||||
public function update(User $user)
|
||||
{
|
||||
global $fuser,$langs,$conf;
|
||||
global $langs,$conf;
|
||||
|
||||
$error=0;
|
||||
|
||||
|
||||
@ -35,12 +35,12 @@ class ExpenseReportStats extends Stats
|
||||
*/
|
||||
public $table_element;
|
||||
|
||||
var $socid;
|
||||
var $userid;
|
||||
public $socid;
|
||||
public $userid;
|
||||
|
||||
var $from;
|
||||
var $field;
|
||||
var $where;
|
||||
public $from;
|
||||
public $field;
|
||||
public $where;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
||||
@ -73,7 +73,7 @@ $modulepart='trip';
|
||||
* Actions
|
||||
*/
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
|
||||
include DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -743,9 +743,11 @@ if ($step == 3 && $datatoexport)
|
||||
|
||||
// un formulaire en plus pour recuperer les filtres
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?step=4&action=submitFormField&datatoexport='.$datatoexport.'" name="FilterField" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Entities").'</td>';
|
||||
//print '<td>'.$langs->trans("ExportableFields").'</td>';
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2016-2018 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2016-2018 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -25,9 +25,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file fichinter/card-rec.php
|
||||
* \ingroup intervention
|
||||
* \brief Page to show predefined fichinter
|
||||
* \file fichinter/card-rec.php
|
||||
* \ingroup intervention
|
||||
* \brief Page to show predefined fichinter
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
@ -396,7 +396,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
if ($num) {
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Duration").'</td>';
|
||||
print '<td class="center">'.$langs->trans("Duration").'</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
while ($i < $num) {
|
||||
@ -413,7 +413,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
print $text.' '.nl2br($objp->description);
|
||||
|
||||
// Qty
|
||||
print '<td align="center">'.convertSecondToTime($objp->duree).'</td>';
|
||||
print '<td class="center">'.convertSecondToTime($objp->duree).'</td>';
|
||||
print "</tr>";
|
||||
|
||||
$i++;
|
||||
@ -429,7 +429,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div align="center"><input type="submit" class="button" value="'.$langs->trans("Create").'">';
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Create").'">';
|
||||
print ' ';
|
||||
print '<input type="button" class="button" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">';
|
||||
print '</div>';
|
||||
@ -495,13 +495,13 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects(
|
||||
$morehtmlref.=$formproject->select_projects(
|
||||
$object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1
|
||||
);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project(
|
||||
$morehtmlref.=$form->form_project(
|
||||
$_SERVER['PHP_SELF'].'?id='.$object->id,
|
||||
$object->socid, $object->fk_project,
|
||||
'none', 0, 0, 0, 1
|
||||
@ -552,7 +552,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
print $langs->trans('Contract');
|
||||
print '</td>';
|
||||
if ($action != 'contrat') {
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=contrat&id='.$object->id.'">';
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=contrat&id='.$object->id.'">';
|
||||
print img_edit($langs->trans('SetContract'), 1);
|
||||
print '</a></td>';
|
||||
}
|
||||
@ -560,17 +560,15 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
print '</td><td>';
|
||||
if ($action == 'contrat') {
|
||||
$formcontract= new Formcontract($db);
|
||||
$formcontract->formSelectContract(
|
||||
$_SERVER["PHP_SELF"].'?id='.$object->id, $object->socid,
|
||||
$object->fk_contrat, 'contratid', 0, 1
|
||||
);
|
||||
$formcontract->formSelectContract($_SERVER["PHP_SELF"].'?id='.$object->id, $object->socid, $object->fk_contrat, 'contratid', 0, 1);
|
||||
} else {
|
||||
if ($object->fk_contrat) {
|
||||
$contratstatic = new Contrat($db);
|
||||
$contratstatic->fetch($object->fk_contrat);
|
||||
print $contratstatic->getNomUrl(0, '', 1);
|
||||
} else
|
||||
print " ";
|
||||
} else {
|
||||
print " ";
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -595,7 +593,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
print $langs->trans('Frequency');
|
||||
print '</td>';
|
||||
if ($action != 'editfrequency' && $user->rights->ficheinter->creer) {
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editfrequency&id='.$id.'">';
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editfrequency&id='.$id.'">';
|
||||
print img_edit($langs->trans('Edit'), 1) . '</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
@ -720,7 +718,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Duration").'</td>';
|
||||
print '<td class="center">'.$langs->trans("Duration").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$num = count($object->lines);
|
||||
@ -744,7 +742,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
print $text.' '.nl2br($object->lines[$i]->desc);
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center">'.convertSecondToTime($object->lines[$i]->duree).'</td>';
|
||||
print '<td class="center">'.convertSecondToTime($object->lines[$i]->duree).'</td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
@ -801,66 +799,38 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
print_barre_liste(
|
||||
$langs->trans("RepeatableInterventional"), $page,
|
||||
$_SERVER['PHP_SELF'], "&socid=$socid", $sortfield, $sortorder,
|
||||
'', $num, '', 'title_commercial.png'
|
||||
);
|
||||
print_barre_liste(
|
||||
$langs->trans("RepeatableInterventional"),
|
||||
$page,
|
||||
$_SERVER['PHP_SELF'],
|
||||
"&socid=$socid",
|
||||
$sortfield,
|
||||
$sortorder,
|
||||
'',
|
||||
$num,
|
||||
'',
|
||||
'title_commercial.png'
|
||||
);
|
||||
|
||||
print $langs->trans("ToCreateAPredefinedInterventional").'<br><br>';
|
||||
|
||||
$i = 0;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre(
|
||||
$langs->trans("Ref"), $_SERVER['PHP_SELF'], "f.titre", "", "",
|
||||
'width="200px" align="left"', $sortfiled, $sortorder
|
||||
);
|
||||
|
||||
print_liste_field_titre(
|
||||
$langs->trans("Company"), $_SERVER['PHP_SELF'], "s.nom", "", "",
|
||||
'width="200px" align="left"', $sortfiled, $sortorder
|
||||
);
|
||||
if (! empty($conf->contrat->enabled))
|
||||
print_liste_field_titre(
|
||||
$langs->trans("Contract"), $_SERVER['PHP_SELF'],
|
||||
"f.fk_contrat", "", "",
|
||||
'width="100px" align="left"', $sortfiled, $sortorder
|
||||
);
|
||||
|
||||
if (! empty($conf->projet->enabled))
|
||||
print_liste_field_titre(
|
||||
$langs->trans("Project"), $_SERVER['PHP_SELF'],
|
||||
"f.fk_project", "", "",
|
||||
'width="100px" align="left"', $sortfiled, $sortorder
|
||||
);
|
||||
print_liste_field_titre(
|
||||
$langs->trans("Duration"), $_SERVER['PHP_SELF'],
|
||||
'f.duree', '', '',
|
||||
'width="50px" align="right"', $sortfiled, $sortorder
|
||||
);
|
||||
// Recurring or not
|
||||
print_liste_field_titre(
|
||||
$langs->trans("Frequency"), $_SERVER['PHP_SELF'],
|
||||
"f.frequency", "", "",
|
||||
'width="100px" align="center"', $sortfiled, $sortorder
|
||||
);
|
||||
print_liste_field_titre(
|
||||
$langs->trans("NbOfGenerationDone"), $_SERVER['PHP_SELF'],
|
||||
"f.nb_gen_done", "", "",
|
||||
'width="100px" align="center"', $sortfiled, $sortorder
|
||||
);
|
||||
|
||||
print_liste_field_titre(
|
||||
$langs->trans("DateLastGeneration"), $_SERVER['PHP_SELF'],
|
||||
"f.date_last_gen", "", "",
|
||||
'width="100px" align="center"', $sortfiled, $sortorder
|
||||
);
|
||||
print_liste_field_titre(
|
||||
$langs->trans("NextDateToIntervention"), $_SERVER['PHP_SELF'],
|
||||
"f.date_when", "", "",
|
||||
'width="100px" align="center"', $sortfiled, $sortorder
|
||||
);
|
||||
print_liste_field_titre("Ref", $_SERVER['PHP_SELF'], "f.titre", "", "", 'width="200px"', $sortfield, $sortorder, 'left ');
|
||||
print_liste_field_titre("Company", $_SERVER['PHP_SELF'], "s.nom", "", "", 'width="200px"', $sortfield, $sortorder, 'left ');
|
||||
if (! empty($conf->contrat->enabled)) {
|
||||
print_liste_field_titre("Contract", $_SERVER['PHP_SELF'], "f.fk_contrat", "", "", 'width="100px"', $sortfield, $sortorder, 'left ');
|
||||
}
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
print_liste_field_titre("Project", $_SERVER['PHP_SELF'], "f.fk_project", "", "", 'width="100px"', $sortfield, $sortorder, 'left ');
|
||||
}
|
||||
print_liste_field_titre("Duration", $_SERVER['PHP_SELF'], 'f.duree', '', '', 'width="50px"', $sortfield, $sortorder, 'right ');
|
||||
// Recurring or not
|
||||
print_liste_field_titre("Frequency", $_SERVER['PHP_SELF'], "f.frequency", "", "", 'width="100px"', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("NbOfGenerationDone", $_SERVER['PHP_SELF'], "f.nb_gen_done", "", "", 'width="100px"', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("DateLastGeneration", $_SERVER['PHP_SELF'], "f.date_last_gen", "", "", 'width="100px"', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("NextDateToIntervention", $_SERVER['PHP_SELF'], "f.date_when", "", "", 'width="100px"', $sortfield, $sortorder, 'center ');
|
||||
print '<th width="100px"></th>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -899,36 +869,36 @@ print_liste_field_titre(
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print '<td align=right>'.convertSecondToTime($objp->duree).'</td>';
|
||||
print '<td class=right>'.convertSecondToTime($objp->duree).'</td>';
|
||||
|
||||
print '<td align="center">'.yn($objp->frequency?1:0).'</td>';
|
||||
print '<td class="center">'.yn($objp->frequency?1:0).'</td>';
|
||||
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
if ($objp->frequency) {
|
||||
print $objp->nb_gen_done.($objp->nb_gen_max>0?' / '. $objp->nb_gen_max:'') ;
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($objp->date_last_gen), 'day') ;
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($objp->date_when), 'day');
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<span class="opacitymedium">'.$langs->trans('NA').'</span>';
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print '<span class="opacitymedium">'.$langs->trans('NA').'</span>';
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print '<span class="opacitymedium">'.$langs->trans('NA').'</span>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
if ($user->rights->ficheinter->creer) {
|
||||
// Action column
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
if ($user->rights->ficheinter->creer) {
|
||||
if (empty($objp->frequency) || $db->jdate($objp->date_when) <= $today) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=createfrommodel';
|
||||
|
||||
@ -1282,7 +1282,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
if ($action != 'contrat')
|
||||
{
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=contrat&id='.$object->id.'">';
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=contrat&id='.$object->id.'">';
|
||||
print img_edit($langs->trans('SetContract'), 1);
|
||||
print '</a></td>';
|
||||
}
|
||||
@ -1393,8 +1393,8 @@ elseif ($id > 0 || ! empty($ref))
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre">'.$langs->trans('Description').'</td>';
|
||||
print '<td class="liste_titre" align="center">'.$langs->trans('Date').'</td>';
|
||||
print '<td class="liste_titre" align="right">'.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?$langs->trans('Duration'):'').'</td>';
|
||||
print '<td class="liste_titre center">'.$langs->trans('Date').'</td>';
|
||||
print '<td class="liste_titre right">'.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?$langs->trans('Duration'):'').'</td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
@ -1414,10 +1414,10 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print dol_htmlentitiesbr($objp->description);
|
||||
|
||||
// Date
|
||||
print '<td align="center" width="150">'.(empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR)?dol_print_date($db->jdate($objp->date_intervention), 'dayhour'):dol_print_date($db->jdate($objp->date_intervention), 'day')).'</td>';
|
||||
print '<td class="center" width="150">'.(empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR)?dol_print_date($db->jdate($objp->date_intervention), 'dayhour'):dol_print_date($db->jdate($objp->date_intervention), 'day')).'</td>';
|
||||
|
||||
// Duration
|
||||
print '<td align="right" width="150">'.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?convertSecondToTime($objp->duree):'').'</td>';
|
||||
print '<td class="right" width="150">'.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?convertSecondToTime($objp->duree):'').'</td>';
|
||||
|
||||
print "</td>\n";
|
||||
|
||||
@ -1425,16 +1425,16 @@ elseif ($id > 0 || ! empty($ref))
|
||||
// Icone d'edition et suppression
|
||||
if ($object->statut == 0 && $user->rights->ficheinter->creer)
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editline&line_id='.$objp->rowid.'#'.$objp->rowid.'">';
|
||||
print img_edit();
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=ask_deleteline&line_id='.$objp->rowid.'">';
|
||||
print img_delete();
|
||||
print '</a></td>';
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
if ($num > 1)
|
||||
{
|
||||
if ($i > 0)
|
||||
@ -1484,7 +1484,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
|
||||
// Date d'intervention
|
||||
print '<td align="center" class="nowrap">';
|
||||
print '<td class="center nowrap">';
|
||||
if (!empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR)) {
|
||||
print $form->selectDate($db->jdate($objp->date_intervention), 'di', 0, 0, 0, "date_intervention");
|
||||
} else {
|
||||
@ -1493,7 +1493,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
|
||||
// Duration
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
if (empty($conf->global->FICHINTER_WITHOUT_DURATION)) {
|
||||
$selectmode = 'select';
|
||||
if (!empty($conf->global->INTERVENTION_ADDLINE_FREEDUREATION))
|
||||
@ -1502,7 +1502,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center" colspan="5" valign="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print '<td class="center" colspan="5" valign="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print '<br><input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></td>';
|
||||
print '</tr>' . "\n";
|
||||
|
||||
@ -1532,8 +1532,8 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print '<td>';
|
||||
print '<a name="add"></a>'; // ancre
|
||||
print $langs->trans('Description').'</td>';
|
||||
print '<td align="center">'.$langs->trans('Date').'</td>';
|
||||
print '<td align="right">'.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?$langs->trans('Duration'):'').'</td>';
|
||||
print '<td class="center">'.$langs->trans('Date').'</td>';
|
||||
print '<td class="right">'.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?$langs->trans('Duration'):'').'</td>';
|
||||
print '<td colspan="3"> </td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
@ -1549,7 +1549,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
|
||||
// Date intervention
|
||||
print '<td align="center" class="nowrap">';
|
||||
print '<td class="center nowrap">';
|
||||
$now=dol_now();
|
||||
$timearray=dol_getdate($now);
|
||||
if (! GETPOST('diday', 'int')) {
|
||||
@ -1565,7 +1565,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
|
||||
// Duration
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
if (empty($conf->global->FICHINTER_WITHOUT_DURATION)) {
|
||||
$selectmode = 'select';
|
||||
if (!empty($conf->global->INTERVENTION_ADDLINE_FREEDUREATION)) {
|
||||
@ -1575,7 +1575,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center" valign="middle" colspan="3"><input type="submit" class="button" value="'.$langs->trans('Add').'" name="addline"></td>';
|
||||
print '<td class="center" valign="middle" colspan="3"><input type="submit" class="button" value="'.$langs->trans('Add').'" name="addline"></td>';
|
||||
print '</tr>';
|
||||
|
||||
//Line extrafield
|
||||
|
||||
@ -128,7 +128,7 @@ if ($resql)
|
||||
}
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print '<tr class="impair"><td align="center" colspan="2">';
|
||||
print '<tr class="impair"><td class="center" colspan="2">';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
$dolgraph = new DolGraph();
|
||||
@ -150,7 +150,7 @@ if ($resql)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$fichinterstatic->LibStatut($status, $bool, 0).'</td>';
|
||||
print '<td align="right"><a href="list.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' ';
|
||||
print '<td class="right"><a href="list.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' ';
|
||||
print $fichinterstatic->LibStatut($status, $bool, 3);
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
@ -160,8 +160,8 @@ if ($resql)
|
||||
}
|
||||
}
|
||||
//if ($totalinprocess != $total)
|
||||
//print '<tr class="liste_total"><td>'.$langs->trans("Total").' ('.$langs->trans("CustomersOrdersRunning").')</td><td align="right">'.$totalinprocess.'</td></tr>';
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td align="right">'.$total.'</td></tr>';
|
||||
//print '<tr class="liste_total"><td>'.$langs->trans("Total").' ('.$langs->trans("CustomersOrdersRunning").')</td><td class="right">'.$totalinprocess.'</td></tr>';
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">'.$total.'</td></tr>';
|
||||
print "</table><br>";
|
||||
}
|
||||
else
|
||||
@ -263,7 +263,7 @@ if ($resql)
|
||||
print ' ';
|
||||
print '</td>';
|
||||
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
@ -274,7 +274,7 @@ if ($resql)
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"), "company").' '.$obj->name.'</a></td>';
|
||||
print '<td>'.dol_print_date($db->jdate($obj->datem), 'day').'</td>';
|
||||
print '<td align="right">'.$fichinterstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '<td class="right">'.$fichinterstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
@ -331,7 +331,7 @@ if (! empty($conf->ficheinter->enabled))
|
||||
print ' ';
|
||||
print '</td>';
|
||||
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
@ -342,7 +342,7 @@ if (! empty($conf->ficheinter->enabled))
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"), "company").' '.dol_trunc($obj->name, 24).'</a></td>';
|
||||
|
||||
print '<td align="right">'.$fichinterstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '<td class="right">'.$fichinterstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
|
||||
@ -383,7 +383,7 @@ if ($resql)
|
||||
// Status
|
||||
if (! empty($arrayfields['f.fk_statut']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
$tmp = $objectstatic->LibStatut(0); // To load $this->statuts_short
|
||||
$liststatus=$objectstatic->statuts_short;
|
||||
if (empty($conf->global->FICHINTER_CLASSIFY_BILLED)) unset($liststatus[2]); // Option deprecated. In a future, billed must be managed with a dedicated field to 0 or 1
|
||||
@ -403,7 +403,7 @@ if ($resql)
|
||||
{
|
||||
print '<td class="liste_titre"> </td>';
|
||||
}
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
@ -420,13 +420,13 @@ if ($resql)
|
||||
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER["PHP_SELF"], "f.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER["PHP_SELF"], "f.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($arrayfields['f.fk_statut']['label'], $_SERVER["PHP_SELF"], "f.fk_statut", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER["PHP_SELF"], "f.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
||||
if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER["PHP_SELF"], "f.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
||||
if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($arrayfields['f.fk_statut']['label'], $_SERVER["PHP_SELF"], "f.fk_statut", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['fd.description']['checked'])) print_liste_field_titre($arrayfields['fd.description']['label'], $_SERVER["PHP_SELF"], '');
|
||||
if (! empty($arrayfields['fd.date']['checked'])) print_liste_field_titre($arrayfields['fd.date']['label'], $_SERVER["PHP_SELF"], "fd.date", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['fd.duree']['checked'])) print_liste_field_titre($arrayfields['fd.duree']['label'], $_SERVER["PHP_SELF"], "fd.duree", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
if (! empty($arrayfields['fd.date']['checked'])) print_liste_field_titre($arrayfields['fd.date']['label'], $_SERVER["PHP_SELF"], "fd.date", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['fd.duree']['checked'])) print_liste_field_titre($arrayfields['fd.duree']['label'], $_SERVER["PHP_SELF"], "fd.duree", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
$total = 0;
|
||||
@ -469,7 +469,7 @@ if ($resql)
|
||||
}
|
||||
|
||||
// Other picto tool
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->ficheinter->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
@ -504,7 +504,7 @@ if ($resql)
|
||||
// Date creation
|
||||
if (! empty($arrayfields['f.datec']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
@ -512,7 +512,7 @@ if ($resql)
|
||||
// Date modification
|
||||
if (! empty($arrayfields['f.tms']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
@ -520,7 +520,7 @@ if ($resql)
|
||||
// Status
|
||||
if (! empty($arrayfields['f.fk_statut']['checked']))
|
||||
{
|
||||
print '<td align="right">'.$objectstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '<td class="right">'.$objectstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Fields of detail of line
|
||||
@ -531,18 +531,18 @@ if ($resql)
|
||||
}
|
||||
if (! empty($arrayfields['fd.date']['checked']))
|
||||
{
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->dp), 'dayhour')."</td>\n";
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->dp), 'dayhour')."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['fd.duree']['checked']))
|
||||
{
|
||||
print '<td align="right">'.convertSecondToTime($obj->duree, 'allhourmin').'</td>';
|
||||
print '<td class="right">'.convertSecondToTime($obj->duree, 'allhourmin').'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totaldurationfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalduration']+=$obj->duree;
|
||||
}
|
||||
// Action column
|
||||
print '<td class="nowrap" align="center">';
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
{
|
||||
$selected=0;
|
||||
@ -571,7 +571,7 @@ if ($resql)
|
||||
if ($num < $limit && empty($offset)) print '<td class="left">'.$langs->trans("Total").'</td>';
|
||||
else print '<td class="left">'.$langs->trans("Totalforthispage").'</td>';
|
||||
}
|
||||
elseif ($totalarray['totaldurationfield'] == $i) print '<td align="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>';
|
||||
elseif ($totalarray['totaldurationfield'] == $i) print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>';
|
||||
else print '<td></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
@ -254,7 +254,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
arsort($arrayyears);
|
||||
print $form->selectarray('year', $arrayyears, $year, 0);
|
||||
print '</td></tr>';
|
||||
print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';
|
||||
print '<tr><td class="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
print '<br><br>';
|
||||
@ -263,13 +263,13 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre" height="24">';
|
||||
print '<td align="center">'.$langs->trans("Year").'</td>';
|
||||
print '<td align="right">'.$langs->trans("NbOfinterventions").'</td>';
|
||||
print '<td align="right">%</td>';
|
||||
print '<td align="right">'.$langs->trans("AmountTotal").'</td>';
|
||||
print '<td align="right">%</td>';
|
||||
print '<td align="right">'.$langs->trans("AmountAverage").'</td>';
|
||||
print '<td align="right">%</td>';
|
||||
print '<td class="center">'.$langs->trans("Year").'</td>';
|
||||
print '<td class="right">'.$langs->trans("NbOfinterventions").'</td>';
|
||||
print '<td class="right">%</td>';
|
||||
print '<td class="right">'.$langs->trans("AmountTotal").'</td>';
|
||||
print '<td class="right">%</td>';
|
||||
print '<td class="right">'.$langs->trans("AmountAverage").'</td>';
|
||||
print '<td class="right">%</td>';
|
||||
print '</tr>';
|
||||
|
||||
$oldyear=0;
|
||||
@ -282,26 +282,26 @@ foreach ($data as $val)
|
||||
$oldyear--;
|
||||
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
|
||||
|
||||
print '<td align="right">0</td>';
|
||||
print '<td align="right"></td>';
|
||||
print '<td align="right">0</td>';
|
||||
print '<td align="right"></td>';
|
||||
print '<td align="right">0</td>';
|
||||
print '<td align="right"></td>';
|
||||
print '<td class="right">0</td>';
|
||||
print '<td class="right"></td>';
|
||||
print '<td class="right">0</td>';
|
||||
print '<td class="right"></td>';
|
||||
print '<td class="right">0</td>';
|
||||
print '<td class="right"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
|
||||
print '<td align="right">'.$val['nb'].'</td>';
|
||||
print '<td align="right" style="'.(($val['nb_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['nb_diff']).'</td>';
|
||||
print '<td align="right">'.price(price2num($val['total'], 'MT'), 1).'</td>';
|
||||
print '<td align="right" style="'.(($val['total_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['total_diff']).'</td>';
|
||||
print '<td align="right">'.price(price2num($val['avg'], 'MT'), 1).'</td>';
|
||||
print '<td align="right" style="'.(($val['avg_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['avg_diff']).'</td>';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
|
||||
print '<td class="right">'.$val['nb'].'</td>';
|
||||
print '<td class="right" style="'.(($val['nb_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['nb_diff']).'</td>';
|
||||
print '<td class="right">'.price(price2num($val['total'], 'MT'), 1).'</td>';
|
||||
print '<td class="right" style="'.(($val['total_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['total_diff']).'</td>';
|
||||
print '<td class="right">'.price(price2num($val['avg'], 'MT'), 1).'</td>';
|
||||
print '<td class="right" style="'.(($val['avg_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['avg_diff']).'</td>';
|
||||
print '</tr>';
|
||||
$oldyear=$year;
|
||||
}
|
||||
@ -314,7 +314,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
// Show graphs
|
||||
print '<table class="border" width="100%"><tr class="pair nohover"><td align="center">';
|
||||
print '<table class="border" width="100%"><tr class="pair nohover"><td class="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else {
|
||||
print $px1->show();
|
||||
|
||||
@ -47,13 +47,13 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
||||
<td><?php echo $langs->trans("Intervention"); ?></td>
|
||||
<td><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||
<td></td>
|
||||
<td align="center"><?php echo dol_print_date($objectlink->datev, 'day'); ?></td>
|
||||
<td class="center"><?php echo dol_print_date($objectlink->datev, 'day'); ?></td>
|
||||
<td></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_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
||||
<td class="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td class="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- END PHP TEMPLATE -->
|
||||
<!-- END PHP TEMPLATE -->
|
||||
|
||||
@ -232,7 +232,7 @@ if ($object->id > 0)
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||
print $langs->trans('PaymentConditions');
|
||||
print '<td>';
|
||||
if (($action != 'editconditions') && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editconditions&socid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
if (($action != 'editconditions') && $user->rights->societe->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editconditions&socid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editconditions')
|
||||
@ -251,7 +251,7 @@ if ($object->id > 0)
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('PaymentMode');
|
||||
print '<td>';
|
||||
if (($action != 'editmode') && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
if (($action != 'editmode') && $user->rights->societe->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editmode')
|
||||
@ -269,7 +269,7 @@ if ($object->id > 0)
|
||||
print '<tr><td class="nowrap">';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans("CustomerRelativeDiscountShort");
|
||||
print '<td><td align="right">';
|
||||
print '<td><td class="right">';
|
||||
if ($user->rights->societe->creer && !$user->societe_id > 0)
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||
@ -283,7 +283,7 @@ if ($object->id > 0)
|
||||
print '<table width="100%" class="nobordernopadding">';
|
||||
print '<tr><td class="nowrap">';
|
||||
print $langs->trans("CustomerAbsoluteDiscountShort");
|
||||
print '<td><td align="right">';
|
||||
print '<td><td class="right">';
|
||||
if ($user->rights->societe->creer && !$user->societe_id > 0)
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||
@ -442,7 +442,7 @@ if ($object->id > 0)
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("Summary").'</td>';
|
||||
print '<td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/recap-fourn.php?socid='.$object->id.'">'.$langs->trans("ShowSupplierPreview").'</a></td></tr></table></td>';
|
||||
print '<td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/recap-fourn.php?socid='.$object->id.'">'.$langs->trans("ShowSupplierPreview").'</a></td></tr></table></td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
@ -471,7 +471,7 @@ if ($object->id > 0)
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre'.(($num == 0) ? ' nobottom':'').'">';
|
||||
print '<td colspan="3">'.$langs->trans("ProductsAndServices").'</td><td align="right">';
|
||||
print '<td colspan="3">'.$langs->trans("ProductsAndServices").'</td><td class="right">';
|
||||
print '<a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/product/list.php?fourn_id='.$object->id.'">'.$langs->trans("AllProductReferencesOfSupplier").' <span class="badge">'.$object->nbOfProductRefs().'</span>';
|
||||
print '</a></td></tr>';
|
||||
|
||||
@ -498,8 +498,8 @@ if ($object->id > 0)
|
||||
print '<td class="maxwidthonsmartphone">';
|
||||
print dol_trunc(dol_htmlentities($objp->label), 30);
|
||||
print '</td>';
|
||||
//print '<td align="right" class="nowrap">'.dol_print_date($objp->tms, 'day').'</td>';
|
||||
print '<td align="right">';
|
||||
//print '<td class="right" class="nowrap">'.dol_print_date($objp->tms, 'day').'</td>';
|
||||
print '<td class="right">';
|
||||
//print (isset($objp->unitprice) ? price($objp->unitprice) : '');
|
||||
if (isset($objp->price))
|
||||
{
|
||||
@ -546,8 +546,8 @@ if ($object->id > 0)
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">';
|
||||
print '<table class="nobordernopadding centpercent"><tr><td>'.$langs->trans("LastSupplierProposals", ($num<$MAXLIST?"":$MAXLIST)).'</td>';
|
||||
print '<td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/supplier_proposal/list.php?socid='.$object->id.'">'.$langs->trans("AllPriceRequests").' <span class="badge">'.$num.'</span></td>';
|
||||
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/supplier_proposal/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||
print '<td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/supplier_proposal/list.php?socid='.$object->id.'">'.$langs->trans("AllPriceRequests").' <span class="badge">'.$num.'</span></td>';
|
||||
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/supplier_proposal/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -565,7 +565,7 @@ if ($object->id > 0)
|
||||
$proposalstatic->total_ttc = $obj->total_ttc;
|
||||
print $proposalstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td align="center" width="80">';
|
||||
print '<td class="center" width="80">';
|
||||
if ($obj->dc)
|
||||
{
|
||||
print dol_print_date($db->jdate($obj->dc), 'day');
|
||||
@ -575,7 +575,7 @@ if ($object->id > 0)
|
||||
print "-";
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="right" class="nowrap">'.$proposalstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '<td class="right" class="nowrap">'.$proposalstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
@ -649,8 +649,8 @@ if ($object->id > 0)
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans("LastSupplierOrders", ($num<$MAXLIST?"":$MAXLIST)).'</td>';
|
||||
print '<td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' <span class="badge">'.$num.'</span></td>';
|
||||
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||
print '<td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' <span class="badge">'.$num.'</span></td>';
|
||||
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -668,7 +668,7 @@ if ($object->id > 0)
|
||||
$orderstatic->total_ttc = $obj->total_ttc;
|
||||
print $orderstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td align="center" width="80">';
|
||||
print '<td class="center" width="80">';
|
||||
if ($obj->dc)
|
||||
{
|
||||
print dol_print_date($db->jdate($obj->dc), 'day');
|
||||
@ -678,7 +678,7 @@ if ($object->id > 0)
|
||||
print "-";
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="right" class="nowrap">'.$orderstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '<td class="right" class="nowrap">'.$orderstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
@ -721,8 +721,8 @@ if ($object->id > 0)
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans('LastSuppliersBills', ($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/facture/list.php?socid='.$object->id.'">'.$langs->trans('AllBills').' <span class="badge">'.$num.'</span></td>';
|
||||
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans('LastSuppliersBills', ($num<=$MAXLIST?"":$MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/facture/list.php?socid='.$object->id.'">'.$langs->trans('AllBills').' <span class="badge">'.$num.'</span></td>';
|
||||
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -745,9 +745,9 @@ if ($object->id > 0)
|
||||
print $obj->ref_supplier?' - '.$obj->ref_supplier:'';
|
||||
print ($obj->libelle?' - ':'').dol_trunc($obj->libelle, 14);
|
||||
print '</td>';
|
||||
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->df), 'day').'</td>';
|
||||
print '<td align="right" class="nowrap">'.price($obj->amount).'</td>';
|
||||
print '<td align="right" class="nowrap">';
|
||||
print '<td class="center nowrap">'.dol_print_date($db->jdate($obj->df), 'day').'</td>';
|
||||
print '<td class="right nowrap">'.price($obj->amount).'</td>';
|
||||
print '<td class="right nowrap">';
|
||||
print $facturestatic->LibStatut($obj->paye, $obj->fk_statut, 5, $obj->am);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -1555,9 +1555,10 @@ class FactureFournisseur extends CommonInvoice
|
||||
* @param int $origin_id id origin document
|
||||
* @param double $pu_ht_devise Amount in currency
|
||||
* @param string $ref_supplier Supplier ref
|
||||
* @param string $special_code Special code
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
public function addline($desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, $fk_product = 0, $remise_percent = 0, $date_start = '', $date_end = '', $ventil = 0, $info_bits = '', $price_base_type = 'HT', $type = 0, $rang = -1, $notrigger = false, $array_options = 0, $fk_unit = null, $origin_id = 0, $pu_ht_devise = 0, $ref_supplier = '')
|
||||
public function addline($desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, $fk_product = 0, $remise_percent = 0, $date_start = '', $date_end = '', $ventil = 0, $info_bits = '', $price_base_type = 'HT', $type = 0, $rang = -1, $notrigger = false, $array_options = 0, $fk_unit = null, $origin_id = 0, $pu_ht_devise = 0, $ref_supplier = '', $special_code = '')
|
||||
{
|
||||
global $langs, $mysoc, $conf;
|
||||
|
||||
@ -1727,7 +1728,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
$this->line->rang=$rang;
|
||||
$this->line->info_bits=$info_bits;
|
||||
|
||||
$this->line->special_code=$this->special_code;
|
||||
$this->line->special_code=((string) $special_code != '' ? $special_code : $this->special_code);
|
||||
$this->line->fk_parent_line=$this->fk_parent_line;
|
||||
$this->line->origin=$this->origin;
|
||||
$this->line->origin_id=$origin_id;
|
||||
|
||||
@ -523,12 +523,12 @@ if ($id > 0 || ! empty($ref)) {
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
}
|
||||
print '<td align="right">' . $langs->trans("SupplierRef") . '</td>';
|
||||
print '<td align="right">' . $langs->trans("QtyOrdered") . '</td>';
|
||||
print '<td align="right">' . $langs->trans("QtyDispatchedShort") . '</td>';
|
||||
print '<td align="right">' . $langs->trans("QtyToDispatchShort") . '</td>';
|
||||
print '<td class="right">' . $langs->trans("SupplierRef") . '</td>';
|
||||
print '<td class="right">' . $langs->trans("QtyOrdered") . '</td>';
|
||||
print '<td class="right">' . $langs->trans("QtyDispatchedShort") . '</td>';
|
||||
print '<td class="right">' . $langs->trans("QtyToDispatchShort") . '</td>';
|
||||
print '<td width="32"></td>';
|
||||
print '<td align="right">' . $langs->trans("Warehouse") . '</td>';
|
||||
print '<td class="right">' . $langs->trans("Warehouse") . '</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
@ -595,17 +595,17 @@ if ($id > 0 || ! empty($ref)) {
|
||||
$up_ht_disc = price2num($up_ht_disc * (100 - $objp->remise_percent) / 100, 'MU');
|
||||
|
||||
// Supplier ref
|
||||
print '<td align="right">'.$objp->sref.'</td>';
|
||||
print '<td class="right">'.$objp->sref.'</td>';
|
||||
|
||||
// Qty ordered
|
||||
print '<td align="right">' . $objp->qty . '</td>';
|
||||
print '<td class="right">' . $objp->qty . '</td>';
|
||||
|
||||
// Already dispatched
|
||||
print '<td align="right">' . $products_dispatched[$objp->rowid] . '</td>';
|
||||
print '<td class="right">' . $products_dispatched[$objp->rowid] . '</td>';
|
||||
|
||||
if (! empty($conf->productbatch->enabled) && $objp->tobatch == 1) {
|
||||
$type = 'batch';
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
print '</td>'; // Qty to dispatch
|
||||
print '<td>';
|
||||
//print img_picto($langs->trans('AddDispatchBatchLine'), 'split.png', 'onClick="addDispatchLine(' . $i . ',\'' . $type . '\')"');
|
||||
@ -645,7 +645,7 @@ if ($id > 0 || ! empty($ref)) {
|
||||
} else {
|
||||
|
||||
$type = 'dispatch';
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
print '</td>'; // Qty to dispatch
|
||||
print '<td>';
|
||||
//print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'onClick="addDispatchLine(' . $i . ',\'' . $type . '\')"');
|
||||
@ -672,7 +672,7 @@ if ($id > 0 || ! empty($ref)) {
|
||||
}
|
||||
|
||||
// Qty to dispatch
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
print '<input id="qty' . $suffix . '" name="qty' . $suffix . '" type="text" class="width50 right" value="' . (GETPOST('qty' . $suffix) != '' ? GETPOST('qty' . $suffix) : $remaintodispatch) . '">';
|
||||
print '</td>';
|
||||
|
||||
@ -691,7 +691,7 @@ if ($id > 0 || ! empty($ref)) {
|
||||
print '</td>';
|
||||
|
||||
// Warehouse
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
if (count($listwarehouses) > 1) {
|
||||
print $formproduct->selectWarehouses(GETPOST("entrepot" . $suffix)?GETPOST("entrepot" . $suffix):($objp->fk_default_warehouse?$objp->fk_default_warehouse:''), "entrepot" . $suffix, '', 1, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix);
|
||||
} elseif (count($listwarehouses) == 1) {
|
||||
@ -796,12 +796,12 @@ if ($id > 0 || ! empty($ref)) {
|
||||
print '<td class="dispatch_dluo_title">' . $langs->trans("EatByDate") . '</td>';
|
||||
print '<td class="dispatch_dlc_title">' . $langs->trans("SellByDate") . '</td>';
|
||||
}
|
||||
print '<td align="right">' . $langs->trans("QtyDispatched") . '</td>';
|
||||
print '<td class="right">' . $langs->trans("QtyDispatched") . '</td>';
|
||||
print '<td></td>';
|
||||
print '<td>' . $langs->trans("Warehouse") . '</td>';
|
||||
print '<td>' . $langs->trans("Comment") . '</td>';
|
||||
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) || !empty($conf->reception->enabled))
|
||||
print '<td align="center" colspan="2">' . $langs->trans("Status") . '</td>';
|
||||
print '<td class="center" colspan="2">' . $langs->trans("Status") . '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -836,7 +836,7 @@ if ($id > 0 || ! empty($ref)) {
|
||||
}
|
||||
|
||||
// Qty
|
||||
print '<td align="right">' . $objp->qty . '</td>';
|
||||
print '<td class="right">' . $objp->qty . '</td>';
|
||||
print '<td> </td>';
|
||||
|
||||
// Warehouse
|
||||
@ -851,14 +851,14 @@ if ($id > 0 || ! empty($ref)) {
|
||||
|
||||
// Status
|
||||
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) && empty($reception->rowid)) {
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
$supplierorderdispatch->status = (empty($objp->status) ? 0 : $objp->status);
|
||||
// print $supplierorderdispatch->status;
|
||||
print $supplierorderdispatch->getLibStatut(5);
|
||||
print '</td>';
|
||||
|
||||
// Add button to check/uncheck disaptching
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))
|
||||
{
|
||||
if (empty($objp->status)) {
|
||||
@ -887,13 +887,13 @@ if ($id > 0 || ! empty($ref)) {
|
||||
}
|
||||
print '</td>';
|
||||
}elseif(!empty($conf->reception->enabled)){
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
if(!empty($reception->id)){
|
||||
print $reception->getLibStatut(5);
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print '</td>';
|
||||
|
||||
|
||||
|
||||
@ -119,13 +119,13 @@ if ($resql)
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$commandestatic->LibStatut($statut, 0).'</td>';
|
||||
print '<td align="right"><a href="list.php?statut='.$statut.'">'.(isset($vals[$statut])?$vals[$statut]:0).'</a></td>';
|
||||
print '<td class="right"><a href="list.php?statut='.$statut.'">'.(isset($vals[$statut])?$vals[$statut]:0).'</a></td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print '<tr class="impair"><td align="center" colspan="2">';
|
||||
print '<tr class="impair"><td class="center" colspan="2">';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
$dolgraph = new DolGraph();
|
||||
@ -140,8 +140,8 @@ if ($resql)
|
||||
print '</td></tr>';
|
||||
}
|
||||
//if ($totalinprocess != $total)
|
||||
//print '<tr class="liste_total"><td>'.$langs->trans("Total").' ('.$langs->trans("SuppliersOrdersRunning").')</td><td align="right">'.$totalinprocess.'</td></tr>';
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td align="right">'.$total.'</td></tr>';
|
||||
//print '<tr class="liste_total"><td>'.$langs->trans("Total").' ('.$langs->trans("SuppliersOrdersRunning").')</td><td class="right">'.$totalinprocess.'</td></tr>';
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">'.$total.'</td></tr>';
|
||||
|
||||
print "</table><br>";
|
||||
}
|
||||
@ -176,7 +176,7 @@ if ($resql)
|
||||
print '<table class="liste" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre"><th>'.$langs->trans("Status").'</th>';
|
||||
print '<th align="right">'.$langs->trans("Nb").'</th>';
|
||||
print '<th class="right">'.$langs->trans("Nb").'</th>';
|
||||
print "</tr>\n";
|
||||
|
||||
while ($i < $num)
|
||||
@ -185,7 +185,7 @@ if ($resql)
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$commandestatic->LibStatut($row[1]).'</td>';
|
||||
print '<td align="right"><a href="list.php?statut='.$row[1].'">'.$row[0].' '.$commandestatic->LibStatut($row[1], 3).'</a></td>';
|
||||
print '<td class="right"><a href="list.php?statut='.$row[1].'">'.$row[0].' '.$commandestatic->LibStatut($row[1], 3).'</a></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
@ -341,7 +341,7 @@ if ($resql)
|
||||
print ' ';
|
||||
print '</td>';
|
||||
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
@ -352,7 +352,7 @@ if ($resql)
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"), "company").' '.$obj->name.'</a></td>';
|
||||
print '<td>'.dol_print_date($db->jdate($obj->tms), 'day').'</td>';
|
||||
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
@ -408,7 +408,7 @@ print '<td width="16" class="nobordernopadding nowrap">';
|
||||
print ' ';
|
||||
print '</td>';
|
||||
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
@ -419,7 +419,7 @@ print '</td>';
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).'</a></td>';
|
||||
|
||||
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
|
||||
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
|
||||
@ -791,21 +791,21 @@ if ($resql)
|
||||
// Country
|
||||
if (! empty($arrayfields['country.code_iso']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100');
|
||||
print '</td>';
|
||||
}
|
||||
// Company type
|
||||
if (! empty($arrayfields['typent.code']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre maxwidthonsmartphone" align="center">';
|
||||
print '<td class="liste_titre maxwidthonsmartphone center">';
|
||||
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT));
|
||||
print '</td>';
|
||||
}
|
||||
// Date order
|
||||
if (! empty($arrayfields['cf.date_commande']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre nowraponall" align="center">';
|
||||
print '<td class="liste_titre nowraponall center">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="search_orderday" value="'.$search_orderday.'">';
|
||||
print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="search_ordermonth" value="'.$search_ordermonth.'">';
|
||||
$formother->select_year($search_orderyear?$search_orderyear:-1, 'search_orderyear', 1, 20, 5);
|
||||
@ -814,7 +814,7 @@ if ($resql)
|
||||
// Date delivery
|
||||
if (! empty($arrayfields['cf.date_delivery']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre nowraponall" align="center">';
|
||||
print '<td class="liste_titre nowraponall center">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="search_deliveryday" value="'.$search_deliveryday.'">';
|
||||
print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="search_deliverymonth" value="'.$search_deliverymonth.'">';
|
||||
$formother->select_year($search_deliveryyear?$search_deliveryyear:-1, 'search_deliveryyear', 1, 20, 5);
|
||||
@ -823,21 +823,21 @@ if ($resql)
|
||||
if (! empty($arrayfields['cf.total_ht']['checked']))
|
||||
{
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="5" name="search_total_ht" value="'.$search_total_ht.'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['cf.total_vat']['checked']))
|
||||
{
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="5" name="search_total_vat" value="'.$search_total_vat.'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['cf.total_ttc']['checked']))
|
||||
{
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="5" name="search_total_ttc" value="'.$search_total_ttc.'">';
|
||||
print '</td>';
|
||||
}
|
||||
@ -863,19 +863,19 @@ if ($resql)
|
||||
// Status
|
||||
if (! empty($arrayfields['cf.fk_statut']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
$formorder->selectSupplierOrderStatus((strstr($search_status, ',')?-1:$search_status), 1, 'search_status');
|
||||
print '</td>';
|
||||
}
|
||||
// Status billed
|
||||
if (! empty($arrayfields['cf.billed']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
print $form->selectyesno('search_billed', $search_billed, 1, 0, 1);
|
||||
print '</td>';
|
||||
}
|
||||
// Action column
|
||||
print '<td class="liste_titre" align="middle">';
|
||||
print '<td class="liste_titre middle">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
@ -891,25 +891,25 @@ if ($resql)
|
||||
if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['cf.fk_author']['checked'])) print_liste_field_titre($arrayfields['cf.fk_author']['label'], $_SERVER["PHP_SELF"], "cf.fk_author", "", $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['cf.date_commande']['checked'])) print_liste_field_titre($arrayfields['cf.date_commande']['label'], $_SERVER["PHP_SELF"], "cf.date_commande", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['cf.date_delivery']['checked'])) print_liste_field_titre($arrayfields['cf.date_delivery']['label'], $_SERVER["PHP_SELF"], 'cf.date_livraison', '', $param, 'align="center"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['cf.total_ht']['checked'])) print_liste_field_titre($arrayfields['cf.total_ht']['label'], $_SERVER["PHP_SELF"], "cf.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['cf.total_vat']['checked'])) print_liste_field_titre($arrayfields['cf.total_vat']['label'], $_SERVER["PHP_SELF"], "cf.tva", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['cf.total_ttc']['checked'])) print_liste_field_titre($arrayfields['cf.total_ttc']['label'], $_SERVER["PHP_SELF"], "cf.total_ttc", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['cf.date_commande']['checked'])) print_liste_field_titre($arrayfields['cf.date_commande']['label'], $_SERVER["PHP_SELF"], "cf.date_commande", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['cf.date_delivery']['checked'])) print_liste_field_titre($arrayfields['cf.date_delivery']['label'], $_SERVER["PHP_SELF"], 'cf.date_livraison', '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['cf.total_ht']['checked'])) print_liste_field_titre($arrayfields['cf.total_ht']['label'], $_SERVER["PHP_SELF"], "cf.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['cf.total_vat']['checked'])) print_liste_field_titre($arrayfields['cf.total_vat']['label'], $_SERVER["PHP_SELF"], "cf.tva", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['cf.total_ttc']['checked'])) print_liste_field_titre($arrayfields['cf.total_ttc']['label'], $_SERVER["PHP_SELF"], "cf.total_ttc", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
// Hook fields
|
||||
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (! empty($arrayfields['cf.datec']['checked'])) print_liste_field_titre($arrayfields['cf.datec']['label'], $_SERVER["PHP_SELF"], "cf.date_creation", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['cf.tms']['checked'])) print_liste_field_titre($arrayfields['cf.tms']['label'], $_SERVER["PHP_SELF"], "cf.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['cf.fk_statut']['checked'])) print_liste_field_titre($arrayfields['cf.fk_statut']['label'], $_SERVER["PHP_SELF"], "cf.fk_statut", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['cf.billed']['checked'])) print_liste_field_titre($arrayfields['cf.billed']['label'], $_SERVER["PHP_SELF"], 'cf.billed', '', $param, 'align="center"', $sortfield, $sortorder, '');
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
if (! empty($arrayfields['cf.datec']['checked'])) print_liste_field_titre($arrayfields['cf.datec']['label'], $_SERVER["PHP_SELF"], "cf.date_creation", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
||||
if (! empty($arrayfields['cf.tms']['checked'])) print_liste_field_titre($arrayfields['cf.tms']['label'], $_SERVER["PHP_SELF"], "cf.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
||||
if (! empty($arrayfields['cf.fk_statut']['checked'])) print_liste_field_titre($arrayfields['cf.fk_statut']['label'], $_SERVER["PHP_SELF"], "cf.fk_statut", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['cf.billed']['checked'])) print_liste_field_titre($arrayfields['cf.billed']['label'], $_SERVER["PHP_SELF"], 'cf.billed', '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -952,7 +952,7 @@ if ($resql)
|
||||
//print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
|
||||
//print '</td>';
|
||||
// Other picto tool
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->fournisseur->commande->dir_output.'/' . dol_sanitizeFileName($obj->ref);
|
||||
print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
||||
@ -1027,7 +1027,7 @@ if ($resql)
|
||||
// Country
|
||||
if (! empty($arrayfields['country.code_iso']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
$tmparray=getCountry($obj->fk_pays, 'all');
|
||||
print $tmparray['label'];
|
||||
print '</td>';
|
||||
@ -1036,7 +1036,7 @@ if ($resql)
|
||||
// Type ent
|
||||
if (! empty($arrayfields['typent.code']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1);
|
||||
print $typenArray[$obj->typent_code];
|
||||
print '</td>';
|
||||
@ -1046,7 +1046,7 @@ if ($resql)
|
||||
// Order date
|
||||
if (! empty($arrayfields['cf.date_commande']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
if ($obj->date_commande) print dol_print_date($db->jdate($obj->date_commande), 'day');
|
||||
else print '';
|
||||
print '</td>';
|
||||
@ -1055,7 +1055,7 @@ if ($resql)
|
||||
// Plannned date of delivery
|
||||
if (! empty($arrayfields['cf.date_delivery']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($obj->date_delivery), 'day');
|
||||
if ($objectstatic->hasDelay() && ! empty($objectstatic->date_delivery)) {
|
||||
print ' '.img_picto($langs->trans("Late").' : '.$objectstatic->showDelay(), "warning");
|
||||
@ -1066,7 +1066,7 @@ if ($resql)
|
||||
// Amount HT
|
||||
if (! empty($arrayfields['cf.total_ht']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($obj->total_ht)."</td>\n";
|
||||
print '<td class="right">'.price($obj->total_ht)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalht'] += $obj->total_ht;
|
||||
@ -1074,7 +1074,7 @@ if ($resql)
|
||||
// Amount VAT
|
||||
if (! empty($arrayfields['cf.total_vat']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($obj->total_tva)."</td>\n";
|
||||
print '<td class="right">'.price($obj->total_tva)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalvat'] += $obj->total_tva;
|
||||
@ -1082,7 +1082,7 @@ if ($resql)
|
||||
// Amount TTC
|
||||
if (! empty($arrayfields['cf.total_ttc']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($obj->total_ttc)."</td>\n";
|
||||
print '<td class="right">'.price($obj->total_ttc)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalttc'] += $obj->total_ttc;
|
||||
@ -1097,7 +1097,7 @@ if ($resql)
|
||||
// Date creation
|
||||
if (! empty($arrayfields['cf.datec']['checked']))
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
print '<td class="center nowrap">';
|
||||
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
@ -1105,7 +1105,7 @@ if ($resql)
|
||||
// Date modification
|
||||
if (! empty($arrayfields['cf.tms']['checked']))
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
print '<td class="center nowrap">';
|
||||
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
@ -1113,18 +1113,18 @@ if ($resql)
|
||||
// Status
|
||||
if (! empty($arrayfields['cf.fk_statut']['checked']))
|
||||
{
|
||||
print '<td align="right" class="nowrap">'.$objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed).'</td>';
|
||||
print '<td class="right nowrap">'.$objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Billed
|
||||
if (! empty($arrayfields['cf.billed']['checked']))
|
||||
{
|
||||
print '<td align="center">'.yn($obj->billed).'</td>';
|
||||
print '<td class="center">'.yn($obj->billed).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Action column
|
||||
print '<td class="nowrap" align="center">';
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
{
|
||||
$selected=0;
|
||||
@ -1151,9 +1151,9 @@ if ($resql)
|
||||
if ($num < $limit) print '<td class="left">'.$langs->trans("Total").'</td>';
|
||||
else print '<td class="left">'.$langs->trans("Totalforthispage").'</td>';
|
||||
}
|
||||
elseif ($totalarray['totalhtfield'] == $i) print '<td align="right">'.price($totalarray['totalht']).'</td>';
|
||||
elseif ($totalarray['totalvatfield'] == $i) print '<td align="right">'.price($totalarray['totalvat']).'</td>';
|
||||
elseif ($totalarray['totalttcfield'] == $i) print '<td align="right">'.price($totalarray['totalttc']).'</td>';
|
||||
elseif ($totalarray['totalhtfield'] == $i) print '<td class="right">'.price($totalarray['totalht']).'</td>';
|
||||
elseif ($totalarray['totalvatfield'] == $i) print '<td class="right">'.price($totalarray['totalvat']).'</td>';
|
||||
elseif ($totalarray['totalttcfield'] == $i) print '<td class="right">'.price($totalarray['totalttc']).'</td>';
|
||||
else print '<td></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
@ -500,10 +500,10 @@ if (($action != 'create' && $action != 'add') && !$error) {
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre('Ref', 'orderstoinvoice.php', 'c.ref', '', '&socid=' . $socid, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre('RefSupplier', 'orderstoinvoice.php', 'c.ref_supplier', '', '&socid=' . $socid, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre('OrderDate', 'orderstoinvoice.php', 'c.date_commande', '', '&socid=' . $socid, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('DeliveryDate', 'orderstoinvoice.php', 'c.date_livraison', '', '&socid=' . $socid, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('Status', '', '', '', '', 'align="right"');
|
||||
print_liste_field_titre('GenerateBill', '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre('OrderDate', 'orderstoinvoice.php', 'c.date_commande', '', '&socid=' . $socid, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre('DeliveryDate', 'orderstoinvoice.php', 'c.date_livraison', '', '&socid=' . $socid, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre('Status', '', '', '', '', '', '', '', 'right ');
|
||||
print_liste_field_titre('GenerateBill', '', '', '', '', '', '', '', 'center ');
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
@ -513,27 +513,27 @@ if (($action != 'create' && $action != 'add') && !$error) {
|
||||
print '<input class="flat" size="10" type="text" name="sref" value="' . $sref . '">';
|
||||
print '</td>';
|
||||
// print '<td class="liste_titre">';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" size="10" name="sref_client" value="' . $sref_client . '">';
|
||||
print '</td>';
|
||||
|
||||
// DATE ORDER
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
print $period;
|
||||
print '</td>';
|
||||
|
||||
// DATE DELIVERY
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
print $periodely;
|
||||
print '</td>';
|
||||
|
||||
// SEARCH BUTTON
|
||||
print '<td align="right" class="liste_titre">';
|
||||
print '<td class="right liste_titre">';
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
||||
print '</td>';
|
||||
|
||||
// ALL/NONE
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
if ($conf->use_javascript_ajax)
|
||||
print '<a href="#" id="checkall">' . $langs->trans("All") . '</a> / <a href="#" id="checknone">' . $langs->trans("None") . '</a>';
|
||||
print '</td>';
|
||||
@ -556,7 +556,7 @@ if (($action != 'create' && $action != 'add') && !$error) {
|
||||
print $generic_commande->getNomUrl(1, $objp->fk_statut);
|
||||
print '</td>';
|
||||
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
|
||||
$filename = dol_sanitizeFileName($objp->ref);
|
||||
$filedir = $conf->fournisseur->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
||||
$urlsource = $_SERVER['PHP_SELF'] . '?id=' . $objp->rowid;
|
||||
@ -567,17 +567,17 @@ if (($action != 'create' && $action != 'add') && !$error) {
|
||||
print '<td>' . $objp->ref_supplier . '</td>';
|
||||
|
||||
// Order date
|
||||
print '<td align="center" nowrap>';
|
||||
print '<td class="center nowrap">';
|
||||
print dol_print_date($db->jdate($objp->date_commande), 'day');
|
||||
print '</td>';
|
||||
|
||||
// Delivery date
|
||||
print '<td align="center" nowrap>';
|
||||
print '<td class="center nowrap">';
|
||||
print dol_print_date($db->jdate($objp->date_livraison), 'day');
|
||||
print '</td>';
|
||||
|
||||
// Statut
|
||||
print '<td align="right" class="nowrap">' . $generic_commande->LibStatut($objp->fk_statut, 5) . '</td>';
|
||||
print '<td class="right nowrap">' . $generic_commande->LibStatut($objp->fk_statut, 5) . '</td>';
|
||||
|
||||
// Checkbox
|
||||
print '<td class="center">';
|
||||
|
||||
@ -49,14 +49,14 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
||||
<td><?php echo $langs->trans("SupplierOrder"); ?></td>
|
||||
<td><a href="<?php echo DOL_URL_ROOT.'/fourn/commande/card.php?id='.$objectlink->id ?>"><?php echo img_object($langs->trans("ShowOrder"), "order").' '.$objectlink->ref; ?></a></td>
|
||||
<td class="left"><?php echo $objectlink->ref_supplier; ?></td>
|
||||
<td align="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
||||
<td align="right"><?php
|
||||
<td class="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
||||
<td class="right"><?php
|
||||
if ($user->rights->fournisseur->commande->lire) {
|
||||
$total = $total + $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
} ?></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_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
||||
<td class="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td class="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
@ -66,11 +66,11 @@ if (count($linkedObjectBlock) > 1)
|
||||
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':''); ?>">
|
||||
<td><?php echo $langs->trans("Total"); ?></td>
|
||||
<td></td>
|
||||
<td align="center"></td>
|
||||
<td align="center"></td>
|
||||
<td align="right"><?php echo price($total); ?></td>
|
||||
<td align="right"></td>
|
||||
<td align="right"></td>
|
||||
<td class="center"></td>
|
||||
<td class="center"></td>
|
||||
<td class="right"><?php echo price($total); ?></td>
|
||||
<td class="right"></td>
|
||||
<td class="right"></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
@ -949,7 +949,8 @@ if (empty($reshook))
|
||||
$lines[$i]->fk_unit,
|
||||
$lines[$i]->id,
|
||||
0,
|
||||
$lines[$i]->ref_supplier
|
||||
$lines[$i]->ref_supplier,
|
||||
$lines[$i]->special_code
|
||||
);
|
||||
|
||||
if ($result < 0)
|
||||
@ -2501,7 +2502,7 @@ else
|
||||
print $langs->trans('PaymentConditions');
|
||||
print '<td>';
|
||||
if ($action != 'editconditions' && $user->rights->fournisseur->facture->creer) {
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editconditions&id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editconditions&id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2">';
|
||||
@ -2523,7 +2524,7 @@ else
|
||||
print $langs->trans('PaymentMode');
|
||||
print '</td>';
|
||||
if ($action != 'editmode' && $user->rights->fournisseur->facture->creer) {
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&id='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&id='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2">';
|
||||
@ -2547,7 +2548,7 @@ else
|
||||
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
|
||||
print '</td>';
|
||||
if ($action != 'editmulticurrencycode' && ! empty($object->brouillon))
|
||||
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($action == 'editmulticurrencycode') {
|
||||
@ -2564,7 +2565,7 @@ else
|
||||
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
|
||||
print '</td>';
|
||||
if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency)
|
||||
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') {
|
||||
@ -2589,7 +2590,7 @@ else
|
||||
print $langs->trans('BankAccount');
|
||||
print '<td>';
|
||||
if ($action != 'editbankaccount' && $user->rights->fournisseur->facture->creer)
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($action == 'editbankaccount') {
|
||||
@ -2606,7 +2607,7 @@ else
|
||||
print '<tr><td>';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||
print $langs->trans('IncotermLabel');
|
||||
print '<td><td align="right">';
|
||||
print '<td><td class="right">';
|
||||
if ($user->rights->fournisseur->facture->creer) print '<a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$object->id.'&action=editincoterm">'.img_edit().'</a>';
|
||||
else print ' ';
|
||||
print '</td></tr></table>';
|
||||
@ -2729,8 +2730,8 @@ else
|
||||
print '<td class="liste_titre">' . ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')) . '</td>';
|
||||
print '<td>'.$langs->trans('Date').'</td>';
|
||||
print '<td>'.$langs->trans('Type').'</td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right">'.$langs->trans('BankAccount').'</td>';
|
||||
print '<td align="right">'.$langs->trans('Amount').'</td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td class="right">'.$langs->trans('BankAccount').'</td>';
|
||||
print '<td class="right">'.$langs->trans('Amount').'</td>';
|
||||
print '<td width="18"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -2769,12 +2770,12 @@ else
|
||||
$bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1);
|
||||
}
|
||||
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
if ($objp->baid > 0) print $bankaccountstatic->getNomUrl(1, 'transactions');
|
||||
print '</td>';
|
||||
}
|
||||
print '<td align="right">' . price($sign * $objp->amount) . '</td>';
|
||||
print '<td align="center">';
|
||||
print '<td class="right">' . price($sign * $objp->amount) . '</td>';
|
||||
print '<td class="center">';
|
||||
if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deletepaiement&paiement_id='.$objp->rowid.'">';
|
||||
@ -2795,13 +2796,13 @@ else
|
||||
/*
|
||||
if ($object->paye == 0)
|
||||
{
|
||||
print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('AlreadyPaid').' :</td><td align="right">'.price($totalpaye).'</td><td></td></tr>';
|
||||
print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans("Billed").' :</td><td align="right">'.price($object->total_ttc).'</td><td></td></tr>';
|
||||
print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans('AlreadyPaid').' :</td><td class="right">'.price($totalpaye).'</td><td></td></tr>';
|
||||
print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans("Billed").' :</td><td class="right">'.price($object->total_ttc).'</td><td></td></tr>';
|
||||
|
||||
$resteapayer = $object->total_ttc - $totalpaye;
|
||||
|
||||
print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('RemainderToPay').' :</td>';
|
||||
print '<td align="right"'.($resteapayer?' class="amountremaintopay"':'').'>'.price($resteapayer).'</td><td></td></tr>';
|
||||
print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans('RemainderToPay').' :</td>';
|
||||
print '<td class="right"'.($resteapayer?' class="amountremaintopay"':'').'>'.price($resteapayer).'</td><td></td></tr>';
|
||||
}
|
||||
*/
|
||||
|
||||
@ -2815,12 +2816,12 @@ else
|
||||
if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE)
|
||||
{
|
||||
// Total already paid
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right">';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right">';
|
||||
if ($object->type != FactureFournisseur::TYPE_DEPOSIT)
|
||||
print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits');
|
||||
else
|
||||
print $langs->trans('AlreadyPaid');
|
||||
print ' :</td><td align="right"'.(($totalpaye > 0)?' class="amountalreadypaid"':'').'>' . price($totalpaye) . '</td><td> </td></tr>';
|
||||
print ' :</td><td class="right"'.(($totalpaye > 0)?' class="amountalreadypaid"':'').'>' . price($totalpaye) . '</td><td> </td></tr>';
|
||||
|
||||
//$resteapayer = $object->total_ttc - $totalpaye;
|
||||
$resteapayeraffiche = $resteapayer;
|
||||
@ -2844,15 +2845,15 @@ else
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$invoice->fetch($obj->fk_invoice_supplier_source);
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right">';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right">';
|
||||
if ($invoice->type == FactureFournisseur::TYPE_CREDIT_NOTE)
|
||||
print $langs->trans("CreditNote") . ' ';
|
||||
if ($invoice->type == FactureFournisseur::TYPE_DEPOSIT)
|
||||
print $langs->trans("Deposit") . ' ';
|
||||
print $invoice->getNomUrl(0);
|
||||
print ' :</td>';
|
||||
print '<td align="right">' . price($obj->amount_ttc) . '</td>';
|
||||
print '<td align="right">';
|
||||
print '<td class="right">' . price($obj->amount_ttc) . '</td>';
|
||||
print '<td class="right">';
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&action=unlinkdiscount&discountid=' . $obj->rowid . '">' . img_delete() . '</a>';
|
||||
print '</td></tr>';
|
||||
$i ++;
|
||||
@ -2867,51 +2868,51 @@ else
|
||||
|
||||
// Paye partiellement 'escompte'
|
||||
if (($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'discount_vat') {
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right nowrap">';
|
||||
print $form->textwithpicto($langs->trans("Discount") . ':', $langs->trans("HelpEscompte"), - 1);
|
||||
print '</td><td align="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>';
|
||||
print '</td><td class="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>';
|
||||
$resteapayeraffiche = 0;
|
||||
$cssforamountpaymentcomplete = 'amountpaymentneutral';
|
||||
}
|
||||
// Paye partiellement ou Abandon 'badsupplier'
|
||||
if (($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'badsupplier') {
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right nowrap">';
|
||||
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 class="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>';
|
||||
// $resteapayeraffiche=0;
|
||||
$cssforamountpaymentcomplete = 'amountpaymentneutral';
|
||||
}
|
||||
// Paye partiellement ou Abandon 'product_returned'
|
||||
if (($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'product_returned') {
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right nowrap">';
|
||||
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 class="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>';
|
||||
$resteapayeraffiche = 0;
|
||||
$cssforamountpaymentcomplete = 'amountpaymentneutral';
|
||||
}
|
||||
// Paye partiellement ou Abandon 'abandon'
|
||||
if (($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'abandon') {
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right nowrap">';
|
||||
$text = $langs->trans("HelpAbandonOther");
|
||||
if ($object->close_note)
|
||||
$text .= '<br><br><b>' . $langs->trans("Reason") . '</b>:' . $object->close_note;
|
||||
print $form->textwithpicto($langs->trans("Abandoned") . ':', $text, - 1);
|
||||
print '</td><td align="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>';
|
||||
print '</td><td class="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>';
|
||||
$resteapayeraffiche = 0;
|
||||
$cssforamountpaymentcomplete = 'amountpaymentneutral';
|
||||
}
|
||||
|
||||
// Billed
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right">' . $langs->trans("Billed") . ' :</td><td align="right">' . price($object->total_ttc) . '</td><td> </td></tr>';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right">' . $langs->trans("Billed") . ' :</td><td class="right">' . price($object->total_ttc) . '</td><td> </td></tr>';
|
||||
|
||||
// Remainder to pay
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right">';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right">';
|
||||
if ($resteapayeraffiche >= 0)
|
||||
print $langs->trans('RemainderToPay');
|
||||
else
|
||||
print $langs->trans('ExcessPaid');
|
||||
print ' :</td>';
|
||||
print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($resteapayeraffiche) . '</td>';
|
||||
print '<td class="right"'.($resteapayeraffiche?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($resteapayeraffiche) . '</td>';
|
||||
print '<td class="nowrap"> </td></tr>';
|
||||
}
|
||||
else // Credit note
|
||||
@ -2919,26 +2920,26 @@ else
|
||||
$cssforamountpaymentcomplete='amountpaymentneutral';
|
||||
|
||||
// Total already paid back
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right">';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right">';
|
||||
print $langs->trans('AlreadyPaidBack');
|
||||
print ' :</td><td align="right">' . price($sign * $totalpaye) . '</td><td> </td></tr>';
|
||||
print ' :</td><td class="right">' . price($sign * $totalpaye) . '</td><td> </td></tr>';
|
||||
|
||||
// Billed
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right">' . $langs->trans("Billed") . ' :</td><td align="right">' . price($sign * $object->total_ttc) . '</td><td> </td></tr>';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right">' . $langs->trans("Billed") . ' :</td><td class="right">' . price($sign * $object->total_ttc) . '</td><td> </td></tr>';
|
||||
|
||||
// Remainder to pay back
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right">';
|
||||
print '<tr><td colspan="' . $nbcols . '" class="right">';
|
||||
if ($resteapayeraffiche <= 0)
|
||||
print $langs->trans('RemainderToPayBack');
|
||||
else
|
||||
print $langs->trans('ExcessPaid');
|
||||
print ' :</td>';
|
||||
print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($sign * $resteapayeraffiche) . '</td>';
|
||||
print '<td class="right"'.($resteapayeraffiche?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($sign * $resteapayeraffiche) . '</td>';
|
||||
print '<td class="nowrap"> </td></tr>';
|
||||
|
||||
// Sold credit note
|
||||
// print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('TotalTTC').' :</td>';
|
||||
// print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($sign *
|
||||
// print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans('TotalTTC').' :</td>';
|
||||
// print '<td class="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($sign *
|
||||
// $object->total_ttc).'</b></td><td> </td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -189,13 +189,13 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "f.rowid", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("RefSupplier", $_SERVER["PHP_SELF"], "f.ref_supplier", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("DateDue", $_SERVER["PHP_SELF"], "f.date_lim_reglement", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("DateDue", $_SERVER["PHP_SELF"], "f.date_lim_reglement", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "f.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AmountTTC", $_SERVER["PHP_SELF"], "f.total_ttc", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AlreadyPaid", $_SERVER["PHP_SELF"], "am", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "fk_statut,paye,am", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "f.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("AmountTTC", $_SERVER["PHP_SELF"], "f.total_ttc", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("AlreadyPaid", $_SERVER["PHP_SELF"], "am", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "fk_statut,paye,am", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print "</tr>\n";
|
||||
|
||||
// Lines with filter fields
|
||||
@ -206,14 +206,14 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
print '<input class="flat" size="8" type="text" name="search_ref_supplier" value="'.$search_ref_supplier.'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" size="6" name="search_company" value="'.$search_company.'">';
|
||||
print '</td><td class="liste_titre" align="right">';
|
||||
print '</td><td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="8" name="search_amount_no_tax" value="'.$search_amount_no_tax.'">';
|
||||
print '</td><td class="liste_titre" align="right">';
|
||||
print '</td><td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="8" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
@ -245,8 +245,8 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
|
||||
print '<td class="nowrap">'.dol_trunc($objp->ref_supplier, 12).'</td>';
|
||||
|
||||
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->df), 'day')."</td>\n";
|
||||
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->datelimite), 'day');
|
||||
print '<td class="nowrap center">'.dol_print_date($db->jdate($objp->df), 'day')."</td>\n";
|
||||
print '<td class="nowrap center">'.dol_print_date($db->jdate($objp->datelimite), 'day');
|
||||
if ($facturestatic->hasDelay()) {
|
||||
print img_warning($langs->trans("Late"));
|
||||
}
|
||||
@ -258,12 +258,12 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
print $companystatic->getNomUrl(1, 'supplier', 32);
|
||||
print '</td>';
|
||||
|
||||
print "<td align=\"right\">".price($objp->total_ht)."</td>";
|
||||
print "<td align=\"right\">".price($objp->total_ttc)."</td>";
|
||||
print "<td align=\"right\">".price($objp->am)."</td>";
|
||||
print "<td class=\"right\">".price($objp->total_ht)."</td>";
|
||||
print "<td class=\"right\">".price($objp->total_ttc)."</td>";
|
||||
print "<td class=\"right\">".price($objp->am)."</td>";
|
||||
|
||||
// Show invoice status
|
||||
print '<td align="right" class="nowrap">';
|
||||
print '<td class="right nowrap">';
|
||||
print $facturestatic->LibStatut($objp->paye, $objp->fk_statut, 5, $objp->am);
|
||||
print '</td>';
|
||||
|
||||
@ -276,11 +276,11 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
}
|
||||
|
||||
print '<tr class="liste_total">';
|
||||
print "<td colspan=\"5\" align=\"left\">".$langs->trans("Total").": </td>";
|
||||
print "<td align=\"right\"><b>".price($total_ht)."</b></td>";
|
||||
print "<td align=\"right\"><b>".price($total_ttc)."</b></td>";
|
||||
print "<td align=\"right\"><b>".price($total_paid)."</b></td>";
|
||||
print '<td align="center"> </td>';
|
||||
print "<td colspan=\"5\" class=\"left\">".$langs->trans("Total").": </td>";
|
||||
print "<td class=\"right\"><b>".price($total_ht)."</b></td>";
|
||||
print "<td class=\"right\"><b>".price($total_ttc)."</b></td>";
|
||||
print "<td class=\"right\"><b>".price($total_paid)."</b></td>";
|
||||
print '<td class="center"> </td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
|
||||
@ -589,7 +589,7 @@ if ($resql)
|
||||
// Ref
|
||||
if (! empty($arrayfields['f.ref']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
|
||||
print '</td>';
|
||||
}
|
||||
@ -630,7 +630,7 @@ if ($resql)
|
||||
// Date invoice
|
||||
if (! empty($arrayfields['f.datef']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre nowraponall" align="center">';
|
||||
print '<td class="liste_titre nowraponall center">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="day" value="'.dol_escape_htmltag($day).'">';
|
||||
print '<input class="flat width25 valignmiddle" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
|
||||
$formother->select_year($year?$year:-1, 'year', 1, 20, 5);
|
||||
@ -639,7 +639,7 @@ if ($resql)
|
||||
// Date due
|
||||
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre nowraponall" align="center">';
|
||||
print '<td class="liste_titre nowraponall center">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="day_lim" value="'.dol_escape_htmltag($day_lim).'">';
|
||||
print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="month_lim" value="'.$month_lim.'">';
|
||||
$formother->select_year($year_lim?$year_lim:-1, 'year_lim', 1, 20, 5);
|
||||
@ -670,67 +670,67 @@ if ($resql)
|
||||
// Country
|
||||
if (! empty($arrayfields['country.code_iso']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100');
|
||||
print '</td>';
|
||||
}
|
||||
// Company type
|
||||
if (! empty($arrayfields['typent.code']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre maxwidthonsmartphone" align="center">';
|
||||
print '<td class="liste_titre maxwidthonsmartphone center">';
|
||||
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT));
|
||||
print '</td>';
|
||||
}
|
||||
// Payment mode
|
||||
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<td class="liste_titre left">';
|
||||
$form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 10);
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.total_ht']['checked']))
|
||||
{
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.total_vat']['checked']))
|
||||
{
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="5" name="search_montant_vat" value="'.dol_escape_htmltag($search_montant_vat).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.total_localtax1']['checked']))
|
||||
{
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="5" name="search_montant_localtax1" value="'.$search_montant_localtax1.'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.total_localtax2']['checked']))
|
||||
{
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="5" name="search_montant_localtax2" value="'.$search_montant_localtax2.'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.total_ttc']['checked']))
|
||||
{
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['dynamount_payed']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['rtp']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '</td>';
|
||||
}
|
||||
// Extra fields
|
||||
@ -755,13 +755,13 @@ if ($resql)
|
||||
// Status
|
||||
if (! empty($arrayfields['f.fk_statut']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre maxwidthonsmartphone" align="right">';
|
||||
print '<td class="liste_titre maxwidthonsmartphone right">';
|
||||
$liststatus=array('0'=>$langs->trans("Draft"),'1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid"));
|
||||
print $form->selectarray('search_status', $liststatus, $search_status, 1);
|
||||
print '</td>';
|
||||
}
|
||||
// Action column
|
||||
print '<td class="liste_titre" align="middle">';
|
||||
print '<td class="liste_titre middle">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
@ -773,33 +773,33 @@ if ($resql)
|
||||
if (! empty($arrayfields['f.ref_supplier']['checked'])) print_liste_field_titre($arrayfields['f.ref_supplier']['label'], $_SERVER["PHP_SELF"], 'f.ref_supplier', '', $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.type']['checked'])) print_liste_field_titre($arrayfields['f.type']['label'], $_SERVER["PHP_SELF"], 'f.type', '', $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.label']['checked'])) print_liste_field_titre($arrayfields['f.label']['label'], $_SERVER['PHP_SELF'], "f.libelle,f.rowid", '', $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.datef']['checked'])) print_liste_field_titre($arrayfields['f.datef']['label'], $_SERVER['PHP_SELF'], 'f.datef,f.rowid', '', $param, 'align="center"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.date_lim_reglement']['checked'])) print_liste_field_titre($arrayfields['f.date_lim_reglement']['label'], $_SERVER['PHP_SELF'], "f.date_lim_reglement", '', $param, 'align="center"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.datef']['checked'])) print_liste_field_titre($arrayfields['f.datef']['label'], $_SERVER['PHP_SELF'], 'f.datef,f.rowid', '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['f.date_lim_reglement']['checked'])) print_liste_field_titre($arrayfields['f.date_lim_reglement']['label'], $_SERVER['PHP_SELF'], "f.date_lim_reglement", '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER['PHP_SELF'], "p.ref", '', $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER['PHP_SELF'], 's.nom', '', $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (! empty($arrayfields['f.fk_mode_reglement']['checked'])) print_liste_field_titre($arrayfields['f.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_mode_reglement", "", $param, "", $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.total_ht']['checked'])) print_liste_field_titre($arrayfields['f.total_ht']['label'], $_SERVER['PHP_SELF'], 'f.total', '', $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.total_vat']['checked'])) print_liste_field_titre($arrayfields['f.total_vat']['label'], $_SERVER['PHP_SELF'], 'f.tva', '', $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.total_localtax1']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax1']['label'], $_SERVER['PHP_SELF'], 'f.localtax1', '', $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.total_localtax2']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax2']['label'], $_SERVER['PHP_SELF'], 'f.localtax2', '', $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.total_ttc', '', $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['dynamount_payed']['checked'])) print_liste_field_titre($arrayfields['dynamount_payed']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'align="right"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.total_ht']['checked'])) print_liste_field_titre($arrayfields['f.total_ht']['label'], $_SERVER['PHP_SELF'], 'f.total', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['f.total_vat']['checked'])) print_liste_field_titre($arrayfields['f.total_vat']['label'], $_SERVER['PHP_SELF'], 'f.tva', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['f.total_localtax1']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax1']['label'], $_SERVER['PHP_SELF'], 'f.localtax1', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['f.total_localtax2']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax2']['label'], $_SERVER['PHP_SELF'], 'f.localtax2', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.total_ttc', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['dynamount_payed']['checked'])) print_liste_field_titre($arrayfields['dynamount_payed']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (! empty($arrayfields['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
// Hook fields
|
||||
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER["PHP_SELF"], "f.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER["PHP_SELF"], "f.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
|
||||
if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($arrayfields['f.fk_statut']['label'], $_SERVER["PHP_SELF"], "fk_statut,paye,type", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER["PHP_SELF"], "f.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
||||
if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER["PHP_SELF"], "f.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
||||
if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($arrayfields['f.fk_statut']['label'], $_SERVER["PHP_SELF"], "fk_statut,paye,type", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
$facturestatic=new FactureFournisseur($db);
|
||||
@ -853,7 +853,7 @@ if ($resql)
|
||||
//print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
|
||||
//print '</td>';
|
||||
// Other picto tool
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->fournisseur->facture->dir_output.'/'.get_exdir($obj->facid, 2, 0, 0, $facturestatic, 'invoice_supplier').dol_sanitizeFileName($obj->ref);
|
||||
$subdir = get_exdir($obj->facid, 2, 0, 0, $facturestatic, 'invoice_supplier').dol_sanitizeFileName($obj->ref);
|
||||
@ -894,7 +894,7 @@ if ($resql)
|
||||
// Date
|
||||
if (! empty($arrayfields['f.datef']['checked']))
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
print '<td class="center nowrap">';
|
||||
print dol_print_date($db->jdate($obj->datef), 'day');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
@ -903,7 +903,7 @@ if ($resql)
|
||||
// Date limit
|
||||
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
|
||||
{
|
||||
print '<td align="center" class="nowrap">'.dol_print_date($datelimit, 'day');
|
||||
print '<td class="center nowrap">'.dol_print_date($datelimit, 'day');
|
||||
if ($facturestatic->hasDelay())
|
||||
{
|
||||
print img_warning($langs->trans('Late'));
|
||||
@ -960,7 +960,7 @@ if ($resql)
|
||||
// Country
|
||||
if (! empty($arrayfields['country.code_iso']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
$tmparray=getCountry($obj->fk_pays, 'all');
|
||||
print $tmparray['label'];
|
||||
print '</td>';
|
||||
@ -969,7 +969,7 @@ if ($resql)
|
||||
// Type ent
|
||||
if (! empty($arrayfields['typent.code']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1);
|
||||
print $typenArray[$obj->typent_code];
|
||||
print '</td>';
|
||||
@ -988,7 +988,7 @@ if ($resql)
|
||||
// Amount HT
|
||||
if (! empty($arrayfields['f.total_ht']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($obj->total_ht)."</td>\n";
|
||||
print '<td class="right">'.price($obj->total_ht)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalht'] += $obj->total_ht;
|
||||
@ -996,7 +996,7 @@ if ($resql)
|
||||
// Amount VAT
|
||||
if (! empty($arrayfields['f.total_vat']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($obj->total_vat)."</td>\n";
|
||||
print '<td class="right">'.price($obj->total_vat)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalvat'] += $obj->total_vat;
|
||||
@ -1004,7 +1004,7 @@ if ($resql)
|
||||
// Amount LocalTax1
|
||||
if (! empty($arrayfields['f.total_localtax1']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($obj->total_localtax1)."</td>\n";
|
||||
print '<td class="right">'.price($obj->total_localtax1)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totallocaltax1field']=$totalarray['nbfield'];
|
||||
$totalarray['totallocaltax1'] += $obj->total_localtax1;
|
||||
@ -1012,7 +1012,7 @@ if ($resql)
|
||||
// Amount LocalTax2
|
||||
if (! empty($arrayfields['f.total_localtax2']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($obj->total_localtax2)."</td>\n";
|
||||
print '<td class="right">'.price($obj->total_localtax2)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totallocaltax2field']=$totalarray['nbfield'];
|
||||
$totalarray['totallocaltax2'] += $obj->total_localtax2;
|
||||
@ -1020,7 +1020,7 @@ if ($resql)
|
||||
// Amount TTC
|
||||
if (! empty($arrayfields['f.total_ttc']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($obj->total_ttc)."</td>\n";
|
||||
print '<td class="right">'.price($obj->total_ttc)."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalttc'] += $obj->total_ttc;
|
||||
@ -1028,7 +1028,7 @@ if ($resql)
|
||||
|
||||
if (! empty($arrayfields['dynamount_payed']['checked']))
|
||||
{
|
||||
print '<td align="right">'.(! empty($totalpay)?price($totalpay, 0, $langs):' ').'</td>'; // TODO Use a denormalized field
|
||||
print '<td class="right">'.(! empty($totalpay)?price($totalpay, 0, $langs):' ').'</td>'; // TODO Use a denormalized field
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalamfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalam'] += $totalpay;
|
||||
@ -1036,7 +1036,7 @@ if ($resql)
|
||||
|
||||
if (! empty($arrayfields['rtp']['checked']))
|
||||
{
|
||||
print '<td align="right">'.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').'</td>'; // TODO Use a denormalized field
|
||||
print '<td class="right">'.(! empty($remaintopay)?price($remaintopay, 0, $langs):' ').'</td>'; // TODO Use a denormalized field
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalrtp'] += $remaintopay;
|
||||
@ -1052,7 +1052,7 @@ if ($resql)
|
||||
// Date creation
|
||||
if (! empty($arrayfields['f.datec']['checked']))
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
print '<td class="center nowrap">';
|
||||
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
@ -1060,7 +1060,7 @@ if ($resql)
|
||||
// Date modification
|
||||
if (! empty($arrayfields['f.tms']['checked']))
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
print '<td class="center nowrap">';
|
||||
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
@ -1068,7 +1068,7 @@ if ($resql)
|
||||
// Status
|
||||
if (! empty($arrayfields['f.fk_statut']['checked']))
|
||||
{
|
||||
print '<td align="right" class="nowrap">';
|
||||
print '<td class="right nowrap">';
|
||||
// TODO $paiement is not yet defined
|
||||
print $facturestatic->LibStatut($obj->paye, $obj->fk_statut, 5, $paiement, $obj->type);
|
||||
print "</td>";
|
||||
@ -1076,7 +1076,7 @@ if ($resql)
|
||||
}
|
||||
|
||||
// Action column
|
||||
print '<td class="nowrap" align="center">';
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
{
|
||||
$selected=0;
|
||||
@ -1111,13 +1111,13 @@ if ($resql)
|
||||
if ($num < $limit && empty($offset)) print '<td class="left">'.$langs->trans("Total").'</td>';
|
||||
else print '<td class="left">'.$langs->trans("Totalforthispage").'</td>';
|
||||
}
|
||||
elseif ($totalarray['totalhtfield'] == $i) print '<td align="right">'.price($totalarray['totalht']).'</td>';
|
||||
elseif ($totalarray['totalvatfield'] == $i) print '<td align="right">'.price($totalarray['totalvat']).'</td>';
|
||||
elseif ($totalarray['totallocaltax1field'] == $i) print '<td align="right">'.price($totalarray['totallocaltax1']).'</td>';
|
||||
elseif ($totalarray['totallocaltax2field'] == $i) print '<td align="right">'.price($totalarray['totallocaltax2']).'</td>';
|
||||
elseif ($totalarray['totalttcfield'] == $i) print '<td align="right">'.price($totalarray['totalttc']).'</td>';
|
||||
elseif ($totalarray['totalamfield'] == $i) print '<td align="right">'.price($totalarray['totalam']).'</td>';
|
||||
elseif ($totalarray['totalrtpfield'] == $i) print '<td align="right">'.price($totalarray['totalrtp']).'</td>';
|
||||
elseif ($totalarray['totalhtfield'] == $i) print '<td class="right">'.price($totalarray['totalht']).'</td>';
|
||||
elseif ($totalarray['totalvatfield'] == $i) print '<td class="right">'.price($totalarray['totalvat']).'</td>';
|
||||
elseif ($totalarray['totallocaltax1field'] == $i) print '<td class="right">'.price($totalarray['totallocaltax1']).'</td>';
|
||||
elseif ($totalarray['totallocaltax2field'] == $i) print '<td class="right">'.price($totalarray['totallocaltax2']).'</td>';
|
||||
elseif ($totalarray['totalttcfield'] == $i) print '<td class="right">'.price($totalarray['totalttc']).'</td>';
|
||||
elseif ($totalarray['totalamfield'] == $i) print '<td class="right">'.price($totalarray['totalam']).'</td>';
|
||||
elseif ($totalarray['totalrtpfield'] == $i) print '<td class="right">'.price($totalarray['totalrtp']).'</td>';
|
||||
else print '<td></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
@ -513,17 +513,17 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans('Invoice').'</td>';
|
||||
print '<td>'.$langs->trans('RefSupplier').'</td>';
|
||||
print '<td align="center">'.$langs->trans('Date').'</td>';
|
||||
print '<td align="center">'.$langs->trans('DateMaxPayment').'</td>';
|
||||
print '<td class="center">'.$langs->trans('Date').'</td>';
|
||||
print '<td class="center">'.$langs->trans('DateMaxPayment').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td>'.$langs->trans('Currency').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyAmountTTC').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyAlreadyPaid').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyRemainderToPay').'</td>';
|
||||
print '<td align="right">'.$langs->trans('AmountTTC').'</td>';
|
||||
print '<td align="right">'.$langs->trans('AlreadyPaid').'</td>';
|
||||
print '<td align="right">'.$langs->trans('RemainderToPay').'</td>';
|
||||
print '<td align="center">'.$langs->trans('PaymentAmount').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="center">'.$langs->trans('MulticurrencyPaymentAmount').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td class="right">'.$langs->trans('MulticurrencyAmountTTC').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td class="right">'.$langs->trans('MulticurrencyAlreadyPaid').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td class="right">'.$langs->trans('MulticurrencyRemainderToPay').'</td>';
|
||||
print '<td class="right">'.$langs->trans('AmountTTC').'</td>';
|
||||
print '<td class="right">'.$langs->trans('AlreadyPaid').'</td>';
|
||||
print '<td class="right">'.$langs->trans('RemainderToPay').'</td>';
|
||||
print '<td class="center">'.$langs->trans('PaymentAmount').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td class="center">'.$langs->trans('MulticurrencyPaymentAmount').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$total=0;
|
||||
@ -566,18 +566,18 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
// Date
|
||||
if ($objp->df > 0 )
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($objp->df), 'day').'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center"><b>!!!</b></td>';
|
||||
print '<td class="center"><b>!!!</b></td>';
|
||||
}
|
||||
|
||||
// Date Max Payment
|
||||
if ($objp->dlr > 0 )
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($objp->dlr), 'day');
|
||||
|
||||
if ($invoice->hasDelay())
|
||||
@ -589,30 +589,30 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center"><b>--</b></td>';
|
||||
print '<td class="center"><b>--</b></td>';
|
||||
}
|
||||
|
||||
// Multicurrency
|
||||
if (!empty($conf->multicurrency->enabled))
|
||||
{
|
||||
// Currency
|
||||
print '<td align="center">'.$objp->multicurrency_code."</td>\n";
|
||||
print '<td class="center">'.$objp->multicurrency_code."</td>\n";
|
||||
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
|
||||
{
|
||||
print price($objp->multicurrency_total_ttc);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
|
||||
{
|
||||
print price($objp->multicurrency_am);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
|
||||
{
|
||||
print price($objp->multicurrency_total_ttc - $objp->multicurrency_am);
|
||||
@ -620,17 +620,17 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print '<td align="right">'.price($objp->total_ttc).'</td>';
|
||||
print '<td class="right">'.price($objp->total_ttc).'</td>';
|
||||
|
||||
print '<td align="right">'.price($objp->am);
|
||||
print '<td class="right">'.price($objp->am);
|
||||
if ($creditnotes) print '+'.price($creditnotes);
|
||||
if ($deposits) print '+'.price($deposits);
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">'.price($remaintopay).'</td>';
|
||||
print '<td class="right">'.price($remaintopay).'</td>';
|
||||
|
||||
// Amount
|
||||
print '<td align="center">';
|
||||
print '<td class="center">';
|
||||
|
||||
$namef = 'amount_'.$objp->facid;
|
||||
$nameRemain = 'remain_'.$objp->facid;
|
||||
@ -652,7 +652,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
// Multicurrency Price
|
||||
if (! empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
|
||||
// Add remind multicurrency amount
|
||||
$namef = 'multicurrency_amount_'.$objp->facid;
|
||||
@ -688,19 +688,19 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
{
|
||||
// Print total
|
||||
print '<tr class="liste_total">';
|
||||
print '<td colspan="4" align="left">'.$langs->trans('TotalTTC').':</td>';
|
||||
print '<td colspan="4" class="left">'.$langs->trans('TotalTTC').':</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td> </td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td> </td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td> </td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td> </td>';
|
||||
print '<td align="right"><b>'.price($total_ttc).'</b></td>';
|
||||
print '<td align="right"><b>'.price($totalrecu);
|
||||
print '<td class="right"><b>'.price($total_ttc).'</b></td>';
|
||||
print '<td class="right"><b>'.price($totalrecu);
|
||||
if ($totalrecucreditnote) print '+'.price($totalrecucreditnote);
|
||||
if ($totalrecudeposits) print '+'.price($totalrecudeposits);
|
||||
print '</b></td>';
|
||||
print '<td align="right"><b>'.price(price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).'</b></td>';
|
||||
print '<td align="center" id="result" style="font-weight: bold;"></td>'; // Autofilled
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right" id="multicurrency_result" style="font-weight: bold;"></td>';
|
||||
print '<td class="right"><b>'.price(price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).'</b></td>';
|
||||
print '<td class="center" id="result" style="font-weight: bold;"></td>'; // Autofilled
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td class="right" id="multicurrency_result" style="font-weight: bold;"></td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</table>\n";
|
||||
@ -874,30 +874,30 @@ if (empty($action))
|
||||
|
||||
// Lines for filters fields
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" size="4" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="day" value="'.dol_escape_htmltag($day).'">';
|
||||
print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="month" value="'.dol_escape_htmltag($month).'">';
|
||||
$formother->select_year($year?$year:-1, 'year', 1, 20, 5);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" size="6" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
$form->select_types_paiements($search_paymenttype, 'search_paymenttype', '', 2, 1, 1);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" size="4" name="search_payment_num" value="'.dol_escape_htmltag($search_payment_num).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
$form->select_comptes($search_account, 'search_account', 0, '', 1);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="4" name="search_amount" value="'.dol_escape_htmltag($search_amount).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
@ -905,12 +905,12 @@ if (empty($action))
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], 'p.rowid', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], 'dp', '', $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], 'dp', '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], 's.nom', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], 'c.libelle', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "p.num_paiement", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], 'ba.label', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], 'p.amount', '', $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], 'p.amount', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
//print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],'ref_supplier','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
@ -927,7 +927,7 @@ if (empty($action))
|
||||
// Date
|
||||
$dateformatforpayment = 'day';
|
||||
if (! empty($conf->global->INVOICE_USE_HOURS_FOR_PAYMENT)) $dateformatforpayment='dayhour';
|
||||
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->dp), $dateformatforpayment)."</td>\n";
|
||||
print '<td class="nowrap center">'.dol_print_date($db->jdate($objp->dp), $dateformatforpayment)."</td>\n";
|
||||
|
||||
// Thirdparty
|
||||
print '<td>';
|
||||
@ -947,7 +947,7 @@ if (empty($action))
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">'.price($objp->pamount).'</td>';
|
||||
print '<td class="right">'.price($objp->pamount).'</td>';
|
||||
|
||||
// Ref invoice
|
||||
/*$invoicesupplierstatic->ref=$objp->ref_supplier;
|
||||
|
||||
@ -143,8 +143,8 @@ if ($year)
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Reporting").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Size").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Date").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Size").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Date").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
if (is_resource($handle))
|
||||
@ -156,8 +156,8 @@ if ($year)
|
||||
$tfile = $dir . '/'.$year.'/'.$file;
|
||||
$relativepath = $year.'/'.$file;
|
||||
print '<tr class="oddeven">'.'<td><a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart=facture_fournisseur&file=payments/'.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a></td>';
|
||||
print '<td align="right">'.dol_print_size(dol_filesize($tfile)).'</td>';
|
||||
print '<td align="right">'.dol_print_date(dol_filemtime($tfile), "dayhour").'</td></tr>';
|
||||
print '<td class="right">'.dol_print_size(dol_filesize($tfile)).'</td>';
|
||||
print '<td class="right">'.dol_print_date(dol_filemtime($tfile), "dayhour").'</td></tr>';
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
|
||||
@ -51,8 +51,8 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
||||
<td><?php echo $langs->trans("SupplierInvoice"); ?></td>
|
||||
<td><a href="<?php echo DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$objectlink->id ?>"><?php echo img_object($langs->trans("ShowBill"), "bill").' '.$objectlink->ref; ?></a></td>
|
||||
<td class="left"><?php echo $objectlink->ref_supplier; ?></td>
|
||||
<td align="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
||||
<td align="right"><?php
|
||||
<td class="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
||||
<td class="right"><?php
|
||||
if ($user->rights->fournisseur->facture->lire) {
|
||||
$sign = 1;
|
||||
if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE) $sign = -1;
|
||||
@ -66,8 +66,8 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
||||
echo '<strike>'.price($objectlink->total_ht).'</strike>';
|
||||
}
|
||||
} ?></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_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
||||
<td class="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td class="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
@ -77,11 +77,11 @@ if (count($linkedObjectBlock) > 1)
|
||||
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':''); ?>">
|
||||
<td><?php echo $langs->trans("Total"); ?></td>
|
||||
<td></td>
|
||||
<td align="center"></td>
|
||||
<td align="center"></td>
|
||||
<td align="right"><?php echo price($total); ?></td>
|
||||
<td align="right"></td>
|
||||
<td align="right"></td>
|
||||
<td class="center"></td>
|
||||
<td class="center"></td>
|
||||
<td class="right"><?php echo price($total); ?></td>
|
||||
<td class="right"></td>
|
||||
<td class="right"></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ if ($resql)
|
||||
$i = 0;
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Orders").'</td><td align="center">'.$langs->trans("Nb").'</td><td> </td>';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Orders").'</td><td class="center">'.$langs->trans("Nb").'</td><td> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
while ($i < $num)
|
||||
@ -80,8 +80,8 @@ if ($resql)
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$commandestatic->LibStatut($row[1]).'</td>';
|
||||
print '<td align="center">'.$row[0].'</td>';
|
||||
print '<td align="center"><a href="'.DOL_URL_ROOT.'/fourn/commande/list.php?statut='.$row[1].'">'.$commandestatic->LibStatut($row[1], 3).'</a></td>';
|
||||
print '<td class="center">'.$row[0].'</td>';
|
||||
print '<td class="center"><a href="'.DOL_URL_ROOT.'/fourn/commande/list.php?statut='.$row[1].'">'.$commandestatic->LibStatut($row[1], 3).'</a></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
@ -139,14 +139,14 @@ if (! empty($conf->fournisseur->enabled))
|
||||
$companystatic->client=0;
|
||||
print $companystatic->getNomUrl(1, '', 16);
|
||||
print '</td>';
|
||||
print '<td align="right" class="nowrap">'.price($obj->total_ttc).'</td></tr>';
|
||||
print '<td class="right nowrap">'.price($obj->total_ttc).'</td></tr>';
|
||||
$i++;
|
||||
$total += $obj->total_ttc;
|
||||
}
|
||||
if ($total>0)
|
||||
{
|
||||
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" align="right">'.price($total)."</td></tr>";
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" class="right">'.price($total)."</td></tr>";
|
||||
}
|
||||
print "</table>";
|
||||
print "<br>\n";
|
||||
@ -197,14 +197,14 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
||||
$companystatic->client=0;
|
||||
print $companystatic->getNomUrl(1, '', 16);
|
||||
print '</td>';
|
||||
print '<td align="right">'.price($obj->total_ttc).'</td>';
|
||||
print '<td class="right">'.price($obj->total_ttc).'</td>';
|
||||
print '</tr>';
|
||||
$tot_ttc+=$obj->total_ttc;
|
||||
$i++;
|
||||
}
|
||||
|
||||
print '<tr class="liste_total"><td class="left">'.$langs->trans("Total").'</td>';
|
||||
print '<td colspan="2" align="right">'.price($tot_ttc).'</td>';
|
||||
print '<td colspan="2" class="right">'.price($tot_ttc).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print "</table>";
|
||||
@ -250,7 +250,7 @@ if ($resql)
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans("BoxTitleLastSuppliers", min($max, $num))."</td>\n";
|
||||
print '<td align="right">'.$langs->trans("DateModification")."</td>\n";
|
||||
print '<td class="right">'.$langs->trans("DateModification")."</td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
while ($obj = $db->fetch_object($resql) )
|
||||
@ -259,7 +259,7 @@ if ($resql)
|
||||
print '<td><a href="card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowSupplier"), "company").'</a>';
|
||||
print " <a href=\"card.php?socid=".$obj->socid."\">".$obj->name."</a></td>\n";
|
||||
print '<td class="left">'.$obj->code_fournisseur.' </td>';
|
||||
print '<td align="right">'.dol_print_date($db->jdate($obj->tms), 'day').'</td>';
|
||||
print '<td class="right">'.dol_print_date($db->jdate($obj->tms), 'day').'</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</table>\n";
|
||||
@ -298,7 +298,7 @@ if (count($companystatic->SupplierCategories))
|
||||
print '</td>'."\n";
|
||||
// TODO this page not exist
|
||||
/*
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
print '<a href="stats.php?cat='.$rowid.'">('.$langs->trans("Stats").')</a>';
|
||||
print "</tr>\n";
|
||||
*/
|
||||
|
||||
@ -243,7 +243,7 @@ if ($resql)
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre right">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
@ -255,9 +255,9 @@ if ($resql)
|
||||
print_liste_field_titre("RefSupplierShort", $_SERVER["PHP_SELF"], "ppf.ref_fourn", $param, "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", $param, "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Supplier", $_SERVER["PHP_SELF"], "ppf.fk_soc", $param, "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("BuyingPrice", $_SERVER["PHP_SELF"], "ppf.price", $param, "", 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("QtyMin", $_SERVER["PHP_SELF"], "ppf.quantity", $param, "", 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("UnitPrice", $_SERVER["PHP_SELF"], "ppf.unitprice", $param, "", 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("BuyingPrice", $_SERVER["PHP_SELF"], "ppf.price", $param, "", '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("QtyMin", $_SERVER["PHP_SELF"], "ppf.quantity", $param, "", '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("UnitPrice", $_SERVER["PHP_SELF"], "ppf.unitprice", $param, "", '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"]);
|
||||
print "</tr>\n";
|
||||
|
||||
@ -287,13 +287,13 @@ if ($resql)
|
||||
if ($companystatic->id > 0) print $companystatic->getNomUrl(1, 'supplier');
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">'.(isset($objp->price) ? price($objp->price) : '').'</td>';
|
||||
print '<td class="right">'.(isset($objp->price) ? price($objp->price) : '').'</td>';
|
||||
|
||||
print '<td align="right">'.$objp->qty.'</td>';
|
||||
print '<td class="right">'.$objp->qty.'</td>';
|
||||
|
||||
print '<td align="right">'.(isset($objp->unitprice) ? price($objp->unitprice) : '').'</td>';
|
||||
print '<td class="right">'.(isset($objp->unitprice) ? price($objp->unitprice) : '').'</td>';
|
||||
|
||||
print '<td align="right"></td>';
|
||||
print '<td class="right"></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
|
||||
@ -87,12 +87,12 @@ if ($socid > 0)
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="100" align="center">'.$langs->trans("Date").'</td>';
|
||||
print '<td width="100" class="center">'.$langs->trans("Date").'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td>'.$langs->trans("Status").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Debit").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Credit").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Balance").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Debit").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Credit").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Balance").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -119,15 +119,15 @@ if ($socid > 0)
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print "<td align=\"center\">".dol_print_date($fac->date)."</td>\n";
|
||||
print "<td class=\"center\">".dol_print_date($fac->date)."</td>\n";
|
||||
print "<td><a href=\"facture/card.php?facid=$fac->id\">".img_object($langs->trans("ShowBill"), "bill")." ".$fac->ref."</a></td>\n";
|
||||
|
||||
print '<td aling="left">'.$fac->getLibStatut(2, $totalpaye).'</td>';
|
||||
print '<td align="right">'.price($fac->total_ttc)."</td>\n";
|
||||
print '<td class="left">'.$fac->getLibStatut(2, $totalpaye).'</td>';
|
||||
print '<td class="right">'.price($fac->total_ttc)."</td>\n";
|
||||
$solde = $solde + $fac->total_ttc;
|
||||
|
||||
print '<td align="right"> </td>';
|
||||
print '<td align="right">'.price($solde)."</td>\n";
|
||||
print '<td class="right"> </td>';
|
||||
print '<td class="right">'.price($solde)."</td>\n";
|
||||
|
||||
// Author
|
||||
print '<td class="nowrap" width="50"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$objf->userid.'">'.img_object($langs->trans("ShowUser"), 'user').' '.$objf->login.'</a></td>';
|
||||
@ -154,15 +154,15 @@ if ($socid > 0)
|
||||
$objp = $db->fetch_object($resqlp);
|
||||
//
|
||||
print '<tr class="oddeven">';
|
||||
print '<td align="center">'.dol_print_date($db->jdate($objp->dp))."</td>\n";
|
||||
print '<td class="center">'.dol_print_date($db->jdate($objp->dp))."</td>\n";
|
||||
print '<td>';
|
||||
print ' '; // Decalage
|
||||
print '<a href="paiement/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowPayment"), "payment").' '.$langs->trans("Payment").' '.$objp->rowid.'</td>';
|
||||
print "<td> </td>\n";
|
||||
print "<td> </td>\n";
|
||||
print '<td align="right">'.price($objp->amount).'</td>';
|
||||
print '<td class="right">'.price($objp->amount).'</td>';
|
||||
$solde = $solde - $objp->amount;
|
||||
print '<td align="right">'.price($solde)."</td>\n";
|
||||
print '<td class="right">'.price($solde)."</td>\n";
|
||||
|
||||
// Auteur
|
||||
print '<td class="nowrap" width="50"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$objp->userid.'">'.img_object($langs->trans("ShowUser"), 'user').' '.$objp->login.'</a></td>';
|
||||
|
||||
@ -58,6 +58,8 @@ CREATE TABLE llx_pos_cash_fence(
|
||||
|
||||
-- For 10.0
|
||||
|
||||
DROP TABLE llx_cotisation;
|
||||
|
||||
ALTER TABLE llx_loan ADD COLUMN insurance_amount double(24,8) DEFAULT 0;
|
||||
|
||||
ALTER TABLE llx_facture DROP INDEX idx_facture_uk_facnumber;
|
||||
@ -237,3 +239,6 @@ ALTER TABLE llx_facturedet_rec ADD COLUMN fk_product_fournisseur_price integer D
|
||||
ALTER TABLE llx_facturedet_rec ADD COLUMN fk_user_author integer;
|
||||
ALTER TABLE llx_facturedet_rec ADD COLUMN fk_user_modif integer;
|
||||
|
||||
ALTER TABLE llx_expensereport_det MODIFY COLUMN value_unit double(24,8) NOT NULL;
|
||||
ALTER TABLE llx_expensereport_det ADD COLUMN subprice double(24,8) DEFAULT 0 NOT NULL after qty;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user