Merge branch '5.0' of github.com:atm-maxime/dolibarr into fix_member_search_pgsql
This commit is contained in:
commit
37b1b161f9
@ -2,6 +2,7 @@
|
|||||||
# from Dolibarr GitHub repository.
|
# from Dolibarr GitHub repository.
|
||||||
# For syntax, see http://about.travis-ci.org/docs/user/languages/php/
|
# For syntax, see http://about.travis-ci.org/docs/user/languages/php/
|
||||||
|
|
||||||
|
dist: precise
|
||||||
sudo: required
|
sudo: required
|
||||||
|
|
||||||
language: php
|
language: php
|
||||||
|
|||||||
36
ChangeLog
36
ChangeLog
@ -2,6 +2,40 @@
|
|||||||
English Dolibarr ChangeLog
|
English Dolibarr ChangeLog
|
||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
|
|
||||||
|
***** ChangeLog for 5.0.6 compared to 5.0.5 *****
|
||||||
|
FIX: Removed a bad symbolic link into custom directory.
|
||||||
|
FIX: Renaming a resouce ref rename also the directory of attached files.
|
||||||
|
|
||||||
|
***** ChangeLog for 5.0.5 compared to 5.0.4 *****
|
||||||
|
FIX: #7075 : bad path for document
|
||||||
|
FIX: #7156
|
||||||
|
FIX: #7173
|
||||||
|
FIX: #7224
|
||||||
|
FIX: #7226
|
||||||
|
FIX: #7239
|
||||||
|
FIX: add supplierproposaldet without price (new product)
|
||||||
|
FIX: amount overlap other amount when a pagebreak is done due to an image at the bottom of page.
|
||||||
|
FIX: Bad tax calculation with expense report
|
||||||
|
FIX: Best buy price calculation
|
||||||
|
FIX: Buying prices must always be in positive value.
|
||||||
|
FIX: calculate correct remain to pay for planned bank transactions
|
||||||
|
FIX: delete linked element on facture rec
|
||||||
|
FIX: edit sociale was emptying label
|
||||||
|
FIX: Error when updating thirdparty not returned
|
||||||
|
FIX: holidays with postgresql like on rowid integer
|
||||||
|
FIX: id of user not saved when making a payment of expense report
|
||||||
|
FIX: invoice page list
|
||||||
|
FIX: invoice situation VAT total rounding into PDF crabe
|
||||||
|
FIX: PgSQL compatibility.
|
||||||
|
FIX: remove order rights on invoice page
|
||||||
|
FIX: status were wrong on product referent list
|
||||||
|
FIX: supplier id was not passed to hooks
|
||||||
|
FIX: Support of vat code when using price per customer
|
||||||
|
FIX: User id correction on holiday request
|
||||||
|
FIX: value of user id filled to 0 in llx_bank_url when recording an expense report.
|
||||||
|
FIX: we have to check if contact doesn't already exist on add_contact() function
|
||||||
|
FIX: We should be able to insert data with value '0' into const
|
||||||
|
FIX: install process with DoliWamp
|
||||||
|
|
||||||
***** ChangeLog for 5.0.4 compared to 5.0.3 *****
|
***** ChangeLog for 5.0.4 compared to 5.0.3 *****
|
||||||
FIX: #5640 Prices of a predefined product/service were incorrect under certain circumstances
|
FIX: #5640 Prices of a predefined product/service were incorrect under certain circumstances
|
||||||
@ -507,7 +541,7 @@ NEW: Disabled users are striked.
|
|||||||
NEW: Enhance navigation of project module
|
NEW: Enhance navigation of project module
|
||||||
NEW: fichinter lines ordered by rang AND DATE
|
NEW: fichinter lines ordered by rang AND DATE
|
||||||
NEW: hidden conf to use input file multiple from mail form
|
NEW: hidden conf to use input file multiple from mail form
|
||||||
NEW: hidden feature: SUPPLIERORDER_WITH_NOPRICEDEFINED allow supplier order even if no supplier price defined
|
NEW: hidden feature: SUPPLIER_ORDER_WITH_NOPRICEDEFINED allow supplier order even if no supplier price defined
|
||||||
NEW: Hidden option MAIN_LANDING_PAGE to choose the first page to show after login works as a "global" option (llx_const) and as a "per user" option (llx_user_param).
|
NEW: Hidden option MAIN_LANDING_PAGE to choose the first page to show after login works as a "global" option (llx_const) and as a "per user" option (llx_user_param).
|
||||||
NEW: Holiday is a now a RH module. All RH module provides by default visilibity on users of its hierarchy.
|
NEW: Holiday is a now a RH module. All RH module provides by default visilibity on users of its hierarchy.
|
||||||
NEW: If error is reported during migration process, you can ignore it to avoid to be locked.
|
NEW: If error is reported during migration process, you can ignore it to avoid to be locked.
|
||||||
|
|||||||
@ -353,10 +353,12 @@ begin
|
|||||||
begin
|
begin
|
||||||
// TODO Copy file or ask to install package ?
|
// TODO Copy file or ask to install package ?
|
||||||
//CustomMessage('YouWillInstallDoliWamp')+#13#13
|
//CustomMessage('YouWillInstallDoliWamp')+#13#13
|
||||||
MsgBox('The package vcredist_x86.exe must have been installed first. It seems it is not. Please install it first from <a href="http://ccc">http://www.microsoft.com/en-us/download/details.aspx?id=30679</a> then restart DoliWamp installation/upgrade.',mbInformation,MB_OK);
|
MsgBox('The package vcredist_x86.exe must have been installed first. It seems it is not. Please install it first from <a href="http://www.microsoft.com/en-us/download/details.aspx?id=30679">http://www.microsoft.com/en-us/download/details.aspx?id=30679</a> then restart DoliWamp installation/upgrade.',mbInformation,MB_OK);
|
||||||
end;
|
end;
|
||||||
|
// Pb seems similar with msvcp110.dll
|
||||||
|
//vcredist_x64.exe
|
||||||
|
|
||||||
|
|
||||||
// If we have a new database version, we should only copy old my.ini file into new directory
|
// If we have a new database version, we should only copy old my.ini file into new directory
|
||||||
// and change only all basedir= strings to use new version. Like this, data dir is still correct.
|
// and change only all basedir= strings to use new version. Like this, data dir is still correct.
|
||||||
// Install of service and stop/start scripts are already rebuild by installer.
|
// Install of service and stop/start scripts are already rebuild by installer.
|
||||||
|
|||||||
@ -40,7 +40,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
|||||||
* Main
|
* Main
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (empty($argv[1]))
|
if (empty($argv[1]))
|
||||||
{
|
{
|
||||||
print "Usage: ".$script_file." release=x.y.z\n";
|
print "Usage: ".$script_file." release=x.y.z\n";
|
||||||
exit -1;
|
exit -1;
|
||||||
@ -54,7 +54,7 @@ if ($release != DOL_VERSION)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
|
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
|
||||||
$outputdir=dirname(__FILE__).'/../htdocs/install';
|
$outputdir=dirname(dirname(__FILE__)).'/htdocs/install';
|
||||||
print 'Delete current files '.$outputdir.'/filelist*.xml'."\n";
|
print 'Delete current files '.$outputdir.'/filelist*.xml'."\n";
|
||||||
dol_delete_file($outputdir.'/filelist*.xml',0,1,1);
|
dol_delete_file($outputdir.'/filelist*.xml',0,1,1);
|
||||||
|
|
||||||
|
|||||||
@ -334,7 +334,7 @@ foreach my $target (sort keys %CHOOSEDTARGET) {
|
|||||||
}
|
}
|
||||||
foreach my $target (sort keys %CHOOSEDPUBLISH) {
|
foreach my $target (sort keys %CHOOSEDPUBLISH) {
|
||||||
if ($CHOOSEDPUBLISH{$target} < 0) { next; }
|
if ($CHOOSEDPUBLISH{$target} < 0) { next; }
|
||||||
if ($target eq 'ASSO') { $nbofpublishneedchangelog++; $nbofpublishneedtag++; }
|
if ($target eq 'ASSO') { $nbofpublishneedchangelog++; }
|
||||||
if ($target eq 'SF') { $nbofpublishneedchangelog++; $nbofpublishneedtag++; }
|
if ($target eq 'SF') { $nbofpublishneedchangelog++; $nbofpublishneedtag++; }
|
||||||
$nboftargetok++;
|
$nboftargetok++;
|
||||||
}
|
}
|
||||||
@ -594,7 +594,9 @@ if ($nboftargetok) {
|
|||||||
|
|
||||||
print "Remove subdir of custom dir\n";
|
print "Remove subdir of custom dir\n";
|
||||||
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
|
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
|
||||||
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to keep dir
|
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to keep files only
|
||||||
|
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n";
|
||||||
|
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to keep files only
|
||||||
}
|
}
|
||||||
|
|
||||||
# Build package for each target
|
# Build package for each target
|
||||||
|
|||||||
@ -198,6 +198,9 @@ class Adherent extends CommonObject
|
|||||||
$infos.= $langs->transnoentities("Town").": ".$this->town."\n";
|
$infos.= $langs->transnoentities("Town").": ".$this->town."\n";
|
||||||
$infos.= $langs->transnoentities("Country").": ".$this->country."\n";
|
$infos.= $langs->transnoentities("Country").": ".$this->country."\n";
|
||||||
$infos.= $langs->transnoentities("EMail").": ".$this->email."\n";
|
$infos.= $langs->transnoentities("EMail").": ".$this->email."\n";
|
||||||
|
$infos.= $langs->transnoentities("PhonePro").": ".$this->phone."\n";
|
||||||
|
$infos.= $langs->transnoentities("PhonePerso").": ".$this->phone_perso."\n";
|
||||||
|
$infos.= $langs->transnoentities("PhoneMobile").": ".$this->phone_mobile."\n";
|
||||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||||
{
|
{
|
||||||
$infos.= $langs->transnoentities("Login").": ".$this->login."\n";
|
$infos.= $langs->transnoentities("Login").": ".$this->login."\n";
|
||||||
@ -225,6 +228,10 @@ class Adherent extends CommonObject
|
|||||||
'%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
|
'%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
|
||||||
'%LOGIN%'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
|
'%LOGIN%'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
|
||||||
'%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass,
|
'%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass,
|
||||||
|
'%TYPE%'=>$msgishtml?dol_htmlentitiesbr($this->type):$this->type,
|
||||||
|
'%PHONE_PRO%'=>$msgishtml?dol_htmlentitiesbr($this->phone):$this->phone,
|
||||||
|
'%PHONE_PERSO%'=>$msgishtml?dol_htmlentitiesbr($this->phone_perso):$this->phone_perso,
|
||||||
|
'%PHONE_MOBILE%'=>$msgishtml?dol_htmlentitiesbr($this->phone_mobile):$this->phone_mobile,
|
||||||
// For backward compatibility
|
// For backward compatibility
|
||||||
'%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos,
|
'%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos,
|
||||||
'%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
|
'%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
|
||||||
|
|||||||
@ -127,7 +127,7 @@ class AdherentType extends CommonObject
|
|||||||
$sql.= "note = '".$this->db->escape($this->note)."',";
|
$sql.= "note = '".$this->db->escape($this->note)."',";
|
||||||
$sql.= "vote = '".$this->vote."',";
|
$sql.= "vote = '".$this->vote."',";
|
||||||
$sql.= "mail_valid = '".$this->db->escape($this->mail_valid)."'";
|
$sql.= "mail_valid = '".$this->db->escape($this->mail_valid)."'";
|
||||||
$sql .= " WHERE rowid =".$this->id;
|
$sql.= " WHERE rowid =".$this->id;
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@ -245,7 +245,7 @@ class AdherentType extends CommonObject
|
|||||||
|
|
||||||
$sql = "SELECT rowid, libelle";
|
$sql = "SELECT rowid, libelle";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type";
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type";
|
||||||
$sql.= " WHERE entity = ".$conf->entity;
|
$sql.= " WHERE entity IN (".getEntity('adherent').")";
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
@ -113,7 +113,6 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
|
|||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$errmsg=$langs->trans($company->error);
|
|
||||||
setEventMessages($company->error, $company->errors, 'errors');
|
setEventMessages($company->error, $company->errors, 'errors');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -123,7 +122,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$errmsg=$object->error;
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,7 +210,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
$paymentdate=dol_mktime(0, 0, 0, $_POST["paymentmonth"], $_POST["paymentday"], $_POST["paymentyear"]);
|
$paymentdate=dol_mktime(0, 0, 0, $_POST["paymentmonth"], $_POST["paymentday"], $_POST["paymentyear"]);
|
||||||
}
|
}
|
||||||
$subscription=$_POST["subscription"]; // Amount of subscription
|
$subscription=price2num(GETPOST("subscription",'alpha')); // Amount of subscription
|
||||||
$label=$_POST["label"];
|
$label=$_POST["label"];
|
||||||
|
|
||||||
// Payment informations
|
// Payment informations
|
||||||
@ -229,6 +228,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateSubscription"));
|
$errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateSubscription"));
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
$action='addsubscription';
|
$action='addsubscription';
|
||||||
}
|
}
|
||||||
if (GETPOST('end') && ! $datesubend)
|
if (GETPOST('end') && ! $datesubend)
|
||||||
@ -236,6 +236,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateEndSubscription"));
|
$errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateEndSubscription"));
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
$action='addsubscription';
|
$action='addsubscription';
|
||||||
}
|
}
|
||||||
if (! $datesubend)
|
if (! $datesubend)
|
||||||
@ -246,16 +247,20 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePayment"));
|
$errmsg=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePayment"));
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
$action='addsubscription';
|
$action='addsubscription';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$amount = price2num(GETPOST("subscription",'alpha'));
|
||||||
|
|
||||||
// Check if a payment is mandatory or not
|
// Check if a payment is mandatory or not
|
||||||
if (! $error && $adht->subscription) // Member type need subscriptions
|
if (! $error && $adht->subscription) // Member type need subscriptions
|
||||||
{
|
{
|
||||||
if (! is_numeric($_POST["subscription"]))
|
if (! is_numeric($amount))
|
||||||
{
|
{
|
||||||
// If field is '' or not a numeric value
|
// If field is '' or not a numeric value
|
||||||
$errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
|
$errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
$action='addsubscription';
|
$action='addsubscription';
|
||||||
}
|
}
|
||||||
@ -273,7 +278,11 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
if ($_POST["accountid"]) $errmsg=$langs->trans("ErrorDoNotProvideAccountsIfNullAmount");
|
if ($_POST["accountid"]) $errmsg=$langs->trans("ErrorDoNotProvideAccountsIfNullAmount");
|
||||||
}
|
}
|
||||||
if ($errmsg) $action='addsubscription';
|
if ($errmsg)
|
||||||
|
{
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
|
$action='addsubscription';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -319,6 +328,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg=$db->lasterror();
|
$errmsg=$db->lasterror();
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -326,14 +336,16 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
$error++;
|
$error++;
|
||||||
$errmsg=$acct->error;
|
$errmsg=$acct->error;
|
||||||
$errmsgs=$acct->errors;
|
$errmsgs=$acct->errors;
|
||||||
}
|
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg=$acct->error;
|
$errmsg=$acct->error;
|
||||||
$errmsgs=$acct->errors;
|
$errmsgs=$acct->errors;
|
||||||
}
|
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If option choosed, we create invoice
|
// If option choosed, we create invoice
|
||||||
@ -351,6 +363,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$errmsg=$langs->trans("ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst");
|
$errmsg=$langs->trans("ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst");
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -361,6 +374,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
$errmsg=$customer->error;
|
$errmsg=$customer->error;
|
||||||
$errmsgs=$acct->errors;
|
$errmsgs=$acct->errors;
|
||||||
|
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -378,6 +392,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg='ErrorNoPaymentTermRECEPFound';
|
$errmsg='ErrorNoPaymentTermRECEPFound';
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$invoice->socid=$object->fk_soc;
|
$invoice->socid=$object->fk_soc;
|
||||||
@ -389,12 +404,13 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
$invoice->linked_objects = array_merge($invoice->linked_objects, $_POST['other_linked_objects']);
|
$invoice->linked_objects = array_merge($invoice->linked_objects, $_POST['other_linked_objects']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result=$invoice->create($user);
|
$result=$invoice->create($user);
|
||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
{
|
{
|
||||||
$errmsg=$invoice->error;
|
$errmsg=$invoice->error;
|
||||||
$errmsgs=$invoice->errors;
|
$errmsgs=$invoice->errors;
|
||||||
|
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -415,6 +431,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
{
|
{
|
||||||
$errmsg=$invoice->error;
|
$errmsg=$invoice->error;
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -427,6 +444,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
$errmsg=$invoice->error;
|
$errmsg=$invoice->error;
|
||||||
$errmsgs=$invoice->errors;
|
$errmsgs=$invoice->errors;
|
||||||
|
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -454,6 +472,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
$errmsg=$paiement->error;
|
$errmsg=$paiement->error;
|
||||||
$errmsgs=$paiement->errors;
|
$errmsgs=$paiement->errors;
|
||||||
|
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -535,6 +554,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$errmsg=$object->error;
|
$errmsg=$object->error;
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -581,12 +601,12 @@ if ($rowid > 0)
|
|||||||
dol_fiche_head($head, 'subscription', $langs->trans("Member"), 0, 'user');
|
dol_fiche_head($head, 'subscription', $langs->trans("Member"), 0, 'user');
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'rowid', $linkback);
|
dol_banner_tab($object, 'rowid', $linkback);
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
@ -624,13 +644,13 @@ if ($rowid > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="fichehalfright"><div class="ficheaddleft">';
|
print '<div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
print '<table class="border tableforfield" width="100%">';
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
// Birthday
|
// Birthday
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';
|
print '<tr><td class="titlefield">'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';
|
||||||
|
|
||||||
@ -677,7 +697,7 @@ if ($rowid > 0)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Third party Dolibarr
|
// Third party Dolibarr
|
||||||
if (! empty($conf->societe->enabled))
|
if (! empty($conf->societe->enabled))
|
||||||
{
|
{
|
||||||
@ -752,7 +772,7 @@ if ($rowid > 0)
|
|||||||
|
|
||||||
print "</div></div></div>\n";
|
print "</div></div></div>\n";
|
||||||
print '<div style="clear:both"></div>';
|
print '<div style="clear:both"></div>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -40,7 +40,7 @@ $action = GETPOST('action','alpha');
|
|||||||
$value = GETPOST('value','alpha');
|
$value = GETPOST('value','alpha');
|
||||||
$param = GETPOST('param','alpha');
|
$param = GETPOST('param','alpha');
|
||||||
$cancel = GETPOST('cancel','alpha');
|
$cancel = GETPOST('cancel','alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scan_dir','alpha');
|
||||||
$type = 'action';
|
$type = 'action';
|
||||||
|
|
||||||
|
|
||||||
@ -286,7 +286,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
|||||||
print '<td align="center">'."\n";
|
print '<td align="center">'."\n";
|
||||||
if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name")
|
if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name")
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">';
|
||||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
@ -299,7 +299,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td align="center">'."\n";
|
print '<td align="center">'."\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -311,7 +311,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,7 @@ if (!$user->admin)
|
|||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
$value = GETPOST('value','alpha');
|
$value = GETPOST('value','alpha');
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label','alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scan_dir','alpha');
|
||||||
$type = 'bankaccount';
|
$type = 'bankaccount';
|
||||||
|
|
||||||
|
|
||||||
@ -324,7 +324,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td align="center">' . "\n";
|
print '<td align="center">' . "\n";
|
||||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&scandir=' . $module->scandir . '&label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>';
|
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&scan_dir=' . $module->scandir . '&label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -333,7 +333,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
if ($conf->global->BANKADDON_PDF == $name) {
|
if ($conf->global->BANKADDON_PDF == $name) {
|
||||||
print img_picto($langs->trans("Default"), 'on');
|
print img_picto($langs->trans("Default"), 'on');
|
||||||
} else {
|
} else {
|
||||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&value=' . $name . '&scandir=' . $module->scandir . '&label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
|
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&value=' . $name . '&scan_dir=' . $module->scandir . '&label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -189,7 +189,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -45,7 +45,7 @@ if (! $user->admin) accessforbidden();
|
|||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
$value = GETPOST('value','alpha');
|
$value = GETPOST('value','alpha');
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label','alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scan_dir','alpha');
|
||||||
$type = 'order';
|
$type = 'order';
|
||||||
|
|
||||||
|
|
||||||
@ -490,7 +490,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td align="center">'."\n";
|
print '<td align="center">'."\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -502,7 +502,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ if (!$user->admin) accessforbidden();
|
|||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
$value = GETPOST('value','alpha');
|
$value = GETPOST('value','alpha');
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label','alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scan_dir','alpha');
|
||||||
$type='contract';
|
$type='contract';
|
||||||
|
|
||||||
if (empty($conf->global->CONTRACT_ADDON))
|
if (empty($conf->global->CONTRACT_ADDON))
|
||||||
@ -425,7 +425,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td align="center">'."\n";
|
print '<td align="center">'."\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -437,7 +437,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -44,7 +44,7 @@ if (! $user->admin)
|
|||||||
$action=GETPOST('action','alpha');
|
$action=GETPOST('action','alpha');
|
||||||
$value=GETPOST('value','alpha');
|
$value=GETPOST('value','alpha');
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label','alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scan_dir','alpha');
|
||||||
$type='shipping';
|
$type='shipping';
|
||||||
|
|
||||||
if (empty($conf->global->EXPEDITION_ADDON_NUMBER))
|
if (empty($conf->global->EXPEDITION_ADDON_NUMBER))
|
||||||
@ -291,7 +291,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&value='.$file.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&value='.$file.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
@ -432,7 +432,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td align="center">'."\n";
|
print '<td align="center">'."\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -444,7 +444,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -470,7 +470,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'sending').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'sending').'</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -43,7 +43,7 @@ if (! $user->admin) accessforbidden();
|
|||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
$value = GETPOST('value','alpha');
|
$value = GETPOST('value','alpha');
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label','alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scan_dir','alpha');
|
||||||
$type='expensereport';
|
$type='expensereport';
|
||||||
|
|
||||||
|
|
||||||
@ -423,7 +423,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
if (in_array($name, $def))
|
if (in_array($name, $def))
|
||||||
{
|
{
|
||||||
print "<td align=\"center\">\n";
|
print "<td align=\"center\">\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@ -431,7 +431,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<td align=\"center\">\n";
|
print "<td align=\"center\">\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -443,7 +443,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,7 @@ if (! $user->admin) accessforbidden();
|
|||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
$value = GETPOST('value','alpha');
|
$value = GETPOST('value','alpha');
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label','alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scan_dir','alpha');
|
||||||
$type='ficheinter';
|
$type='ficheinter';
|
||||||
|
|
||||||
|
|
||||||
@ -458,7 +458,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
if (in_array($name, $def))
|
if (in_array($name, $def))
|
||||||
{
|
{
|
||||||
print "<td align=\"center\">\n";
|
print "<td align=\"center\">\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@ -466,7 +466,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<td align=\"center\">\n";
|
print "<td align=\"center\">\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -478,7 +478,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,7 @@ if (!$user->admin) accessforbidden();
|
|||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
$value = GETPOST('value','alpha');
|
$value = GETPOST('value','alpha');
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label','alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scan_dir','alpha');
|
||||||
$type='delivery';
|
$type='delivery';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -412,7 +412,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
if (in_array($name, $def))
|
if (in_array($name, $def))
|
||||||
{
|
{
|
||||||
print "<td align=\"center\">\n";
|
print "<td align=\"center\">\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@ -420,7 +420,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<td align=\"center\">\n";
|
print "<td align=\"center\">\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -432,7 +432,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -61,7 +61,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/del_(.*)/',$action,$reg))
|
if (preg_match('/del_(.*)/',$action,$reg))
|
||||||
{
|
{
|
||||||
$code=$reg[1];
|
$code=$reg[1];
|
||||||
@ -79,7 +79,7 @@ if (preg_match('/del_(.*)/',$action,$reg))
|
|||||||
if ($action == 'add_currency')
|
if ($action == 'add_currency')
|
||||||
{
|
{
|
||||||
$langs->loadCacheCurrencies('');
|
$langs->loadCacheCurrencies('');
|
||||||
|
|
||||||
$code = GETPOST('code', 'alpha');
|
$code = GETPOST('code', 'alpha');
|
||||||
$rate = GETPOST('rate', 'alpha');
|
$rate = GETPOST('rate', 'alpha');
|
||||||
$currency = new MultiCurrency($db);
|
$currency = new MultiCurrency($db);
|
||||||
@ -96,23 +96,23 @@ if ($action == 'add_currency')
|
|||||||
elseif ($action == 'update_currency')
|
elseif ($action == 'update_currency')
|
||||||
{
|
{
|
||||||
$submit = GETPOST('submit', 'alpha');
|
$submit = GETPOST('submit', 'alpha');
|
||||||
|
|
||||||
if ($submit == $langs->trans('Modify'))
|
if ($submit == $langs->trans('Modify'))
|
||||||
{
|
{
|
||||||
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
|
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
|
||||||
$rate = GETPOST('rate', 'float');
|
$rate = price2num(GETPOST('rate', 'alpha'));
|
||||||
$currency = new MultiCurrency($db);
|
$currency = new MultiCurrency($db);
|
||||||
|
|
||||||
if ($currency->fetch($fk_multicurrency) > 0)
|
if ($currency->fetch($fk_multicurrency) > 0)
|
||||||
{
|
{
|
||||||
$currency->updateRate($rate);
|
$currency->updateRate($rate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($submit == $langs->trans('Delete'))
|
elseif ($submit == $langs->trans('Delete'))
|
||||||
{
|
{
|
||||||
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
|
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
|
||||||
$currency = new MultiCurrency($db);
|
$currency = new MultiCurrency($db);
|
||||||
|
|
||||||
if ($currency->fetch($fk_multicurrency) > 0)
|
if ($currency->fetch($fk_multicurrency) > 0)
|
||||||
{
|
{
|
||||||
if ($currency->delete() > 0) setEventMessages($langs->trans('RecordDeleted'), array());
|
if ($currency->delete() > 0) setEventMessages($langs->trans('RecordDeleted'), array());
|
||||||
@ -120,14 +120,14 @@ elseif ($action == 'update_currency')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($action == 'synchronize')
|
elseif ($action == 'synchronize')
|
||||||
{
|
{
|
||||||
$response = GETPOST('response');
|
$response = GETPOST('response');
|
||||||
$response = json_decode($response);
|
$response = json_decode($response);
|
||||||
|
|
||||||
if ($response->success)
|
if ($response->success)
|
||||||
{
|
{
|
||||||
MultiCurrency::syncRates($response);
|
MultiCurrency::syncRates($response);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -226,7 +226,7 @@ print '</form>';
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* TODO uncomment when the functionality will integrated
|
/* TODO uncomment when the functionality will integrated
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td>'.$langs->transnoentitiesnoconv("multicurrency_modifyRateApplication").'</td>';
|
print '<td>'.$langs->transnoentitiesnoconv("multicurrency_modifyRateApplication").'</td>';
|
||||||
@ -259,8 +259,8 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
|
|||||||
print $langs->trans("Value").' <input type="button" id="bt_sync" class="button" onclick="javascript:getRates();" value="'.$langs->trans('Synchronize').'" />';
|
print $langs->trans("Value").' <input type="button" id="bt_sync" class="button" onclick="javascript:getRates();" value="'.$langs->trans('Synchronize').'" />';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td><a target="_blank" href="https://currencylayer.com">'.$langs->transnoentitiesnoconv("multicurrency_appId").'</a></td>';
|
print '<td><a target="_blank" href="https://currencylayer.com">'.$langs->transnoentitiesnoconv("multicurrency_appId").'</a></td>';
|
||||||
@ -273,7 +273,7 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
|
|||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td>'.$langs->transnoentitiesnoconv("multicurrency_appCurrencySource").'</td>';
|
print '<td>'.$langs->transnoentitiesnoconv("multicurrency_appCurrencySource").'</td>';
|
||||||
@ -286,7 +286,7 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
|
|||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td>'.$langs->transnoentitiesnoconv("multicurrency_alternateCurrencySource").'</td>';
|
print '<td>'.$langs->transnoentitiesnoconv("multicurrency_alternateCurrencySource").'</td>';
|
||||||
@ -299,7 +299,7 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
|
|||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br />';
|
print '<br />';
|
||||||
}
|
}
|
||||||
@ -334,7 +334,7 @@ print '</td></form></tr>';
|
|||||||
foreach ($TCurrency as &$currency)
|
foreach ($TCurrency as &$currency)
|
||||||
{
|
{
|
||||||
if($currency->code == $conf->currency) continue;
|
if($currency->code == $conf->currency) continue;
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td>'.$currency->code.' - '.$currency->name.'</td>';
|
print '<td>'.$currency->code.' - '.$currency->name.'</td>';
|
||||||
@ -363,7 +363,7 @@ print '
|
|||||||
{
|
{
|
||||||
$("#bt_sync").attr("disabled", true);
|
$("#bt_sync").attr("disabled", true);
|
||||||
var url_sync = "http://apilayer.net/api/live?access_key='.$conf->global->MULTICURRENCY_APP_ID.'&format=1'.(!empty($conf->global->MULTICURRENCY_APP_SOURCE) ? '&source='.$conf->global->MULTICURRENCY_APP_SOURCE : '').'";
|
var url_sync = "http://apilayer.net/api/live?access_key='.$conf->global->MULTICURRENCY_APP_ID.'&format=1'.(!empty($conf->global->MULTICURRENCY_APP_SOURCE) ? '&source='.$conf->global->MULTICURRENCY_APP_SOURCE : '').'";
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url_sync,
|
url: url_sync,
|
||||||
dataType: "jsonp"
|
dataType: "jsonp"
|
||||||
|
|||||||
@ -36,7 +36,7 @@ if (! $user->admin) accessforbidden();
|
|||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
$value = GETPOST('value','alpha');
|
$value = GETPOST('value','alpha');
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label','alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scan_dir','alpha');
|
||||||
$type='invoice';
|
$type='invoice';
|
||||||
|
|
||||||
if (empty($conf->global->PAYMENT_ADDON)) $conf->global->PAYMENT_ADDON = 'mod_payment_cicada.php';
|
if (empty($conf->global->PAYMENT_ADDON)) $conf->global->PAYMENT_ADDON = 'mod_payment_cicada.php';
|
||||||
@ -201,7 +201,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -332,7 +332,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td align="center">'."\n";
|
print '<td align="center">'."\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -344,7 +344,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -42,7 +42,7 @@ if (! $user->admin) accessforbidden();
|
|||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
$value = GETPOST('value','alpha');
|
$value = GETPOST('value','alpha');
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label','alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scan_dir','alpha');
|
||||||
$type='propal';
|
$type='propal';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -469,7 +469,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<td align=\"center\">\n";
|
print "<td align=\"center\">\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -481,7 +481,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,7 @@ accessforbidden();
|
|||||||
$type=GETPOST('type', 'alpha');
|
$type=GETPOST('type', 'alpha');
|
||||||
$value=GETPOST('value', 'alpha');
|
$value=GETPOST('value', 'alpha');
|
||||||
$action=GETPOST('action', 'alpha');
|
$action=GETPOST('action', 'alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scan_dir','alpha');
|
||||||
|
|
||||||
$specimenthirdparty=new Societe($db);
|
$specimenthirdparty=new Societe($db);
|
||||||
$specimenthirdparty->initAsSpecimen();
|
$specimenthirdparty->initAsSpecimen();
|
||||||
@ -398,7 +398,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
//if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name")
|
//if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name")
|
||||||
//{
|
//{
|
||||||
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
|
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">';
|
||||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
/*}
|
/*}
|
||||||
@ -411,7 +411,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td align="center">'."\n";
|
print '<td align="center">'."\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -421,11 +421,11 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
//print img_picto($langs->trans("Default"),'on');
|
//print img_picto($langs->trans("Default"),'on');
|
||||||
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
|
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"),'on').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"),'on').'</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -44,7 +44,7 @@ $type=GETPOST('type', 'alpha');
|
|||||||
$value=GETPOST('value', 'alpha');
|
$value=GETPOST('value', 'alpha');
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label','alpha');
|
||||||
$action=GETPOST('action', 'alpha');
|
$action=GETPOST('action', 'alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scan_dir','alpha');
|
||||||
|
|
||||||
$specimenthirdparty=new Societe($db);
|
$specimenthirdparty=new Societe($db);
|
||||||
$specimenthirdparty->initAsSpecimen();
|
$specimenthirdparty->initAsSpecimen();
|
||||||
@ -420,7 +420,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td align="center">'."\n";
|
print '<td align="center">'."\n";
|
||||||
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name")
|
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name")
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier">';
|
||||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
@ -433,7 +433,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td align="center">'."\n";
|
print '<td align="center">'."\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -445,7 +445,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,7 @@ if (! $user->admin) accessforbidden();
|
|||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
$value = GETPOST('value','alpha');
|
$value = GETPOST('value','alpha');
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label','alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scan_dir','alpha');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -172,7 +172,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ if (! $user->admin) accessforbidden();
|
|||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
$value = GETPOST('value','alpha');
|
$value = GETPOST('value','alpha');
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label','alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scan_dir','alpha');
|
||||||
$type='supplier_proposal';
|
$type='supplier_proposal';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -446,7 +446,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<td align=\"center\">\n";
|
print "<td align=\"center\">\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -458,7 +458,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
||||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -121,7 +121,7 @@ if (GETPOST('removedassigned') || GETPOST('removedassigned') == '0')
|
|||||||
$donotclearsession=1;
|
$donotclearsession=1;
|
||||||
if ($action == 'add') $action = 'create';
|
if ($action == 'add') $action = 'create';
|
||||||
if ($action == 'update') $action = 'edit';
|
if ($action == 'update') $action = 'edit';
|
||||||
|
|
||||||
$listUserAssignedUpdated = true;
|
$listUserAssignedUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,6 +572,11 @@ if ($action == 'mupdate')
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Actions to delete doc
|
||||||
|
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||||
|
$permissioncreate = ($user->rights->agenda->allactions->delete || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->delete));
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -724,7 +729,7 @@ if ($action == 'create')
|
|||||||
print '<div class="assignedtouser">';
|
print '<div class="assignedtouser">';
|
||||||
print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0');
|
print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0');
|
||||||
print '</div>';
|
print '</div>';
|
||||||
if (in_array($user->id,array_keys($listofuserid)))
|
if (in_array($user->id,array_keys($listofuserid)))
|
||||||
{
|
{
|
||||||
print '<div class="myavailability">';
|
print '<div class="myavailability">';
|
||||||
print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.(((! isset($_GET['transparency']) && ! isset($_POST['transparency'])) || GETPOST('transparency'))?' checked':'').'> '.$langs->trans("Busy");
|
print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.(((! isset($_GET['transparency']) && ! isset($_POST['transparency'])) || GETPOST('transparency'))?' checked':'').'> '.$langs->trans("Busy");
|
||||||
@ -851,11 +856,11 @@ if ($id > 0)
|
|||||||
$result3=$object->fetch_contact();
|
$result3=$object->fetch_contact();
|
||||||
$result4=$object->fetch_userassigned();
|
$result4=$object->fetch_userassigned();
|
||||||
$result5=$object->fetch_optionals($id,$extralabels);
|
$result5=$object->fetch_optionals($id,$extralabels);
|
||||||
|
|
||||||
if ($listUserAssignedUpdated || $donotclearsession)
|
if ($listUserAssignedUpdated || $donotclearsession)
|
||||||
{
|
{
|
||||||
$percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):(in_array(GETPOST('complete'),array(-1,100))?GETPOST('complete'):GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
|
$percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):(in_array(GETPOST('complete'),array(-1,100))?GETPOST('complete'):GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
|
||||||
|
|
||||||
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
|
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
|
||||||
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
|
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
|
||||||
|
|
||||||
@ -872,7 +877,7 @@ if ($id > 0)
|
|||||||
//$object->societe->id = $_POST["socid"]; // deprecated
|
//$object->societe->id = $_POST["socid"]; // deprecated
|
||||||
//$object->contact->id = $_POST["contactid"]; // deprecated
|
//$object->contact->id = $_POST["contactid"]; // deprecated
|
||||||
$object->fk_project = GETPOST("projectid",'int');
|
$object->fk_project = GETPOST("projectid",'int');
|
||||||
|
|
||||||
$object->note = GETPOST("note");
|
$object->note = GETPOST("note");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1064,11 +1069,11 @@ if ($id > 0)
|
|||||||
$listofuserid=json_decode($_SESSION['assignedtouser'], true);
|
$listofuserid=json_decode($_SESSION['assignedtouser'], true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<div class="assignedtouser">';
|
print '<div class="assignedtouser">';
|
||||||
print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0');
|
print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0');
|
||||||
print '</div>';
|
print '</div>';
|
||||||
if (in_array($user->id,array_keys($listofuserid)))
|
if (in_array($user->id,array_keys($listofuserid)))
|
||||||
{
|
{
|
||||||
print '<div class="myavailability">';
|
print '<div class="myavailability">';
|
||||||
print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.($listofuserid[$user->id]['transparency']?' checked':'').'>'.$langs->trans("Busy");
|
print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.($listofuserid[$user->id]['transparency']?' checked':'').'>'.$langs->trans("Busy");
|
||||||
@ -1086,10 +1091,10 @@ if ($id > 0)
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
|
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Thirdparty - Contact
|
// Thirdparty - Contact
|
||||||
@ -1200,11 +1205,11 @@ if ($id > 0)
|
|||||||
$out.=img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone pictoactionview"');
|
$out.=img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone pictoactionview"');
|
||||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewDay").'</a>';
|
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||||
$linkback.=$out;
|
$linkback.=$out;
|
||||||
|
|
||||||
dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
|
dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
|
||||||
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
// Affichage fiche action en mode visu
|
// Affichage fiche action en mode visu
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
@ -1268,7 +1273,7 @@ if ($id > 0)
|
|||||||
print '<div class="assignedtouser">';
|
print '<div class="assignedtouser">';
|
||||||
print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||||
print '</div>';
|
print '</div>';
|
||||||
if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid)))
|
if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid)))
|
||||||
{
|
{
|
||||||
print '<div class="myavailability">';
|
print '<div class="myavailability">';
|
||||||
print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody
|
print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody
|
||||||
@ -1449,7 +1454,7 @@ if ($id > 0)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id;
|
$filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id;
|
||||||
$urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id;
|
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||||
|
|
||||||
$genallowed=$user->rights->agenda->myactions->create;
|
$genallowed=$user->rights->agenda->myactions->create;
|
||||||
$delallowed=$user->rights->agenda->myactions->delete;
|
$delallowed=$user->rights->agenda->myactions->delete;
|
||||||
|
|||||||
@ -474,7 +474,7 @@ class AdvanceTargetingMailing extends CommonObject
|
|||||||
$sql.= " LEFT OUTER JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as saleman ON saleman.fk_soc=t.rowid ";
|
$sql.= " LEFT OUTER JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as saleman ON saleman.fk_soc=t.rowid ";
|
||||||
}
|
}
|
||||||
if (array_key_exists('cust_categ', $arrayquery)) {
|
if (array_key_exists('cust_categ', $arrayquery)) {
|
||||||
$sql.= " LEFT OUTER JOIN " . MAIN_DB_PREFIX . "categorie_societe as custcateg ON custcateg.fk_societe=t.rowid ";
|
$sql.= " LEFT OUTER JOIN " . MAIN_DB_PREFIX . "categorie_societe as custcateg ON custcateg.fk_soc=t.rowid ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($arrayquery['cust_name'])) {
|
if (!empty($arrayquery['cust_name'])) {
|
||||||
|
|||||||
@ -73,9 +73,9 @@ $search_zip=GETPOST('search_zip','alpha');
|
|||||||
$search_state=trim(GETPOST("search_state"));
|
$search_state=trim(GETPOST("search_state"));
|
||||||
$search_country=GETPOST("search_country",'int');
|
$search_country=GETPOST("search_country",'int');
|
||||||
$search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
|
$search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
|
||||||
$viewstatut=GETPOST('viewstatut');
|
$viewstatut=GETPOST('viewstatut','alpha');
|
||||||
$optioncss = GETPOST('optioncss','alpha');
|
$optioncss = GETPOST('optioncss','alpha');
|
||||||
$object_statut=GETPOST('propal_statut');
|
$object_statut=GETPOST('propal_statut','alpha');
|
||||||
|
|
||||||
$sall=GETPOST('sall', 'alphanohtml');
|
$sall=GETPOST('sall', 'alphanohtml');
|
||||||
$mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
|
$mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
|
||||||
@ -353,6 +353,7 @@ if ($resql)
|
|||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
$soc->fetch($socid);
|
$soc->fetch($socid);
|
||||||
$title = $langs->trans('ListOfProposals') . ' - '.$soc->name;
|
$title = $langs->trans('ListOfProposals') . ' - '.$soc->name;
|
||||||
|
if (empty($search_societe)) $search_societe = $soc->name;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1513,7 +1513,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 'SelectThirdParty');
|
print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 3)', 'SelectThirdParty');
|
||||||
// reload page to retrieve customer informations
|
// reload page to retrieve customer informations
|
||||||
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE))
|
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE))
|
||||||
{
|
{
|
||||||
@ -2084,7 +2084,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
print $object->date ? dol_print_date($object->date, 'day') : ' ';
|
print $object->date ? dol_print_date($object->date, 'day') : ' ';
|
||||||
if ($object->hasDelay() && empty($object->date_livraison)) {
|
if ($object->hasDelay() && ! empty($object->date_livraison)) {
|
||||||
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
|
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2541,7 +2541,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
if (! empty($conf->expedition->enabled)) {
|
if (! empty($conf->expedition->enabled)) {
|
||||||
$numshipping = $object->nb_expedition();
|
$numshipping = $object->nb_expedition();
|
||||||
|
|
||||||
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfProductsLines() > 0) {
|
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
|
||||||
if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer)) {
|
if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer)) {
|
||||||
if ($user->rights->expedition->creer) {
|
if ($user->rights->expedition->creer) {
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/expedition/shipment.php?id=' . $object->id . '">' . $langs->trans('CreateShipment') . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/expedition/shipment.php?id=' . $object->id . '">' . $langs->trans('CreateShipment') . '</a></div>';
|
||||||
|
|||||||
@ -165,7 +165,7 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
// Selection of new fields
|
// Selection of new fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||||
|
|
||||||
// Purge search criteria
|
// Purge search criteria
|
||||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
@ -208,51 +208,51 @@ if (empty($reshook))
|
|||||||
|
|
||||||
|
|
||||||
if ($massaction == 'confirm_createbills') {
|
if ($massaction == 'confirm_createbills') {
|
||||||
|
|
||||||
$orders = GETPOST('toselect');
|
$orders = GETPOST('toselect');
|
||||||
$createbills_onebythird = GETPOST('createbills_onebythird', 'int');
|
$createbills_onebythird = GETPOST('createbills_onebythird', 'int');
|
||||||
$validate_invoices = GETPOST('valdate_invoices', 'int');
|
$validate_invoices = GETPOST('valdate_invoices', 'int');
|
||||||
|
|
||||||
$TFact = array();
|
$TFact = array();
|
||||||
$TFactThird = array();
|
$TFactThird = array();
|
||||||
|
|
||||||
$nb_bills_created = 0;
|
$nb_bills_created = 0;
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
foreach($orders as $id_order) {
|
foreach($orders as $id_order) {
|
||||||
|
|
||||||
$cmd = new Commande($db);
|
$cmd = new Commande($db);
|
||||||
if($cmd->fetch($id_order) <= 0) continue;
|
if($cmd->fetch($id_order) <= 0) continue;
|
||||||
|
|
||||||
$object = new Facture($db);
|
$object = new Facture($db);
|
||||||
if(!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $object = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order.
|
if(!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $object = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order.
|
||||||
else {
|
else {
|
||||||
|
|
||||||
$object->socid = $cmd->socid;
|
$object->socid = $cmd->socid;
|
||||||
$object->type = Facture::TYPE_STANDARD;
|
$object->type = Facture::TYPE_STANDARD;
|
||||||
$object->cond_reglement_id = $cmd->cond_reglement_id;
|
$object->cond_reglement_id = $cmd->cond_reglement_id;
|
||||||
$object->mode_reglement_id = $cmd->mode_reglement_id;
|
$object->mode_reglement_id = $cmd->mode_reglement_id;
|
||||||
$object->fk_project = $cmd->fk_project;
|
$object->fk_project = $cmd->fk_project;
|
||||||
|
|
||||||
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||||
if (empty($datefacture))
|
if (empty($datefacture))
|
||||||
{
|
{
|
||||||
$datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y"));
|
$datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y"));
|
||||||
}
|
}
|
||||||
|
|
||||||
$object->date = $datefacture;
|
$object->date = $datefacture;
|
||||||
$object->origin = 'commande';
|
$object->origin = 'commande';
|
||||||
$object->origin_id = $id_order;
|
$object->origin_id = $id_order;
|
||||||
|
|
||||||
$res = $object->create($user);
|
$res = $object->create($user);
|
||||||
|
|
||||||
if($res > 0) $nb_bills_created++;
|
if($res > 0) $nb_bills_created++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($object->id > 0) {
|
if($object->id > 0) {
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
|
||||||
$sql.= "fk_source";
|
$sql.= "fk_source";
|
||||||
@ -274,17 +274,17 @@ if ($massaction == 'confirm_createbills') {
|
|||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
$lines = $cmd->lines;
|
$lines = $cmd->lines;
|
||||||
if (empty($lines) && method_exists($cmd, 'fetch_lines'))
|
if (empty($lines) && method_exists($cmd, 'fetch_lines'))
|
||||||
{
|
{
|
||||||
$cmd->fetch_lines();
|
$cmd->fetch_lines();
|
||||||
$lines = $cmd->lines;
|
$lines = $cmd->lines;
|
||||||
}
|
}
|
||||||
|
|
||||||
$fk_parent_line=0;
|
$fk_parent_line=0;
|
||||||
$num=count($lines);
|
$num=count($lines);
|
||||||
|
|
||||||
for ($i=0;$i<$num;$i++)
|
for ($i=0;$i<$num;$i++)
|
||||||
{
|
{
|
||||||
$desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
|
$desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
|
||||||
@ -373,43 +373,43 @@ if ($massaction == 'confirm_createbills') {
|
|||||||
$fk_parent_line = $result;
|
$fk_parent_line = $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cmd->classifyBilled($user);
|
$cmd->classifyBilled($user);
|
||||||
|
|
||||||
if(!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $object;
|
if(!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $object;
|
||||||
else $TFact[$object->id] = $object;
|
else $TFact[$object->id] = $object;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build doc with all invoices
|
// Build doc with all invoices
|
||||||
$TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird;
|
$TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird;
|
||||||
$toselect = array();
|
$toselect = array();
|
||||||
|
|
||||||
if(!empty($validate_invoices)) {
|
if(!empty($validate_invoices)) {
|
||||||
|
|
||||||
$massaction = $action = 'builddoc';
|
$massaction = $action = 'builddoc';
|
||||||
|
|
||||||
foreach($TAllFact as &$object) {
|
foreach($TAllFact as &$object) {
|
||||||
$object->validate($user);
|
$object->validate($user);
|
||||||
$toselect[] = $object->id; // For builddoc action
|
$toselect[] = $object->id; // For builddoc action
|
||||||
|
|
||||||
// Fac builddoc
|
// Fac builddoc
|
||||||
$upload_dir = $conf->facture->dir_output;
|
$upload_dir = $conf->facture->dir_output;
|
||||||
$permissioncreate=$user->rights->facture->creer;
|
$permissioncreate=$user->rights->facture->creer;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
$objectclass='Facture';
|
$objectclass='Facture';
|
||||||
$objectlabel='Invoice';
|
$objectlabel='Invoice';
|
||||||
$permtoread = $user->rights->facture->lire;
|
$permtoread = $user->rights->facture->lire;
|
||||||
$permtodelete = $user->rights->facture->supprimer;
|
$permtodelete = $user->rights->facture->supprimer;
|
||||||
$uploaddir = $conf->facture->dir_output;
|
$uploaddir = $conf->facture->dir_output;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
@ -424,7 +424,7 @@ if ($massaction == 'confirm_createbills') {
|
|||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -578,6 +578,7 @@ if ($resql)
|
|||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
$soc->fetch($socid);
|
$soc->fetch($socid);
|
||||||
$title = $langs->trans('ListOfOrders') . ' - '.$soc->name;
|
$title = $langs->trans('ListOfOrders') . ' - '.$soc->name;
|
||||||
|
if (empty($search_company)) $search_company = $soc->name;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -601,9 +602,9 @@ if ($resql)
|
|||||||
$title.=' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled)?'':$langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill');
|
$title.=' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled)?'':$langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill');
|
||||||
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||||
|
|
||||||
$param='';
|
$param='';
|
||||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||||
@ -635,7 +636,7 @@ if ($resql)
|
|||||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||||
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
'presend'=>$langs->trans("SendByMail"),
|
'presend'=>$langs->trans("SendByMail"),
|
||||||
@ -658,11 +659,11 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit);
|
||||||
|
|
||||||
if ($massaction == 'presend')
|
if ($massaction == 'presend')
|
||||||
{
|
{
|
||||||
$langs->load("mails");
|
$langs->load("mails");
|
||||||
|
|
||||||
if (! GETPOST('cancel'))
|
if (! GETPOST('cancel'))
|
||||||
{
|
{
|
||||||
$objecttmp=new Commande($db);
|
$objecttmp=new Commande($db);
|
||||||
@ -681,17 +682,17 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<input type="hidden" name="massaction" value="confirm_presend">';
|
print '<input type="hidden" name="massaction" value="confirm_presend">';
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
$formmail = new FormMail($db);
|
$formmail = new FormMail($db);
|
||||||
|
|
||||||
dol_fiche_head(null, '', '');
|
dol_fiche_head(null, '', '');
|
||||||
|
|
||||||
$topicmail="SendOrderRef";
|
$topicmail="SendOrderRef";
|
||||||
$modelmail="order_send";
|
$modelmail="order_send";
|
||||||
|
|
||||||
// Cree l'objet formulaire mail
|
// Cree l'objet formulaire mail
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
$formmail = new FormMail($db);
|
$formmail = new FormMail($db);
|
||||||
@ -744,23 +745,23 @@ if ($resql)
|
|||||||
$formmail->substit['__REFCLIENT__']='__REFCLIENT__'; // We want to keep the tag
|
$formmail->substit['__REFCLIENT__']='__REFCLIENT__'; // We want to keep the tag
|
||||||
$formmail->substit['__PERSONALIZED__']='';
|
$formmail->substit['__PERSONALIZED__']='';
|
||||||
$formmail->substit['__CONTACTCIVNAME__']='';
|
$formmail->substit['__CONTACTCIVNAME__']='';
|
||||||
|
|
||||||
// Tableau des parametres complementaires du post
|
// Tableau des parametres complementaires du post
|
||||||
$formmail->param['action']=$action;
|
$formmail->param['action']=$action;
|
||||||
$formmail->param['models']=$modelmail;
|
$formmail->param['models']=$modelmail;
|
||||||
$formmail->param['models_id']=GETPOST('modelmailselected','int');
|
$formmail->param['models_id']=GETPOST('modelmailselected','int');
|
||||||
$formmail->param['id']=join(',',$arrayofselected);
|
$formmail->param['id']=join(',',$arrayofselected);
|
||||||
//$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
|
//$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
|
||||||
|
|
||||||
print $formmail->get_form();
|
print $formmail->get_form();
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
}
|
}
|
||||||
elseif ($massaction == 'createbills')
|
elseif ($massaction == 'createbills')
|
||||||
{
|
{
|
||||||
//var_dump($_REQUEST);
|
//var_dump($_REQUEST);
|
||||||
print '<input type="hidden" name="massaction" value="confirm_createbills">';
|
print '<input type="hidden" name="massaction" value="confirm_createbills">';
|
||||||
|
|
||||||
print '<table class="border" width="100%" >';
|
print '<table class="border" width="100%" >';
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="titlefieldmiddle">';
|
print '<td class="titlefieldmiddle">';
|
||||||
@ -787,22 +788,22 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('CreateInvoiceForThisCustomer').'"> ';
|
print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('CreateInvoiceForThisCustomer').'"> ';
|
||||||
print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
|
print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sall)
|
if ($sall)
|
||||||
{
|
{
|
||||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||||
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
||||||
}
|
}
|
||||||
|
|
||||||
$moreforfilter='';
|
$moreforfilter='';
|
||||||
|
|
||||||
// If the user can view prospects other than his'
|
// If the user can view prospects other than his'
|
||||||
@ -829,14 +830,14 @@ if ($resql)
|
|||||||
$moreforfilter.='<div class="divsearchfield">';
|
$moreforfilter.='<div class="divsearchfield">';
|
||||||
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
|
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
|
||||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
||||||
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1);
|
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
|
||||||
$moreforfilter.='</div>';
|
$moreforfilter.='</div>';
|
||||||
}
|
}
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
|
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
|
||||||
else $moreforfilter = $hookmanager->resPrint;
|
else $moreforfilter = $hookmanager->resPrint;
|
||||||
|
|
||||||
if (! empty($moreforfilter))
|
if (! empty($moreforfilter))
|
||||||
{
|
{
|
||||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||||
@ -846,7 +847,7 @@ if ($resql)
|
|||||||
|
|
||||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
|
|
||||||
@ -868,9 +869,9 @@ if ($resql)
|
|||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
{
|
{
|
||||||
$align=$extrafields->getAlignFlag($key);
|
$align=$extrafields->getAlignFlag($key);
|
||||||
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||||
@ -890,21 +891,21 @@ if ($resql)
|
|||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
// Ref
|
// Ref
|
||||||
if (! empty($arrayfields['c.ref']['checked']))
|
if (! empty($arrayfields['c.ref']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
|
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Ref customer
|
// Ref customer
|
||||||
if (! empty($arrayfields['c.ref_client']['checked']))
|
if (! empty($arrayfields['c.ref_client']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '<input class="flat" type="text" size="6" name="search_ref_customer" value="'.$search_ref_customer.'">';
|
print '<input class="flat" type="text" size="6" name="search_ref_customer" value="'.$search_ref_customer.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Thirpdarty
|
// Thirpdarty
|
||||||
if (! empty($arrayfields['s.nom']['checked']))
|
if (! empty($arrayfields['s.nom']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '<input class="flat" type="text" name="search_company" value="'.$search_company.'">';
|
print '<input class="flat" type="text" name="search_company" value="'.$search_company.'">';
|
||||||
@ -944,7 +945,7 @@ if ($resql)
|
|||||||
$formother->select_year($orderyear?$orderyear:-1,'orderyear',1, 20, 5);
|
$formother->select_year($orderyear?$orderyear:-1,'orderyear',1, 20, 5);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['c.date_delivery']['checked']))
|
if (! empty($arrayfields['c.date_delivery']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="center">';
|
print '<td class="liste_titre" align="center">';
|
||||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="deliveryday" value="'.$deliveryday.'">';
|
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="deliveryday" value="'.$deliveryday.'">';
|
||||||
@ -1017,10 +1018,10 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
print '<td class="liste_titre maxwidthonsmartphone" align="right">';
|
print '<td class="liste_titre maxwidthonsmartphone" align="right">';
|
||||||
$liststatus=array(
|
$liststatus=array(
|
||||||
Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"),
|
Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"),
|
||||||
Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"),
|
Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"),
|
||||||
Commande::STATUS_ACCEPTED=>$langs->trans("StatusOrderSentShort"),
|
Commande::STATUS_ACCEPTED=>$langs->trans("StatusOrderSentShort"),
|
||||||
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
|
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
|
||||||
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort")
|
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort")
|
||||||
);
|
);
|
||||||
print $form->selectarray('viewstatut', $liststatus, $viewstatut, -4);
|
print $form->selectarray('viewstatut', $liststatus, $viewstatut, -4);
|
||||||
@ -1038,16 +1039,16 @@ if ($resql)
|
|||||||
$searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
$searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||||
print $searchpitco;
|
print $searchpitco;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$total=0;
|
$total=0;
|
||||||
$subtotal=0;
|
$subtotal=0;
|
||||||
$productstat_cache=array();
|
$productstat_cache=array();
|
||||||
|
|
||||||
$generic_commande = new Commande($db);
|
$generic_commande = new Commande($db);
|
||||||
$generic_product = new Product($db);
|
$generic_product = new Product($db);
|
||||||
|
|
||||||
$i=0;
|
$i=0;
|
||||||
$var=true;
|
$var=true;
|
||||||
$totalarray=array();
|
$totalarray=array();
|
||||||
@ -1062,7 +1063,7 @@ if ($resql)
|
|||||||
$text_info='';
|
$text_info='';
|
||||||
$text_warning='';
|
$text_warning='';
|
||||||
$nbprod=0;
|
$nbprod=0;
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
if (! empty($arrayfields['c.ref']['checked']))
|
if (! empty($arrayfields['c.ref']['checked']))
|
||||||
{
|
{
|
||||||
@ -1078,12 +1079,12 @@ if ($resql)
|
|||||||
$generic_commande->total_ttc = $obj->total_ttc;
|
$generic_commande->total_ttc = $obj->total_ttc;
|
||||||
$generic_commande->lines=array();
|
$generic_commande->lines=array();
|
||||||
$generic_commande->getLinesArray();
|
$generic_commande->getLinesArray();
|
||||||
|
|
||||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||||
print '<td class="nobordernopadding nowrap">';
|
print '<td class="nobordernopadding nowrap">';
|
||||||
print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$obj->fk_statut));
|
print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$obj->fk_statut));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Show shippable Icon (create subloop, so may be slow)
|
// Show shippable Icon (create subloop, so may be slow)
|
||||||
if ($conf->stock->enabled)
|
if ($conf->stock->enabled)
|
||||||
{
|
{
|
||||||
@ -1091,7 +1092,7 @@ if ($resql)
|
|||||||
if (($obj->fk_statut > 0) && ($obj->fk_statut < 3))
|
if (($obj->fk_statut > 0) && ($obj->fk_statut < 3))
|
||||||
{
|
{
|
||||||
$numlines = count($generic_commande->lines); // Loop on each line of order
|
$numlines = count($generic_commande->lines); // Loop on each line of order
|
||||||
for ($lig=0; $lig < $numlines; $lig++)
|
for ($lig=0; $lig < $numlines; $lig++)
|
||||||
{
|
{
|
||||||
if ($generic_commande->lines[$lig]->product_type == 0 && $generic_commande->lines[$lig]->fk_product > 0) // If line is a product and not a service
|
if ($generic_commande->lines[$lig]->product_type == 0 && $generic_commande->lines[$lig]->fk_product > 0) // If line is a product and not a service
|
||||||
{
|
{
|
||||||
@ -1115,8 +1116,8 @@ if ($resql)
|
|||||||
$text_info .= ' - '.$langs->trans("Stock").': '.$generic_product->stock_reel;
|
$text_info .= ' - '.$langs->trans("Stock").': '.$generic_product->stock_reel;
|
||||||
$text_info .= ' - '.$langs->trans("VirtualStock").': '.$generic_product->stock_theorique;
|
$text_info .= ' - '.$langs->trans("VirtualStock").': '.$generic_product->stock_theorique;
|
||||||
$text_info .= '<br>';
|
$text_info .= '<br>';
|
||||||
|
|
||||||
if ($generic_commande->lines[$lig]->qty > $generic_product->stock_reel)
|
if ($generic_commande->lines[$lig]->qty > $generic_product->stock_reel)
|
||||||
{
|
{
|
||||||
$notshippable++;
|
$notshippable++;
|
||||||
}
|
}
|
||||||
@ -1176,7 +1177,7 @@ if ($resql)
|
|||||||
$text_info = $langs->trans('NonShippable').'<br>'.$text_info;
|
$text_info = $langs->trans('NonShippable').'<br>'.$text_info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($nbprod)
|
if ($nbprod)
|
||||||
{
|
{
|
||||||
@ -1187,7 +1188,7 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Warning late icon and note
|
// Warning late icon and note
|
||||||
print '<td class="nobordernopadding nowrap">';
|
print '<td class="nobordernopadding nowrap">';
|
||||||
if ($generic_commande->hasDelay()) {
|
if ($generic_commande->hasDelay()) {
|
||||||
@ -1200,7 +1201,7 @@ if ($resql)
|
|||||||
print '</span>';
|
print '</span>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||||
$filename=dol_sanitizeFileName($obj->ref);
|
$filename=dol_sanitizeFileName($obj->ref);
|
||||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||||
@ -1208,11 +1209,11 @@ if ($resql)
|
|||||||
print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir);
|
print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ref customer
|
// Ref customer
|
||||||
if (! empty($arrayfields['c.ref_client']['checked']))
|
if (! empty($arrayfields['c.ref_client']['checked']))
|
||||||
{
|
{
|
||||||
@ -1230,7 +1231,7 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $companystatic->getNomUrl(1,'customer');
|
print $companystatic->getNomUrl(1,'customer');
|
||||||
|
|
||||||
// If module invoices enabled and user with invoice creation permissions
|
// If module invoices enabled and user with invoice creation permissions
|
||||||
if (! empty($conf->facture->enabled) && ! empty($conf->global->ORDER_BILLING_ALL_CUSTOMER))
|
if (! empty($conf->facture->enabled) && ! empty($conf->global->ORDER_BILLING_ALL_CUSTOMER))
|
||||||
{
|
{
|
||||||
@ -1286,7 +1287,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Order date
|
// Order date
|
||||||
if (! empty($arrayfields['c.date_commande']['checked']))
|
if (! empty($arrayfields['c.date_commande']['checked']))
|
||||||
{
|
{
|
||||||
@ -1327,7 +1328,7 @@ if ($resql)
|
|||||||
if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield'];
|
if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield'];
|
||||||
$totalarray['totalttc'] += $obj->total_ttc;
|
$totalarray['totalttc'] += $obj->total_ttc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
@ -1378,7 +1379,7 @@ if ($resql)
|
|||||||
print '<td align="center">'.yn($obj->billed).'</td>';
|
print '<td align="center">'.yn($obj->billed).'</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Action column
|
// Action column
|
||||||
print '<td class="nowrap" align="center">';
|
print '<td class="nowrap" align="center">';
|
||||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
@ -1389,9 +1390,9 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$total+=$obj->total_ht;
|
$total+=$obj->total_ht;
|
||||||
$subtotal+=$obj->total_ht;
|
$subtotal+=$obj->total_ht;
|
||||||
$i++;
|
$i++;
|
||||||
@ -1424,18 +1425,18 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|
||||||
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
print '</table>'."\n";
|
print '</table>'."\n";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>'."\n";
|
print '</form>'."\n";
|
||||||
|
|
||||||
//print '<br>'.img_help(1,'').' '.$langs->trans("ToBillSeveralOrderSelectCustomer", $langs->transnoentitiesnoconv("CreateInvoiceForThisCustomer")).'<br>';
|
//print '<br>'.img_help(1,'').' '.$langs->trans("ToBillSeveralOrderSelectCustomer", $langs->transnoentitiesnoconv("CreateInvoiceForThisCustomer")).'<br>';
|
||||||
|
|
||||||
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
|
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -1443,18 +1444,18 @@ if ($resql)
|
|||||||
*/
|
*/
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
||||||
$urlsource.=str_replace('&','&',$param);
|
$urlsource.=str_replace('&','&',$param);
|
||||||
|
|
||||||
$filedir=$diroutputmassaction;
|
$filedir=$diroutputmassaction;
|
||||||
$genallowed=$user->rights->commande->lire;
|
$genallowed=$user->rights->commande->lire;
|
||||||
$delallowed=$user->rights->commande->lire;
|
$delallowed=$user->rights->commande->lire;
|
||||||
|
|
||||||
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<br><a name="show_files"></a><a href="'.$_SERVER["PHP_SELF"].'?show_files=1'.$param.'#show_files">'.$langs->trans("ShowTempMassFilesArea").'</a>';
|
print '<br><a name="show_files"></a><a href="'.$_SERVER["PHP_SELF"].'?show_files=1'.$param.'#show_files">'.$langs->trans("ShowTempMassFilesArea").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -433,7 +433,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
if ($object->canBeConciliated() > 0) {
|
if ($object->canBeConciliated() > 0) {
|
||||||
// If not cash account and can be reconciliate
|
// If not cash account and can be reconciliate
|
||||||
if ($user->rights->banque->consolidate) {
|
if ($user->rights->banque->consolidate) {
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/bankentries.php?action=reconcile'.$param.'">'.$langs->trans("Conciliate").'</a>';
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/bankentries.php?action=reconcile'.$param.(!empty($page)?('&page='.$page):'').'">'.$langs->trans("Conciliate").'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
|
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,7 +57,7 @@ $limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
|||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
$page = GETPOST("page",'int');
|
$page = GETPOST("page",'int');
|
||||||
if ($page == -1) { $page = 0; }
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
@ -127,9 +127,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
|
|||||||
$search_number='';
|
$search_number='';
|
||||||
$search_statut='';
|
$search_statut='';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -299,9 +299,9 @@ if (! empty($arrayfields['toreconcile']['checked'])) print_liste_field_titr
|
|||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
{
|
{
|
||||||
$align=$extrafields->getAlignFlag($key);
|
$align=$extrafields->getAlignFlag($key);
|
||||||
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||||
@ -435,7 +435,7 @@ $var=true;
|
|||||||
foreach ($accounts as $key=>$type)
|
foreach ($accounts as $key=>$type)
|
||||||
{
|
{
|
||||||
if ($i >= $limit) break;
|
if ($i >= $limit) break;
|
||||||
|
|
||||||
$found++;
|
$found++;
|
||||||
|
|
||||||
$acc = new Account($db);
|
$acc = new Account($db);
|
||||||
@ -452,7 +452,7 @@ foreach ($accounts as $key=>$type)
|
|||||||
{
|
{
|
||||||
$lastcurrencycode=$acc->currency_code;
|
$lastcurrencycode=$acc->currency_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
@ -461,14 +461,14 @@ foreach ($accounts as $key=>$type)
|
|||||||
print '<td>'.$acc->getNomUrl(1).'</td>';
|
print '<td>'.$acc->getNomUrl(1).'</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
if (! empty($arrayfields['b.label']['checked']))
|
if (! empty($arrayfields['b.label']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$acc->label.'</td>';
|
print '<td>'.$acc->label.'</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Account type
|
// Account type
|
||||||
if (! empty($arrayfields['accountype']['checked']))
|
if (! empty($arrayfields['accountype']['checked']))
|
||||||
{
|
{
|
||||||
@ -477,14 +477,14 @@ foreach ($accounts as $key=>$type)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Number
|
// Number
|
||||||
if (! empty($arrayfields['b.number']['checked']))
|
if (! empty($arrayfields['b.number']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$acc->number.'</td>';
|
print '<td>'.$acc->number.'</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Account number
|
// Account number
|
||||||
if (! empty($arrayfields['b.account_number']['checked']))
|
if (! empty($arrayfields['b.account_number']['checked']))
|
||||||
{
|
{
|
||||||
@ -492,7 +492,7 @@ foreach ($accounts as $key=>$type)
|
|||||||
print '<td>'.length_accountg($acc->account_number).'</td>';
|
print '<td>'.length_accountg($acc->account_number).'</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Accountancy journal
|
// Accountancy journal
|
||||||
if (! empty($arrayfields['b.accountancy_journal']['checked']))
|
if (! empty($arrayfields['b.accountancy_journal']['checked']))
|
||||||
{
|
{
|
||||||
@ -500,7 +500,7 @@ foreach ($accounts as $key=>$type)
|
|||||||
print '<td>'.length_accountg($acc->accountancy_journal).'</td>';
|
print '<td>'.length_accountg($acc->accountancy_journal).'</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Transactions to reconcile
|
// Transactions to reconcile
|
||||||
if (! empty($arrayfields['toreconcile']['checked']))
|
if (! empty($arrayfields['toreconcile']['checked']))
|
||||||
{
|
{
|
||||||
@ -519,13 +519,13 @@ foreach ($accounts as $key=>$type)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
{
|
{
|
||||||
print '<td';
|
print '<td';
|
||||||
$align=$extrafields->getAlignFlag($key);
|
$align=$extrafields->getAlignFlag($key);
|
||||||
@ -558,14 +558,14 @@ foreach ($accounts as $key=>$type)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Statut
|
// Statut
|
||||||
if (! empty($arrayfields['b.clos']['checked']))
|
if (! empty($arrayfields['b.clos']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center">'.$acc->getLibStatut(5).'</td>';
|
print '<td align="center">'.$acc->getLibStatut(5).'</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Balance
|
// Balance
|
||||||
if (! empty($arrayfields['balance']['checked']))
|
if (! empty($arrayfields['balance']['checked']))
|
||||||
{
|
{
|
||||||
@ -576,7 +576,7 @@ foreach ($accounts as $key=>$type)
|
|||||||
if (! $i) $totalarray['totalbalancefield']=$totalarray['nbfield'];
|
if (! $i) $totalarray['totalbalancefield']=$totalarray['nbfield'];
|
||||||
$totalarray['totalbalance'] += $solde;
|
$totalarray['totalbalance'] += $solde;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Action column
|
// Action column
|
||||||
print '<td class="nowrap" align="center">';
|
print '<td class="nowrap" align="center">';
|
||||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
@ -587,7 +587,7 @@ foreach ($accounts as $key=>$type)
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$total[$acc->currency_code] += $solde;
|
$total[$acc->currency_code] += $solde;
|
||||||
|
|||||||
@ -275,6 +275,8 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
|||||||
$refcomp=$societestatic->getNomUrl(1,'',24);
|
$refcomp=$societestatic->getNomUrl(1,'',24);
|
||||||
|
|
||||||
$paiement = $facturestatic->getSommePaiement(); // Payment already done
|
$paiement = $facturestatic->getSommePaiement(); // Payment already done
|
||||||
|
$paiement+= $facturestatic->getSumDepositsUsed();
|
||||||
|
$paiement+= $facturestatic->getSumCreditNotesUsed();
|
||||||
}
|
}
|
||||||
if ($obj->family == 'social_contribution')
|
if ($obj->family == 'social_contribution')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1149,7 +1149,9 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
||||||
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
$targetExtraFields = new ExtraFields($db);
|
||||||
|
$targetExtraFieldLabels = $targetExtraFields->fetch_name_optionals_label($object->table_element_line);
|
||||||
|
$lines[$i]->fetch_optionals($lines[$i]->rowid, $targetExtraFieldLabels);
|
||||||
$array_options = $lines[$i]->array_options;
|
$array_options = $lines[$i]->array_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2971,8 +2973,9 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
// Ref customer
|
// Ref customer
|
||||||
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', 0, 1);
|
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', 0, 1);
|
||||||
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', null, null, '', 1);
|
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', null, null, '', 1);
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
||||||
|
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->thirdparty->id.'">'.$langs->trans("OtherBills").'</a>)';
|
||||||
// Project
|
// Project
|
||||||
if (! empty($conf->projet->enabled))
|
if (! empty($conf->projet->enabled))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -486,7 +486,8 @@ class Facture extends CommonInvoice
|
|||||||
foreach ($exp->linkedObjectsIds['commande'] as $key => $value)
|
foreach ($exp->linkedObjectsIds['commande'] as $key => $value)
|
||||||
{
|
{
|
||||||
$originforcontact = 'commande';
|
$originforcontact = 'commande';
|
||||||
$originidforcontact = $value->id;
|
if (is_object($value)) $originidforcontact = $value->id;
|
||||||
|
else $originidforcontact = $value;
|
||||||
break; // We take first one
|
break; // We take first one
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -513,7 +513,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
$tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx));
|
$tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx));
|
||||||
$tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));
|
$tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));
|
||||||
|
|
||||||
// if price ht was forced (ie: from gui when calculated by margin rate and cost price). TODO Why this ?
|
// if price ht was forced (ie: from gui when calculated by margin rate and cost price). TODO Why this ?
|
||||||
if (! empty($price_ht))
|
if (! empty($price_ht))
|
||||||
{
|
{
|
||||||
@ -1055,7 +1055,7 @@ if ($action == 'create')
|
|||||||
$disableedit=1;
|
$disableedit=1;
|
||||||
$disablemove=1;
|
$disablemove=1;
|
||||||
$disableremove=1;
|
$disableremove=1;
|
||||||
$ret = $object->printObjectLines('', $mysoc, $soc, $lineid, 0); // No date selector for template invoice
|
$ret = $object->printObjectLines('', $mysoc, $object->thirdparty, $lineid, 0); // No date selector for template invoice
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
@ -1470,7 +1470,7 @@ else
|
|||||||
{
|
{
|
||||||
//$disableedit=1;
|
//$disableedit=1;
|
||||||
//$disablemove=1;
|
//$disablemove=1;
|
||||||
$ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 0); // No date selector for template invoice
|
$ret = $object->printObjectLines($action, $mysoc, $object->thirdparty, $lineid, 0); // No date selector for template invoice
|
||||||
}
|
}
|
||||||
|
|
||||||
// Form to add new line
|
// Form to add new line
|
||||||
@ -1481,7 +1481,7 @@ else
|
|||||||
$var = true;
|
$var = true;
|
||||||
|
|
||||||
// Add free products/services
|
// Add free products/services
|
||||||
$object->formAddObjectLine(0, $mysoc, $soc); // No date selector for template invoice
|
$object->formAddObjectLine(0, $mysoc, $object->thirdparty); // No date selector for template invoice
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
|||||||
@ -423,6 +423,7 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
$soc->fetch($socid);
|
$soc->fetch($socid);
|
||||||
|
if (empty($search_societe)) $search_societe = $soc->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
$param='&socid='.$socid;
|
$param='&socid='.$socid;
|
||||||
@ -620,7 +621,7 @@ if ($resql)
|
|||||||
$moreforfilter.='<div class="divsearchfield">';
|
$moreforfilter.='<div class="divsearchfield">';
|
||||||
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
|
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
|
||||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
||||||
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1);
|
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
|
||||||
$moreforfilter.='</div>';
|
$moreforfilter.='</div>';
|
||||||
}
|
}
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
|
|||||||
@ -1629,8 +1629,8 @@ class Contrat extends CommonObject
|
|||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options)>0) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options)>0) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$contractline = new ContratLigne($this->db);
|
$contractline = new ContratLigne($this->db);
|
||||||
$contractline->array_options=$array_option;
|
$contractline->array_options=$array_options;
|
||||||
$contractline->id= $this->db->last_insert_id(MAIN_DB_PREFIX.$contractline->table_element);
|
$contractline->id= $rowid;
|
||||||
$result=$contractline->insertExtraFields();
|
$result=$contractline->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -305,7 +305,14 @@ if ($resql)
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||||
|
|
||||||
|
if ($socid > 0)
|
||||||
|
{
|
||||||
|
$soc = new Societe($db);
|
||||||
|
$soc->fetch($socid);
|
||||||
|
if (empty($search_name)) $search_name = $soc->name;
|
||||||
|
}
|
||||||
|
|
||||||
$param='';
|
$param='';
|
||||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||||
@ -323,7 +330,7 @@ if ($resql)
|
|||||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||||
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
//'presend'=>$langs->trans("SendByMail"),
|
//'presend'=>$langs->trans("SendByMail"),
|
||||||
@ -332,7 +339,7 @@ if ($resql)
|
|||||||
if ($user->rights->contrat->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
|
if ($user->rights->contrat->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
|
||||||
if ($massaction == 'presend') $arrayofmassactions=array();
|
if ($massaction == 'presend') $arrayofmassactions=array();
|
||||||
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
@ -348,9 +355,9 @@ if ($resql)
|
|||||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||||
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
||||||
}
|
}
|
||||||
|
|
||||||
$moreforfilter='';
|
$moreforfilter='';
|
||||||
|
|
||||||
// If the user can view prospects other than his'
|
// If the user can view prospects other than his'
|
||||||
if ($user->rights->societe->client->voir || $socid)
|
if ($user->rights->societe->client->voir || $socid)
|
||||||
{
|
{
|
||||||
@ -375,15 +382,15 @@ if ($resql)
|
|||||||
$moreforfilter.='<div class="divsearchfield">';
|
$moreforfilter.='<div class="divsearchfield">';
|
||||||
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
|
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
|
||||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
||||||
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1);
|
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
|
||||||
$moreforfilter.='</div>';
|
$moreforfilter.='</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
|
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
|
||||||
else $moreforfilter = $hookmanager->resPrint;
|
else $moreforfilter = $hookmanager->resPrint;
|
||||||
|
|
||||||
if (! empty($moreforfilter))
|
if (! empty($moreforfilter))
|
||||||
{
|
{
|
||||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||||
@ -393,7 +400,7 @@ if ($resql)
|
|||||||
|
|
||||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -411,9 +418,9 @@ if ($resql)
|
|||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
{
|
{
|
||||||
$align=$extrafields->getAlignFlag($key);
|
$align=$extrafields->getAlignFlag($key);
|
||||||
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||||
@ -486,7 +493,7 @@ if ($resql)
|
|||||||
print '<td class="liste_titre maxwidthonsmartphone" align="center">';
|
print '<td class="liste_titre maxwidthonsmartphone" align="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 $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>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['sale_representative']['checked']))
|
if (! empty($arrayfields['sale_representative']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
@ -541,7 +548,7 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Status
|
// Status
|
||||||
if (! empty($arrayfields['status']['checked']))
|
if (! empty($arrayfields['status']['checked']))
|
||||||
{
|
{
|
||||||
@ -557,12 +564,12 @@ if ($resql)
|
|||||||
while ($i < min($num,$limit))
|
while ($i < min($num,$limit))
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$contracttmp->ref=$obj->ref;
|
$contracttmp->ref=$obj->ref;
|
||||||
$contracttmp->id=$obj->rowid;
|
$contracttmp->id=$obj->rowid;
|
||||||
$contracttmp->ref_customer=$obj->ref_customer;
|
$contracttmp->ref_customer=$obj->ref_customer;
|
||||||
$contracttmp->ref_supplier=$obj->ref_supplier;
|
$contracttmp->ref_supplier=$obj->ref_supplier;
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
if (! empty($arrayfields['c.ref']['checked']))
|
if (! empty($arrayfields['c.ref']['checked']))
|
||||||
@ -578,15 +585,15 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['c.ref_customer']['checked']))
|
if (! empty($arrayfields['c.ref_customer']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$obj->ref_customer.'</td>';
|
print '<td>'.$obj->ref_customer.'</td>';
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['c.ref_supplier']['checked']))
|
if (! empty($arrayfields['c.ref_supplier']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$obj->ref_supplier.'</td>';
|
print '<td>'.$obj->ref_supplier.'</td>';
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['s.nom']['checked']))
|
if (! empty($arrayfields['s.nom']['checked']))
|
||||||
{
|
{
|
||||||
print '<td><a href="../comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
|
print '<td><a href="../comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
|
||||||
}
|
}
|
||||||
@ -629,7 +636,7 @@ if ($resql)
|
|||||||
print $typenArray[$obj->typent_code];
|
print $typenArray[$obj->typent_code];
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['sale_representative']['checked']))
|
if (! empty($arrayfields['sale_representative']['checked']))
|
||||||
{
|
{
|
||||||
// Sales representatives
|
// Sales representatives
|
||||||
@ -713,7 +720,7 @@ if ($resql)
|
|||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Status
|
// Status
|
||||||
if (! empty($arrayfields['status']['checked']))
|
if (! empty($arrayfields['status']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center">'.($obj->nb_initial>0?$obj->nb_initial:'').'</td>';
|
print '<td align="center">'.($obj->nb_initial>0?$obj->nb_initial:'').'</td>';
|
||||||
print '<td align="center">'.($obj->nb_running>0?$obj->nb_running:'').'</td>';
|
print '<td align="center">'.($obj->nb_running>0?$obj->nb_running:'').'</td>';
|
||||||
@ -730,7 +737,7 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -738,7 +745,7 @@ if ($resql)
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -331,7 +331,7 @@ if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights-
|
|||||||
$moreforfilter.='<div class="divsearchfield">';
|
$moreforfilter.='<div class="divsearchfield">';
|
||||||
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
|
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
|
||||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
||||||
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1);
|
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
|
||||||
$moreforfilter.='</div>';
|
$moreforfilter.='</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -515,23 +515,23 @@ $var=True; $i=0;
|
|||||||
while ($i < min($num,$limit))
|
while ($i < min($num,$limit))
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$contractstatic->id=$obj->cid;
|
$contractstatic->id=$obj->cid;
|
||||||
$contractstatic->ref=$obj->ref?$obj->ref:$obj->cid;
|
$contractstatic->ref=$obj->ref?$obj->ref:$obj->cid;
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
if (! empty($arrayfields['c.ref']['checked']))
|
if (! empty($arrayfields['c.ref']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $contractstatic->getNomUrl(1,16);
|
print $contractstatic->getNomUrl(1,16);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Service
|
// Service
|
||||||
if (! empty($arrayfields['p.description']['checked']))
|
if (! empty($arrayfields['p.description']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($obj->pid)
|
if ($obj->pid)
|
||||||
@ -551,9 +551,9 @@ while ($i < min($num,$limit))
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
if (! empty($arrayfields['s.nom']['checked']))
|
if (! empty($arrayfields['s.nom']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$companystatic->id=$obj->socid;
|
$companystatic->id=$obj->socid;
|
||||||
@ -562,9 +562,9 @@ while ($i < min($num,$limit))
|
|||||||
print $companystatic->getNomUrl(1,'customer',28);
|
print $companystatic->getNomUrl(1,'customer',28);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start date
|
// Start date
|
||||||
if (! empty($arrayfields['cd.date_ouverture_prevue']['checked']))
|
if (! empty($arrayfields['cd.date_ouverture_prevue']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print ($obj->date_ouverture_prevue?dol_print_date($db->jdate($obj->date_ouverture_prevue)):' ');
|
print ($obj->date_ouverture_prevue?dol_print_date($db->jdate($obj->date_ouverture_prevue)):' ');
|
||||||
@ -573,15 +573,15 @@ while ($i < min($num,$limit))
|
|||||||
else print ' ';
|
else print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['cd.date_ouverture']['checked']))
|
if (! empty($arrayfields['cd.date_ouverture']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center">'.($obj->date_ouverture?dol_print_date($db->jdate($obj->date_ouverture)):' ').'</td>';
|
print '<td align="center">'.($obj->date_ouverture?dol_print_date($db->jdate($obj->date_ouverture)):' ').'</td>';
|
||||||
}
|
}
|
||||||
// End date
|
// End date
|
||||||
if (! empty($arrayfields['cd.date_fin_validite']['checked']))
|
if (! empty($arrayfields['cd.date_fin_validite']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center">'.($obj->date_fin_validite?dol_print_date($db->jdate($obj->date_fin_validite)):' ');
|
print '<td align="center">'.($obj->date_fin_validite?dol_print_date($db->jdate($obj->date_fin_validite)):' ');
|
||||||
if ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < ($now - $conf->contrat->services->expires->warning_delay) && $obj->statut < 5)
|
if ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < ($now - $conf->contrat->services->expires->warning_delay) && $obj->statut < 5)
|
||||||
{
|
{
|
||||||
$warning_delay=$conf->contrat->services->expires->warning_delay / 3600 / 24;
|
$warning_delay=$conf->contrat->services->expires->warning_delay / 3600 / 24;
|
||||||
$textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days");
|
$textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days");
|
||||||
@ -590,7 +590,7 @@ while ($i < min($num,$limit))
|
|||||||
else print ' ';
|
else print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['cd.date_cloture']['checked']))
|
if (! empty($arrayfields['cd.date_cloture']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($obj->date_cloture)).'</td>';
|
print '<td align="center">'.dol_print_date($db->jdate($obj->date_cloture)).'</td>';
|
||||||
}
|
}
|
||||||
@ -657,7 +657,7 @@ while ($i < min($num,$limit))
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -599,7 +599,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
$datecreate = dol_now();
|
$datecreate = dol_now();
|
||||||
|
|
||||||
// Socpeople must have already been added by some a trigger, then we have to check it to avoid DB_ERROR_RECORD_ALREADY_EXISTS error
|
// Socpeople must have already been added by some a trigger, then we have to check it to avoid DB_ERROR_RECORD_ALREADY_EXISTS error
|
||||||
$TListeContacts=$this->liste_contact(-1, $source);
|
$TListeContacts=$this->liste_contact(-1, $source);
|
||||||
$already_added=false;
|
$already_added=false;
|
||||||
@ -611,11 +611,11 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$already_added) {
|
if(!$already_added) {
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
// Insertion dans la base
|
// Insertion dans la base
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_contact";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_contact";
|
||||||
$sql.= " (element_id, fk_socpeople, datecreate, statut, fk_c_type_contact) ";
|
$sql.= " (element_id, fk_socpeople, datecreate, statut, fk_c_type_contact) ";
|
||||||
@ -623,7 +623,7 @@ abstract class CommonObject
|
|||||||
$sql.= "'".$this->db->idate($datecreate)."'";
|
$sql.= "'".$this->db->idate($datecreate)."'";
|
||||||
$sql.= ", 4, ". $id_type_contact;
|
$sql.= ", 4, ". $id_type_contact;
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -636,7 +636,7 @@ abstract class CommonObject
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -2239,6 +2239,8 @@ abstract class CommonObject
|
|||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
|
$multicurrency_tx = !empty($this->multicurrency_tx) ? $this->multicurrency_tx : 1;
|
||||||
|
|
||||||
// Define constants to find lines to sum
|
// Define constants to find lines to sum
|
||||||
$fieldtva='total_tva';
|
$fieldtva='total_tva';
|
||||||
$fieldlocaltax1='total_localtax1';
|
$fieldlocaltax1='total_localtax1';
|
||||||
@ -2291,7 +2293,6 @@ abstract class CommonObject
|
|||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
// Note: There is no check on detail line and no check on total, if $forcedroundingmode = 'none'
|
// Note: There is no check on detail line and no check on total, if $forcedroundingmode = 'none'
|
||||||
$multicurrency_tx = !empty($this->multicurrency_tx) ? $this->multicurrency_tx : 1;
|
|
||||||
if ($forcedroundingmode == '0') // Check if data on line are consistent. This may solve lines that were not consistent because set with $forcedroundingmode='auto'
|
if ($forcedroundingmode == '0') // Check if data on line are consistent. This may solve lines that were not consistent because set with $forcedroundingmode='auto'
|
||||||
{
|
{
|
||||||
$localtax_array=array($obj->localtax1_type,$obj->localtax1_tx,$obj->localtax2_type,$obj->localtax2_tx);
|
$localtax_array=array($obj->localtax1_type,$obj->localtax1_tx,$obj->localtax2_type,$obj->localtax2_tx);
|
||||||
@ -2309,11 +2310,14 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->total_ht += $obj->total_ht; // The only field visible at end of line detail
|
$this->total_ht += $obj->total_ht; // The field visible at end of line detail
|
||||||
$this->total_tva += $obj->total_tva;
|
$this->total_tva += $obj->total_tva;
|
||||||
$this->total_localtax1 += $obj->total_localtax1;
|
$this->total_localtax1 += $obj->total_localtax1;
|
||||||
$this->total_localtax2 += $obj->total_localtax2;
|
$this->total_localtax2 += $obj->total_localtax2;
|
||||||
$this->total_ttc += $obj->total_ttc;
|
$this->total_ttc += $obj->total_ttc;
|
||||||
|
$this->multicurrency_total_ht += $obj->multicurrency_total_ht; // The field visible at end of line detail
|
||||||
|
$this->multicurrency_total_tva += $obj->multicurrency_total_tva;
|
||||||
|
$this->multicurrency_total_ttc += $obj->multicurrency_total_ttc;
|
||||||
|
|
||||||
if (! isset($total_ht_by_vats[$obj->vatrate])) $total_ht_by_vats[$obj->vatrate]=0;
|
if (! isset($total_ht_by_vats[$obj->vatrate])) $total_ht_by_vats[$obj->vatrate]=0;
|
||||||
if (! isset($total_tva_by_vats[$obj->vatrate])) $total_tva_by_vats[$obj->vatrate]=0;
|
if (! isset($total_tva_by_vats[$obj->vatrate])) $total_tva_by_vats[$obj->vatrate]=0;
|
||||||
@ -2322,7 +2326,7 @@ abstract class CommonObject
|
|||||||
$total_tva_by_vats[$obj->vatrate] += $obj->total_tva;
|
$total_tva_by_vats[$obj->vatrate] += $obj->total_tva;
|
||||||
$total_ttc_by_vats[$obj->vatrate] += $obj->total_ttc;
|
$total_ttc_by_vats[$obj->vatrate] += $obj->total_ttc;
|
||||||
|
|
||||||
if ($forcedroundingmode == '1') // Check if we need adjustement onto line for vat
|
if ($forcedroundingmode == '1') // Check if we need adjustement onto line for vat. TODO This works on the company currency but not on multicurrency
|
||||||
{
|
{
|
||||||
$tmpvat=price2num($total_ht_by_vats[$obj->vatrate] * $obj->vatrate / 100, 'MT', 1);
|
$tmpvat=price2num($total_ht_by_vats[$obj->vatrate] * $obj->vatrate / 100, 'MT', 1);
|
||||||
$diff=price2num($total_tva_by_vats[$obj->vatrate]-$tmpvat, 'MT', 1);
|
$diff=price2num($total_tva_by_vats[$obj->vatrate]-$tmpvat, 'MT', 1);
|
||||||
@ -2346,26 +2350,25 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add revenue stamp to total
|
// Add revenue stamp to total
|
||||||
$this->total_ttc += isset($this->revenuestamp)?$this->revenuestamp:0;
|
$this->total_ttc += isset($this->revenuestamp)?$this->revenuestamp:0;
|
||||||
|
$this->multicurrency_total_ttc += isset($this->revenuestamp)?($this->revenuestamp * $multicurrency_tx):0;
|
||||||
|
|
||||||
// Situations totals
|
// Situations totals
|
||||||
if ($this->situation_cycle_ref && $this->situation_counter > 1) {
|
if ($this->situation_cycle_ref && $this->situation_counter > 1 && method_exists($this, 'get_prev_sits')) {
|
||||||
$prev_sits = $this->get_prev_sits();
|
$prev_sits = $this->get_prev_sits();
|
||||||
|
|
||||||
foreach ($prev_sits as $sit) {
|
foreach ($prev_sits as $sit) { // $sit is an object Facture loaded with a fetch.
|
||||||
$this->total_ht -= $sit->total_ht;
|
$this->total_ht -= $sit->total_ht;
|
||||||
$this->total_tva -= $sit->total_tva;
|
$this->total_tva -= $sit->total_tva;
|
||||||
$this->total_localtax1 -= $sit->total_localtax1;
|
$this->total_localtax1 -= $sit->total_localtax1;
|
||||||
$this->total_localtax2 -= $sit->total_localtax2;
|
$this->total_localtax2 -= $sit->total_localtax2;
|
||||||
$this->total_ttc -= $sit->total_ttc;
|
$this->total_ttc -= $sit->total_ttc;
|
||||||
|
$this->multicurrency_total_ht -= $sit->multicurrency_total_ht;
|
||||||
|
$this->multicurrency_total_tva -= $sit->multicurrency_total_tva;
|
||||||
|
$this->multicurrency_total_ttc -= $sit->multicurrency_total_ttc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Multicurrency
|
|
||||||
$this->multicurrency_total_ht += $this->total_ht * $multicurrency_tx;
|
|
||||||
$this->multicurrency_total_tva += $this->total_tva * $multicurrency_tx;
|
|
||||||
$this->multicurrency_total_ttc += $this->total_ttc * $multicurrency_tx;
|
|
||||||
|
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|
||||||
// Now update global field total_ht, total_ttc and tva
|
// Now update global field total_ht, total_ttc and tva
|
||||||
@ -2379,7 +2382,7 @@ abstract class CommonObject
|
|||||||
if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') $fieldtva='total_tva';
|
if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') $fieldtva='total_tva';
|
||||||
if ($this->element == 'propal') $fieldttc='total';
|
if ($this->element == 'propal') $fieldttc='total';
|
||||||
if ($this->element == 'expensereport') $fieldtva='total_tva';
|
if ($this->element == 'expensereport') $fieldtva='total_tva';
|
||||||
if ($this->element == 'supplier_proposal') $fieldttc='total';
|
if ($this->element == 'supplier_proposal') $fieldttc='total';
|
||||||
|
|
||||||
if (empty($nodatabaseupdate))
|
if (empty($nodatabaseupdate))
|
||||||
{
|
{
|
||||||
@ -3947,7 +3950,7 @@ abstract class CommonObject
|
|||||||
|
|
||||||
// Now we add first model found in directories scanned
|
// Now we add first model found in directories scanned
|
||||||
$listofdir=explode(',',$dirtoscan);
|
$listofdir=explode(',',$dirtoscan);
|
||||||
foreach($listofdir as $key=>$tmpdir)
|
foreach($listofdir as $key => $tmpdir)
|
||||||
{
|
{
|
||||||
$tmpdir=trim($tmpdir);
|
$tmpdir=trim($tmpdir);
|
||||||
$tmpdir=preg_replace('/DOL_DATA_ROOT/',DOL_DATA_ROOT,$tmpdir);
|
$tmpdir=preg_replace('/DOL_DATA_ROOT/',DOL_DATA_ROOT,$tmpdir);
|
||||||
|
|||||||
@ -2207,10 +2207,6 @@ class Form
|
|||||||
unset($producttmpselect);
|
unset($producttmpselect);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED))
|
|
||||||
{
|
|
||||||
print '<input type="hidden" id="idprod" name="idprod" value="0" />';
|
|
||||||
}
|
|
||||||
// mode=2 means suppliers products
|
// mode=2 means suppliers products
|
||||||
$urloption=($socid > 0?'socid='.$socid.'&':'').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
|
$urloption=($socid > 0?'socid='.$socid.'&':'').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
|
||||||
print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
|
print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
|
||||||
@ -2218,11 +2214,6 @@ class Form
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED))
|
|
||||||
{
|
|
||||||
print '<input type="hidden" id="idprod" name="idprod" value="0" />';
|
|
||||||
print '<script type="text/javascript">$("#'.$htmlname.'").change(function() { $("#idprod").val($(this).val());});</script>';
|
|
||||||
}
|
|
||||||
print $this->select_produits_fournisseurs_list($socid,$selected,$htmlname,$filtertype,$filtre,'',-1,0,0,$alsoproductwithnosupplierprice);
|
print $this->select_produits_fournisseurs_list($socid,$selected,$htmlname,$filtertype,$filtre,'',-1,0,0,$alsoproductwithnosupplierprice);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -271,7 +271,7 @@ class SMTPs
|
|||||||
{
|
{
|
||||||
$this->_moreinheader = $_val;
|
$this->_moreinheader = $_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get trackid
|
* get trackid
|
||||||
*
|
*
|
||||||
@ -291,7 +291,7 @@ class SMTPs
|
|||||||
{
|
{
|
||||||
return $this->_moreinheader;
|
return $this->_moreinheader;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set errors to
|
* Set errors to
|
||||||
*
|
*
|
||||||
@ -411,7 +411,7 @@ class SMTPs
|
|||||||
function _server_authenticate()
|
function _server_authenticate()
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
// Send the RFC2554 specified EHLO.
|
// Send the RFC2554 specified EHLO.
|
||||||
// This improvment as provided by 'SirSir' to
|
// This improvment as provided by 'SirSir' to
|
||||||
// accomodate both SMTP AND ESMTP capable servers
|
// accomodate both SMTP AND ESMTP capable servers
|
||||||
@ -441,7 +441,7 @@ class SMTPs
|
|||||||
{
|
{
|
||||||
$this->_setErr(126, '"' . $host . '" does not support authenticated connections.');
|
$this->_setErr(126, '"' . $host . '" does not support authenticated connections.');
|
||||||
return $_retVal;
|
return $_retVal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Send Authentication to Server
|
// Send Authentication to Server
|
||||||
// Check for errors along the way
|
// Check for errors along the way
|
||||||
@ -882,7 +882,7 @@ class SMTPs
|
|||||||
if ( $_strReplyTo )
|
if ( $_strReplyTo )
|
||||||
$this->_msgReplyTo = $this->_strip_email($_strReplyTo);
|
$this->_msgReplyTo = $this->_strip_email($_strReplyTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the Address from which mail will be the reply-to
|
* Retrieves the Address from which mail will be the reply-to
|
||||||
*
|
*
|
||||||
@ -892,15 +892,15 @@ class SMTPs
|
|||||||
function getReplyTo($_part = true)
|
function getReplyTo($_part = true)
|
||||||
{
|
{
|
||||||
$_retValue = '';
|
$_retValue = '';
|
||||||
|
|
||||||
if ( $_part === true )
|
if ( $_part === true )
|
||||||
$_retValue = $this->_msgReplyTo;
|
$_retValue = $this->_msgReplyTo;
|
||||||
else
|
else
|
||||||
$_retValue = $this->_msgReplyTo[$_part];
|
$_retValue = $this->_msgReplyTo[$_part];
|
||||||
|
|
||||||
return $_retValue;
|
return $_retValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inserts given addresses into structured format.
|
* Inserts given addresses into structured format.
|
||||||
* This method takes a list of given addresses, via an array
|
* This method takes a list of given addresses, via an array
|
||||||
@ -1196,6 +1196,8 @@ class SMTPs
|
|||||||
*/
|
*/
|
||||||
function getHeader()
|
function getHeader()
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
$_header = 'From: ' . $this->getFrom('org') . "\r\n"
|
$_header = 'From: ' . $this->getFrom('org') . "\r\n"
|
||||||
. 'To: ' . $this->getTO() . "\r\n";
|
. 'To: ' . $this->getTO() . "\r\n";
|
||||||
|
|
||||||
@ -1212,13 +1214,13 @@ class SMTPs
|
|||||||
if ( $this->getBCC() )
|
if ( $this->getBCC() )
|
||||||
$_header .= 'Bcc: ' . $this->getBCC() . "\r\n";
|
$_header .= 'Bcc: ' . $this->getBCC() . "\r\n";
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$host=$this->getHost();
|
$host=$this->getHost();
|
||||||
$host=preg_replace('@tcp://@i','',$host); // Remove prefix
|
$host=preg_replace('@tcp://@i','',$host); // Remove prefix
|
||||||
$host=preg_replace('@ssl://@i','',$host); // Remove prefix
|
$host=preg_replace('@ssl://@i','',$host); // Remove prefix
|
||||||
|
|
||||||
$host=dol_getprefix('email');
|
$host=dol_getprefix('email');
|
||||||
|
|
||||||
//NOTE: Message-ID should probably contain the username of the user who sent the msg
|
//NOTE: Message-ID should probably contain the username of the user who sent the msg
|
||||||
$_header .= 'Subject: ' . $this->getSubject() . "\r\n";
|
$_header .= 'Subject: ' . $this->getSubject() . "\r\n";
|
||||||
$_header .= 'Date: ' . date("r") . "\r\n";
|
$_header .= 'Date: ' . date("r") . "\r\n";
|
||||||
@ -1237,7 +1239,7 @@ class SMTPs
|
|||||||
}
|
}
|
||||||
if ( $this->getMoreInHeader() )
|
if ( $this->getMoreInHeader() )
|
||||||
$_header .= $this->getMoreInHeader(); // Value must include the "\r\n";
|
$_header .= $this->getMoreInHeader(); // Value must include the "\r\n";
|
||||||
|
|
||||||
//$_header .=
|
//$_header .=
|
||||||
// 'Read-Receipt-To: ' . $this->getFrom( 'org' ) . "\r\n"
|
// 'Read-Receipt-To: ' . $this->getFrom( 'org' ) . "\r\n"
|
||||||
// 'Return-Receipt-To: ' . $this->getFrom( 'org' ) . "\r\n";
|
// 'Return-Receipt-To: ' . $this->getFrom( 'org' ) . "\r\n";
|
||||||
@ -1258,9 +1260,10 @@ class SMTPs
|
|||||||
$_header .= "Reply-To: ".$this->getReplyTo('addr') ."\r\n";
|
$_header .= "Reply-To: ".$this->getReplyTo('addr') ."\r\n";
|
||||||
|
|
||||||
$_header .= 'X-Mailer: Dolibarr version ' . DOL_VERSION .' (using SMTPs Mailer)' . "\r\n";
|
$_header .= 'X-Mailer: Dolibarr version ' . DOL_VERSION .' (using SMTPs Mailer)' . "\r\n";
|
||||||
|
$_header .= 'X-Dolibarr-Option: '.($conf->global->MAIN_MAIL_USE_MULTI_PART?'MAIN_MAIL_USE_MULTI_PART':'No MAIN_MAIL_USE_MULTI_PART') . "\r\n";
|
||||||
$_header .= 'Mime-Version: 1.0' . "\r\n";
|
$_header .= 'Mime-Version: 1.0' . "\r\n";
|
||||||
|
|
||||||
|
|
||||||
return $_header;
|
return $_header;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1289,17 +1292,17 @@ class SMTPs
|
|||||||
$strContentAltText = html_entity_decode(strip_tags($strContent));
|
$strContentAltText = html_entity_decode(strip_tags($strContent));
|
||||||
$strContentAltText = rtrim(wordwrap($strContentAltText, 75, "\r\n"));
|
$strContentAltText = rtrim(wordwrap($strContentAltText, 75, "\r\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make RFC2045 Compliant
|
// Make RFC2045 Compliant
|
||||||
//$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems ko if not used on a base64 content
|
//$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems ko if not used on a base64 content
|
||||||
$strContent = rtrim(wordwrap($strContent, 75, "\r\n")); // TODO Using this method creates unexpected line break on text/plain content.
|
$strContent = rtrim(wordwrap($strContent, 75, "\r\n")); // TODO Using this method creates unexpected line break on text/plain content.
|
||||||
|
|
||||||
$this->_msgContent[$strType] = array();
|
$this->_msgContent[$strType] = array();
|
||||||
|
|
||||||
$this->_msgContent[$strType]['mimeType'] = $strMimeType;
|
$this->_msgContent[$strType]['mimeType'] = $strMimeType;
|
||||||
$this->_msgContent[$strType]['data'] = $strContent;
|
$this->_msgContent[$strType]['data'] = $strContent;
|
||||||
$this->_msgContent[$strType]['dataText'] = $strContentAltText;
|
$this->_msgContent[$strType]['dataText'] = $strContentAltText;
|
||||||
|
|
||||||
if ( $this->getMD5flag() )
|
if ( $this->getMD5flag() )
|
||||||
$this->_msgContent[$strType]['md5'] = dol_hash($strContent, 3);
|
$this->_msgContent[$strType]['md5'] = dol_hash($strContent, 3);
|
||||||
//}
|
//}
|
||||||
@ -1313,7 +1316,7 @@ class SMTPs
|
|||||||
function getBodyContent()
|
function getBodyContent()
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
// Generate a new Boundary string
|
// Generate a new Boundary string
|
||||||
$this->_setBoundary();
|
$this->_setBoundary();
|
||||||
|
|
||||||
@ -1361,7 +1364,7 @@ class SMTPs
|
|||||||
$content .= "\r\n";
|
$content .= "\r\n";
|
||||||
|
|
||||||
$content .= "--" . $this->_getBoundary('mixed') . "\r\n";
|
$content .= "--" . $this->_getBoundary('mixed') . "\r\n";
|
||||||
|
|
||||||
if (key_exists('image', $this->_msgContent)) // If inline image found
|
if (key_exists('image', $this->_msgContent)) // If inline image found
|
||||||
{
|
{
|
||||||
$content.= 'Content-Type: multipart/alternative; boundary="'.$this->_getBoundary('alternative').'"' . "\r\n";
|
$content.= 'Content-Type: multipart/alternative; boundary="'.$this->_getBoundary('alternative').'"' . "\r\n";
|
||||||
@ -1369,7 +1372,7 @@ class SMTPs
|
|||||||
$content .= "--" . $this->_getBoundary('alternative') . "\r\n";
|
$content .= "--" . $this->_getBoundary('alternative') . "\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// $this->_msgContent must be sorted with key 'text' or 'html' first then 'image' then 'attachment'
|
// $this->_msgContent must be sorted with key 'text' or 'html' first then 'image' then 'attachment'
|
||||||
|
|
||||||
|
|
||||||
@ -1429,18 +1432,18 @@ class SMTPs
|
|||||||
$content.= "\r\n";
|
$content.= "\r\n";
|
||||||
$content.= "--" . $this->_getBoundary('related') . "\r\n";
|
$content.= "--" . $this->_getBoundary('related') . "\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! key_exists('image', $this->_msgContent) && $_content['dataText'] && ! empty($conf->global->MAIN_MAIL_USE_MULTI_PART)) // Add plain text message part before html part
|
if (! key_exists('image', $this->_msgContent) && $_content['dataText'] && ! empty($conf->global->MAIN_MAIL_USE_MULTI_PART)) // Add plain text message part before html part
|
||||||
{
|
{
|
||||||
$content.= 'Content-Type: multipart/alternative; boundary="'.$this->_getBoundary('alternative').'"' . "\r\n";
|
$content.= 'Content-Type: multipart/alternative; boundary="'.$this->_getBoundary('alternative').'"' . "\r\n";
|
||||||
$content .= "\r\n";
|
$content .= "\r\n";
|
||||||
$content .= "--" . $this->_getBoundary('alternative') . "\r\n";
|
$content .= "--" . $this->_getBoundary('alternative') . "\r\n";
|
||||||
|
|
||||||
$content.= "Content-Type: text/plain; charset=" . $this->getCharSet() . "\r\n";
|
$content.= "Content-Type: text/plain; charset=" . $this->getCharSet() . "\r\n";
|
||||||
$content.= "\r\n". $_content['dataText'] . "\r\n";
|
$content.= "\r\n". $_content['dataText'] . "\r\n";
|
||||||
$content.= "--" . $this->_getBoundary('alternative') . "\r\n";
|
$content.= "--" . $this->_getBoundary('alternative') . "\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$content .= 'Content-Type: ' . $_content['mimeType'] . '; '
|
$content .= 'Content-Type: ' . $_content['mimeType'] . '; '
|
||||||
// . 'charset="' . $this->getCharSet() . '"';
|
// . 'charset="' . $this->getCharSet() . '"';
|
||||||
. 'charset=' . $this->getCharSet() . '';
|
. 'charset=' . $this->getCharSet() . '';
|
||||||
@ -1462,7 +1465,7 @@ class SMTPs
|
|||||||
{
|
{
|
||||||
$content.= "--" . $this->_getBoundary('alternative') . "--". "\r\n";
|
$content.= "--" . $this->_getBoundary('alternative') . "--". "\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$content .= "\r\n";
|
$content .= "\r\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -146,7 +146,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
|
|||||||
$buf = fgets($fp, 4096);
|
$buf = fgets($fp, 4096);
|
||||||
|
|
||||||
// Test if request must be ran only for particular database or version (if yes, we must remove the -- comment)
|
// Test if request must be ran only for particular database or version (if yes, we must remove the -- comment)
|
||||||
if (preg_match('/^--\sV(MYSQL|PGSQL|)([0-9\.]+)/i',$buf,$reg))
|
if (preg_match('/^--\sV(MYSQL|PGSQL)([^\s]*)/i',$buf,$reg))
|
||||||
{
|
{
|
||||||
$qualified=1;
|
$qualified=1;
|
||||||
|
|
||||||
@ -159,20 +159,29 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
|
|||||||
// restrict on version
|
// restrict on version
|
||||||
if ($qualified)
|
if ($qualified)
|
||||||
{
|
{
|
||||||
|
if (! empty($reg[2]))
|
||||||
$versionrequest=explode('.',$reg[2]);
|
{
|
||||||
//print var_dump($versionrequest);
|
if (is_numeric($reg[2])) // This is a version
|
||||||
//print var_dump($versionarray);
|
{
|
||||||
if (! count($versionrequest) || ! count($versionarray) || versioncompare($versionrequest,$versionarray) > 0)
|
$versionrequest=explode('.',$reg[2]);
|
||||||
{
|
//print var_dump($versionrequest);
|
||||||
$qualified=0;
|
//print var_dump($versionarray);
|
||||||
}
|
if (! count($versionrequest) || ! count($versionarray) || versioncompare($versionrequest,$versionarray) > 0)
|
||||||
|
{
|
||||||
|
$qualified=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // This is a test on a constant. For example when we have -- VMYSQLUTF8UNICODE, we test constant $conf->global->UTF8UNICODE
|
||||||
|
{
|
||||||
|
if (empty($conf->db->dolibarr_main_db_collation) || ($reg[2] != strtoupper(preg_replace('/_/', '', $conf->db->dolibarr_main_db_collation)))) $qualified=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($qualified)
|
if ($qualified)
|
||||||
{
|
{
|
||||||
// Version qualified, delete SQL comments
|
// Version qualified, delete SQL comments
|
||||||
$buf=preg_replace('/^--\sV(MYSQL|PGSQL|)([0-9\.]+)/i','',$buf);
|
$buf=preg_replace('/^--\sV(MYSQL|PGSQL)([^\s]*)/i','',$buf);
|
||||||
//print "Ligne $i qualifi?e par version: ".$buf.'<br>';
|
//print "Ligne $i qualifi?e par version: ".$buf.'<br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -769,7 +778,7 @@ function activateModule($value,$withdeps=1)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$result=$objMod->init();
|
$result=$objMod->init();
|
||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
{
|
{
|
||||||
$ret['errors'][]=$objMod->error;
|
$ret['errors'][]=$objMod->error;
|
||||||
}
|
}
|
||||||
@ -799,19 +808,19 @@ function activateModule($value,$withdeps=1)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($activate)
|
if ($activate)
|
||||||
{
|
{
|
||||||
$ret['nbmodules']+=$resarray['nbmodules'];
|
$ret['nbmodules']+=$resarray['nbmodules'];
|
||||||
$ret['nbperms']+=$resarray['nbperms'];
|
$ret['nbperms']+=$resarray['nbperms'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$ret['errors'][] = $langs->trans('activateModuleDependNotSatisfied', $objMod->name, $objMod->depends[$i]);
|
$ret['errors'][] = $langs->trans('activateModuleDependNotSatisfied', $objMod->name, $objMod->depends[$i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($objMod->conflictwith) && is_array($objMod->conflictwith) && ! empty($objMod->conflictwith))
|
if (isset($objMod->conflictwith) && is_array($objMod->conflictwith) && ! empty($objMod->conflictwith))
|
||||||
{
|
{
|
||||||
// Desactivation des modules qui entrent en conflit
|
// Desactivation des modules qui entrent en conflit
|
||||||
@ -830,12 +839,12 @@ function activateModule($value,$withdeps=1)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! count($ret['errors']))
|
if (! count($ret['errors']))
|
||||||
{
|
{
|
||||||
$ret['nbmodules']++;
|
$ret['nbmodules']++;
|
||||||
$ret['nbperms']+=count($objMod->rights);
|
$ret['nbperms']+=count($objMod->rights);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1307,7 +1316,7 @@ function showModulesExludedForExternal($modules)
|
|||||||
//if (empty($conf->global->$moduleconst)) continue;
|
//if (empty($conf->global->$moduleconst)) continue;
|
||||||
if (! in_array($modulename,$listofmodules)) continue;
|
if (! in_array($modulename,$listofmodules)) continue;
|
||||||
//var_dump($modulename.'eee'.$langs->trans('Module'.$module->numero.'Name'));
|
//var_dump($modulename.'eee'.$langs->trans('Module'.$module->numero.'Name'));
|
||||||
|
|
||||||
if ($i > 0) $text.=', ';
|
if ($i > 0) $text.=', ';
|
||||||
else $text.=' ';
|
else $text.=' ';
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -40,6 +40,7 @@
|
|||||||
* Ex: array('disabled'=>
|
* Ex: array('disabled'=>
|
||||||
* Ex: array('show'=>
|
* Ex: array('show'=>
|
||||||
* Ex: array('update_textarea'=>
|
* Ex: array('update_textarea'=>
|
||||||
|
* Ex: array('option_disabled'=> id to disable and warning to show if we select a disabled value (this is possible when using autocomplete ajax)
|
||||||
* @return string Script
|
* @return string Script
|
||||||
*/
|
*/
|
||||||
function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLength=2, $autoselect=0, $ajaxoptions=array())
|
function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLength=2, $autoselect=0, $ajaxoptions=array())
|
||||||
@ -140,6 +141,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
|
|||||||
$("#'.$htmlname.'").val(ui.item.id).trigger("change"); // Select new value
|
$("#'.$htmlname.'").val(ui.item.id).trigger("change"); // Select new value
|
||||||
// Disable an element
|
// Disable an element
|
||||||
if (options.option_disabled) {
|
if (options.option_disabled) {
|
||||||
|
console.log("Make action option_disabled on #"+options.option_disabled+" with disabled="+ui.item.disabled)
|
||||||
if (ui.item.disabled) {
|
if (ui.item.disabled) {
|
||||||
$("#" + options.option_disabled).prop("disabled", true);
|
$("#" + options.option_disabled).prop("disabled", true);
|
||||||
if (options.error) {
|
if (options.error) {
|
||||||
@ -148,28 +150,32 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
|
|||||||
if (options.warning) {
|
if (options.warning) {
|
||||||
$.jnotify(options.warning, "warning", false); // Output with jnotify the warning message
|
$.jnotify(options.warning, "warning", false); // Output with jnotify the warning message
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$("#" + options.option_disabled).removeAttr("disabled");
|
$("#" + options.option_disabled).removeAttr("disabled");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (options.disabled) {
|
if (options.disabled) {
|
||||||
|
console.log("Make action disabled on each "+options.option_disabled)
|
||||||
$.each(options.disabled, function(key, value) {
|
$.each(options.disabled, function(key, value) {
|
||||||
$("#" + value).prop("disabled", true);
|
$("#" + value).prop("disabled", true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (options.show) {
|
if (options.show) {
|
||||||
|
console.log("Make action show on each "+options.show)
|
||||||
$.each(options.show, function(key, value) {
|
$.each(options.show, function(key, value) {
|
||||||
$("#" + value).show().trigger("show");
|
$("#" + value).show().trigger("show");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Update an input
|
// Update an input
|
||||||
if (ui.item.update) {
|
if (ui.item.update) {
|
||||||
|
console.log("Make action update on each ui.item.update")
|
||||||
// loop on each "update" fields
|
// loop on each "update" fields
|
||||||
$.each(ui.item.update, function(key, value) {
|
$.each(ui.item.update, function(key, value) {
|
||||||
$("#" + key).val(value).trigger("change");
|
$("#" + key).val(value).trigger("change");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (ui.item.textarea) {
|
if (ui.item.textarea) {
|
||||||
|
console.log("Make action textarea on each ui.item.textarea")
|
||||||
$.each(ui.item.textarea, function(key, value) {
|
$.each(ui.item.textarea, function(key, value) {
|
||||||
if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined" && CKEDITOR.instances[key] != "undefined") {
|
if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined" && CKEDITOR.instances[key] != "undefined") {
|
||||||
CKEDITOR.instances[key].setData(value);
|
CKEDITOR.instances[key].setData(value);
|
||||||
@ -181,12 +187,12 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
console.log("ajax_autocompleter new value selected, we trigger change on original component so field #search_'.$htmlname.'");
|
console.log("ajax_autocompleter new value selected, we trigger change on original component so field #search_'.$htmlname.'");
|
||||||
|
|
||||||
$("#search_'.$htmlname.'").trigger("change"); // We have changed value of the combo select, we must be sure to trigger all js hook binded on this event. This is required to trigger other javascript change method binded on original field by other code.
|
$("#search_'.$htmlname.'").trigger("change"); // We have changed value of the combo select, we must be sure to trigger all js hook binded on this event. This is required to trigger other javascript change method binded on original field by other code.
|
||||||
}
|
}
|
||||||
,delay: 500
|
,delay: 500
|
||||||
}).data("ui-autocomplete")._renderItem = function( ul, item ) {
|
}).data("ui-autocomplete")._renderItem = function( ul, item ) {
|
||||||
|
|
||||||
return $("<li>")
|
return $("<li>")
|
||||||
.data( "ui-autocomplete-item", item ) // jQuery UI > 1.10.0
|
.data( "ui-autocomplete-item", item ) // jQuery UI > 1.10.0
|
||||||
.append( \'<a><span class="tag">\' + item.label + "</span></a>" )
|
.append( \'<a><span class="tag">\' + item.label + "</span></a>" )
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -419,7 +420,7 @@ function dol_get_next_week($day, $week, $month, $year)
|
|||||||
{
|
{
|
||||||
$tmparray = dol_get_first_day_week($day, $month, $year);
|
$tmparray = dol_get_first_day_week($day, $month, $year);
|
||||||
|
|
||||||
$time=dol_mktime(12,0,0,$month,$tmparray['first_day'],$year,1,0);
|
$time=dol_mktime(12,0,0,$tmparray['first_month'],$tmparray['first_day'],$tmparray['first_year'],1,0);
|
||||||
$time+=24*60*60*7;
|
$time+=24*60*60*7;
|
||||||
$tmparray=dol_getdate($time,true);
|
$tmparray=dol_getdate($time,true);
|
||||||
|
|
||||||
|
|||||||
@ -323,6 +323,7 @@ function dol_dir_is_emtpy($folder)
|
|||||||
*
|
*
|
||||||
* @param string $file Filename
|
* @param string $file Filename
|
||||||
* @return int <0 if KO, Number of lines in files if OK
|
* @return int <0 if KO, Number of lines in files if OK
|
||||||
|
* @see dol_nboflines
|
||||||
*/
|
*/
|
||||||
function dol_count_nb_of_line($file)
|
function dol_count_nb_of_line($file)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2325,7 +2325,7 @@ function img_picto($titlealt, $picto, $morealt = '', $pictoisfullpath = false, $
|
|||||||
if ($pictoisfullpath)
|
if ($pictoisfullpath)
|
||||||
{
|
{
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto .= '.png';
|
if (! preg_match('/(\.png|\.gif|\.svg)$/i',$picto)) $picto .= '.png';
|
||||||
$fullpathpicto = $picto;
|
$fullpathpicto = $picto;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2346,7 +2346,7 @@ function img_picto($titlealt, $picto, $morealt = '', $pictoisfullpath = false, $
|
|||||||
$path = $regs[2]; // $path is $mymodule
|
$path = $regs[2]; // $path is $mymodule
|
||||||
}
|
}
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto .= '.png';
|
if (! preg_match('/(\.png|\.gif|\.svg)$/i',$picto)) $picto .= '.png';
|
||||||
// If alt path are defined, define url where img file is, according to physical path
|
// If alt path are defined, define url where img file is, according to physical path
|
||||||
foreach ($conf->file->dol_document_root as $type => $dirroot) // ex: array(["main"]=>"/home/maindir/htdocs", ["alt0"]=>"/home/moddir0/htdocs", ...)
|
foreach ($conf->file->dol_document_root as $type => $dirroot) // ex: array(["main"]=>"/home/maindir/htdocs", ["alt0"]=>"/home/moddir0/htdocs", ...)
|
||||||
{
|
{
|
||||||
@ -4488,22 +4488,57 @@ function dol_string_nohtmltag($StringHtml,$removelinefeed=1,$pagecodeto='UTF-8')
|
|||||||
* Return first line of text. Cut will depends if content is HTML or not.
|
* Return first line of text. Cut will depends if content is HTML or not.
|
||||||
*
|
*
|
||||||
* @param string $text Input text
|
* @param string $text Input text
|
||||||
|
* @param int $nboflines Nb of lines to get (default is 1 = first line only)
|
||||||
* @return string Output text
|
* @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)
|
function dolGetFirstLineOfText($text, $nboflines=1)
|
||||||
{
|
{
|
||||||
if (dol_textishtml($text))
|
if ($nboflines == 1)
|
||||||
{
|
{
|
||||||
$firstline=preg_replace('/<br[^>]*>.*$/s','',$text); // The s pattern modifier means the . can match newline characters
|
if (dol_textishtml($text))
|
||||||
$firstline=preg_replace('/<div[^>]*>.*$/s','',$firstline); // The s pattern modifier means the . can match newline characters
|
{
|
||||||
|
$firstline=preg_replace('/<br[^>]*>.*$/s','',$text); // The s pattern modifier means the . can match newline characters
|
||||||
|
$firstline=preg_replace('/<div[^>]*>.*$/s','',$firstline); // The s pattern modifier means the . can match newline characters
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$firstline=preg_replace('/[\n\r].*/','',$text);
|
||||||
|
}
|
||||||
|
return $firstline.((strlen($firstline) != strlen($text))?'...':'');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$firstline=preg_replace('/[\n\r].*/','',$text);
|
$ishtml=0;
|
||||||
|
if (dol_textishtml($text))
|
||||||
|
{
|
||||||
|
$text=preg_replace('/\n/','',$text);
|
||||||
|
$ishtml=1;
|
||||||
|
$repTable = array("\t" => " ", "\n" => " ", "\r" => " ", "\0" => " ", "\x0B" => " ");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$repTable = array("\t" => " ", "\n" => "<br>", "\r" => " ", "\0" => " ", "\x0B" => " ");
|
||||||
|
}
|
||||||
|
|
||||||
|
$text = strtr($text, $repTable);
|
||||||
|
if ($charset == 'UTF-8') { $pattern = '/(<br[^>]*>)/Uu'; } // /U is to have UNGREEDY regex to limit to one html tag. /u is for UTF8 support
|
||||||
|
else $pattern = '/(<br[^>]*>)/U'; // /U is to have UNGREEDY regex to limit to one html tag.
|
||||||
|
$a = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
|
||||||
|
|
||||||
|
$firstline='';
|
||||||
|
$i=0;
|
||||||
|
$nba = count($a); // 2x nb of lines in $a because $a contains also a line for each new line separator
|
||||||
|
while (($i < $nba) && ($i < ($nboflines * 2)))
|
||||||
|
{
|
||||||
|
if ($i % 2 == 0) $firstline .= $a[$i];
|
||||||
|
elseif (($i < (($nboflines * 2) - 1)) && ($i < ($nba - 1))) $firstline .= ($ishtml?"<br>\n":"\n");
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
unset($a);
|
||||||
|
return $firstline.(($i < $nba)?'...':'');
|
||||||
}
|
}
|
||||||
return $firstline.((strlen($firstline) != strlen($text))?'...':'');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -4665,7 +4700,7 @@ function dol_nboflines($s,$maxchar=0)
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return nb of lines of a formated text with \n and <br> (we can't have both \n and br)
|
* Return nb of lines of a formated text with \n and <br> (WARNING: string must not have mixed \n and br separators)
|
||||||
*
|
*
|
||||||
* @param string $text Text
|
* @param string $text Text
|
||||||
* @param int $maxlinesize Largeur de ligne en caracteres (ou 0 si pas de limite - defaut)
|
* @param int $maxlinesize Largeur de ligne en caracteres (ou 0 si pas de limite - defaut)
|
||||||
@ -4701,6 +4736,8 @@ function dol_nboflines_bis($text,$maxlinesize=0,$charset='UTF-8')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unset($a);
|
||||||
return $nblines;
|
return $nblines;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5772,29 +5809,39 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
|
|||||||
$i3 = 0;
|
$i3 = 0;
|
||||||
foreach($tmpcrits as $tmpcrit)
|
foreach($tmpcrits as $tmpcrit)
|
||||||
{
|
{
|
||||||
$newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : '') . $field . " LIKE '";
|
$newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : '');
|
||||||
|
|
||||||
|
if (preg_match('/\.(id|rowid)$/', $field)) // Special cas for rowid that is sometimes a ref so used as a search field
|
||||||
|
{
|
||||||
|
$newres .= $field . " = " . (is_numeric(trim($tmpcrit))?trim($tmpcrit):'0');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$newres .= $field . " LIKE '";
|
||||||
|
|
||||||
|
$tmpcrit=trim($tmpcrit);
|
||||||
|
$tmpcrit2=$tmpcrit;
|
||||||
|
$tmpbefore='%'; $tmpafter='%';
|
||||||
|
if (preg_match('/^[\^\$]/', $tmpcrit))
|
||||||
|
{
|
||||||
|
$tmpbefore='';
|
||||||
|
$tmpcrit2 = preg_replace('/^[\^\$]/', '', $tmpcrit2);
|
||||||
|
}
|
||||||
|
if (preg_match('/[\^\$]$/', $tmpcrit))
|
||||||
|
{
|
||||||
|
$tmpafter='';
|
||||||
|
$tmpcrit2 = preg_replace('/[\^\$]$/', '', $tmpcrit2);
|
||||||
|
}
|
||||||
|
$newres .= $tmpbefore;
|
||||||
|
$newres .= $db->escape($tmpcrit2);
|
||||||
|
$newres .= $tmpafter;
|
||||||
|
$newres .= "'";
|
||||||
|
if (empty($tmpcrit2))
|
||||||
|
{
|
||||||
|
$newres .= ' OR ' . $field . " IS NULL";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$tmpcrit=trim($tmpcrit);
|
|
||||||
$tmpcrit2=$tmpcrit;
|
|
||||||
$tmpbefore='%'; $tmpafter='%';
|
|
||||||
if (preg_match('/^[\^\$]/', $tmpcrit))
|
|
||||||
{
|
|
||||||
$tmpbefore='';
|
|
||||||
$tmpcrit2 = preg_replace('/^[\^\$]/', '', $tmpcrit2);
|
|
||||||
}
|
|
||||||
if (preg_match('/[\^\$]$/', $tmpcrit))
|
|
||||||
{
|
|
||||||
$tmpafter='';
|
|
||||||
$tmpcrit2 = preg_replace('/[\^\$]$/', '', $tmpcrit2);
|
|
||||||
}
|
|
||||||
$newres .= $tmpbefore;
|
|
||||||
$newres .= $db->escape($tmpcrit2);
|
|
||||||
$newres .= $tmpafter;
|
|
||||||
$newres .= "'";
|
|
||||||
if (empty($tmpcrit2))
|
|
||||||
{
|
|
||||||
$newres .= ' OR ' . $field . " IS NULL";
|
|
||||||
}
|
|
||||||
$i3++;
|
$i3++;
|
||||||
}
|
}
|
||||||
$i2++; // a criteria was added to string
|
$i2++; // a criteria was added to string
|
||||||
|
|||||||
@ -42,19 +42,21 @@ if (! function_exists('json_encode'))
|
|||||||
*
|
*
|
||||||
* @param mixed $elements PHP Object to json encode
|
* @param mixed $elements PHP Object to json encode
|
||||||
* @return string Json encoded string
|
* @return string Json encoded string
|
||||||
* @deprecated PHP >= 5.3 supports native json_encode
|
|
||||||
* @see json_encode()
|
* @see json_encode()
|
||||||
*/
|
*/
|
||||||
function dol_json_encode($elements)
|
function dol_json_encode($elements)
|
||||||
{
|
{
|
||||||
dol_syslog('dol_json_encode() is deprecated. Please update your code to use native json_encode().', LOG_WARNING);
|
dol_syslog("For better permorfance, enable the native json in your PHP", LOG_WARNING);
|
||||||
|
|
||||||
$num=count($elements);
|
$num=0;
|
||||||
if (is_object($elements)) // Count number of properties for an object
|
if (is_object($elements)) // Count number of properties for an object
|
||||||
{
|
{
|
||||||
$num=0;
|
|
||||||
foreach($elements as $key => $value) $num++;
|
foreach($elements as $key => $value) $num++;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$num=count($elements);
|
||||||
|
}
|
||||||
//var_dump($num);
|
//var_dump($num);
|
||||||
|
|
||||||
// determine type
|
// determine type
|
||||||
|
|||||||
@ -1753,6 +1753,8 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0)
|
|||||||
*/
|
*/
|
||||||
function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = null)
|
function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = null)
|
||||||
{
|
{
|
||||||
|
if (empty($hookmanager)) global $hookmanager;
|
||||||
|
|
||||||
$reshook=0;
|
$reshook=0;
|
||||||
$result='';
|
$result='';
|
||||||
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) )
|
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) )
|
||||||
|
|||||||
@ -50,8 +50,8 @@
|
|||||||
* @param array $localtaxes_array Array with localtaxes info array('0'=>type1,'1'=>rate1,'2'=>type2,'3'=>rate2) (loaded by getLocalTaxesFromRate(vatrate, 0, ...) function).
|
* @param array $localtaxes_array Array with localtaxes info array('0'=>type1,'1'=>rate1,'2'=>type2,'3'=>rate2) (loaded by getLocalTaxesFromRate(vatrate, 0, ...) function).
|
||||||
* @param integer $progress Situation invoices progress (value from 0 to 100, 100 by default)
|
* @param integer $progress Situation invoices progress (value from 0 to 100, 100 by default)
|
||||||
* @param double $multicurrency_tx Currency rate (1 by default)
|
* @param double $multicurrency_tx Currency rate (1 by default)
|
||||||
* @param double $pu_ht_devise Amount in currency
|
* @param double $pu_devise Amount in currency
|
||||||
* @return array [
|
* @return array [
|
||||||
* 0=total_ht,
|
* 0=total_ht,
|
||||||
* 1=total_vat, (main vat only)
|
* 1=total_vat, (main vat only)
|
||||||
* 2=total_ttc, (total_ht + main vat + local taxes)
|
* 2=total_ttc, (total_ht + main vat + local taxes)
|
||||||
@ -65,15 +65,16 @@
|
|||||||
* 10=total_tax2 for total_ht,
|
* 10=total_tax2 for total_ht,
|
||||||
* 11=pu_tax1 for pu_ht, !! should not be used
|
* 11=pu_tax1 for pu_ht, !! should not be used
|
||||||
* 12=pu_tax2 for pu_ht, !! should not be used
|
* 12=pu_tax2 for pu_ht, !! should not be used
|
||||||
* 13=!! should not be used
|
* 13=?? !! should not be used
|
||||||
* 14=total_tax1 for total_ht_without_discount,
|
* 14=total_tax1 for total_ht_without_discount,
|
||||||
* 15=total_tax2 for total_ht_without_discount]
|
* 15=total_tax2 for total_ht_without_discount,
|
||||||
|
*
|
||||||
* 16=multicurrency_total_ht
|
* 16=multicurrency_total_ht
|
||||||
* 17=multicurrency_total_tva
|
* 17=multicurrency_total_tva
|
||||||
* 18=multicurrency_total_ttc
|
* 18=multicurrency_total_ttc
|
||||||
* 19=multicurrency_pu_ht
|
* 19=multicurrency_pu_ht
|
||||||
*/
|
*/
|
||||||
function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller = '', $localtaxes_array='', $progress=100, $multicurrency_tx=1, $pu_ht_devise=0)
|
function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller = '', $localtaxes_array='', $progress=100, $multicurrency_tx=1, $pu_devise=0)
|
||||||
{
|
{
|
||||||
global $conf,$mysoc,$db;
|
global $conf,$mysoc,$db;
|
||||||
|
|
||||||
@ -101,10 +102,10 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
|
|||||||
//dol_syslog("Price.lib::calcul_price_total qty=".$qty." pu=".$pu." remiserpercent_ligne=".$remise_percent_ligne." txtva=".$txtva." uselocaltax1_rate=".$uselocaltax1_rate." uselocaltax2_rate=".$uselocaltax2_rate.' remise_percent_global='.$remise_percent_global.' price_base_type='.$ice_base_type.' type='.$type.' progress='.$progress);
|
//dol_syslog("Price.lib::calcul_price_total qty=".$qty." pu=".$pu." remiserpercent_ligne=".$remise_percent_ligne." txtva=".$txtva." uselocaltax1_rate=".$uselocaltax1_rate." uselocaltax2_rate=".$uselocaltax2_rate.' remise_percent_global='.$remise_percent_global.' price_base_type='.$ice_base_type.' type='.$type.' progress='.$progress);
|
||||||
|
|
||||||
$countryid=$seller->country_id;
|
$countryid=$seller->country_id;
|
||||||
|
|
||||||
if (is_numeric($uselocaltax1_rate)) $uselocaltax1_rate=(float) $uselocaltax1_rate;
|
if (is_numeric($uselocaltax1_rate)) $uselocaltax1_rate=(float) $uselocaltax1_rate;
|
||||||
if (is_numeric($uselocaltax2_rate)) $uselocaltax2_rate=(float) $uselocaltax2_rate;
|
if (is_numeric($uselocaltax2_rate)) $uselocaltax2_rate=(float) $uselocaltax2_rate;
|
||||||
|
|
||||||
if ($uselocaltax1_rate < 0) $uselocaltax1_rate=$seller->localtax1_assuj;
|
if ($uselocaltax1_rate < 0) $uselocaltax1_rate=$seller->localtax1_assuj;
|
||||||
if ($uselocaltax2_rate < 0) $uselocaltax2_rate=$seller->localtax2_assuj;
|
if ($uselocaltax2_rate < 0) $uselocaltax2_rate=$seller->localtax2_assuj;
|
||||||
|
|
||||||
@ -143,14 +144,15 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
|
|||||||
}
|
}
|
||||||
else dol_print_error($db);
|
else dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
// pu calculation from pu_devise if pu empty
|
// pu calculation from pu_devise if pu empty
|
||||||
if(empty($pu) && !empty($pu_ht_devise)) {
|
if(empty($pu) && !empty($pu_devise)) {
|
||||||
$pu = $pu_ht_devise / $multicurrency_tx;
|
$pu = $pu_devise / $multicurrency_tx;
|
||||||
} else {
|
|
||||||
$pu_ht_devise = $pu * $multicurrency_tx;
|
|
||||||
}
|
}
|
||||||
|
if(empty($pu_devise) && !empty($multicurrency_tx)) {
|
||||||
|
$pu_devise = $pu * $multicurrency_tx;
|
||||||
|
}
|
||||||
|
|
||||||
// initialize total (may be HT or TTC depending on price_base_type)
|
// initialize total (may be HT or TTC depending on price_base_type)
|
||||||
$tot_sans_remise = $pu * $qty * $progress / 100;
|
$tot_sans_remise = $pu * $qty * $progress / 100;
|
||||||
$tot_avec_remise_ligne = $tot_sans_remise * (1 - ($remise_percent_ligne / 100));
|
$tot_avec_remise_ligne = $tot_sans_remise * (1 - ($remise_percent_ligne / 100));
|
||||||
@ -338,13 +340,47 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
|
|||||||
$result[10]=round($result[10]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
|
$result[10]=round($result[10]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Multicurrency
|
// Multicurrency
|
||||||
$result[16] = price2num($result[0] * $multicurrency_tx, 'MT');
|
if ($multicurrency_tx != 1)
|
||||||
$result[17] = price2num($result[1] * $multicurrency_tx, 'MT');
|
{
|
||||||
$result[18] = price2num($result[2] * $multicurrency_tx, 'MT');
|
// Recal function using the multicurrency price as reference price. We must set param $multicurrency_tx to 1 to avoid infinite loop.
|
||||||
$result[19] = price2num($pu_ht_devise, 'MU');
|
$newresult = calcul_price_total($qty, $pu_devise, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller, $localtaxes_array, $progress, 1, 0);
|
||||||
|
|
||||||
|
$result[16] = $newresult[0];
|
||||||
|
$result[17] = $newresult[1];
|
||||||
|
$result[18] = $newresult[2];
|
||||||
|
$result[19] = $newresult[3];
|
||||||
|
$result[20] = $newresult[4];
|
||||||
|
$result[21] = $newresult[5];
|
||||||
|
$result[22] = $newresult[6];
|
||||||
|
$result[23] = $newresult[7];
|
||||||
|
$result[24] = $newresult[8];
|
||||||
|
$result[25] = $newresult[9];
|
||||||
|
$result[26] = $newresult[10];
|
||||||
|
/*
|
||||||
|
$result[16] = price2num($result[0] * $multicurrency_tx, 'MT');
|
||||||
|
$result[17] = price2num($result[1] * $multicurrency_tx, 'MT');
|
||||||
|
$result[18] = price2num($result[2] * $multicurrency_tx, 'MT');
|
||||||
|
$result[19] = price2num($pu_devise, 'MU');
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$result[16] = $result[0];
|
||||||
|
$result[17] = $result[1];
|
||||||
|
$result[18] = $result[2];
|
||||||
|
$result[19] = $result[3];
|
||||||
|
$result[20] = $result[4];
|
||||||
|
$result[21] = $result[5];
|
||||||
|
$result[22] = $result[6];
|
||||||
|
$result[23] = $result[7];
|
||||||
|
$result[24] = $result[8];
|
||||||
|
$result[25] = $result[9];
|
||||||
|
$result[26] = $result[10];
|
||||||
|
}
|
||||||
|
|
||||||
|
//var_dump($result);
|
||||||
// initialize result array
|
// initialize result array
|
||||||
//for ($i=0; $i <= 18; $i++) $result[$i] = (float) $result[$i];
|
//for ($i=0; $i <= 18; $i++) $result[$i] = (float) $result[$i];
|
||||||
|
|
||||||
|
|||||||
@ -375,7 +375,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandsh
|
|||||||
|
|
||||||
$check = array('adherent','banque','user','usergroup','produit','service','produit|service','categorie'); // Test on entity only (Objects with no link to company)
|
$check = array('adherent','banque','user','usergroup','produit','service','produit|service','categorie'); // Test on entity only (Objects with no link to company)
|
||||||
$checksoc = array('societe'); // Test for societe object
|
$checksoc = array('societe'); // Test for societe object
|
||||||
$checkother = array('contact'); // Test on entity and link to societe. Allowed if link is empty (Ex: contacts...).
|
$checkother = array('contact','agenda'); // Test on entity and link to third party. Allowed if link is empty (Ex: contacts...).
|
||||||
$checkproject = array('projet','project'); // Test for project object
|
$checkproject = array('projet','project'); // Test for project object
|
||||||
$checktask = array('projet_task');
|
$checktask = array('projet_task');
|
||||||
$nocheck = array('barcode','stock','fournisseur'); // No test
|
$nocheck = array('barcode','stock','fournisseur'); // No test
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2006-2007 Yannick Warnier <ywarnier@beeznest.org>
|
* Copyright (C) 2006-2007 Yannick Warnier <ywarnier@beeznest.org>
|
||||||
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2012-2016 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012-2017 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
@ -583,11 +583,11 @@ function tax_by_date($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
|
|||||||
{
|
{
|
||||||
$oldrowid=$assoc['rowid'];
|
$oldrowid=$assoc['rowid'];
|
||||||
$list[$assoc['rate']]['totalht'] += $assoc['total_ht'];
|
$list[$assoc['rate']]['totalht'] += $assoc['total_ht'];
|
||||||
|
$list[$assoc['rate']]['vat'] += $assoc['total_vat'];
|
||||||
$list[$assoc['rate']]['localtax1'] += $assoc['total_localtax1'];
|
$list[$assoc['rate']]['localtax1'] += $assoc['total_localtax1'];
|
||||||
$list[$assoc['rate']]['localtax2'] += $assoc['total_localtax2'];
|
$list[$assoc['rate']]['localtax2'] += $assoc['total_localtax2'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$list[$assoc['rate']]['vat'] = $assoc['total_vat'];
|
|
||||||
$list[$assoc['rate']]['dtotal_ttc'][] = $assoc['total_ttc'];
|
$list[$assoc['rate']]['dtotal_ttc'][] = $assoc['total_ttc'];
|
||||||
$list[$assoc['rate']]['dtype'][] = 'ExpenseReportPayment';
|
$list[$assoc['rate']]['dtype'][] = 'ExpenseReportPayment';
|
||||||
$list[$assoc['rate']]['datef'][] = $assoc['datef'];
|
$list[$assoc['rate']]['datef'][] = $assoc['datef'];
|
||||||
|
|||||||
@ -1255,55 +1255,55 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
*
|
*
|
||||||
* @return int Error count (0 if ok)
|
* @return int Error count (0 if ok)
|
||||||
*/
|
*/
|
||||||
function insert_tabs()
|
function insert_tabs()
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$err=0;
|
$err=0;
|
||||||
|
|
||||||
if (! empty($this->tabs))
|
if (! empty($this->tabs))
|
||||||
{
|
{
|
||||||
$i=0;
|
$i=0;
|
||||||
foreach ($this->tabs as $key => $value)
|
foreach ($this->tabs as $key => $value)
|
||||||
{
|
{
|
||||||
if (is_array($value) && count($value) == 0) continue; // Discard empty arrays
|
if (is_array($value) && count($value) == 0) continue; // Discard empty arrays
|
||||||
|
|
||||||
$entity=$conf->entity;
|
$entity=$conf->entity;
|
||||||
$newvalue = $value;
|
$newvalue = $value;
|
||||||
|
|
||||||
if (is_array($value))
|
if (is_array($value))
|
||||||
{
|
{
|
||||||
$newvalue = $value['data'];
|
$newvalue = $value['data'];
|
||||||
if (isset($value['entity'])) $entity = $value['entity'];
|
if (isset($value['entity'])) $entity = $value['entity'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($newvalue)
|
if ($newvalue)
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (";
|
||||||
$sql.= "name";
|
$sql.= "name";
|
||||||
$sql.= ", type";
|
$sql.= ", type";
|
||||||
$sql.= ", value";
|
$sql.= ", value";
|
||||||
$sql.= ", note";
|
$sql.= ", note";
|
||||||
$sql.= ", visible";
|
$sql.= ", visible";
|
||||||
$sql.= ", entity";
|
$sql.= ", entity";
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
$sql.= " VALUES (";
|
$sql.= " VALUES (";
|
||||||
$sql.= $this->db->encrypt($this->const_name."_TABS_".$i,1);
|
$sql.= $this->db->encrypt($this->const_name."_TABS_".$i,1);
|
||||||
$sql.= ", 'chaine'";
|
$sql.= ", 'chaine'";
|
||||||
$sql.= ", ".$this->db->encrypt($value,1);
|
$sql.= ", ".$this->db->encrypt($newvalue,1);
|
||||||
$sql.= ", null";
|
$sql.= ", null";
|
||||||
$sql.= ", '0'";
|
$sql.= ", '0'";
|
||||||
$sql.= ", ".$conf->entity;
|
$sql.= ", ".$entity;
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::insert_tabs", LOG_DEBUG);
|
dol_syslog(get_class($this)."::insert_tabs", LOG_DEBUG);
|
||||||
$this->db->query($sql);
|
$this->db->query($sql);
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $err;
|
return $err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds constants
|
* Adds constants
|
||||||
|
|||||||
@ -216,11 +216,11 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
$heightforinfotot = 40; // Height reserved to output the info and total part
|
$heightforinfotot = 40; // Height reserved to output the info and total part
|
||||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||||
|
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
{
|
{
|
||||||
$pdf->setPrintHeader(false);
|
$pdf->setPrintHeader(false);
|
||||||
@ -293,16 +293,16 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$height_incoterms=$nexY-$tab_top;
|
$height_incoterms=$nexY-$tab_top;
|
||||||
|
|
||||||
// Rect prend une longueur en 3eme param
|
// Rect prend une longueur en 3eme param
|
||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192,192,192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
|
||||||
|
|
||||||
$tab_top = $nexY+6;
|
$tab_top = $nexY+6;
|
||||||
$height_incoterms += 4;
|
$height_incoterms += 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche notes
|
// Affiche notes
|
||||||
$notetoshow=empty($object->note_public)?'':$object->note_public;
|
$notetoshow=empty($object->note_public)?'':$object->note_public;
|
||||||
if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE))
|
if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE))
|
||||||
@ -454,7 +454,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
|
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
|
||||||
if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva;
|
if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva;
|
||||||
else $tvaligne=$object->lines[$i]->total_tva;
|
else $tvaligne=$object->lines[$i]->total_tva;
|
||||||
|
|
||||||
$localtax1ligne=$object->lines[$i]->total_localtax1;
|
$localtax1ligne=$object->lines[$i]->total_localtax1;
|
||||||
$localtax2ligne=$object->lines[$i]->total_localtax2;
|
$localtax2ligne=$object->lines[$i]->total_localtax2;
|
||||||
$localtax1_rate=$object->lines[$i]->localtax1_tx;
|
$localtax1_rate=$object->lines[$i]->localtax1_tx;
|
||||||
@ -561,7 +561,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs);
|
$posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Pied de page
|
// Pied de page
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||||
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
@ -838,6 +838,8 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
// Show VAT by rates and total
|
// Show VAT by rates and total
|
||||||
$pdf->SetFillColor(248,248,248);
|
$pdf->SetFillColor(248,248,248);
|
||||||
|
|
||||||
|
$total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
|
||||||
|
|
||||||
$this->atleastoneratenotnull=0;
|
$this->atleastoneratenotnull=0;
|
||||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
||||||
{
|
{
|
||||||
@ -1011,7 +1013,6 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$pdf->SetFillColor(224,224,224);
|
$pdf->SetFillColor(224,224,224);
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
|
||||||
|
|
||||||
$total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
|
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1);
|
||||||
}
|
}
|
||||||
@ -1024,7 +1025,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
//$creditnoteamount=$object->getSumCreditNotesUsed();
|
//$creditnoteamount=$object->getSumCreditNotesUsed();
|
||||||
//$depositsamount=$object->getSumDepositsUsed();
|
//$depositsamount=$object->getSumDepositsUsed();
|
||||||
//print "x".$creditnoteamount."-".$depositsamount;exit;
|
//print "x".$creditnoteamount."-".$depositsamount;exit;
|
||||||
$resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
|
$resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
|
||||||
if (! empty($object->paye)) $resteapayer=0;
|
if (! empty($object->paye)) $resteapayer=0;
|
||||||
|
|
||||||
if ($deja_regle > 0)
|
if ($deja_regle > 0)
|
||||||
@ -1270,7 +1271,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
|
$pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$posy+=2;
|
$posy+=2;
|
||||||
|
|
||||||
// Show list of linked objects
|
// Show list of linked objects
|
||||||
|
|||||||
@ -84,7 +84,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->posxpicture=$this->posxweightvol - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
|
$this->posxpicture=$this->posxweightvol - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
|
||||||
|
|
||||||
if ($this->page_largeur < 210) // To work with US executive format
|
if ($this->page_largeur < 210) // To work with US executive format
|
||||||
{
|
{
|
||||||
$this->posxweightvol-=20;
|
$this->posxweightvol-=20;
|
||||||
@ -92,7 +92,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$this->posxqtyordered-=20;
|
$this->posxqtyordered-=20;
|
||||||
$this->posxqtytoship-=20;
|
$this->posxqtytoship-=20;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->global->SHIPPING_PDF_HIDE_ORDERED))
|
if (! empty($conf->global->SHIPPING_PDF_HIDE_ORDERED))
|
||||||
{
|
{
|
||||||
$this->posxweightvol += ($this->posxqtytoship - $this->posxqtyordered);
|
$this->posxweightvol += ($this->posxqtytoship - $this->posxqtyordered);
|
||||||
@ -139,17 +139,17 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
if (! empty($conf->global->MAIN_GENERATE_SHIPMENT_WITH_PICTURE))
|
if (! empty($conf->global->MAIN_GENERATE_SHIPMENT_WITH_PICTURE))
|
||||||
{
|
{
|
||||||
$objphoto = new Product($this->db);
|
$objphoto = new Product($this->db);
|
||||||
|
|
||||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||||
{
|
{
|
||||||
if (empty($object->lines[$i]->fk_product)) continue;
|
if (empty($object->lines[$i]->fk_product)) continue;
|
||||||
|
|
||||||
$objphoto = new Product($this->db);
|
$objphoto = new Product($this->db);
|
||||||
$objphoto->fetch($object->lines[$i]->fk_product);
|
$objphoto->fetch($object->lines[$i]->fk_product);
|
||||||
|
|
||||||
$pdir = get_exdir($object->lines[$i]->fk_product,2,0,0,$objphoto,'product') . $object->lines[$i]->fk_product ."/photos/";
|
$pdir = get_exdir($object->lines[$i]->fk_product,2,0,0,$objphoto,'product') . $object->lines[$i]->fk_product ."/photos/";
|
||||||
$dir = $conf->product->dir_output.'/'.$pdir;
|
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||||
|
|
||||||
$realpath='';
|
$realpath='';
|
||||||
|
|
||||||
foreach ($objphoto->liste_photos($dir,1) as $key => $obj)
|
foreach ($objphoto->liste_photos($dir,1) as $key => $obj)
|
||||||
@ -169,17 +169,17 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
{
|
{
|
||||||
$filename=$obj['photo'];
|
$filename=$obj['photo'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$realpath = $dir.$filename;
|
$realpath = $dir.$filename;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($realpath) $realpatharray[$i]=$realpath;
|
if ($realpath) $realpatharray[$i]=$realpath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($realpatharray) == 0) $this->posxpicture=$this->posxweightvol;
|
if (count($realpatharray) == 0) $this->posxpicture=$this->posxweightvol;
|
||||||
|
|
||||||
if ($conf->expedition->dir_output)
|
if ($conf->expedition->dir_output)
|
||||||
{
|
{
|
||||||
// Definition de $dir et $file
|
// Definition de $dir et $file
|
||||||
@ -219,7 +219,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
|
|
||||||
// Set nblignes with the new facture lines content after hook
|
// Set nblignes with the new facture lines content after hook
|
||||||
$nblignes = count($object->lines);
|
$nblignes = count($object->lines);
|
||||||
|
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
$heightforinfotot = 8; // Height reserved to output the info and total part
|
$heightforinfotot = 8; // Height reserved to output the info and total part
|
||||||
@ -282,11 +282,11 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$height_incoterms=$nexY-$tab_top;
|
$height_incoterms=$nexY-$tab_top;
|
||||||
|
|
||||||
// Rect prend une longueur en 3eme param
|
// Rect prend une longueur en 3eme param
|
||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192,192,192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
|
||||||
|
|
||||||
$tab_top = $nexY+6;
|
$tab_top = $nexY+6;
|
||||||
$height_incoterms += 4;
|
$height_incoterms += 4;
|
||||||
}
|
}
|
||||||
@ -343,7 +343,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
// Rect prend une longueur en 3eme param
|
// Rect prend une longueur en 3eme param
|
||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192,192,192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
||||||
|
|
||||||
$tab_height = $tab_height - $height_note;
|
$tab_height = $tab_height - $height_note;
|
||||||
$tab_top = $nexY+6;
|
$tab_top = $nexY+6;
|
||||||
}
|
}
|
||||||
@ -400,7 +400,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
|
|
||||||
$pdf->startTransaction();
|
$pdf->startTransaction();
|
||||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc);
|
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc);
|
||||||
|
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
||||||
{
|
{
|
||||||
@ -434,10 +434,10 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$pdf->commitTransaction();
|
$pdf->commitTransaction();
|
||||||
}
|
}
|
||||||
$posYAfterDescription=$pdf->GetY();
|
$posYAfterDescription=$pdf->GetY();
|
||||||
|
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
|
|
||||||
$pdf->setPage($pageposbefore);
|
$pdf->setPage($pageposbefore);
|
||||||
$pdf->setTopMargin($this->marge_haute);
|
$pdf->setTopMargin($this->marge_haute);
|
||||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
@ -456,29 +456,29 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
|
|
||||||
$pdf->SetXY($this->posxweightvol, $curY);
|
$pdf->SetXY($this->posxweightvol, $curY);
|
||||||
$weighttxt='';
|
$weighttxt='';
|
||||||
if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->weight)
|
if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->weight)
|
||||||
{
|
{
|
||||||
$weighttxt=round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, 5).' '.measuring_units_string($object->lines[$i]->weight_units,"weight");
|
$weighttxt=round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, 5).' '.measuring_units_string($object->lines[$i]->weight_units,"weight");
|
||||||
}
|
}
|
||||||
$voltxt='';
|
$voltxt='';
|
||||||
if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->volume)
|
if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->volume)
|
||||||
{
|
{
|
||||||
$voltxt=round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, 5).' '.measuring_units_string($object->lines[$i]->volume_units?$object->lines[$i]->volume_units:0,"volume");
|
$voltxt=round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, 5).' '.measuring_units_string($object->lines[$i]->volume_units?$object->lines[$i]->volume_units:0,"volume");
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->writeHTMLCell($this->posxqtyordered - $this->posxweightvol + 2, 3, $this->posxweightvol - 1, $curY, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt, 0, 0, false, true, 'C');
|
$pdf->writeHTMLCell($this->posxqtyordered - $this->posxweightvol + 2, 3, $this->posxweightvol - 1, $curY, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt, 0, 0, false, true, 'C');
|
||||||
//$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 3, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt,'','C');
|
//$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 3, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt,'','C');
|
||||||
|
|
||||||
if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED))
|
if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED))
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->posxqtyordered, $curY);
|
$pdf->SetXY($this->posxqtyordered, $curY);
|
||||||
$pdf->MultiCell(($this->posxqtytoship - $this->posxqtyordered), 3, $object->lines[$i]->qty_asked,'','C');
|
$pdf->MultiCell(($this->posxqtytoship - $this->posxqtyordered), 3, $object->lines[$i]->qty_asked,'','C');
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetXY($this->posxqtytoship, $curY);
|
$pdf->SetXY($this->posxqtytoship, $curY);
|
||||||
$pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 3, $object->lines[$i]->qty_shipped,'','C');
|
$pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 3, $object->lines[$i]->qty_shipped,'','C');
|
||||||
|
|
||||||
if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT))
|
if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT))
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->posxpuht, $curY);
|
$pdf->SetXY($this->posxpuht, $curY);
|
||||||
$pdf->MultiCell(($this->posxtotalht - $this->posxpuht-1), 3, price($object->lines[$i]->subprice, 0, $outputlangs),'','R');
|
$pdf->MultiCell(($this->posxtotalht - $this->posxpuht-1), 3, price($object->lines[$i]->subprice, 0, $outputlangs),'','R');
|
||||||
@ -489,7 +489,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
|
|
||||||
$nexY+=3;
|
$nexY+=3;
|
||||||
if ($weighttxt && $voltxt) $nexY+=2;
|
if ($weighttxt && $voltxt) $nexY+=2;
|
||||||
|
|
||||||
// Add line
|
// Add line
|
||||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||||
{
|
{
|
||||||
@ -548,7 +548,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Affiche zone totaux
|
// Affiche zone totaux
|
||||||
$posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs);
|
$posy=$this->_tableau_tot($pdf, $object, 0, $bottomlasttab, $outputlangs);
|
||||||
|
|
||||||
// Pied de page
|
// Pied de page
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||||
@ -612,7 +612,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
}*/
|
}*/
|
||||||
if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED)) $largcol2 = ($this->posxqtyordered - $this->posxweightvol);
|
if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED)) $largcol2 = ($this->posxqtyordered - $this->posxweightvol);
|
||||||
else $largcol2 = ($this->posxqtytoship - $this->posxweightvol);
|
else $largcol2 = ($this->posxqtytoship - $this->posxweightvol);
|
||||||
|
|
||||||
$useborder=0;
|
$useborder=0;
|
||||||
$index = 0;
|
$index = 0;
|
||||||
|
|
||||||
@ -626,12 +626,12 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$totalOrdered=$tmparray['ordered'];
|
$totalOrdered=$tmparray['ordered'];
|
||||||
$totalToShip=$tmparray['toship'];
|
$totalToShip=$tmparray['toship'];
|
||||||
// Set trueVolume and volume_units not currently stored into database
|
// Set trueVolume and volume_units not currently stored into database
|
||||||
if ($object->trueWidth && $object->trueHeight && $object->trueDepth)
|
if ($object->trueWidth && $object->trueHeight && $object->trueDepth)
|
||||||
{
|
{
|
||||||
$object->trueVolume=price(($object->trueWidth * $object->trueHeight * $object->trueDepth), 0, $outputlangs, 0, 0);
|
$object->trueVolume=price(($object->trueWidth * $object->trueHeight * $object->trueDepth), 0, $outputlangs, 0, 0);
|
||||||
$object->volume_units=$object->size_units * 3;
|
$object->volume_units=$object->size_units * 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($totalWeight!='') $totalWeighttoshow=showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs);
|
if ($totalWeight!='') $totalWeighttoshow=showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs);
|
||||||
if ($totalVolume!='') $totalVolumetoshow=showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs);
|
if ($totalVolume!='') $totalVolumetoshow=showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs);
|
||||||
if ($object->trueWeight) $totalWeighttoshow=showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs);
|
if ($object->trueWeight) $totalWeighttoshow=showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs);
|
||||||
@ -640,48 +640,48 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$pdf->SetFillColor(255,255,255);
|
$pdf->SetFillColor(255,255,255);
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("Total"), 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("Total"), 0, 'L', 1);
|
||||||
|
|
||||||
if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED))
|
if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED))
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->posxqtyordered, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($this->posxqtyordered, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($this->posxqtytoship - $this->posxqtyordered, $tab2_hl, $totalOrdered, 0, 'C', 1);
|
$pdf->MultiCell($this->posxqtytoship - $this->posxqtyordered, $tab2_hl, $totalOrdered, 0, 'C', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetXY($this->posxqtytoship, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($this->posxqtytoship, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($this->posxpuht - $this->posxqtytoship, $tab2_hl, $totalToShip, 0, 'C', 1);
|
$pdf->MultiCell($this->posxpuht - $this->posxqtytoship, $tab2_hl, $totalToShip, 0, 'C', 1);
|
||||||
|
|
||||||
if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT)) {
|
if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT)) {
|
||||||
|
|
||||||
$pdf->SetXY($this->posxpuht, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($this->posxpuht, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($this->posxtotalht - $this->posxpuht, $tab2_hl, '', 0, 'C', 1);
|
$pdf->MultiCell($this->posxtotalht - $this->posxpuht, $tab2_hl, '', 0, 'C', 1);
|
||||||
|
|
||||||
$pdf->SetXY($this->posxtotalht, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($this->posxtotalht, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalht, $tab2_hl, price($object->total_ht, 0, $outputlangs), 0, 'C', 1);
|
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalht, $tab2_hl, price($object->total_ht, 0, $outputlangs), 0, 'C', 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Total Weight
|
// Total Weight
|
||||||
if ($totalWeighttoshow)
|
if ($totalWeighttoshow)
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalWeighttoshow, 0, 'C', 1);
|
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalWeighttoshow, 0, 'C', 1);
|
||||||
|
|
||||||
$index++;
|
$index++;
|
||||||
}
|
}
|
||||||
if ($totalVolumetoshow)
|
if ($totalVolumetoshow)
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalVolumetoshow, 0, 'C', 1);
|
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalVolumetoshow, 0, 'C', 1);
|
||||||
|
|
||||||
$index++;
|
$index++;
|
||||||
}
|
}
|
||||||
if (! $totalWeighttoshow && ! $totalVolumetoshow) $index++;
|
if (! $totalWeighttoshow && ! $totalVolumetoshow) $index++;
|
||||||
|
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
return ($tab2_top + ($tab2_hl * $index));
|
return ($tab2_top + ($tab2_hl * $index));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show table for lines
|
* Show table for lines
|
||||||
*
|
*
|
||||||
@ -728,7 +728,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$pdf->SetXY($this->posxweightvol-1, $tab_top+1);
|
$pdf->SetXY($this->posxweightvol-1, $tab_top+1);
|
||||||
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 2, $outputlangs->transnoentities("WeightVolShort"),'','C');
|
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 2, $outputlangs->transnoentities("WeightVolShort"),'','C');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED))
|
if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED))
|
||||||
{
|
{
|
||||||
$pdf->line($this->posxqtyordered-1, $tab_top, $this->posxqtyordered-1, $tab_top + $tab_height);
|
$pdf->line($this->posxqtyordered-1, $tab_top, $this->posxqtyordered-1, $tab_top + $tab_height);
|
||||||
@ -738,14 +738,14 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$pdf->MultiCell(($this->posxqtytoship - $this->posxqtyordered), 2, $outputlangs->transnoentities("QtyOrdered"),'','C');
|
$pdf->MultiCell(($this->posxqtytoship - $this->posxqtyordered), 2, $outputlangs->transnoentities("QtyOrdered"),'','C');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->line($this->posxqtytoship-1, $tab_top, $this->posxqtytoship-1, $tab_top + $tab_height);
|
$pdf->line($this->posxqtytoship-1, $tab_top, $this->posxqtytoship-1, $tab_top + $tab_height);
|
||||||
if (empty($hidetop))
|
if (empty($hidetop))
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->posxqtytoship, $tab_top+1);
|
$pdf->SetXY($this->posxqtytoship, $tab_top+1);
|
||||||
$pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 2, $outputlangs->transnoentities("QtyToShip"),'','C');
|
$pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 2, $outputlangs->transnoentities("QtyToShip"),'','C');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT)) {
|
if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT)) {
|
||||||
|
|
||||||
$pdf->line($this->posxpuht-1, $tab_top, $this->posxpuht-1, $tab_top + $tab_height);
|
$pdf->line($this->posxpuht-1, $tab_top, $this->posxpuht-1, $tab_top + $tab_height);
|
||||||
@ -754,7 +754,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$pdf->SetXY($this->posxpuht-1, $tab_top+1);
|
$pdf->SetXY($this->posxpuht-1, $tab_top+1);
|
||||||
$pdf->MultiCell(($this->posxtotalht - $this->posxpuht), 2, $outputlangs->transnoentities("PriceUHT"),'','C');
|
$pdf->MultiCell(($this->posxtotalht - $this->posxpuht), 2, $outputlangs->transnoentities("PriceUHT"),'','C');
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->line($this->posxtotalht-1, $tab_top, $this->posxtotalht-1, $tab_top + $tab_height);
|
$pdf->line($this->posxtotalht-1, $tab_top, $this->posxtotalht-1, $tab_top + $tab_height);
|
||||||
if (empty($hidetop))
|
if (empty($hidetop))
|
||||||
{
|
{
|
||||||
@ -763,7 +763,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -780,7 +780,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
global $conf,$langs,$mysoc;
|
global $conf,$langs,$mysoc;
|
||||||
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
|
pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
|
||||||
@ -796,7 +796,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$pdf->SetFont('','B', $default_font_size + 3);
|
$pdf->SetFont('','B', $default_font_size + 3);
|
||||||
|
|
||||||
$w = 110;
|
$w = 110;
|
||||||
|
|
||||||
$posy=$this->marge_haute;
|
$posy=$this->marge_haute;
|
||||||
$posx=$this->page_largeur-$this->marge_droite-$w;
|
$posx=$this->page_largeur-$this->marge_droite-$w;
|
||||||
|
|
||||||
@ -863,7 +863,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$pdf->SetFont('','', $default_font_size + 1);
|
$pdf->SetFont('','', $default_font_size + 1);
|
||||||
|
|
||||||
$posy+=5;
|
$posy+=5;
|
||||||
|
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx,$posy);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
$pdf->MultiCell($w, 4, $outputlangs->transnoentities("RefSending") ." : ".$object->ref, '', 'R');
|
$pdf->MultiCell($w, 4, $outputlangs->transnoentities("RefSending") ." : ".$object->ref, '', 'R');
|
||||||
@ -876,7 +876,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
$pdf->MultiCell($w, 4, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_delivery,"day",false,$outputlangs,true), '', 'R');
|
$pdf->MultiCell($w, 4, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_delivery,"day",false,$outputlangs,true), '', 'R');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($object->thirdparty->code_client))
|
if (! empty($object->thirdparty->code_client))
|
||||||
{
|
{
|
||||||
$posy+=4;
|
$posy+=4;
|
||||||
@ -904,7 +904,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
//$linkedobject->fetchObjectLinked() Get all linked object to the $linkedobject (commonly order) into $linkedobject->linkedObjects
|
//$linkedobject->fetchObjectLinked() Get all linked object to the $linkedobject (commonly order) into $linkedobject->linkedObjects
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 2);
|
$pdf->SetFont('','', $default_font_size - 2);
|
||||||
$text=$linkedobject->ref;
|
$text=$linkedobject->ref;
|
||||||
if ($linkedobject->ref_client) $text.=' ('.$linkedobject->ref_client.')';
|
if ($linkedobject->ref_client) $text.=' ('.$linkedobject->ref_client.')';
|
||||||
@ -939,7 +939,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
|
|
||||||
$hautcadre=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 38 : 40;
|
$hautcadre=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 38 : 40;
|
||||||
$widthrecbox=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 82;
|
$widthrecbox=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 82;
|
||||||
|
|
||||||
// Show sender frame
|
// Show sender frame
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
$pdf->SetFont('','', $default_font_size - 2);
|
$pdf->SetFont('','', $default_font_size - 2);
|
||||||
@ -950,7 +950,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1);
|
$pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
$pdf->SetFillColor(255,255,255);
|
$pdf->SetFillColor(255,255,255);
|
||||||
|
|
||||||
// Show sender name
|
// Show sender name
|
||||||
$pdf->SetXY($posx+2,$posy+3);
|
$pdf->SetXY($posx+2,$posy+3);
|
||||||
$pdf->SetFont('','B',$default_font_size);
|
$pdf->SetFont('','B',$default_font_size);
|
||||||
|
|||||||
@ -214,9 +214,9 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
$deja_regle = $object->getSommePaiement();
|
$deja_regle = $object->getSommePaiement(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
|
||||||
$amount_credit_notes_included = $object->getSumCreditNotesUsed();
|
$amount_credit_notes_included = $object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
|
||||||
$amount_deposits_included = $object->getSumDepositsUsed();
|
$amount_deposits_included = $object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
|
||||||
|
|
||||||
// Definition of $dir and $file
|
// Definition of $dir and $file
|
||||||
if ($object->specimen)
|
if ($object->specimen)
|
||||||
@ -255,16 +255,16 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
// Set nblignes with the new facture lines content after hook
|
// Set nblignes with the new facture lines content after hook
|
||||||
$nblignes = count($object->lines);
|
$nblignes = count($object->lines);
|
||||||
$nbpayments = count($object->getListOfPayments());
|
$nbpayments = count($object->getListOfPayments());
|
||||||
|
|
||||||
// Create pdf instance
|
// Create pdf instance
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
$heightforinfotot = 50+(4*$nbpayments); // Height reserved to output the info and total part and payment part
|
$heightforinfotot = 50+(4*$nbpayments); // Height reserved to output the info and total part and payment part
|
||||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||||
|
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
{
|
{
|
||||||
$pdf->setPrintHeader(false);
|
$pdf->setPrintHeader(false);
|
||||||
@ -509,7 +509,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
||||||
$pdf->SetXY($this->posxqty, $curY);
|
$pdf->SetXY($this->posxqty, $curY);
|
||||||
// Enough for 6 chars
|
// Enough for 6 chars
|
||||||
|
|
||||||
if ($this->situationinvoice)
|
if ($this->situationinvoice)
|
||||||
{
|
{
|
||||||
$pdf->MultiCell($this->posxprogress-$this->posxqty-0.8, 4, $qty, 0, 'R');
|
$pdf->MultiCell($this->posxprogress-$this->posxqty-0.8, 4, $qty, 0, 'R');
|
||||||
@ -769,9 +769,9 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 4);
|
$pdf->SetFont('','', $default_font_size - 4);
|
||||||
|
|
||||||
|
|
||||||
// Loop on each deposits and credit notes included
|
// Loop on each deposits and credit notes included
|
||||||
$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
|
$sql = "SELECT re.rowid, re.amount_ht, re.multicurrency_amount_ht, re.amount_tva, re.multicurrency_amount_tva, re.amount_ttc, re.multicurrency_amount_ttc,";
|
||||||
$sql.= " re.description, re.fk_facture_source,";
|
$sql.= " re.description, re.fk_facture_source,";
|
||||||
$sql.= " f.type, f.datef";
|
$sql.= " f.type, f.datef";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re, ".MAIN_DB_PREFIX ."facture as f";
|
$sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re, ".MAIN_DB_PREFIX ."facture as f";
|
||||||
@ -796,7 +796,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$pdf->SetXY($tab3_posx, $tab3_top+$y);
|
$pdf->SetXY($tab3_posx, $tab3_top+$y);
|
||||||
$pdf->MultiCell(20, 3, dol_print_date($obj->datef,'day',false,$outputlangs,true), 0, 'L', 0);
|
$pdf->MultiCell(20, 3, dol_print_date($obj->datef,'day',false,$outputlangs,true), 0, 'L', 0);
|
||||||
$pdf->SetXY($tab3_posx+21, $tab3_top+$y);
|
$pdf->SetXY($tab3_posx+21, $tab3_top+$y);
|
||||||
$pdf->MultiCell(20, 3, price($obj->amount_ttc, 0, $outputlangs), 0, 'L', 0);
|
$pdf->MultiCell(20, 3, price(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $obj->multicurrency_amount_ttc : $obj->amount_ttc, 0, $outputlangs), 0, 'L', 0);
|
||||||
$pdf->SetXY($tab3_posx+40, $tab3_top+$y);
|
$pdf->SetXY($tab3_posx+40, $tab3_top+$y);
|
||||||
$pdf->MultiCell(20, 3, $text, 0, 'L', 0);
|
$pdf->MultiCell(20, 3, $text, 0, 'L', 0);
|
||||||
$pdf->SetXY($tab3_posx+58, $tab3_top+$y);
|
$pdf->SetXY($tab3_posx+58, $tab3_top+$y);
|
||||||
@ -815,14 +815,14 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
|
|
||||||
// Loop on each payment
|
// Loop on each payment
|
||||||
// TODO Call getListOfPaymentsgetListOfPayments instead of hard coded sql
|
// TODO Call getListOfPaymentsgetListOfPayments instead of hard coded sql
|
||||||
$sql = "SELECT p.datep as date, p.fk_paiement, p.num_paiement as num, pf.amount as amount,";
|
$sql = "SELECT p.datep as date, p.fk_paiement, p.num_paiement as num, pf.amount as amount, pf.multicurrency_amount,";
|
||||||
$sql.= " cp.code";
|
$sql.= " cp.code";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id";
|
||||||
$sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = ".$object->id;
|
$sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = ".$object->id;
|
||||||
//$sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = 1";
|
//$sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = 1";
|
||||||
$sql.= " ORDER BY p.datep";
|
$sql.= " ORDER BY p.datep";
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -835,7 +835,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$pdf->SetXY($tab3_posx, $tab3_top+$y);
|
$pdf->SetXY($tab3_posx, $tab3_top+$y);
|
||||||
$pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0);
|
$pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0);
|
||||||
$pdf->SetXY($tab3_posx+21, $tab3_top+$y);
|
$pdf->SetXY($tab3_posx+21, $tab3_top+$y);
|
||||||
$pdf->MultiCell(20, 3, price($sign * $row->amount, 0, $outputlangs), 0, 'L', 0);
|
$pdf->MultiCell(20, 3, price($sign * (($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount), 0, $outputlangs), 0, 'L', 0);
|
||||||
$pdf->SetXY($tab3_posx+40, $tab3_top+$y);
|
$pdf->SetXY($tab3_posx+40, $tab3_top+$y);
|
||||||
$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code);
|
$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code);
|
||||||
|
|
||||||
@ -1052,7 +1052,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$pdf->SetFillColor(255,255,255);
|
$pdf->SetFillColor(255,255,255);
|
||||||
$pdf->SetXY($col1x, $tab2_top + 0);
|
$pdf->SetXY($col1x, $tab2_top + 0);
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
||||||
|
|
||||||
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
|
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
|
||||||
$pdf->SetXY($col2x, $tab2_top + 0);
|
$pdf->SetXY($col2x, $tab2_top + 0);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1);
|
||||||
@ -1060,6 +1060,8 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
// Show VAT by rates and total
|
// Show VAT by rates and total
|
||||||
$pdf->SetFillColor(248,248,248);
|
$pdf->SetFillColor(248,248,248);
|
||||||
|
|
||||||
|
$total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
|
||||||
|
|
||||||
$this->atleastoneratenotnull=0;
|
$this->atleastoneratenotnull=0;
|
||||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
||||||
{
|
{
|
||||||
@ -1071,7 +1073,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// FIXME amount of vat not supported with multicurrency
|
// FIXME amount of vat not supported with multicurrency
|
||||||
|
|
||||||
//Local tax 1 before VAT
|
//Local tax 1 before VAT
|
||||||
//if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
//if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||||
//{
|
//{
|
||||||
@ -1141,26 +1143,26 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
|
|
||||||
//}
|
//}
|
||||||
|
|
||||||
// VAT
|
// VAT
|
||||||
// Situations totals migth be wrong on huge amounts
|
// Situations totals migth be wrong on huge amounts
|
||||||
if ($object->situation_cycle_ref && $object->situation_counter > 1) {
|
if ($object->situation_cycle_ref && $object->situation_counter > 1) {
|
||||||
|
|
||||||
$sum_pdf_tva = 0;
|
$sum_pdf_tva = 0;
|
||||||
foreach($this->tva as $tvakey => $tvaval){
|
foreach($this->tva as $tvakey => $tvaval){
|
||||||
$sum_pdf_tva+=$tvaval; // sum VAT amounts to compare to object
|
$sum_pdf_tva+=$tvaval; // sum VAT amounts to compare to object
|
||||||
}
|
}
|
||||||
|
|
||||||
if($sum_pdf_tva!=$object->total_tva) { // apply coef to recover the VAT object amount (the good one)
|
if($sum_pdf_tva!=$object->total_tva) { // apply coef to recover the VAT object amount (the good one)
|
||||||
$coef_fix_tva = $object->total_tva / $sum_pdf_tva;
|
$coef_fix_tva = $object->total_tva / $sum_pdf_tva;
|
||||||
|
|
||||||
foreach($this->tva as $tvakey => $tvaval) {
|
foreach($this->tva as $tvakey => $tvaval) {
|
||||||
$this->tva[$tvakey]=$tvaval * $coef_fix_tva;
|
$this->tva[$tvakey]=$tvaval * $coef_fix_tva;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($this->tva as $tvakey => $tvaval)
|
foreach($this->tva as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey != 0) // On affiche pas taux 0
|
if ($tvakey != 0) // On affiche pas taux 0
|
||||||
@ -1270,7 +1272,6 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$pdf->SetFillColor(224,224,224);
|
$pdf->SetFillColor(224,224,224);
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
|
||||||
|
|
||||||
$total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
|
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1);
|
||||||
}
|
}
|
||||||
@ -1278,10 +1279,10 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
|
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$creditnoteamount=$object->getSumCreditNotesUsed();
|
$creditnoteamount=$object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
|
||||||
$depositsamount=$object->getSumDepositsUsed();
|
$depositsamount=$object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
|
||||||
//print "x".$creditnoteamount."-".$depositsamount;exit;
|
//print "x".$creditnoteamount."-".$depositsamount;exit;
|
||||||
$resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
|
$resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
|
||||||
if ($object->paye) $resteapayer=0;
|
if ($object->paye) $resteapayer=0;
|
||||||
|
|
||||||
if ($deja_regle > 0 || $creditnoteamount > 0 || $depositsamount > 0)
|
if ($deja_regle > 0 || $creditnoteamount > 0 || $depositsamount > 0)
|
||||||
@ -1416,7 +1417,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
if (empty($hidetop))
|
if (empty($hidetop))
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
$pdf->SetXY($this->posxqty-1, $tab_top+1);
|
||||||
|
|
||||||
if($this->situationinvoice)
|
if($this->situationinvoice)
|
||||||
{
|
{
|
||||||
$pdf->MultiCell($this->posxprogress-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
|
$pdf->MultiCell($this->posxprogress-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
|
||||||
@ -1430,14 +1431,14 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
|
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->situationinvoice) {
|
if ($this->situationinvoice) {
|
||||||
$pdf->line($this->posxprogress - 1, $tab_top, $this->posxprogress - 1, $tab_top + $tab_height);
|
$pdf->line($this->posxprogress - 1, $tab_top, $this->posxprogress - 1, $tab_top + $tab_height);
|
||||||
|
|
||||||
if (empty($hidetop)) {
|
if (empty($hidetop)) {
|
||||||
|
|
||||||
$pdf->SetXY($this->posxprogress, $tab_top+1);
|
$pdf->SetXY($this->posxprogress, $tab_top+1);
|
||||||
|
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
if($conf->global->PRODUCT_USE_UNITS)
|
||||||
{
|
{
|
||||||
$pdf->MultiCell($this->posxunit-$this->posxprogress,2, $outputlangs->transnoentities("Progress"),'','C');
|
$pdf->MultiCell($this->posxunit-$this->posxprogress,2, $outputlangs->transnoentities("Progress"),'','C');
|
||||||
@ -1450,9 +1451,9 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
{
|
{
|
||||||
$pdf->MultiCell($this->postotalht-$this->posxprogress,2, $outputlangs->transnoentities("Progress"),'','C');
|
$pdf->MultiCell($this->postotalht-$this->posxprogress,2, $outputlangs->transnoentities("Progress"),'','C');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($conf->global->PRODUCT_USE_UNITS) {
|
if($conf->global->PRODUCT_USE_UNITS) {
|
||||||
@ -1617,7 +1618,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("DatePointOfTax")." : " . dol_print_date($object->date_pointoftax,"day",false,$outputlangs), '', 'R');
|
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("DatePointOfTax")." : " . dol_print_date($object->date_pointoftax,"day",false,$outputlangs), '', 'R');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($object->type != 2)
|
if ($object->type != 2)
|
||||||
{
|
{
|
||||||
$posy+=3;
|
$posy+=3;
|
||||||
@ -1648,7 +1649,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$pdf->MultiCell($w, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
|
$pdf->MultiCell($w, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$posy+=1;
|
$posy+=1;
|
||||||
|
|
||||||
// Show list of linked objects
|
// Show list of linked objects
|
||||||
|
|||||||
@ -294,7 +294,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
$pageposafter=$pageposbefore;
|
$pageposafter=$pageposbefore;
|
||||||
//print $pageposafter.'-'.$pageposbefore;exit;
|
//print $pageposafter.'-'.$pageposbefore;exit;
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pdf->writeHTMLCell(0, 0, $curX, $curY, $txt.'<br>'.$desc, LR, 1, 0);
|
$pdf->writeHTMLCell(0, 0, $curX, $curY, dol_concatdesc($txt,$desc), 0, 1, 0);
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
$posyafter=$pdf->GetY();
|
$posyafter=$pdf->GetY();
|
||||||
//var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit;
|
//var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit;
|
||||||
|
|||||||
@ -272,12 +272,12 @@ class modFournisseur extends DolibarrModules
|
|||||||
$this->rights[$r][5] = 'approve2';
|
$this->rights[$r][5] = 'approve2';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Menus
|
// Menus
|
||||||
//-------
|
//-------
|
||||||
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
|
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
|
||||||
|
|
||||||
|
|
||||||
// Exports
|
// Exports
|
||||||
//--------
|
//--------
|
||||||
$r=0;
|
$r=0;
|
||||||
@ -435,7 +435,7 @@ class modFournisseur extends DolibarrModules
|
|||||||
// End add extra fields object
|
// End add extra fields object
|
||||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
|
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
|
||||||
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
|
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
|
||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,';
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,';
|
||||||
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f';
|
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f';
|
||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)';
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)';
|
||||||
@ -444,7 +444,7 @@ class modFournisseur extends DolibarrModules
|
|||||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn as p ON pf.fk_paiementfourn = p.rowid';
|
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn as p ON pf.fk_paiementfourn = p.rowid';
|
||||||
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid';
|
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid';
|
||||||
$this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_invoice',1).')';
|
$this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_invoice',1).')';
|
||||||
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
|
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
|
||||||
|
|
||||||
// Order
|
// Order
|
||||||
$r++;
|
$r++;
|
||||||
|
|||||||
@ -155,14 +155,14 @@ class modProduct extends DolibarrModules
|
|||||||
if ($mysoc->useNPR()) $this->export_fields_array[$r]['p.recuperableonly']='NPR';
|
if ($mysoc->useNPR()) $this->export_fields_array[$r]['p.recuperableonly']='NPR';
|
||||||
if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.stock'=>'Stock','p.seuil_stock_alerte'=>'StockLimit','p.desiredstock'=>'DesiredStock','p.pmp'=>'PMPValue'));
|
if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.stock'=>'Stock','p.seuil_stock_alerte'=>'StockLimit','p.desiredstock'=>'DesiredStock','p.pmp'=>'PMPValue'));
|
||||||
if (! empty($conf->barcode->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.barcode'=>'BarCode'));
|
if (! empty($conf->barcode->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.barcode'=>'BarCode'));
|
||||||
if (! empty($conf->fournisseur->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('s.nom'=>'Supplier','pf.ref_fourn'=>'SupplierRef','pf.unitprice'=>'SuppliersPrices'));
|
if (! empty($conf->fournisseur->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('s.nom'=>'Supplier','pf.ref_fourn'=>'SupplierRef','pf.unitprice'=>'BuyingPrice','pf.quantity'=>'QtyMin','pf.remise_percent'=>'DiscountQtyMin'));
|
||||||
if (! empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.cost_price'=>'CostPrice'));
|
if (! empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.cost_price'=>'CostPrice'));
|
||||||
if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('group_concat(cat.label)'=>'Categories'));
|
if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('group_concat(cat.label)'=>'Categories'));
|
||||||
if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel','l.description'=>'TranslatedDescription','l.note'=>'TranslatedNote'));
|
if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel','l.description'=>'TranslatedDescription','l.note'=>'TranslatedNote'));
|
||||||
$this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.length'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date');
|
$this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.length'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date');
|
||||||
if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.stock'=>'Numeric','p.seuil_stock_alerte'=>'Numeric','p.desiredstock'=>'Numeric','p.pmp'=>'Numeric','p.cost_price'=>'Numeric'));
|
if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.stock'=>'Numeric','p.seuil_stock_alerte'=>'Numeric','p.desiredstock'=>'Numeric','p.pmp'=>'Numeric','p.cost_price'=>'Numeric'));
|
||||||
if (! empty($conf->barcode->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.barcode'=>'Text'));
|
if (! empty($conf->barcode->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.barcode'=>'Text'));
|
||||||
if (! empty($conf->fournisseur->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('s.nom'=>'Text','pf.ref_fourn'=>'Text','pf.unitprice'=>'Numeric'));
|
if (! empty($conf->fournisseur->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('s.nom'=>'Text','pf.ref_fourn'=>'Text','pf.unitprice'=>'Numeric','pf.quantity'=>'Numeric','pf.remise_percent'=>'Numeric'));
|
||||||
if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('l.lang'=>'Text', 'l.label'=>'Text','l.description'=>'Text','l.note'=>'Text'));
|
if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('l.lang'=>'Text', 'l.label'=>'Text','l.description'=>'Text','l.note'=>'Text'));
|
||||||
if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array("group_concat(cat.label)"=>'Text'));
|
if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array("group_concat(cat.label)"=>'Text'));
|
||||||
$this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",'p.label'=>"product",'p.description'=>"product",'p.url'=>"product",'p.accountancy_code_sell'=>'product','p.accountancy_code_buy'=>'product','p.note'=>"product",'p.length'=>"product",'p.surface'=>"product",'p.volume'=>"product",'p.weight'=>"product",'p.customcode'=>'product','p.price_base_type'=>"product",'p.price'=>"product",'p.price_ttc'=>"product",'p.tva_tx'=>"product",'p.tosell'=>"product",'p.tobuy'=>"product",'p.datec'=>"product",'p.tms'=>"product");
|
$this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",'p.label'=>"product",'p.description'=>"product",'p.url'=>"product",'p.accountancy_code_sell'=>'product','p.accountancy_code_buy'=>'product','p.note'=>"product",'p.length'=>"product",'p.surface'=>"product",'p.volume'=>"product",'p.weight'=>"product",'p.customcode'=>'product','p.price_base_type'=>"product",'p.price'=>"product",'p.price_ttc'=>"product",'p.tva_tx'=>"product",'p.tosell'=>"product",'p.tobuy'=>"product",'p.datec'=>"product",'p.tms'=>"product");
|
||||||
|
|||||||
@ -273,7 +273,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
{
|
{
|
||||||
$pdf->setPrintHeader(false);
|
$pdf->setPrintHeader(false);
|
||||||
@ -322,19 +322,19 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
$pagenb++;
|
$pagenb++;
|
||||||
|
|
||||||
$heightforinfotot = 40; // Height reserved to output the info and total part
|
$heightforinfotot = 40; // Height reserved to output the info and total part
|
||||||
$heightforsignature = empty($conf->global->PROPAL_DISABLE_SIGNATURE)?(pdfGetHeightForHtmlContent($pdf, $outputlangs->transnoentities("ProposalCustomerSignature"))+10):0;
|
$heightforsignature = empty($conf->global->PROPAL_DISABLE_SIGNATURE)?(pdfGetHeightForHtmlContent($pdf, $outputlangs->transnoentities("ProposalCustomerSignature"))+10):0;
|
||||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||||
//print $heightforinfotot + $heightforsignature + $heightforfreetext + $heightforfooter;exit;
|
//print $heightforinfotot + $heightforsignature + $heightforfreetext + $heightforfooter;exit;
|
||||||
|
|
||||||
$this->_pagehead($pdf, $object, 1, $outputlangs);
|
$this->_pagehead($pdf, $object, 1, $outputlangs);
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
|
|
||||||
$tab_top = 90;
|
$tab_top = 90;
|
||||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||||
$tab_height = 130;
|
$tab_height = 130;
|
||||||
@ -383,7 +383,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$notetoshow.='Affaire suivi par '.$tmpuser->getFullName($langs);
|
$notetoshow.='Affaire suivi par '.$tmpuser->getFullName($langs);
|
||||||
if ($tmpuser->email) $notetoshow.=', Mail: '.$tmpuser->email;
|
if ($tmpuser->email) $notetoshow.=', Mail: '.$tmpuser->email;
|
||||||
if ($tmpuser->office_phone) $notetoshow.=', Tel: '.$tmpuser->office_phone;
|
if ($tmpuser->office_phone) $notetoshow.=', Tel: '.$tmpuser->office_phone;
|
||||||
}
|
}
|
||||||
if ($notetoshow)
|
if ($notetoshow)
|
||||||
{
|
{
|
||||||
$tab_top = 88 + $height_incoterms;
|
$tab_top = 88 + $height_incoterms;
|
||||||
@ -451,8 +451,6 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
// Description of product line
|
// Description of product line
|
||||||
$curX = $this->posxdesc-1;
|
$curX = $this->posxdesc-1;
|
||||||
|
|
||||||
$showpricebeforepagebreak=1;
|
|
||||||
|
|
||||||
$pdf->startTransaction();
|
$pdf->startTransaction();
|
||||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc);
|
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc);
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
@ -554,14 +552,14 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
|
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
|
||||||
if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva;
|
if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva;
|
||||||
else $tvaligne=$object->lines[$i]->total_tva;
|
else $tvaligne=$object->lines[$i]->total_tva;
|
||||||
|
|
||||||
$localtax1ligne=$object->lines[$i]->total_localtax1;
|
$localtax1ligne=$object->lines[$i]->total_localtax1;
|
||||||
$localtax2ligne=$object->lines[$i]->total_localtax2;
|
$localtax2ligne=$object->lines[$i]->total_localtax2;
|
||||||
$localtax1_rate=$object->lines[$i]->localtax1_tx;
|
$localtax1_rate=$object->lines[$i]->localtax1_tx;
|
||||||
$localtax2_rate=$object->lines[$i]->localtax2_tx;
|
$localtax2_rate=$object->lines[$i]->localtax2_tx;
|
||||||
$localtax1_type=$object->lines[$i]->localtax1_type;
|
$localtax1_type=$object->lines[$i]->localtax1_type;
|
||||||
$localtax2_type=$object->lines[$i]->localtax2_type;
|
$localtax2_type=$object->lines[$i]->localtax2_type;
|
||||||
|
|
||||||
if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100;
|
if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100;
|
||||||
if ($object->remise_percent) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100;
|
if ($object->remise_percent) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100;
|
||||||
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
|
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
|
||||||
@ -669,7 +667,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
{
|
{
|
||||||
$posy=$this->_signature_area($pdf, $object, $posy, $outputlangs);
|
$posy=$this->_signature_area($pdf, $object, $posy, $outputlangs);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pied de page
|
// Pied de page
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||||
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
@ -1012,6 +1010,8 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
// Show VAT by rates and total
|
// Show VAT by rates and total
|
||||||
$pdf->SetFillColor(248,248,248);
|
$pdf->SetFillColor(248,248,248);
|
||||||
|
|
||||||
|
$total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
|
||||||
|
|
||||||
$this->atleastoneratenotnull=0;
|
$this->atleastoneratenotnull=0;
|
||||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
||||||
{
|
{
|
||||||
@ -1188,7 +1188,6 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$pdf->SetFillColor(224,224,224);
|
$pdf->SetFillColor(224,224,224);
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
|
||||||
|
|
||||||
$total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
|
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1);
|
||||||
}
|
}
|
||||||
@ -1481,7 +1480,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
|
$pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$posy+=2;
|
$posy+=2;
|
||||||
|
|
||||||
// Show list of linked objects
|
// Show list of linked objects
|
||||||
|
|||||||
@ -717,6 +717,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
|
|
||||||
$useborder=0;
|
$useborder=0;
|
||||||
|
|
||||||
|
// Total TTC
|
||||||
$index++;
|
$index++;
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
@ -727,6 +728,14 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1);
|
||||||
|
|
||||||
|
$creditnoteamount=0;
|
||||||
|
$depositsamount=0;
|
||||||
|
//$creditnoteamount=$object->getSumCreditNotesUsed();
|
||||||
|
//$depositsamount=$object->getSumDepositsUsed();
|
||||||
|
//print "x".$creditnoteamount."-".$depositsamount;exit;
|
||||||
|
$resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
|
||||||
|
if (! empty($object->paye)) $resteapayer=0;
|
||||||
|
|
||||||
if ($deja_regle > 0)
|
if ($deja_regle > 0)
|
||||||
{
|
{
|
||||||
$index++;
|
$index++;
|
||||||
@ -743,7 +752,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1);
|
||||||
|
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle), $useborder, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer), $useborder, 'R', 1);
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
}
|
}
|
||||||
@ -877,6 +886,11 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
*/
|
*/
|
||||||
function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
|
function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
|
$sign=1;
|
||||||
|
if ($object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1;
|
||||||
|
|
||||||
$tab3_posx = 120;
|
$tab3_posx = 120;
|
||||||
$tab3_top = $posy + 8;
|
$tab3_top = $posy + 8;
|
||||||
$tab3_width = 80;
|
$tab3_width = 80;
|
||||||
@ -910,8 +924,11 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 4);
|
$pdf->SetFont('','', $default_font_size - 4);
|
||||||
|
|
||||||
|
// Loop on each deposits and credit notes included
|
||||||
|
//
|
||||||
|
|
||||||
// Loop on each payment
|
// Loop on each payment
|
||||||
$sql = "SELECT p.datep as date, p.fk_paiement as type, p.num_paiement as num, pf.amount as amount,";
|
$sql = "SELECT p.datep as date, p.fk_paiement as type, p.num_paiement as num, pf.amount as amount, pf.multicurrency_amount,";
|
||||||
$sql.= " cp.code";
|
$sql.= " cp.code";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf, ".MAIN_DB_PREFIX."paiementfourn as p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf, ".MAIN_DB_PREFIX."paiementfourn as p";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id";
|
||||||
@ -929,7 +946,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$pdf->SetXY($tab3_posx, $tab3_top+$y);
|
$pdf->SetXY($tab3_posx, $tab3_top+$y);
|
||||||
$pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0);
|
$pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0);
|
||||||
$pdf->SetXY($tab3_posx+21, $tab3_top+$y);
|
$pdf->SetXY($tab3_posx+21, $tab3_top+$y);
|
||||||
$pdf->MultiCell(20, 3, price($row->amount), 0, 'L', 0);
|
$pdf->MultiCell(20, 3, price($sign * (($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount)), 0, 'L', 0);
|
||||||
$pdf->SetXY($tab3_posx+40, $tab3_top+$y);
|
$pdf->SetXY($tab3_posx+40, $tab3_top+$y);
|
||||||
$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code);
|
$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code);
|
||||||
|
|
||||||
|
|||||||
@ -840,7 +840,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
//$creditnoteamount=$object->getSumCreditNotesUsed();
|
//$creditnoteamount=$object->getSumCreditNotesUsed();
|
||||||
//$depositsamount=$object->getSumDepositsUsed();
|
//$depositsamount=$object->getSumDepositsUsed();
|
||||||
//print "x".$creditnoteamount."-".$depositsamount;exit;
|
//print "x".$creditnoteamount."-".$depositsamount;exit;
|
||||||
$resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
|
$resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
|
||||||
if (! empty($object->paye)) $resteapayer=0;
|
if (! empty($object->paye)) $resteapayer=0;
|
||||||
|
|
||||||
if ($deja_regle > 0)
|
if ($deja_regle > 0)
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
* $langs
|
* $langs
|
||||||
* $dateSelector
|
* $dateSelector
|
||||||
* $forceall (0 by default, 1 for supplier invoices/orders)
|
* $forceall (0 by default, 1 for supplier invoices/orders)
|
||||||
* $senderissupplier (0 by default, 1 for supplier invoices/orders)
|
* $senderissupplier (0 by default, 1 or 2 for supplier invoices/orders)
|
||||||
* $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
|
* $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ if (in_array($object->element,array('propal', 'supplier_proposal','facture','fac
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- BEGIN PHP TEMPLATE objectline_create.tpl.php -->
|
<!-- BEGIN PHP TEMPLATE objectline_create.tpl.php -->
|
||||||
<?php
|
<?php
|
||||||
$nolinesbefore=(count($this->lines) == 0 || $forcetoshowtitlelines);
|
$nolinesbefore=(count($this->lines) == 0 || $forcetoshowtitlelines);
|
||||||
if ($nolinesbefore) {
|
if ($nolinesbefore) {
|
||||||
?>
|
?>
|
||||||
@ -94,7 +94,7 @@ if ($nolinesbefore) {
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
else $colspan++;
|
else $colspan++;
|
||||||
|
|
||||||
if ($conf->global->MARGIN_TYPE == "1")
|
if ($conf->global->MARGIN_TYPE == "1")
|
||||||
echo $langs->trans('BuyingPrice');
|
echo $langs->trans('BuyingPrice');
|
||||||
else
|
else
|
||||||
@ -108,7 +108,7 @@ if ($nolinesbefore) {
|
|||||||
?>
|
?>
|
||||||
<td class="linecoledit" colspan="<?php echo $colspan; ?>"> </td>
|
<td class="linecoledit" colspan="<?php echo $colspan; ?>"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<tr class="pair nodrag nodrop nohoverpair<?php echo ($nolinesbefore || $object->element=='contrat')?'':' liste_titre_add'; ?>">
|
<tr class="pair nodrag nodrop nohoverpair<?php echo ($nolinesbefore || $object->element=='contrat')?'':' liste_titre_add'; ?>">
|
||||||
@ -200,20 +200,22 @@ else {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum
|
||||||
if ($senderissupplier != 2)
|
if ($senderissupplier != 2)
|
||||||
{
|
{
|
||||||
$ajaxoptions=array(
|
$ajaxoptions=array(
|
||||||
'update' => array('qty'=>'qty','remise_percent' => 'discount','idprod' => 'idprod'), // html id tags that will be edited with which ajax json response key
|
'update' => array('qty'=>'qty','remise_percent' => 'discount','idprod' => 'idprod'), // html id tags that will be edited with which ajax json response key
|
||||||
'option_disabled' => 'addPredefinedProductButton', // html id to disable once select is done
|
'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done
|
||||||
'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'error'
|
'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for exemple shown we select a disabled option into combo)
|
||||||
);
|
);
|
||||||
$alsoproductwithnosupplierprice=0;
|
$alsoproductwithnosupplierprice=0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$ajaxoptions = array();
|
$ajaxoptions = array();
|
||||||
$alsoproductwithnosupplierprice=1;
|
$alsoproductwithnosupplierprice=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice);
|
$form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice);
|
||||||
}
|
}
|
||||||
echo '</span>';
|
echo '</span>';
|
||||||
@ -263,13 +265,13 @@ else {
|
|||||||
<td class="nobottom linecoluht" align="right">
|
<td class="nobottom linecoluht" align="right">
|
||||||
<input type="text" size="5" name="price_ht" id="price_ht" class="flat" value="<?php echo (isset($_POST["price_ht"])?GETPOST("price_ht",'alpha',2):''); ?>">
|
<input type="text" size="5" name="price_ht" id="price_ht" class="flat" value="<?php echo (isset($_POST["price_ht"])?GETPOST("price_ht",'alpha',2):''); ?>">
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<?php if (!empty($conf->multicurrency->enabled)) { $colspan++;?>
|
<?php if (!empty($conf->multicurrency->enabled)) { $colspan++;?>
|
||||||
<td class="nobottom linecoluht_currency" align="right">
|
<td class="nobottom linecoluht_currency" align="right">
|
||||||
<input type="text" size="5" name="multicurrency_price_ht" id="multicurrency_price_ht" class="flat" value="<?php echo (isset($_POST["multicurrency_price_ht"])?GETPOST("multicurrency_price_ht",'alpha',2):''); ?>">
|
<input type="text" size="5" name="multicurrency_price_ht" id="multicurrency_price_ht" class="flat" value="<?php echo (isset($_POST["multicurrency_price_ht"])?GETPOST("multicurrency_price_ht",'alpha',2):''); ?>">
|
||||||
</td>
|
</td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<?php if (! empty($inputalsopricewithtax)) { ?>
|
<?php if (! empty($inputalsopricewithtax)) { ?>
|
||||||
<td class="nobottom linecoluttc" align="right">
|
<td class="nobottom linecoluttc" align="right">
|
||||||
<input type="text" size="5" name="price_ttc" id="price_ttc" class="flat" value="<?php echo (isset($_POST["price_ttc"])?GETPOST("price_ttc",'alpha',2):''); ?>">
|
<input type="text" size="5" name="price_ttc" id="price_ttc" class="flat" value="<?php echo (isset($_POST["price_ttc"])?GETPOST("price_ttc",'alpha',2):''); ?>">
|
||||||
@ -306,7 +308,7 @@ else {
|
|||||||
<?php
|
<?php
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->margins->creer)
|
if ($user->rights->margins->creer)
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
|
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
|
||||||
@ -561,9 +563,9 @@ jQuery(document).ready(function() {
|
|||||||
$("#idprod, #idprodfournprice").change(function()
|
$("#idprod, #idprodfournprice").change(function()
|
||||||
{
|
{
|
||||||
console.log("#idprod, #idprodfournprice change triggered");
|
console.log("#idprod, #idprodfournprice change triggered");
|
||||||
|
|
||||||
setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva
|
setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva
|
||||||
|
|
||||||
jQuery('#trlinefordates').show();
|
jQuery('#trlinefordates').show();
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
@ -584,13 +586,13 @@ jQuery(document).ready(function() {
|
|||||||
var defaultkey = '';
|
var defaultkey = '';
|
||||||
var defaultprice = '';
|
var defaultprice = '';
|
||||||
var bestpricefound = 0;
|
var bestpricefound = 0;
|
||||||
|
|
||||||
var bestpriceid = 0; var bestpricevalue = 0;
|
var bestpriceid = 0; var bestpricevalue = 0;
|
||||||
var pmppriceid = 0; var pmppricevalue = 0;
|
var pmppriceid = 0; var pmppricevalue = 0;
|
||||||
var costpriceid = 0; var costpricevalue = 0;
|
var costpriceid = 0; var costpricevalue = 0;
|
||||||
|
|
||||||
/* setup of margin calculation */
|
/* setup of margin calculation */
|
||||||
var defaultbuyprice = '<?php
|
var defaultbuyprice = '<?php
|
||||||
if (isset($conf->global->MARGIN_TYPE))
|
if (isset($conf->global->MARGIN_TYPE))
|
||||||
{
|
{
|
||||||
if ($conf->global->MARGIN_TYPE == '1') print 'bestsupplierprice';
|
if ($conf->global->MARGIN_TYPE == '1') print 'bestsupplierprice';
|
||||||
@ -598,7 +600,7 @@ jQuery(document).ready(function() {
|
|||||||
if ($conf->global->MARGIN_TYPE == 'costprice') print 'costprice';
|
if ($conf->global->MARGIN_TYPE == 'costprice') print 'costprice';
|
||||||
} ?>';
|
} ?>';
|
||||||
console.log("we will set the field for margin. defaultbuyprice="+defaultbuyprice);
|
console.log("we will set the field for margin. defaultbuyprice="+defaultbuyprice);
|
||||||
|
|
||||||
var i = 0;
|
var i = 0;
|
||||||
$(data).each(function() {
|
$(data).each(function() {
|
||||||
if (this.id != 'pmpprice' && this.id != 'costprice')
|
if (this.id != 'pmpprice' && this.id != 'costprice')
|
||||||
@ -615,7 +617,7 @@ jQuery(document).ready(function() {
|
|||||||
//console.log("id="+this.id+"-price="+this.price);
|
//console.log("id="+this.id+"-price="+this.price);
|
||||||
if ('pmp' == defaultbuyprice || 'costprice' == defaultbuyprice)
|
if ('pmp' == defaultbuyprice || 'costprice' == defaultbuyprice)
|
||||||
{
|
{
|
||||||
if (this.price > 0) {
|
if (this.price > 0) {
|
||||||
defaultkey = this.id; defaultprice = this.price; pmppriceid = this.id; pmppricevalue = this.price;
|
defaultkey = this.id; defaultprice = this.price; pmppriceid = this.id; pmppricevalue = this.price;
|
||||||
//console.log("pmppricevalue="+pmppricevalue);
|
//console.log("pmppricevalue="+pmppricevalue);
|
||||||
}
|
}
|
||||||
@ -634,22 +636,22 @@ jQuery(document).ready(function() {
|
|||||||
options += '<option value="'+this.id+'" price="'+this.price+'">'+this.label+'</option>';
|
options += '<option value="'+this.id+'" price="'+this.price+'">'+this.label+'</option>';
|
||||||
});
|
});
|
||||||
options += '<option value="inputprice" price="'+defaultprice+'"><?php echo $langs->trans("InputPrice"); ?></option>';
|
options += '<option value="inputprice" price="'+defaultprice+'"><?php echo $langs->trans("InputPrice"); ?></option>';
|
||||||
|
|
||||||
console.log("finally selected defaultkey="+defaultkey+" defaultprice="+defaultprice);
|
console.log("finally selected defaultkey="+defaultkey+" defaultprice="+defaultprice);
|
||||||
|
|
||||||
$("#fournprice_predef").html(options).show();
|
$("#fournprice_predef").html(options).show();
|
||||||
if (defaultkey != '')
|
if (defaultkey != '')
|
||||||
{
|
{
|
||||||
$("#fournprice_predef").val(defaultkey);
|
$("#fournprice_predef").val(defaultkey);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* At loading, no product are yet selected, so we hide field of buying_price */
|
/* At loading, no product are yet selected, so we hide field of buying_price */
|
||||||
$("#buying_price").hide();
|
$("#buying_price").hide();
|
||||||
|
|
||||||
/* Define default price at loading */
|
/* Define default price at loading */
|
||||||
var defaultprice = $("#fournprice_predef").find('option:selected').attr("price");
|
var defaultprice = $("#fournprice_predef").find('option:selected').attr("price");
|
||||||
$("#buying_price").val(defaultprice);
|
$("#buying_price").val(defaultprice);
|
||||||
|
|
||||||
$("#fournprice_predef").change(function() {
|
$("#fournprice_predef").change(function() {
|
||||||
console.log("change on fournprice_predef");
|
console.log("change on fournprice_predef");
|
||||||
/* Hide field buying_price according to choice into list (if 'inputprice' or not) */
|
/* Hide field buying_price according to choice into list (if 'inputprice' or not) */
|
||||||
|
|||||||
@ -108,7 +108,7 @@ class Cronjob extends CommonObject
|
|||||||
if (isset($this->nbrun)) $this->nbrun=trim($this->nbrun);
|
if (isset($this->nbrun)) $this->nbrun=trim($this->nbrun);
|
||||||
if (isset($this->libname)) $this->libname = trim($this->libname);
|
if (isset($this->libname)) $this->libname = trim($this->libname);
|
||||||
if (isset($this->test)) $this->test = trim($this->test);
|
if (isset($this->test)) $this->test = trim($this->test);
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
// Put here code to add a control on parameters values
|
// Put here code to add a control on parameters values
|
||||||
if (dol_strlen($this->datestart)==0) {
|
if (dol_strlen($this->datestart)==0) {
|
||||||
@ -363,9 +363,9 @@ class Cronjob extends CommonObject
|
|||||||
function fetch_all($sortorder='DESC', $sortfield='t.rowid', $limit=0, $offset=0, $status=1, $filter='')
|
function fetch_all($sortorder='DESC', $sortfield='t.rowid', $limit=0, $offset=0, $status=1, $filter='')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$this->lines=array();
|
$this->lines=array();
|
||||||
|
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
$sql.= " t.rowid,";
|
$sql.= " t.rowid,";
|
||||||
$sql.= " t.entity,";
|
$sql.= " t.entity,";
|
||||||
@ -403,7 +403,7 @@ class Cronjob extends CommonObject
|
|||||||
if ($status == 2) $sql.= " AND t.status = 2";
|
if ($status == 2) $sql.= " AND t.status = 2";
|
||||||
//Manage filter
|
//Manage filter
|
||||||
if (is_array($filter) && count($filter)>0) {
|
if (is_array($filter) && count($filter)>0) {
|
||||||
foreach($filter as $key => $value)
|
foreach($filter as $key => $value)
|
||||||
{
|
{
|
||||||
if ($key == 't.rowid') $sql.= ' AND '.$key.' = '.$this->db->escape($value);
|
if ($key == 't.rowid') $sql.= ' AND '.$key.' = '.$this->db->escape($value);
|
||||||
else $sql.= ' AND '.$key.' LIKE \'%'.$this->db->escape($value).'%\'';
|
else $sql.= ' AND '.$key.' LIKE \'%'.$this->db->escape($value).'%\'';
|
||||||
@ -523,7 +523,7 @@ class Cronjob extends CommonObject
|
|||||||
if (empty($this->maxrun)) $this->maxrun=0;
|
if (empty($this->maxrun)) $this->maxrun=0;
|
||||||
if (isset($this->libname)) $this->libname = trim($this->libname);
|
if (isset($this->libname)) $this->libname = trim($this->libname);
|
||||||
if (isset($this->test)) $this->test = trim($this->test);
|
if (isset($this->test)) $this->test = trim($this->test);
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
// Put here code to add a control on parameters values
|
// Put here code to add a control on parameters values
|
||||||
if (dol_strlen($this->datestart)==0) {
|
if (dol_strlen($this->datestart)==0) {
|
||||||
@ -834,8 +834,8 @@ class Cronjob extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Run a job.
|
* Run a job.
|
||||||
* Once job is finished, status and nb of run is updated.
|
* Once job is finished, status and nb of run is updated.
|
||||||
* This function does not plan the next run. This is done by function ->reprogram_jobs
|
* This function does not plan the next run. This is done by function ->reprogram_jobs
|
||||||
*
|
*
|
||||||
* @param string $userlogin User login
|
* @param string $userlogin User login
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
@ -850,7 +850,7 @@ class Cronjob extends CommonObject
|
|||||||
|
|
||||||
$langs->load('cron');
|
$langs->load('cron');
|
||||||
|
|
||||||
if (empty($userlogin))
|
if (empty($userlogin))
|
||||||
{
|
{
|
||||||
$this->error="User login is mandatory";
|
$this->error="User login is mandatory";
|
||||||
dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR);
|
||||||
@ -911,16 +911,16 @@ class Cronjob extends CommonObject
|
|||||||
// load classes
|
// load classes
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$ret=dol_include_once($this->classesname);
|
$ret=dol_include_once($this->classesname);
|
||||||
if ($ret===false || (! class_exists($this->objectname)))
|
if ($ret===false || (! class_exists($this->objectname)))
|
||||||
{
|
{
|
||||||
$this->error=$langs->trans('CronCannotLoadClass',$this->classesname,$this->objectname);
|
$this->error=$langs->trans('CronCannotLoadClass',$this->classesname,$this->objectname);
|
||||||
dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR);
|
||||||
$this->lastoutput = $this->error;
|
$this->lastoutput = $this->error;
|
||||||
$this->lastresult = -1;
|
$this->lastresult = -1;
|
||||||
$retval = $this->lastresult;
|
$retval = $this->lastresult;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// test if method exists
|
// test if method exists
|
||||||
@ -936,7 +936,7 @@ class Cronjob extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load langs
|
// Load langs
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@ -951,15 +951,16 @@ class Cronjob extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::run_jobs START ".$this->objectname."->".$this->methodename."(".$this->params.");", LOG_DEBUG);
|
dol_syslog(get_class($this)."::run_jobs START ".$this->objectname."->".$this->methodename."(".$this->params.");", LOG_DEBUG);
|
||||||
|
|
||||||
// Create Object for the call module
|
// Create Object for the call module
|
||||||
$object = new $this->objectname($this->db);
|
$object = new $this->objectname($this->db);
|
||||||
|
|
||||||
$params_arr = array_map('trim', explode(",",$this->params));
|
$params_arr = array_map('trim', explode(",",$this->params));
|
||||||
|
|
||||||
if (!is_array($params_arr))
|
if (!is_array($params_arr))
|
||||||
{
|
{
|
||||||
$result = call_user_func(array($object, $this->methodename), $this->params);
|
$result = call_user_func(array($object, $this->methodename), $this->params);
|
||||||
@ -968,8 +969,8 @@ class Cronjob extends CommonObject
|
|||||||
{
|
{
|
||||||
$result = call_user_func_array(array($object, $this->methodename), $params_arr);
|
$result = call_user_func_array(array($object, $this->methodename), $params_arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result===false || $result != 0)
|
if ($result === false || (! is_bool($result) && $result != 0))
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
dol_syslog(get_class($this)."::run_jobs END result=".$result." error=".$object->error, LOG_ERR);
|
dol_syslog(get_class($this)."::run_jobs END result=".$result." error=".$object->error, LOG_ERR);
|
||||||
@ -986,7 +987,7 @@ class Cronjob extends CommonObject
|
|||||||
$this->lastresult=var_export($result,true);
|
$this->lastresult=var_export($result,true);
|
||||||
$retval = $this->lastresult;
|
$retval = $this->lastresult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->jobtype == 'function')
|
if($this->jobtype == 'function')
|
||||||
@ -1018,7 +1019,7 @@ class Cronjob extends CommonObject
|
|||||||
$result = call_user_func_array($this->methodename, $params_arr);
|
$result = call_user_func_array($this->methodename, $params_arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result === false || $result != 0)
|
if ($result === false || (! is_bool($result) && $result != 0))
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
dol_syslog(get_class($this)."::run_jobs result=".$result, LOG_ERR);
|
dol_syslog(get_class($this)."::run_jobs result=".$result, LOG_ERR);
|
||||||
@ -1059,7 +1060,7 @@ class Cronjob extends CommonObject
|
|||||||
$this->lastoutput = ''; // Will be filled later
|
$this->lastoutput = ''; // Will be filled later
|
||||||
$this->lastresult = $retval;
|
$this->lastresult = $retval;
|
||||||
$retval = $this->lastresult;
|
$retval = $this->lastresult;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($execmethod == 2)
|
if ($execmethod == 2)
|
||||||
@ -1083,21 +1084,21 @@ class Cronjob extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update with result
|
// Update with result
|
||||||
if (is_array($output_arr) && count($output_arr)>0)
|
if (is_array($output_arr) && count($output_arr)>0)
|
||||||
{
|
{
|
||||||
foreach($output_arr as $val)
|
foreach($output_arr as $val)
|
||||||
{
|
{
|
||||||
$this->lastoutput.=$val."\n";
|
$this->lastoutput.=$val."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->lastresult=$retval;
|
$this->lastresult=$retval;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::run_jobs output_arr:".var_export($output_arr,true)." lastoutput=".$this->lastoutput." lastresult=".$this->lastresult, LOG_DEBUG);
|
dol_syslog(get_class($this)."::run_jobs output_arr:".var_export($output_arr,true)." lastoutput=".$this->lastoutput." lastresult=".$this->lastresult, LOG_DEBUG);
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::run_jobs now we update job to track it is finished (with success or error)");
|
dol_syslog(get_class($this)."::run_jobs now we update job to track it is finished (with success or error)");
|
||||||
|
|
||||||
$this->datelastresult=dol_now();
|
$this->datelastresult=dol_now();
|
||||||
$result = $this->update($user); // This include begin/commit
|
$result = $this->update($user); // This include begin/commit
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -1122,19 +1123,19 @@ class Cronjob extends CommonObject
|
|||||||
function reprogram_jobs($userlogin, $now)
|
function reprogram_jobs($userlogin, $now)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::reprogram_jobs userlogin:$userlogin", LOG_DEBUG);
|
dol_syslog(get_class($this)."::reprogram_jobs userlogin:$userlogin", LOG_DEBUG);
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||||
$user=new User($this->db);
|
$user=new User($this->db);
|
||||||
$result=$user->fetch('',$userlogin);
|
$result=$user->fetch('',$userlogin);
|
||||||
if ($result<0)
|
if ($result<0)
|
||||||
{
|
{
|
||||||
$this->error="User Error:".$user->error;
|
$this->error="User Error:".$user->error;
|
||||||
dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (empty($user->id))
|
if (empty($user->id))
|
||||||
{
|
{
|
||||||
$this->error=" User user login:".$userlogin." do not exists";
|
$this->error=" User user login:".$userlogin." do not exists";
|
||||||
dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR);
|
||||||
@ -1144,24 +1145,24 @@ class Cronjob extends CommonObject
|
|||||||
|
|
||||||
dol_syslog(get_class($this)."::reprogram_jobs ", LOG_DEBUG);
|
dol_syslog(get_class($this)."::reprogram_jobs ", LOG_DEBUG);
|
||||||
|
|
||||||
|
|
||||||
if (empty($this->datenextrun))
|
if (empty($this->datenextrun))
|
||||||
{
|
{
|
||||||
if (empty($this->datestart)) $this->datenextrun = $now + ($this->frequency * $this->unitfrequency);
|
if (empty($this->datestart)) $this->datenextrun = $now + ($this->frequency * $this->unitfrequency);
|
||||||
else $this->datenextrun = $this->datestart + ($this->frequency * $this->unitfrequency);
|
else $this->datenextrun = $this->datestart + ($this->frequency * $this->unitfrequency);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->datenextrun < $now && $this->frequency > 0 && $this->unitfrequency > 0)
|
if ($this->datenextrun < $now && $this->frequency > 0 && $this->unitfrequency > 0)
|
||||||
{
|
{
|
||||||
// Loop until date is after future
|
// Loop until date is after future
|
||||||
while ($this->datenextrun < $now)
|
while ($this->datenextrun < $now)
|
||||||
{
|
{
|
||||||
$this->datenextrun += ($this->frequency * $this->unitfrequency);
|
$this->datenextrun += ($this->frequency * $this->unitfrequency);
|
||||||
|
|
||||||
// TODO For exact frequency (every month, every year, ...), use instead a dol_time_plus_duree($time, $duration_value, $duration_unit)
|
// TODO For exact frequency (every month, every year, ...), use instead a dol_time_plus_duree($time, $duration_value, $duration_unit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//$this->datenextrun=$this->datenextrun + ($this->frequency * $this->unitfrequency);
|
//$this->datenextrun=$this->datenextrun + ($this->frequency * $this->unitfrequency);
|
||||||
}
|
}
|
||||||
@ -1177,9 +1178,9 @@ class Cronjob extends CommonObject
|
|||||||
dol_syslog(get_class($this)."::reprogram_jobs Job will be set to archived", LOG_ERR);
|
dol_syslog(get_class($this)."::reprogram_jobs Job will be set to archived", LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->update($user);
|
$result = $this->update($user);
|
||||||
if ($result<0)
|
if ($result<0)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@ -42,6 +42,8 @@ $typeconst=array('yesno','texte','chaine');
|
|||||||
|
|
||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
$value = GETPOST('value');
|
$value = GETPOST('value');
|
||||||
|
$label = GETPOST('label','alpha');
|
||||||
|
$scandir = GETPOST('scan_dir','alpha');
|
||||||
|
|
||||||
$type='donation';
|
$type='donation';
|
||||||
|
|
||||||
@ -397,14 +399,14 @@ if (is_resource($handle))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<td align=\"center\">\n";
|
print "<td align=\"center\">\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<td align=\"center\">\n";
|
print "<td align=\"center\">\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -418,9 +420,9 @@ if (is_resource($handle))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<td align=\"center\">";
|
print "<td align=\"center\">";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Info
|
// Info
|
||||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||||
|
|||||||
@ -120,12 +120,12 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
|||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
if ($cancel)
|
if ($cancel)
|
||||||
{
|
{
|
||||||
$action = '';
|
$action = '';
|
||||||
$object->fetch($id); // show shipment also after canceling modification
|
$object->fetch($id); // show shipment also after canceling modification
|
||||||
}
|
}
|
||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
|
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
|
||||||
|
|
||||||
// Set incoterm
|
// Set incoterm
|
||||||
@ -134,13 +134,13 @@ if (empty($reshook))
|
|||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$result = $object->reOpen();
|
$result = $object->reOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set incoterm
|
// Set incoterm
|
||||||
if ($action == 'set_incoterms' && !empty($conf->incoterm->enabled))
|
if ($action == 'set_incoterms' && !empty($conf->incoterm->enabled))
|
||||||
{
|
{
|
||||||
$result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
|
$result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'setref_customer')
|
if ($action == 'setref_customer')
|
||||||
{
|
{
|
||||||
$result = $object->fetch($id);
|
$result = $object->fetch($id);
|
||||||
@ -157,14 +157,14 @@ if (empty($reshook))
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'update_extras')
|
if ($action == 'update_extras')
|
||||||
{
|
{
|
||||||
// Fill array 'array_options' with data from update form
|
// Fill array 'array_options' with data from update form
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
|
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields (by external module or standard code)
|
||||||
@ -180,11 +180,11 @@ if (empty($reshook))
|
|||||||
} else if ($reshook < 0)
|
} else if ($reshook < 0)
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error)
|
if ($error)
|
||||||
$action = 'edit_extras';
|
$action = 'edit_extras';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create shipment
|
// Create shipment
|
||||||
if ($action == 'add' && $user->rights->expedition->creer)
|
if ($action == 'add' && $user->rights->expedition->creer)
|
||||||
{
|
{
|
||||||
@ -255,18 +255,18 @@ if (empty($reshook))
|
|||||||
$sub_qty[$j]['q']=GETPOST($qty,'int'); // the qty we want to move for this stock record
|
$sub_qty[$j]['q']=GETPOST($qty,'int'); // the qty we want to move for this stock record
|
||||||
$sub_qty[$j]['id_batch']=GETPOST($batch,'int'); // the id into llx_product_batch of stock record to move
|
$sub_qty[$j]['id_batch']=GETPOST($batch,'int'); // the id into llx_product_batch of stock record to move
|
||||||
$subtotalqty+=$sub_qty[$j]['q'];
|
$subtotalqty+=$sub_qty[$j]['q'];
|
||||||
|
|
||||||
//var_dump($qty);var_dump($batch);var_dump($sub_qty[$j]['q']);var_dump($sub_qty[$j]['id_batch']);
|
//var_dump($qty);var_dump($batch);var_dump($sub_qty[$j]['q']);var_dump($sub_qty[$j]['id_batch']);
|
||||||
|
|
||||||
$j++;
|
$j++;
|
||||||
$batch="batchl".$i."_".$j;
|
$batch="batchl".$i."_".$j;
|
||||||
$qty = "qtyl".$i.'_'.$j;
|
$qty = "qtyl".$i.'_'.$j;
|
||||||
}
|
}
|
||||||
|
|
||||||
$batch_line[$i]['detail']=$sub_qty; // array of details
|
$batch_line[$i]['detail']=$sub_qty; // array of details
|
||||||
$batch_line[$i]['qty']=$subtotalqty;
|
$batch_line[$i]['qty']=$subtotalqty;
|
||||||
$batch_line[$i]['ix_l']=GETPOST($idl,'int');
|
$batch_line[$i]['ix_l']=GETPOST($idl,'int');
|
||||||
|
|
||||||
$totalqty+=$subtotalqty;
|
$totalqty+=$subtotalqty;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -293,11 +293,11 @@ if (empty($reshook))
|
|||||||
$stockLine[$i][$j]['ix_l']=GETPOST($idl,'int');
|
$stockLine[$i][$j]['ix_l']=GETPOST($idl,'int');
|
||||||
|
|
||||||
$totalqty+=GETPOST($qty,'int');
|
$totalqty+=GETPOST($qty,'int');
|
||||||
|
|
||||||
$j++;
|
$j++;
|
||||||
$stockLocation="ent1".$i."_".$j;
|
$stockLocation="ent1".$i."_".$j;
|
||||||
$qty = "qtyl".$i.'_'.$j;
|
$qty = "qtyl".$i.'_'.$j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -305,7 +305,7 @@ if (empty($reshook))
|
|||||||
//shipment line for product with no batch management and no multiple stock location
|
//shipment line for product with no batch management and no multiple stock location
|
||||||
if (GETPOST($qty,'int') > 0) $totalqty+=GETPOST($qty,'int');
|
if (GETPOST($qty,'int') > 0) $totalqty+=GETPOST($qty,'int');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||||
$array_options[$i] = $extrafieldsline->getOptionalsFromPost($extralabelsline, $i);
|
$array_options[$i] = $extrafieldsline->getOptionalsFromPost($extralabelsline, $i);
|
||||||
@ -316,9 +316,9 @@ if (empty($reshook))
|
|||||||
unset($_POST["options_" . $key]);
|
unset($_POST["options_" . $key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//var_dump($batch_line[2]);
|
//var_dump($batch_line[2]);
|
||||||
|
|
||||||
if ($totalqty > 0) // There is at least one thing to ship
|
if ($totalqty > 0) // There is at least one thing to ship
|
||||||
@ -328,7 +328,7 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$qty = "qtyl".$i;
|
$qty = "qtyl".$i;
|
||||||
if (! isset($batch_line[$i]))
|
if (! isset($batch_line[$i]))
|
||||||
{
|
{
|
||||||
// not batch mode
|
// not batch mode
|
||||||
if (isset($stockLine[$i]))
|
if (isset($stockLine[$i]))
|
||||||
{
|
{
|
||||||
@ -356,7 +356,7 @@ if (empty($reshook))
|
|||||||
$entrepot_id = is_numeric(GETPOST($ent,'int'))?GETPOST($ent,'int'):GETPOST('entrepot_id','int');
|
$entrepot_id = is_numeric(GETPOST($ent,'int'))?GETPOST($ent,'int'):GETPOST('entrepot_id','int');
|
||||||
if ($entrepot_id < 0) $entrepot_id='';
|
if ($entrepot_id < 0) $entrepot_id='';
|
||||||
if (! ($objectsrc->lines[$i]->fk_product > 0)) $entrepot_id = 0;
|
if (! ($objectsrc->lines[$i]->fk_product > 0)) $entrepot_id = 0;
|
||||||
|
|
||||||
$ret=$object->addline($entrepot_id, GETPOST($idl,'int'), GETPOST($qty,'int'), $array_options[$i]);
|
$ret=$object->addline($entrepot_id, GETPOST($idl,'int'), GETPOST($qty,'int'), $array_options[$i]);
|
||||||
if ($ret < 0)
|
if ($ret < 0)
|
||||||
{
|
{
|
||||||
@ -367,7 +367,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// batch mode
|
// batch mode
|
||||||
if ($batch_line[$i]['qty']>0)
|
if ($batch_line[$i]['qty']>0)
|
||||||
{
|
{
|
||||||
@ -379,11 +379,11 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$ret=$object->create($user); // This create shipment (like Odoo picking) and line of shipments. Stock movement will when validating shipment.
|
$ret=$object->create($user); // This create shipment (like Odoo picking) and line of shipments. Stock movement will when validating shipment.
|
||||||
@ -437,9 +437,9 @@ if (empty($reshook))
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
$result = $object->valid($user);
|
$result = $object->valid($user);
|
||||||
|
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
@ -632,7 +632,7 @@ if ($action == 'create2')
|
|||||||
$action=''; $id=''; $ref='';
|
$action=''; $id=''; $ref='';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mode creation.
|
// Mode creation.
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
$expe = new Expedition($db);
|
$expe = new Expedition($db);
|
||||||
@ -756,15 +756,15 @@ if ($action == 'create')
|
|||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print '<input name="tracking_number" size="20" value="'.GETPOST('tracking_number','alpha').'">';
|
print '<input name="tracking_number" size="20" value="'.GETPOST('tracking_number','alpha').'">';
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'socid'=>$socid);
|
$parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'socid'=>$socid);
|
||||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$expe,$action); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$expe,$action); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
if (empty($reshook) && ! empty($extrafields->attribute_label)) {
|
if (empty($reshook) && ! empty($extrafields->attribute_label)) {
|
||||||
print $expe->showOptionals($extrafields, 'edit');
|
print $expe->showOptionals($extrafields, 'edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Incoterms
|
// Incoterms
|
||||||
if (!empty($conf->incoterm->enabled))
|
if (!empty($conf->incoterm->enabled))
|
||||||
@ -786,12 +786,12 @@ if ($action == 'create')
|
|||||||
print $form->selectarray('model', $liste, $conf->global->EXPEDITION_ADDON_PDF);
|
print $form->selectarray('model', $liste, $conf->global->EXPEDITION_ADDON_PDF);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
// Shipment lines
|
// Shipment lines
|
||||||
|
|
||||||
$numAsked = count($object->lines);
|
$numAsked = count($object->lines);
|
||||||
@ -819,14 +819,14 @@ if ($action == 'create')
|
|||||||
|
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
|
|
||||||
// Load shipments already done for same order
|
// Load shipments already done for same order
|
||||||
$object->loadExpeditions();
|
$object->loadExpeditions();
|
||||||
|
|
||||||
if ($numAsked)
|
if ($numAsked)
|
||||||
{
|
{
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -834,7 +834,7 @@ if ($action == 'create')
|
|||||||
print '<td align="center">'.$langs->trans("QtyOrdered").'</td>';
|
print '<td align="center">'.$langs->trans("QtyOrdered").'</td>';
|
||||||
print '<td align="center">'.$langs->trans("QtyShipped").'</td>';
|
print '<td align="center">'.$langs->trans("QtyShipped").'</td>';
|
||||||
print '<td align="center">'.$langs->trans("QtyToShip");
|
print '<td align="center">'.$langs->trans("QtyToShip");
|
||||||
if (empty($conf->productbatch->enabled))
|
if (empty($conf->productbatch->enabled))
|
||||||
{
|
{
|
||||||
print ' <br>(<a href="#" id="autofill">'.$langs->trans("Fill").'</a>';
|
print ' <br>(<a href="#" id="autofill">'.$langs->trans("Fill").'</a>';
|
||||||
print ' / <a href="#" id="autoreset">'.$langs->trans("Reset").'</a>)';
|
print ' / <a href="#" id="autoreset">'.$langs->trans("Reset").'</a>)';
|
||||||
@ -871,7 +871,7 @@ if ($action == 'create')
|
|||||||
if (! empty($line->date_end)) $type=1;
|
if (! empty($line->date_end)) $type=1;
|
||||||
|
|
||||||
print "<tr ".$bc[$var].">\n";
|
print "<tr ".$bc[$var].">\n";
|
||||||
|
|
||||||
// Product label
|
// Product label
|
||||||
if ($line->fk_product > 0) // If predefined product
|
if ($line->fk_product > 0) // If predefined product
|
||||||
{
|
{
|
||||||
@ -899,7 +899,7 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
print ($line->desc && $line->desc!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->desc):'';
|
print ($line->desc && $line->desc!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->desc):'';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -944,7 +944,7 @@ if ($action == 'create')
|
|||||||
$quantityToBeDelivered = $quantityAsked - $quantityDelivered;
|
$quantityToBeDelivered = $quantityAsked - $quantityDelivered;
|
||||||
}
|
}
|
||||||
$warehouse_id = GETPOST('entrepot_id','int');
|
$warehouse_id = GETPOST('entrepot_id','int');
|
||||||
|
|
||||||
$warehouseObject = null;
|
$warehouseObject = null;
|
||||||
if ($warehouse_id > 0 || ! ($line->fk_product > 0) || empty($conf->stock->enabled)) // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection
|
if ($warehouse_id > 0 || ! ($line->fk_product > 0) || empty($conf->stock->enabled)) // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection
|
||||||
{
|
{
|
||||||
@ -1026,10 +1026,10 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
// Product need lot
|
// Product need lot
|
||||||
print '<td></td><td></td></tr>'; // end line and start a new one for lot/serial
|
print '<td></td><td></td></tr>'; // end line and start a new one for lot/serial
|
||||||
|
|
||||||
$staticwarehouse=new Entrepot($db);
|
$staticwarehouse=new Entrepot($db);
|
||||||
if ($warehouse_id > 0) $staticwarehouse->fetch($warehouse_id);
|
if ($warehouse_id > 0) $staticwarehouse->fetch($warehouse_id);
|
||||||
|
|
||||||
$subj=0;
|
$subj=0;
|
||||||
// Define nb of lines suggested for this order line
|
// Define nb of lines suggested for this order line
|
||||||
$nbofsuggested=0;
|
$nbofsuggested=0;
|
||||||
@ -1052,11 +1052,11 @@ if ($action == 'create')
|
|||||||
print '<td colspan="3" ></td><td align="center">';
|
print '<td colspan="3" ></td><td align="center">';
|
||||||
print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="'.$deliverableQty.'">';
|
print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="'.$deliverableQty.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
|
|
||||||
print $staticwarehouse->getNomUrl(0).' / ';
|
print $staticwarehouse->getNomUrl(0).' / ';
|
||||||
|
|
||||||
print '<!-- Show details of lot -->';
|
print '<!-- Show details of lot -->';
|
||||||
print '<input name="batchl'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$dbatch->id.'">';
|
print '<input name="batchl'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$dbatch->id.'">';
|
||||||
print $langs->trans("DetailBatchFormat", $dbatch->batch, dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->qty);
|
print $langs->trans("DetailBatchFormat", $dbatch->batch, dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->qty);
|
||||||
@ -1075,28 +1075,28 @@ if ($action == 'create')
|
|||||||
print '<tr '.$bc[$var].'><td colspan="3"></td><td align="center">';
|
print '<tr '.$bc[$var].'><td colspan="3"></td><td align="center">';
|
||||||
print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="0" disabled="disabled"> ';
|
print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="0" disabled="disabled"> ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $staticwarehouse->libelle);
|
print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $staticwarehouse->libelle);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// ship from multiple locations
|
// ship from multiple locations
|
||||||
if (empty($conf->productbatch->enabled) || ! $product->hasbatch())
|
if (empty($conf->productbatch->enabled) || ! $product->hasbatch())
|
||||||
{
|
{
|
||||||
print '<td></td><td></td></tr>'; // end line and start a new one for each warehouse
|
print '<td></td><td></td></tr>'; // end line and start a new one for each warehouse
|
||||||
print '<!-- Case warehouse not already known and product does not need lot -->';
|
print '<!-- Case warehouse not already known and product does not need lot -->';
|
||||||
|
|
||||||
print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
|
print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
|
||||||
$subj=0;
|
$subj=0;
|
||||||
// Define nb of lines suggested for this order line
|
// Define nb of lines suggested for this order line
|
||||||
$nbofsuggested=0;
|
$nbofsuggested=0;
|
||||||
foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse)
|
foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse)
|
||||||
{
|
{
|
||||||
if ($stock_warehouse->real > 0)
|
if ($stock_warehouse->real > 0)
|
||||||
{
|
{
|
||||||
$nbofsuggested++;
|
$nbofsuggested++;
|
||||||
}
|
}
|
||||||
@ -1105,7 +1105,7 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
$warehouseObject=new Entrepot($db);
|
$warehouseObject=new Entrepot($db);
|
||||||
$warehouseObject->fetch($warehouse_id);
|
$warehouseObject->fetch($warehouse_id);
|
||||||
if ($stock_warehouse->real > 0)
|
if ($stock_warehouse->real > 0)
|
||||||
{
|
{
|
||||||
$stock = + $stock_warehouse->real; // Convert it to number
|
$stock = + $stock_warehouse->real; // Convert it to number
|
||||||
$deliverableQty = min($quantityToBeDelivered,$stock);
|
$deliverableQty = min($quantityToBeDelivered,$stock);
|
||||||
@ -1120,7 +1120,7 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
else print $langs->trans("NA");
|
else print $langs->trans("NA");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Stock
|
// Stock
|
||||||
if (! empty($conf->stock->enabled))
|
if (! empty($conf->stock->enabled))
|
||||||
{
|
{
|
||||||
@ -1128,10 +1128,10 @@ if ($action == 'create')
|
|||||||
if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
{
|
{
|
||||||
print $warehouseObject->getNomUrl(0).' ';
|
print $warehouseObject->getNomUrl(0).' ';
|
||||||
|
|
||||||
print '<!-- Show details of stock -->';
|
print '<!-- Show details of stock -->';
|
||||||
print '('.$stock.')';
|
print '('.$stock.')';
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1179,7 +1179,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
$subj=0;
|
$subj=0;
|
||||||
print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
|
print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
|
||||||
|
|
||||||
$warehouseObject=new Entrepot($db);
|
$warehouseObject=new Entrepot($db);
|
||||||
$productlotObject=new Productlot($db);
|
$productlotObject=new Productlot($db);
|
||||||
// Define nb of lines suggested for this order line
|
// Define nb of lines suggested for this order line
|
||||||
@ -1193,7 +1193,7 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse)
|
foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse)
|
||||||
{
|
{
|
||||||
$warehouseObject->fetch($warehouse_id);
|
$warehouseObject->fetch($warehouse_id);
|
||||||
if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) {
|
if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) {
|
||||||
@ -1205,11 +1205,11 @@ if ($action == 'create')
|
|||||||
print '<!-- subj='.$subj.'/'.$nbofsuggested.' --><tr '.((($subj + 1) == $nbofsuggested)?$bc[$var]:'').'><td colspan="3"></td><td align="center">';
|
print '<!-- subj='.$subj.'/'.$nbofsuggested.' --><tr '.((($subj + 1) == $nbofsuggested)?$bc[$var]:'').'><td colspan="3"></td><td align="center">';
|
||||||
print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="'.$deliverableQty.'">';
|
print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="'.$deliverableQty.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
|
|
||||||
print $warehouseObject->getNomUrl(0).' / ';
|
print $warehouseObject->getNomUrl(0).' / ';
|
||||||
|
|
||||||
print '<!-- Show details of lot -->';
|
print '<!-- Show details of lot -->';
|
||||||
print '<input name="batchl'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$dbatch->id.'">';
|
print '<input name="batchl'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$dbatch->id.'">';
|
||||||
//print $langs->trans("DetailBatchFormat", $dbatch->batch, dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->qty);
|
//print $langs->trans("DetailBatchFormat", $dbatch->batch, dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->qty);
|
||||||
@ -1247,12 +1247,12 @@ if ($action == 'create')
|
|||||||
print $langs->trans("NA");
|
print $langs->trans("NA");
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
{
|
{
|
||||||
$warehouse_selected_id = GETPOST('entrepot_id','int');
|
$warehouse_selected_id = GETPOST('entrepot_id','int');
|
||||||
if ($warehouse_selected_id > 0)
|
if ($warehouse_selected_id > 0)
|
||||||
{
|
{
|
||||||
$warehouseObject=new Entrepot($db);
|
$warehouseObject=new Entrepot($db);
|
||||||
$warehouseObject->fetch($warehouse_selected_id);
|
$warehouseObject->fetch($warehouse_selected_id);
|
||||||
@ -1272,10 +1272,10 @@ if ($action == 'create')
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Display lines extrafields
|
//Display lines extrafields
|
||||||
if (is_array($extralabelslines) && count($extralabelslines)>0)
|
if (is_array($extralabelslines) && count($extralabelslines)>0)
|
||||||
{
|
{
|
||||||
$colspan=5;
|
$colspan=5;
|
||||||
$line = new ExpeditionLigne($db);
|
$line = new ExpeditionLigne($db);
|
||||||
@ -1325,14 +1325,14 @@ else if ($id || $ref)
|
|||||||
|
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
$soc->fetch($object->socid);
|
$soc->fetch($object->socid);
|
||||||
|
|
||||||
$res = $object->fetch_optionals($object->id, $extralabels);
|
$res = $object->fetch_optionals($object->id, $extralabels);
|
||||||
|
|
||||||
$head=shipping_prepare_head($object);
|
$head=shipping_prepare_head($object);
|
||||||
dol_fiche_head($head, 'shipping', $langs->trans("Shipment"), 0, 'sending');
|
dol_fiche_head($head, 'shipping', $langs->trans("Shipment"), 0, 'sending');
|
||||||
|
|
||||||
$formconfirm='';
|
$formconfirm='';
|
||||||
|
|
||||||
// Confirm deleteion
|
// Confirm deleteion
|
||||||
if ($action == 'delete')
|
if ($action == 'delete')
|
||||||
{
|
{
|
||||||
@ -1378,18 +1378,18 @@ else if ($id || $ref)
|
|||||||
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
|
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
|
||||||
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
|
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print form confirm
|
// Print form confirm
|
||||||
print $formconfirm;
|
print $formconfirm;
|
||||||
|
|
||||||
|
|
||||||
// Calculate totalWeight and totalVolume for all products
|
// Calculate totalWeight and totalVolume for all products
|
||||||
// by adding weight and volume of each product line.
|
// by adding weight and volume of each product line.
|
||||||
$tmparray=$object->getTotalWeightVolume();
|
$tmparray=$object->getTotalWeightVolume();
|
||||||
$totalWeight=$tmparray['weight'];
|
$totalWeight=$tmparray['weight'];
|
||||||
$totalVolume=$tmparray['volume'];
|
$totalVolume=$tmparray['volume'];
|
||||||
|
|
||||||
|
|
||||||
if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled))
|
if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled))
|
||||||
{
|
{
|
||||||
$objectsrc=new Commande($db);
|
$objectsrc=new Commande($db);
|
||||||
@ -1444,15 +1444,15 @@ else if ($id || $ref)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||||
|
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Linked documents
|
// Linked documents
|
||||||
@ -1535,7 +1535,7 @@ else if ($id || $ref)
|
|||||||
if (!empty($object->trueWeight)) print ' ('.$langs->trans("SumOfProductWeights").': ';
|
if (!empty($object->trueWeight)) print ' ('.$langs->trans("SumOfProductWeights").': ';
|
||||||
//print $totalWeight.' '.measuring_units_string(0,"weight");
|
//print $totalWeight.' '.measuring_units_string(0,"weight");
|
||||||
print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND)?$conf->global->MAIN_WEIGHT_DEFAULT_ROUND:-1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?$conf->global->MAIN_WEIGHT_DEFAULT_UNIT:'no');
|
print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND)?$conf->global->MAIN_WEIGHT_DEFAULT_ROUND:-1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?$conf->global->MAIN_WEIGHT_DEFAULT_UNIT:'no');
|
||||||
//if (empty($object->trueWeight)) print ' ('.$langs->trans("Calculated").')';
|
//if (empty($object->trueWeight)) print ' ('.$langs->trans("Calculated").')';
|
||||||
if (!empty($object->trueWeight)) print ')';
|
if (!empty($object->trueWeight)) print ')';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -1582,7 +1582,7 @@ else if ($id || $ref)
|
|||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
$calculatedVolume=0;
|
$calculatedVolume=0;
|
||||||
$volumeUnit=0;
|
$volumeUnit=0;
|
||||||
if ($object->trueWidth && $object->trueHeight && $object->trueDepth)
|
if ($object->trueWidth && $object->trueHeight && $object->trueDepth)
|
||||||
{
|
{
|
||||||
$calculatedVolume=($object->trueWidth * $object->trueHeight * $object->trueDepth);
|
$calculatedVolume=($object->trueWidth * $object->trueHeight * $object->trueDepth);
|
||||||
$volumeUnit=$object->size_units * 3;
|
$volumeUnit=$object->size_units * 3;
|
||||||
@ -1590,7 +1590,7 @@ else if ($id || $ref)
|
|||||||
// If sending volume not defined we use sum of products
|
// If sending volume not defined we use sum of products
|
||||||
if ($calculatedVolume > 0)
|
if ($calculatedVolume > 0)
|
||||||
{
|
{
|
||||||
if ($volumeUnit < 50)
|
if ($volumeUnit < 50)
|
||||||
{
|
{
|
||||||
//print $calculatedVolume.' '.measuring_units_string($volumeUnit,"volume");
|
//print $calculatedVolume.' '.measuring_units_string($volumeUnit,"volume");
|
||||||
print showDimensionInBestUnit($calculatedVolume, $volumeUnit, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND)?$conf->global->MAIN_VOLUME_DEFAULT_ROUND:-1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT)?$conf->global->MAIN_VOLUME_DEFAULT_UNIT:'no');
|
print showDimensionInBestUnit($calculatedVolume, $volumeUnit, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND)?$conf->global->MAIN_VOLUME_DEFAULT_ROUND:-1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT)?$conf->global->MAIN_VOLUME_DEFAULT_UNIT:'no');
|
||||||
@ -1611,14 +1611,14 @@ else if ($id || $ref)
|
|||||||
// Other attributes
|
// Other attributes
|
||||||
$cols = 2;
|
$cols = 2;
|
||||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="fichehalfright">';
|
print '<div class="fichehalfright">';
|
||||||
print '<div class="ficheaddleft">';
|
print '<div class="ficheaddleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
// Sending method
|
// Sending method
|
||||||
@ -1652,7 +1652,7 @@ else if ($id || $ref)
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Tracking Number
|
// Tracking Number
|
||||||
print '<tr><td class="titlefield">'.$form->editfieldkey("TrackingNumber",'trackingnumber',$object->tracking_number,$object,$user->rights->expedition->creer).'</td><td colspan="3">';
|
print '<tr><td class="titlefield">'.$form->editfieldkey("TrackingNumber",'trackingnumber',$object->tracking_number,$object,$user->rights->expedition->creer).'</td><td colspan="3">';
|
||||||
print $form->editfieldval("TrackingNumber",'trackingnumber',$object->tracking_url,$object,$user->rights->expedition->creer,'string',$object->tracking_number);
|
print $form->editfieldval("TrackingNumber",'trackingnumber',$object->tracking_url,$object,$user->rights->expedition->creer,'string',$object->tracking_number);
|
||||||
@ -1682,19 +1682,19 @@ else if ($id || $ref)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<div class="clearboth"></div>';
|
print '<div class="clearboth"></div>';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Lines of products
|
* Lines of products
|
||||||
*/
|
*/
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -1717,7 +1717,7 @@ else if ($id || $ref)
|
|||||||
{
|
{
|
||||||
print '<td align="center">'.$langs->trans("QtyInOtherShipments").'</td>';
|
print '<td align="center">'.$langs->trans("QtyInOtherShipments").'</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td align="center">'.$langs->trans("CalculatedWeight").'</td>';
|
print '<td align="center">'.$langs->trans("CalculatedWeight").'</td>';
|
||||||
print '<td align="center">'.$langs->trans("CalculatedVolume").'</td>';
|
print '<td align="center">'.$langs->trans("CalculatedVolume").'</td>';
|
||||||
//print '<td align="center">'.$langs->trans("Size").'</td>';
|
//print '<td align="center">'.$langs->trans("Size").'</td>';
|
||||||
@ -1778,7 +1778,7 @@ else if ($id || $ref)
|
|||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
while($i < $num)
|
while($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
@ -1885,7 +1885,7 @@ else if ($id || $ref)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Weight
|
// Weight
|
||||||
@ -1945,7 +1945,7 @@ else if ($id || $ref)
|
|||||||
}
|
}
|
||||||
print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"),$detail);
|
print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"),$detail);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("NA");
|
print $langs->trans("NA");
|
||||||
}
|
}
|
||||||
@ -1955,7 +1955,7 @@ else if ($id || $ref)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
// Display lines extrafields
|
// Display lines extrafields
|
||||||
if (is_array($extralabelslines) && count($extralabelslines)>0) {
|
if (is_array($extralabelslines) && count($extralabelslines)>0) {
|
||||||
$colspan= empty($conf->productbatch->enabled) ? 5 : 6;
|
$colspan= empty($conf->productbatch->enabled) ? 5 : 6;
|
||||||
@ -1968,9 +1968,9 @@ else if ($id || $ref)
|
|||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Show also lines ordered but not delivered
|
// TODO Show also lines ordered but not delivered
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
@ -1981,7 +1981,7 @@ else if ($id || $ref)
|
|||||||
|
|
||||||
$object->fetchObjectLinked($object->id,$object->element);
|
$object->fetchObjectLinked($object->id,$object->element);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Boutons actions
|
* Boutons actions
|
||||||
*/
|
*/
|
||||||
@ -2008,14 +2008,14 @@ else if ($id || $ref)
|
|||||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("Validate").'</a>';
|
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("Validate").'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO add alternative status
|
// TODO add alternative status
|
||||||
// 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
|
// 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
|
||||||
if ($object->statut == 2 && $object->billed && $user->rights->expedition->creer)
|
if ($object->statut == 2 && $object->billed && $user->rights->expedition->creer)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("ReOpen").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("ReOpen").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send
|
// Send
|
||||||
if ($object->statut > 0)
|
if ($object->statut > 0)
|
||||||
{
|
{
|
||||||
@ -2025,16 +2025,18 @@ else if ($id || $ref)
|
|||||||
}
|
}
|
||||||
else print '<a class="butActionRefused" href="#">'.$langs->trans('SendByMail').'</a>';
|
else print '<a class="butActionRefused" href="#">'.$langs->trans('SendByMail').'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create bill and Close shipment
|
// Create bill
|
||||||
if (! empty($conf->facture->enabled) && $object->statut > 0)
|
if (! empty($conf->facture->enabled) && $object->statut > 0)
|
||||||
{
|
{
|
||||||
if ($user->rights->facture->creer)
|
if ($user->rights->facture->creer)
|
||||||
{
|
{
|
||||||
|
// TODO show button only if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))
|
||||||
|
// If we do that, we must also make this option official.
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is just to generate a delivery receipt
|
// This is just to generate a delivery receipt
|
||||||
//var_dump($object->linkedObjectsIds['delivery']);
|
//var_dump($object->linkedObjectsIds['delivery']);
|
||||||
if ($conf->livraison_bon->enabled && ($object->statut == 1 || $object->statut == 2) && $user->rights->expedition->livraison->creer && count($object->linkedObjectsIds['delivery']) == 0)
|
if ($conf->livraison_bon->enabled && ($object->statut == 1 || $object->statut == 2) && $user->rights->expedition->livraison->creer && count($object->linkedObjectsIds['delivery']) == 0)
|
||||||
@ -2056,14 +2058,14 @@ else if ($id || $ref)
|
|||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action='.$paramaction.'">'.$langs->trans($label).'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action='.$paramaction.'">'.$langs->trans($label).'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->expedition->supprimer)
|
if ($user->rights->expedition->supprimer)
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2071,11 +2073,11 @@ else if ($id || $ref)
|
|||||||
/*
|
/*
|
||||||
* Documents generated
|
* Documents generated
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action != 'presend')
|
if ($action != 'presend')
|
||||||
{
|
{
|
||||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||||
|
|
||||||
$objectref = dol_sanitizeFileName($object->ref);
|
$objectref = dol_sanitizeFileName($object->ref);
|
||||||
$filedir = $conf->expedition->dir_output . "/sending/" .$objectref;
|
$filedir = $conf->expedition->dir_output . "/sending/" .$objectref;
|
||||||
|
|
||||||
@ -2086,12 +2088,12 @@ else if ($id || $ref)
|
|||||||
|
|
||||||
print $formfile->showdocuments('expedition',$objectref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
|
print $formfile->showdocuments('expedition',$objectref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
|
||||||
|
|
||||||
|
|
||||||
// Show links to link elements
|
// Show links to link elements
|
||||||
//$linktoelem = $form->showLinkToObjectBlock($object, null, array('order'));
|
//$linktoelem = $form->showLinkToObjectBlock($object, null, array('order'));
|
||||||
$somethingshown = $form->showLinkedObjectBlock($object, '');
|
$somethingshown = $form->showLinkedObjectBlock($object, '');
|
||||||
|
|
||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
// List of actions on element
|
// List of actions on element
|
||||||
@ -2102,11 +2104,11 @@ else if ($id || $ref)
|
|||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action presend
|
* Action presend
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//Select mail models is same action as presend
|
//Select mail models is same action as presend
|
||||||
if (GETPOST('modelselected')) {
|
if (GETPOST('modelselected')) {
|
||||||
$action = 'presend';
|
$action = 'presend';
|
||||||
@ -2167,7 +2169,7 @@ else if ($id || $ref)
|
|||||||
{
|
{
|
||||||
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'shi'.$object->id);
|
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'shi'.$object->id);
|
||||||
}
|
}
|
||||||
$formmail->withfrom=1;
|
$formmail->withfrom=1;
|
||||||
$liste=array();
|
$liste=array();
|
||||||
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
|
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
|
||||||
@ -2200,7 +2202,7 @@ else if ($id || $ref)
|
|||||||
{
|
{
|
||||||
$contactarr=$objectsrc->liste_contact(-1,'external');
|
$contactarr=$objectsrc->liste_contact(-1,'external');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($contactarr) && count($contactarr)>0) {
|
if (is_array($contactarr) && count($contactarr)>0) {
|
||||||
foreach($contactarr as $contact) {
|
foreach($contactarr as $contact) {
|
||||||
|
|
||||||
|
|||||||
@ -50,6 +50,7 @@ $search_zip=GETPOST('search_zip','alpha');
|
|||||||
$search_state=trim(GETPOST("search_state"));
|
$search_state=trim(GETPOST("search_state"));
|
||||||
$search_country=GETPOST("search_country",'int');
|
$search_country=GETPOST("search_country",'int');
|
||||||
$search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
|
$search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
|
||||||
|
$search_billed=GETPOST("search_billed",'int');
|
||||||
$sall = GETPOST('sall', 'alphanohtml');
|
$sall = GETPOST('sall', 'alphanohtml');
|
||||||
$optioncss = GETPOST('optioncss','alpha');
|
$optioncss = GETPOST('optioncss','alpha');
|
||||||
|
|
||||||
@ -100,7 +101,8 @@ $arrayfields=array(
|
|||||||
'e.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
'e.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
||||||
'e.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
|
'e.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
|
||||||
'l.ref'=>array('label'=>$langs->trans("DeliveryRef"), 'checked'=>1, 'enabled'=>$conf->livraison_bon->enabled),
|
'l.ref'=>array('label'=>$langs->trans("DeliveryRef"), 'checked'=>1, 'enabled'=>$conf->livraison_bon->enabled),
|
||||||
'l.date_delivery'=>array('label'=>$langs->trans("DateReceived"), 'checked'=>1, 'enabled'=>$conf->livraison_bon->enabled)
|
'l.date_delivery'=>array('label'=>$langs->trans("DateReceived"), 'checked'=>1, 'enabled'=>$conf->livraison_bon->enabled),
|
||||||
|
'e.billed'=>array('label'=>$langs->trans("Billed"), 'checked'=>1, 'position'=>1000, 'enabled'=>(!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)))
|
||||||
);
|
);
|
||||||
|
|
||||||
// Extra fields
|
// Extra fields
|
||||||
@ -138,6 +140,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
|
|||||||
$search_type='';
|
$search_type='';
|
||||||
$search_country='';
|
$search_country='';
|
||||||
$search_type_thirdparty='';
|
$search_type_thirdparty='';
|
||||||
|
$search_billed='';
|
||||||
$viewstatut='';
|
$viewstatut='';
|
||||||
$search_array_options=array();
|
$search_array_options=array();
|
||||||
}
|
}
|
||||||
@ -158,9 +161,9 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -174,7 +177,7 @@ $formcompany=new FormCompany($db);
|
|||||||
$helpurl='EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones';
|
$helpurl='EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones';
|
||||||
llxHeader('',$langs->trans('ListOfSendings'),$helpurl);
|
llxHeader('',$langs->trans('ListOfSendings'),$helpurl);
|
||||||
|
|
||||||
$sql = "SELECT e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.date_delivery as date_livraison, l.date_delivery as date_reception, e.fk_statut,";
|
$sql = "SELECT e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.date_delivery as date_livraison, l.date_delivery as date_reception, e.fk_statut, e.billed,";
|
||||||
$sql.= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ';
|
$sql.= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ';
|
||||||
$sql.= " typent.code as typent_code,";
|
$sql.= " typent.code as typent_code,";
|
||||||
$sql.= " state.code_departement as state_code, state.nom as state_name,";
|
$sql.= " state.code_departement as state_code, state.nom as state_name,";
|
||||||
@ -210,6 +213,7 @@ if ($socid)
|
|||||||
if ($viewstatut <> '' && $viewstatut >= 0) {
|
if ($viewstatut <> '' && $viewstatut >= 0) {
|
||||||
$sql.= " AND e.fk_statut = ".$viewstatut;
|
$sql.= " AND e.fk_statut = ".$viewstatut;
|
||||||
}
|
}
|
||||||
|
if ($search_billed != '' && $search_billed >= 0) $sql.=' AND e.billed = '.$search_billed;
|
||||||
if ($search_town) $sql.= natural_search('s.town', $search_town);
|
if ($search_town) $sql.= natural_search('s.town', $search_town);
|
||||||
if ($search_zip) $sql.= natural_search("s.zip",$search_zip);
|
if ($search_zip) $sql.= natural_search("s.zip",$search_zip);
|
||||||
if ($search_state) $sql.= natural_search("state.nom",$search_state);
|
if ($search_state) $sql.= natural_search("state.nom",$search_state);
|
||||||
@ -271,9 +275,9 @@ if ($resql)
|
|||||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||||
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
//$massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
|
//$massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
@ -282,7 +286,7 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="action" value="list">';
|
print '<input type="hidden" name="action" value="list">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num, $nbtotalofrecords, '', 0, '', '', $limit);
|
print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num, $nbtotalofrecords, '', 0, '', '', $limit);
|
||||||
|
|
||||||
if ($sall)
|
if ($sall)
|
||||||
@ -290,7 +294,7 @@ if ($resql)
|
|||||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||||
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
||||||
}
|
}
|
||||||
|
|
||||||
$moreforfilter='';
|
$moreforfilter='';
|
||||||
if (! empty($moreforfilter))
|
if (! empty($moreforfilter))
|
||||||
{
|
{
|
||||||
@ -304,7 +308,7 @@ if ($resql)
|
|||||||
|
|
||||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
|
|
||||||
@ -324,9 +328,9 @@ if ($resql)
|
|||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
{
|
{
|
||||||
$align=$extrafields->getAlignFlag($key);
|
$align=$extrafields->getAlignFlag($key);
|
||||||
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||||
@ -340,28 +344,28 @@ if ($resql)
|
|||||||
if (! empty($arrayfields['e.datec']['checked'])) print_liste_field_titre($arrayfields['e.datec']['label'],$_SERVER["PHP_SELF"],"e.date_creation","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
if (! empty($arrayfields['e.datec']['checked'])) print_liste_field_titre($arrayfields['e.datec']['label'],$_SERVER["PHP_SELF"],"e.date_creation","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['e.tms']['checked'])) print_liste_field_titre($arrayfields['e.tms']['label'],$_SERVER["PHP_SELF"],"e.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
if (! empty($arrayfields['e.tms']['checked'])) print_liste_field_titre($arrayfields['e.tms']['label'],$_SERVER["PHP_SELF"],"e.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['e.fk_statut']['checked'])) print_liste_field_titre($arrayfields['e.fk_statut']['label'],$_SERVER["PHP_SELF"],"e.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
|
if (! empty($arrayfields['e.fk_statut']['checked'])) print_liste_field_titre($arrayfields['e.fk_statut']['label'],$_SERVER["PHP_SELF"],"e.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['l.fk_statut']['checked'])) print_liste_field_titre($arrayfields['l.fk_statut']['label'], $_SERVER["PHP_SELF"],"l.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
|
if (! empty($arrayfields['e.billed']['checked'])) print_liste_field_titre($arrayfields['e.billed']['label'],$_SERVER["PHP_SELF"],"e.billed","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
|
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Lignes des champs de filtre
|
// Lignes des champs de filtre
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
// Ref
|
// Ref
|
||||||
if (! empty($arrayfields['e.ref']['checked']))
|
if (! empty($arrayfields['e.ref']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<input class="flat" size="6" type="text" name="search_ref_exp" value="'.$search_ref_exp.'">';
|
print '<input class="flat" size="6" type="text" name="search_ref_exp" value="'.$search_ref_exp.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Ref customer
|
// Ref customer
|
||||||
if (! empty($arrayfields['e.ref_customer']['checked']))
|
if (! empty($arrayfields['e.ref_customer']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<input class="flat" size="6" type="text" name="search_ref_customer" value="'.$search_ref_customer.'">';
|
print '<input class="flat" size="6" type="text" name="search_ref_customer" value="'.$search_ref_customer.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
if (! empty($arrayfields['s.nom']['checked']))
|
if (! empty($arrayfields['s.nom']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '<input class="flat" type="text" size="8" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
|
print '<input class="flat" type="text" size="8" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
|
||||||
@ -393,18 +397,18 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Date delivery planned
|
// Date delivery planned
|
||||||
if (! empty($arrayfields['e.date_delivery']['checked']))
|
if (! empty($arrayfields['e.date_delivery']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['l.ref']['checked']))
|
if (! empty($arrayfields['l.ref']['checked']))
|
||||||
{
|
{
|
||||||
// Delivery ref
|
// Delivery ref
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<input class="flat" size="10" type="text" name="search_ref_liv" value="'.$search_ref_liv.'"';
|
print '<input class="flat" size="10" type="text" name="search_ref_liv" value="'.$search_ref_liv.'"';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['l.date_delivery']['checked']))
|
if (! empty($arrayfields['l.date_delivery']['checked']))
|
||||||
{
|
{
|
||||||
// Date received
|
// Date received
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
@ -455,6 +459,13 @@ if ($resql)
|
|||||||
print $form->selectarray('viewstatut', array('0'=>$langs->trans('StatusSendingDraftShort'),'1'=>$langs->trans('StatusSendingValidatedShort'),'2'=>$langs->trans('StatusSendingProcessedShort')),$viewstatut,1);
|
print $form->selectarray('viewstatut', array('0'=>$langs->trans('StatusSendingDraftShort'),'1'=>$langs->trans('StatusSendingValidatedShort'),'2'=>$langs->trans('StatusSendingProcessedShort')),$viewstatut,1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
// Status billed
|
||||||
|
if (! empty($arrayfields['e.billed']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre maxwidthonsmartphone" align="center">';
|
||||||
|
print $form->selectyesno('search_billed', $search_billed, 1, 0, 1);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
// Action column
|
// Action column
|
||||||
print '<td class="liste_titre" align="middle">';
|
print '<td class="liste_titre" align="middle">';
|
||||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||||
@ -471,15 +482,15 @@ if ($resql)
|
|||||||
|
|
||||||
$shipment->id=$obj->rowid;
|
$shipment->id=$obj->rowid;
|
||||||
$shipment->ref=$obj->ref;
|
$shipment->ref=$obj->ref;
|
||||||
|
|
||||||
$companystatic->id=$obj->socid;
|
$companystatic->id=$obj->socid;
|
||||||
$companystatic->ref=$obj->name;
|
$companystatic->ref=$obj->name;
|
||||||
$companystatic->name=$obj->name;
|
$companystatic->name=$obj->name;
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
if (! empty($arrayfields['e.ref']['checked']))
|
if (! empty($arrayfields['e.ref']['checked']))
|
||||||
{
|
{
|
||||||
@ -488,7 +499,7 @@ if ($resql)
|
|||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ref customer
|
// Ref customer
|
||||||
if (! empty($arrayfields['e.ref_customer']['checked']))
|
if (! empty($arrayfields['e.ref_customer']['checked']))
|
||||||
{
|
{
|
||||||
@ -496,8 +507,8 @@ if ($resql)
|
|||||||
print $obj->ref_customer;
|
print $obj->ref_customer;
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
if (! empty($arrayfields['s.nom']['checked']))
|
if (! empty($arrayfields['s.nom']['checked']))
|
||||||
{
|
{
|
||||||
@ -546,7 +557,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Date delivery planed
|
// Date delivery planed
|
||||||
if (! empty($arrayfields['e.date_delivery']['checked']))
|
if (! empty($arrayfields['e.date_delivery']['checked']))
|
||||||
{
|
{
|
||||||
@ -558,7 +569,7 @@ if ($resql)
|
|||||||
}*/
|
}*/
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($arrayfields['l.ref']['checked']) || ! empty($arrayfields['l.date_delivery']['checked']))
|
if (! empty($arrayfields['l.ref']['checked']) || ! empty($arrayfields['l.date_delivery']['checked']))
|
||||||
{
|
{
|
||||||
$shipment->fetchObjectLinked($shipment->id,$shipment->element);
|
$shipment->fetchObjectLinked($shipment->id,$shipment->element);
|
||||||
@ -572,7 +583,7 @@ if ($resql)
|
|||||||
print !empty($receiving) ? $receiving->getNomUrl($db) : '';
|
print !empty($receiving) ? $receiving->getNomUrl($db) : '';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($arrayfields['l.date_delivery']['checked']))
|
if (! empty($arrayfields['l.date_delivery']['checked']))
|
||||||
{
|
{
|
||||||
// Date received
|
// Date received
|
||||||
@ -626,10 +637,17 @@ if ($resql)
|
|||||||
print '<td align="right" class="nowrap">'.$shipment->LibStatut($obj->fk_statut,5).'</td>';
|
print '<td align="right" class="nowrap">'.$shipment->LibStatut($obj->fk_statut,5).'</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
// Billed
|
||||||
|
if (! empty($arrayfields['e.billed']['checked']))
|
||||||
|
{
|
||||||
|
print '<td align="center">'.yn($obj->billed).'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
// Action column
|
// Action column
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014-2015 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2014-2015 Ferran Marcet <fmarcet@2byte.es>
|
||||||
* Copyright (C) 2014-2015 Charlie Benke <charlies@patas-monkey.com>
|
* Copyright (C) 2014-2015 Charlie Benke <charlies@patas-monkey.com>
|
||||||
@ -785,7 +785,8 @@ if (empty($reshook))
|
|||||||
$parameters=array('id'=>$object->id);
|
$parameters=array('id'=>$object->id);
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{ $result=$object->updateExtraField($_POST["attribute"]);
|
{
|
||||||
|
$result=$object->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
|
|||||||
@ -211,7 +211,14 @@ $result=$db->query($sql);
|
|||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
|
|
||||||
|
if ($socid > 0)
|
||||||
|
{
|
||||||
|
$soc = new Societe($db);
|
||||||
|
$soc->fetch($socid);
|
||||||
|
if (empty($search_company)) $search_company = $soc->name;
|
||||||
|
}
|
||||||
|
|
||||||
$param='';
|
$param='';
|
||||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr');
|
if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr');
|
||||||
if (! defined('DOL_VERSION')) define('DOL_VERSION','5.0.5'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
if (! defined('DOL_VERSION')) define('DOL_VERSION','5.0.7'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
||||||
|
|
||||||
if (! defined('EURO')) define('EURO',chr(128));
|
if (! defined('EURO')) define('EURO',chr(128));
|
||||||
|
|
||||||
|
|||||||
@ -66,7 +66,7 @@ $hookmanager->initHooks(array('suppliercard','globalcard'));
|
|||||||
* Action
|
* Action
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$parameters=array('socid'=>$socid);
|
$parameters=array('id'=>$id);
|
||||||
$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
@ -629,19 +629,40 @@ if ($object->id > 0)
|
|||||||
if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->creer)
|
if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->creer)
|
||||||
{
|
{
|
||||||
$langs->load("supplier_proposal");
|
$langs->load("supplier_proposal");
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddSupplierProposal").'</a>';
|
if ($object->status == 1)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddSupplierProposal").'</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("AddSupplierProposal").'</a>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->fournisseur->commande->creer)
|
if ($user->rights->fournisseur->commande->creer)
|
||||||
{
|
{
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddOrder").'</a>';
|
if ($object->status == 1)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddOrder").'</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("AddOrder").'</a>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->fournisseur->facture->creer)
|
if ($user->rights->fournisseur->facture->creer)
|
||||||
{
|
{
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a>';
|
if ($object->status == 1)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("AddBill").'</a>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->fournisseur->facture->creer)
|
if ($user->rights->fournisseur->facture->creer)
|
||||||
|
|||||||
@ -1157,7 +1157,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
// insert products details into database
|
// insert products details into database
|
||||||
for ($i=0;$i<$num;$i++)
|
for ($i=0;$i<$num;$i++)
|
||||||
{
|
{
|
||||||
$result = $this->addline( // This include test on qty if option SUPPLIERORDER_WITH_NOPRICEDEFINED is not set
|
$result = $this->addline( // This include test on qty if option SUPPLIER_ORDER_WITH_NOPRICEDEFINED is not set
|
||||||
$this->lines[$i]->desc,
|
$this->lines[$i]->desc,
|
||||||
$this->lines[$i]->subprice,
|
$this->lines[$i]->subprice,
|
||||||
$this->lines[$i]->qty,
|
$this->lines[$i]->qty,
|
||||||
@ -1393,7 +1393,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
|
|
||||||
if ($fk_product > 0)
|
if ($fk_product > 0)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->SUPPLIERORDER_WITH_NOPRICEDEFINED))
|
if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED))
|
||||||
{
|
{
|
||||||
// Check quantity is enough
|
// Check quantity is enough
|
||||||
dol_syslog(get_class($this)."::addline we check supplier prices fk_product=".$fk_product." fk_prod_fourn_price=".$fk_prod_fourn_price." qty=".$qty." fourn_ref=".$fourn_ref);
|
dol_syslog(get_class($this)."::addline we check supplier prices fk_product=".$fk_product." fk_prod_fourn_price=".$fk_prod_fourn_price." qty=".$qty." fourn_ref=".$fourn_ref);
|
||||||
@ -1408,7 +1408,8 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$result=$prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', $this->fk_soc); // Search on couple $fk_prod_fourn_price/$qty first, then on triplet $qty/$fk_product/$fourn_ref/$this->fk_soc
|
$result=$prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', $this->fk_soc); // Search on couple $fk_prod_fourn_price/$qty first, then on triplet $qty/$fk_product/$fourn_ref/$this->fk_soc
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$pu = $prod->fourn_pu; // Unit price supplier price set by get_buyprice
|
$pu = 0; // Unit price supplier price set by get_buyprice
|
||||||
|
$pu_ht_devise = $prod->fourn_pu; // With multicurrency, supplier price is related to its currency, $pu will be calculated (= $pu_ht_devise if exchange rate is 1)
|
||||||
$ref_supplier = $prod->ref_supplier; // Ref supplier price set by get_buyprice
|
$ref_supplier = $prod->ref_supplier; // Ref supplier price set by get_buyprice
|
||||||
}
|
}
|
||||||
if ($result == 0) // If result == 0, we failed to found the supplier reference price
|
if ($result == 0) // If result == 0, we failed to found the supplier reference price
|
||||||
@ -2832,8 +2833,9 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$supplierorderdispatch = new CommandeFournisseurDispatch($this->db);
|
$supplierorderdispatch = new CommandeFournisseurDispatch($this->db);
|
||||||
$filter=array('t.fk_commande'=>$this->id);
|
$filter=array('t.fk_commande'=>$this->id);
|
||||||
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) {
|
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) {
|
||||||
$filter['t.status']=1;
|
$filter['t.status']=1; // Restrict to lines with status validated
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret=$supplierorderdispatch->fetchAll('','',0,0,$filter);
|
$ret=$supplierorderdispatch->fetchAll('','',0,0,$filter);
|
||||||
if ($ret<0)
|
if ($ret<0)
|
||||||
{
|
{
|
||||||
@ -2844,20 +2846,27 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
{
|
{
|
||||||
if (is_array($supplierorderdispatch->lines) && count($supplierorderdispatch->lines)>0)
|
if (is_array($supplierorderdispatch->lines) && count($supplierorderdispatch->lines)>0)
|
||||||
{
|
{
|
||||||
//Build array with quantity deliverd by product
|
$date_liv = dol_now();
|
||||||
|
|
||||||
|
// Build array with quantity deliverd by product
|
||||||
foreach($supplierorderdispatch->lines as $line) {
|
foreach($supplierorderdispatch->lines as $line) {
|
||||||
$qtydelivered[$line->fk_product]+=$line->qty;
|
$qtydelivered[$line->fk_product]+=$line->qty;
|
||||||
}
|
}
|
||||||
foreach($this->lines as $line) {
|
foreach($this->lines as $line) {
|
||||||
$qtywished[$line->fk_product]+=$line->qty;
|
$qtywished[$line->fk_product]+=$line->qty;
|
||||||
}
|
}
|
||||||
|
|
||||||
$date_liv = dol_now();
|
|
||||||
|
|
||||||
//Compare array
|
//Compare array
|
||||||
$diff_array=array_diff_assoc($qtydelivered,$qtywished);
|
$diff_array=array_diff_assoc($qtydelivered,$qtywished); // Warning: $diff_array is done only on common keys.
|
||||||
|
$keysinwishednotindelivered=array_diff(array_keys($qtywished),array_keys($qtydelivered)); // To check we also have same number of keys
|
||||||
|
$keysindeliverednotinwished=array_diff(array_keys($qtydelivered),array_keys($qtywished)); // To check we also have same number of keys
|
||||||
|
/*var_dump(array_keys($qtydelivered));
|
||||||
|
var_dump(array_keys($qtywished));
|
||||||
|
var_dump($diff_array);
|
||||||
|
var_dump($keysinwishednotindelivered);
|
||||||
|
var_dump($keysindeliverednotinwished);
|
||||||
|
exit;*/
|
||||||
|
|
||||||
if (count($diff_array)==0) //No diff => mean everythings is received
|
if (count($diff_array)==0 && count($keysinwishednotindelivered)==0 && count($keysindeliverednotinwished)==0) //No diff => mean everythings is received
|
||||||
{
|
{
|
||||||
if ($closeopenorder)
|
if ($closeopenorder)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||||
* Copyright (C) 2005 Marc Barilley <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2017 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014-2016 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2014-2016 Marcos García <marcosgdf@gmail.com>
|
||||||
@ -1788,7 +1788,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$response = new WorkboardResponse();
|
$response = new WorkboardResponse();
|
||||||
$response->warning_delay=$conf->facture->fournisseur->warning_delay/60/60/24;
|
$response->warning_delay=$conf->facture->fournisseur->warning_delay/60/60/24;
|
||||||
$response->label=$langs->trans("SupplierBillsToPay");
|
$response->label=$langs->trans("SupplierBillsToPay");
|
||||||
$response->url=DOL_URL_ROOT.'/fourn/facture/list.php?filtre=fac.fk_statut:1,paye:0&mainmenu=accountancy&leftmenu=suppliers_bills';
|
$response->url=DOL_URL_ROOT.'/fourn/facture/list.php?search_status=1&mainmenu=accountancy&leftmenu=suppliers_bills';
|
||||||
$response->img=img_object($langs->trans("Bills"),"bill");
|
$response->img=img_object($langs->trans("Bills"),"bill");
|
||||||
|
|
||||||
$facturestatic = new FactureFournisseur($this->db);
|
$facturestatic = new FactureFournisseur($this->db);
|
||||||
|
|||||||
@ -588,7 +588,8 @@ class ProductFournisseur extends Product
|
|||||||
foreach($record_array as $record)
|
foreach($record_array as $record)
|
||||||
{
|
{
|
||||||
$fourn_price = $record["price"];
|
$fourn_price = $record["price"];
|
||||||
$fourn_unitprice = $record["unitprice"];
|
// discount calculated buy price
|
||||||
|
$fourn_unitprice = $record["unitprice"] * (1 - $record["remise_percent"] / 100) + $record["unitcharges"] - $record["remise"];
|
||||||
if (!empty($conf->dynamicprices->enabled) && !empty($record["fk_supplier_price_expression"])) {
|
if (!empty($conf->dynamicprices->enabled) && !empty($record["fk_supplier_price_expression"])) {
|
||||||
$prod_supplier = new ProductFournisseur($this->db);
|
$prod_supplier = new ProductFournisseur($this->db);
|
||||||
$prod_supplier->product_fourn_price_id = $record["product_fourn_price_id"];
|
$prod_supplier->product_fourn_price_id = $record["product_fourn_price_id"];
|
||||||
@ -620,7 +621,7 @@ class ProductFournisseur extends Product
|
|||||||
$this->fourn_qty = $record["quantity"];
|
$this->fourn_qty = $record["quantity"];
|
||||||
$this->fourn_remise_percent = $record["remise_percent"];
|
$this->fourn_remise_percent = $record["remise_percent"];
|
||||||
$this->fourn_remise = $record["remise"];
|
$this->fourn_remise = $record["remise"];
|
||||||
$this->fourn_unitprice = $fourn_unitprice;
|
$this->fourn_unitprice = $record["unitprice"];
|
||||||
$this->fourn_charges = $record["charges"]; // deprecated
|
$this->fourn_charges = $record["charges"]; // deprecated
|
||||||
$this->fourn_unitcharges = $record["unitcharges"]; // deprecated
|
$this->fourn_unitcharges = $record["unitcharges"]; // deprecated
|
||||||
$this->fourn_tva_tx = $record["tva_tx"];
|
$this->fourn_tva_tx = $record["tva_tx"];
|
||||||
@ -629,7 +630,7 @@ class ProductFournisseur extends Product
|
|||||||
$this->delivery_time_days = $record["delivery_time_days"];
|
$this->delivery_time_days = $record["delivery_time_days"];
|
||||||
$this->fk_supplier_price_expression = $record["fk_supplier_price_expression"];
|
$this->fk_supplier_price_expression = $record["fk_supplier_price_expression"];
|
||||||
$this->id = $prodid;
|
$this->id = $prodid;
|
||||||
$min = $this->fourn_unitprice;
|
$min = $fourn_unitprice;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -346,21 +346,29 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$productsupplier = new ProductFournisseur($db);
|
$productsupplier = new ProductFournisseur($db);
|
||||||
|
|
||||||
if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED))
|
if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) // TODO this test seems useless
|
||||||
{
|
{
|
||||||
$idprod=0;
|
$idprod=0;
|
||||||
if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...)
|
if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...)
|
||||||
}
|
}
|
||||||
|
if (preg_match('/^idprod_([0-9]+)$/',GETPOST('idprodfournprice'), $reg))
|
||||||
if (GETPOST('idprodfournprice') > 0)
|
{
|
||||||
|
$idprod=$reg[1];
|
||||||
|
$res=$productsupplier->fetch($idprod);
|
||||||
|
// Call to init properties of $productsupplier
|
||||||
|
// So if a supplier price already exists for another thirdparty (first one found), we use it as reference price
|
||||||
|
$productsupplier->get_buyprice(0, -1, $idprod, 'none'); // We force qty to -1 to be sure to find if a supplier price exist
|
||||||
|
}
|
||||||
|
elseif (GETPOST('idprodfournprice') > 0)
|
||||||
{
|
{
|
||||||
$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qty); // Just to see if a price exists for the quantity. Not used to found vat.
|
$qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat.
|
||||||
|
//$qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist
|
||||||
|
$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch);
|
||||||
|
$res=$productsupplier->fetch($idprod);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($idprod > 0)
|
if ($idprod > 0)
|
||||||
{
|
{
|
||||||
$res=$productsupplier->fetch($idprod);
|
|
||||||
|
|
||||||
$label = $productsupplier->label;
|
$label = $productsupplier->label;
|
||||||
|
|
||||||
$desc = $productsupplier->description;
|
$desc = $productsupplier->description;
|
||||||
@ -381,8 +389,8 @@ if (empty($reshook))
|
|||||||
$tva_tx,
|
$tva_tx,
|
||||||
$localtax1_tx,
|
$localtax1_tx,
|
||||||
$localtax2_tx,
|
$localtax2_tx,
|
||||||
|
$idprod,
|
||||||
$productsupplier->id,
|
$productsupplier->id,
|
||||||
GETPOST('idprodfournprice'),
|
|
||||||
$productsupplier->fourn_ref,
|
$productsupplier->fourn_ref,
|
||||||
$remise_percent,
|
$remise_percent,
|
||||||
'HT',
|
'HT',
|
||||||
@ -2074,6 +2082,7 @@ elseif (! empty($object->id))
|
|||||||
// Add free products/services form
|
// Add free products/services form
|
||||||
global $forceall, $senderissupplier, $dateSelector;
|
global $forceall, $senderissupplier, $dateSelector;
|
||||||
$forceall=1; $senderissupplier=1; $dateSelector=0;
|
$forceall=1; $senderissupplier=1; $dateSelector=0;
|
||||||
|
if (! empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) $senderissupplier=2; // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum.
|
||||||
|
|
||||||
// Show object lines
|
// Show object lines
|
||||||
$inputalsopricewithtax=0;
|
$inputalsopricewithtax=0;
|
||||||
|
|||||||
@ -28,6 +28,7 @@
|
|||||||
* \ingroup commande
|
* \ingroup commande
|
||||||
* \brief Page to dispatch receiving
|
* \brief Page to dispatch receiving
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_order/modules_commandefournisseur.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_order/modules_commandefournisseur.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
|
||||||
@ -84,17 +85,33 @@ if ($id > 0 || ! empty($ref)) {
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'checkdispatchline' && ! ((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 ($action == 'checkdispatchline' && ! ((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))))
|
||||||
|
{
|
||||||
|
$error=0;
|
||||||
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
|
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
|
||||||
|
|
||||||
|
$db->begin();
|
||||||
|
|
||||||
$result = $supplierorderdispatch->fetch($lineid);
|
$result = $supplierorderdispatch->fetch($lineid);
|
||||||
if (! $result)
|
if (! $result)
|
||||||
dol_print_error($db);
|
{
|
||||||
$result = $supplierorderdispatch->setStatut(1);
|
$error++;
|
||||||
if ($result < 0) {
|
|
||||||
setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
|
setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
|
||||||
$error ++;
|
|
||||||
$action = '';
|
$action = '';
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$result = $supplierorderdispatch->setStatut(1);
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
|
||||||
|
$error++;
|
||||||
|
$action = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
$result = $object->calcAndSetStatusDispatch($user);
|
$result = $object->calcAndSetStatusDispatch($user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
@ -102,19 +119,42 @@ if ($action == 'checkdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED
|
|||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$db->commit();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'uncheckdispatchline' && ! ((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 ($action == 'uncheckdispatchline' && ! ((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))))
|
||||||
|
{
|
||||||
|
$error=0;
|
||||||
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
|
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
|
||||||
|
|
||||||
|
$db->begin();
|
||||||
|
|
||||||
$result = $supplierorderdispatch->fetch($lineid);
|
$result = $supplierorderdispatch->fetch($lineid);
|
||||||
if (! $result)
|
if (! $result)
|
||||||
dol_print_error($db);
|
{
|
||||||
$result = $supplierorderdispatch->setStatut(0);
|
$error++;
|
||||||
if ($result < 0) {
|
|
||||||
setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
|
setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
|
||||||
$error ++;
|
|
||||||
$action = '';
|
$action = '';
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$result = $supplierorderdispatch->setStatut(0);
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
|
||||||
|
$error ++;
|
||||||
|
$action = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
$result = $object->calcAndSetStatusDispatch($user);
|
$result = $object->calcAndSetStatusDispatch($user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
@ -122,19 +162,42 @@ if ($action == 'uncheckdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANC
|
|||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$db->commit();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'denydispatchline' && ! ((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 ($action == 'denydispatchline' && ! ((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))))
|
||||||
|
{
|
||||||
|
$error=0;
|
||||||
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
|
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
|
||||||
|
|
||||||
|
$db->begin();
|
||||||
|
|
||||||
$result = $supplierorderdispatch->fetch($lineid);
|
$result = $supplierorderdispatch->fetch($lineid);
|
||||||
if (! $result)
|
if (! $result)
|
||||||
dol_print_error($db);
|
{
|
||||||
$result = $supplierorderdispatch->setStatut(2);
|
$error++;
|
||||||
if ($result < 0) {
|
|
||||||
setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
|
setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
|
||||||
$error ++;
|
|
||||||
$action = '';
|
$action = '';
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$result = $supplierorderdispatch->setStatut(2);
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
|
||||||
|
$error ++;
|
||||||
|
$action = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
$result = $object->calcAndSetStatusDispatch($user);
|
$result = $object->calcAndSetStatusDispatch($user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
@ -142,6 +205,14 @@ if ($action == 'denydispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_
|
|||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$db->commit();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) {
|
if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) {
|
||||||
@ -150,10 +221,10 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
|
|||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$pos = 0;
|
$pos = 0;
|
||||||
foreach ($_POST as $key => $value)
|
foreach ($_POST as $key => $value)
|
||||||
{
|
{
|
||||||
// without batch module enabled
|
// without batch module enabled
|
||||||
if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg))
|
if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg))
|
||||||
{
|
{
|
||||||
$pos ++;
|
$pos ++;
|
||||||
|
|
||||||
@ -184,7 +255,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// with batch module enabled
|
// with batch module enabled
|
||||||
if (preg_match('/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg))
|
if (preg_match('/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg))
|
||||||
{
|
{
|
||||||
$pos ++;
|
$pos ++;
|
||||||
|
|
||||||
@ -286,11 +357,11 @@ if ($id > 0 || ! empty($ref)) {
|
|||||||
$title = $langs->trans("SupplierOrder");
|
$title = $langs->trans("SupplierOrder");
|
||||||
dol_fiche_head($head, 'dispatch', $title, 0, 'order');
|
dol_fiche_head($head, 'dispatch', $title, 0, 'order');
|
||||||
|
|
||||||
|
|
||||||
// Supplier order card
|
// Supplier order card
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/commande/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/commande/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
$morehtmlref='<div class="refidno">';
|
$morehtmlref='<div class="refidno">';
|
||||||
// Ref supplier
|
// Ref supplier
|
||||||
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1);
|
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1);
|
||||||
@ -331,14 +402,14 @@ if ($id > 0 || ! empty($ref)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||||
|
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
@ -362,7 +433,7 @@ if ($id > 0 || ! empty($ref)) {
|
|||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
// if ($mesg) print $mesg;
|
// if ($mesg) print $mesg;
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
@ -382,7 +453,7 @@ if ($id > 0 || ! empty($ref)) {
|
|||||||
print '<form method="POST" action="dispatch.php?id=' . $object->id . '">';
|
print '<form method="POST" action="dispatch.php?id=' . $object->id . '">';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||||
print '<input type="hidden" name="action" value="dispatch">';
|
print '<input type="hidden" name="action" value="dispatch">';
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
@ -585,10 +656,10 @@ if ($id > 0 || ! empty($ref)) {
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
if ($nbproduct)
|
if ($nbproduct)
|
||||||
{
|
{
|
||||||
$checkboxlabel=$langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv($object->statuts[5]));
|
$checkboxlabel=$langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv($object->statuts[5]));
|
||||||
|
|
||||||
print '<br><div class="center">';
|
print '<br><div class="center">';
|
||||||
print $langs->trans("Comment") . ' : ';
|
print $langs->trans("Comment") . ' : ';
|
||||||
print '<input type="text" class="minwidth400" maxlength="128" name="comment" value="';
|
print '<input type="text" class="minwidth400" maxlength="128" name="comment" value="';
|
||||||
@ -597,7 +668,7 @@ if ($id > 0 || ! empty($ref)) {
|
|||||||
print '" class="flat"><br>';
|
print '" class="flat"><br>';
|
||||||
|
|
||||||
print '<input type="checkbox" checked="checked" name="closeopenorder"> '.$checkboxlabel;
|
print '<input type="checkbox" checked="checked" name="closeopenorder"> '.$checkboxlabel;
|
||||||
|
|
||||||
print '<br><input type="submit" class="button" value="' . $langs->trans("DispatchVerb") . '"';
|
print '<br><input type="submit" class="button" value="' . $langs->trans("DispatchVerb") . '"';
|
||||||
if (count($listwarehouses) <= 0)
|
if (count($listwarehouses) <= 0)
|
||||||
print ' disabled';
|
print ' disabled';
|
||||||
@ -609,7 +680,7 @@ if ($id > 0 || ! empty($ref)) {
|
|||||||
if (! $nbproduct) {
|
if (! $nbproduct) {
|
||||||
if (empty($conf->global->SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED))
|
if (empty($conf->global->SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED))
|
||||||
print '<div class="opacitymedium">'.$langs->trans("NoPredefinedProductToDispatch").'</div>'; // No predefined line at all
|
print '<div class="opacitymedium">'.$langs->trans("NoPredefinedProductToDispatch").'</div>'; // No predefined line at all
|
||||||
else
|
else
|
||||||
print '<div class="opacitymedium">'.$langs->trans("NoMorePredefinedProductToDispatch").'</div>'; // No predefined line that remain to be dispatched.
|
print '<div class="opacitymedium">'.$langs->trans("NoMorePredefinedProductToDispatch").'</div>'; // No predefined line that remain to be dispatched.
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -618,7 +689,7 @@ if ($id > 0 || ! empty($ref)) {
|
|||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
// List of lines already dispatched
|
// List of lines already dispatched
|
||||||
$sql = "SELECT p.ref, p.label,";
|
$sql = "SELECT p.ref, p.label,";
|
||||||
$sql .= " e.rowid as warehouse_id, e.label as entrepot,";
|
$sql .= " e.rowid as warehouse_id, e.label as entrepot,";
|
||||||
@ -699,7 +770,8 @@ if ($id > 0 || ! empty($ref)) {
|
|||||||
|
|
||||||
// Add button to check/uncheck disaptching
|
// Add button to check/uncheck disaptching
|
||||||
print '<td align="center">';
|
print '<td align="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($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)) {
|
if (empty($objp->status)) {
|
||||||
print '<a class="button buttonRefused" href="#">' . $langs->trans("Approve") . '</a>';
|
print '<a class="button buttonRefused" href="#">' . $langs->trans("Approve") . '</a>';
|
||||||
print '<a class="button buttonRefused" href="#">' . $langs->trans("Deny") . '</a>';
|
print '<a class="button buttonRefused" href="#">' . $langs->trans("Deny") . '</a>';
|
||||||
|
|||||||
@ -475,7 +475,7 @@ if ($resql)
|
|||||||
$moreforfilter.='<div class="divsearchfield">';
|
$moreforfilter.='<div class="divsearchfield">';
|
||||||
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
|
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
|
||||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
||||||
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1);
|
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
|
||||||
$moreforfilter.='</div>';
|
$moreforfilter.='</div>';
|
||||||
}
|
}
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
@ -719,7 +719,7 @@ if ($resql)
|
|||||||
if (! empty($arrayfields['cf.ref']['checked']))
|
if (! empty($arrayfields['cf.ref']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
|
|
||||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||||
// Picto + Ref
|
// Picto + Ref
|
||||||
print '<td class="nobordernopadding nowrap">';
|
print '<td class="nobordernopadding nowrap">';
|
||||||
@ -734,7 +734,7 @@ if ($resql)
|
|||||||
$filedir=$conf->fournisseur->dir_output.'/commande' . '/' . dol_sanitizeFileName($obj->ref);
|
$filedir=$conf->fournisseur->dir_output.'/commande' . '/' . dol_sanitizeFileName($obj->ref);
|
||||||
print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -201,7 +201,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
$model=$object->modelpdf;
|
$model=$object->modelpdf;
|
||||||
$ret = $object->fetch($id); // Reload to get new records
|
$ret = $object->fetch($id); // Reload to get new records
|
||||||
|
|
||||||
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
if ($result < 0) dol_print_error($db,$result);
|
if ($result < 0) dol_print_error($db,$result);
|
||||||
}
|
}
|
||||||
@ -269,7 +269,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set supplier ref
|
// Set supplier ref
|
||||||
if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer)
|
if ($action == 'setref_supplier' && $user->rights->fournisseur->facture->creer)
|
||||||
{
|
{
|
||||||
$object->ref_supplier = GETPOST('ref_supplier', 'alpha');
|
$object->ref_supplier = GETPOST('ref_supplier', 'alpha');
|
||||||
|
|
||||||
@ -297,13 +297,13 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// payments conditions
|
// payments conditions
|
||||||
if ($action == 'setconditions' && $user->rights->fournisseur->commande->creer)
|
if ($action == 'setconditions' && $user->rights->fournisseur->facture->creer)
|
||||||
{
|
{
|
||||||
$result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int'));
|
$result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// payment mode
|
// payment mode
|
||||||
else if ($action == 'setmode' && $user->rights->fournisseur->commande->creer)
|
else if ($action == 'setmode' && $user->rights->fournisseur->facture->creer)
|
||||||
{
|
{
|
||||||
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int'));
|
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int'));
|
||||||
}
|
}
|
||||||
@ -945,21 +945,30 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if (GETPOST('prod_entry_mode') != 'free' && empty($error)) // With combolist mode idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or ''
|
if (GETPOST('prod_entry_mode') != 'free' && empty($error)) // With combolist mode idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or ''
|
||||||
{
|
{
|
||||||
$idprod=0;
|
|
||||||
$productsupplier=new ProductFournisseur($db);
|
$productsupplier=new ProductFournisseur($db);
|
||||||
|
|
||||||
if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-2; // Same behaviour than with combolist. When not select idprodfournprice is now -2 (to avoid conflict with next action that may return -1)
|
$idprod=0;
|
||||||
|
if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...)
|
||||||
|
|
||||||
if (GETPOST('idprodfournprice') > 0)
|
if (preg_match('/^idprod_([0-9]+)$/',GETPOST('idprodfournprice'), $reg))
|
||||||
|
{
|
||||||
|
$idprod=$reg[1];
|
||||||
|
$res=$productsupplier->fetch($idprod);
|
||||||
|
// Call to init properties of $productsupplier
|
||||||
|
// So if a supplier price already exists for another thirdparty (first one found), we use it as reference price
|
||||||
|
$productsupplier->get_buyprice(0, -1, $idprod, 'none'); // We force qty to -1 to be sure to find if a supplier price exist
|
||||||
|
}
|
||||||
|
elseif (GETPOST('idprodfournprice') > 0)
|
||||||
{
|
{
|
||||||
$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qty); // Just to see if a price exists for the quantity. Not used to found vat.
|
$qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat.
|
||||||
|
//$qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist
|
||||||
|
$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch);
|
||||||
|
$res=$productsupplier->fetch($idprod);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Replaces $fk_unit with the product's
|
//Replaces $fk_unit with the product's
|
||||||
if ($idprod > 0)
|
if ($idprod > 0)
|
||||||
{
|
{
|
||||||
$result=$productsupplier->fetch($idprod);
|
|
||||||
|
|
||||||
$label = $productsupplier->label;
|
$label = $productsupplier->label;
|
||||||
|
|
||||||
$desc = $productsupplier->description;
|
$desc = $productsupplier->description;
|
||||||
@ -974,10 +983,29 @@ if (empty($reshook))
|
|||||||
$type = $productsupplier->type;
|
$type = $productsupplier->type;
|
||||||
$price_base_type = 'HT';
|
$price_base_type = 'HT';
|
||||||
|
|
||||||
// TODO Save the product supplier ref into database into field ref_supplier (must rename field ref into ref_supplier first)
|
// TODO Save the product supplier ref into database (like done for supplier propal and order) into field ref_supplier (must rename field ref into ref_supplier first)
|
||||||
$result=$object->addline($desc, $productsupplier->fourn_pu, $tva_tx, $localtax1_tx, $localtax2_tx, $qty, $idprod, $remise_percent, $date_start, $date_end, 0, $tva_npr, $price_base_type, $type, -1, 0, $array_options, $productsupplier->fk_unit);
|
$result=$object->addline(
|
||||||
|
$desc,
|
||||||
|
$productsupplier->fourn_pu,
|
||||||
|
$tva_tx,
|
||||||
|
$localtax1_tx,
|
||||||
|
$localtax2_tx,
|
||||||
|
$qty,
|
||||||
|
$idprod,
|
||||||
|
$remise_percent,
|
||||||
|
$date_start,
|
||||||
|
$date_end,
|
||||||
|
0,
|
||||||
|
$tva_npr,
|
||||||
|
$price_base_type,
|
||||||
|
$type,
|
||||||
|
-1,
|
||||||
|
0,
|
||||||
|
$array_options,
|
||||||
|
$productsupplier->fk_unit
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if ($idprod == -2 || $idprod == 0)
|
if ($idprod == -99 || $idprod == 0)
|
||||||
{
|
{
|
||||||
// Product not selected
|
// Product not selected
|
||||||
$error++;
|
$error++;
|
||||||
@ -1019,7 +1047,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
$price_base_type = 'HT';
|
$price_base_type = 'HT';
|
||||||
$pu_ht_devise = price2num($price_ht_devise, 'MU');
|
$pu_ht_devise = price2num($price_ht_devise, 'MU');
|
||||||
|
|
||||||
$result=$object->addline($product_desc, $pu_ht, $tva_tx, $localtax1_tx, $localtax2_tx, $qty, 0, $remise_percent, $date_start, $date_end, 0, $tva_npr, $price_base_type, $type, -1, 0, $array_options, $fk_unit, 0, $pu_ht_devise);
|
$result=$object->addline($product_desc, $pu_ht, $tva_tx, $localtax1_tx, $localtax2_tx, $qty, 0, $remise_percent, $date_start, $date_end, 0, $tva_npr, $price_base_type, $type, -1, 0, $array_options, $fk_unit, 0, $pu_ht_devise);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1518,7 +1546,7 @@ if ($action == 'create')
|
|||||||
if ((empty($origin)) || ((($origin == 'propal') || ($origin == 'commande')) && (! empty($originid))))
|
if ((empty($origin)) || ((($origin == 'propal') || ($origin == 'commande')) && (! empty($originid))))
|
||||||
{
|
{
|
||||||
// Deposit
|
// Deposit
|
||||||
if (empty($conf->global->INVOICE_DISABLE_DEPOSIT))
|
if (empty($conf->global->INVOICE_DISABLE_DEPOSIT))
|
||||||
{
|
{
|
||||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||||
$tmp='<input type="radio" id="radio_deposit" name="type" value="3"' . (GETPOST('type') == 3 ? ' checked' : '') . '> ';
|
$tmp='<input type="radio" id="radio_deposit" name="type" value="3"' . (GETPOST('type') == 3 ? ' checked' : '') . '> ';
|
||||||
@ -1548,12 +1576,12 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Not yet supporter for supplier
|
/* Not yet supporter for supplier
|
||||||
if ($societe->id > 0)
|
if ($societe->id > 0)
|
||||||
{
|
{
|
||||||
// Replacement
|
// Replacement
|
||||||
if (empty($conf->global->INVOICE_DISABLE_REPLACEMENT))
|
if (empty($conf->global->INVOICE_DISABLE_REPLACEMENT))
|
||||||
{
|
{
|
||||||
print '<!-- replacement line -->';
|
print '<!-- replacement line -->';
|
||||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||||
@ -1603,7 +1631,7 @@ if ($action == 'create')
|
|||||||
if ($societe->id > 0)
|
if ($societe->id > 0)
|
||||||
{
|
{
|
||||||
// Credit note
|
// Credit note
|
||||||
if (empty($conf->global->INVOICE_DISABLE_CREDIT_NOTE))
|
if (empty($conf->global->INVOICE_DISABLE_CREDIT_NOTE))
|
||||||
{
|
{
|
||||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||||
$tmp='<input type="radio" id="radio_creditnote" name="type" value="2"' . (GETPOST('type') == 2 ? ' checked' : '');
|
$tmp='<input type="radio" id="radio_creditnote" name="type" value="2"' . (GETPOST('type') == 2 ? ' checked' : '');
|
||||||
@ -1639,12 +1667,12 @@ if ($action == 'create')
|
|||||||
$text .= '</select>';
|
$text .= '</select>';
|
||||||
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3);
|
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3);
|
||||||
print $desc;
|
print $desc;
|
||||||
|
|
||||||
print '<div id="credit_note_options" class="clearboth">';
|
print '<div id="credit_note_options" class="clearboth">';
|
||||||
print ' <input data-role="none" type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>";
|
print ' <input data-role="none" type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>";
|
||||||
print '<br> <input data-role="none" type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>";
|
print '<br> <input data-role="none" type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</div></div>';
|
print '</div></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1989,8 +2017,8 @@ else
|
|||||||
|
|
||||||
$morehtmlref='<div class="refidno">';
|
$morehtmlref='<div class="refidno">';
|
||||||
// Ref supplier
|
// Ref supplier
|
||||||
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
|
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->facture->creer, 'string', '', 0, 1);
|
||||||
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1);
|
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->facture->creer, 'string', '', null, null, '', 1);
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
||||||
// Project
|
// Project
|
||||||
@ -1998,7 +2026,7 @@ else
|
|||||||
{
|
{
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||||
if ($user->rights->fournisseur->commande->creer)
|
if ($user->rights->fournisseur->facture->creer)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
@ -2029,7 +2057,7 @@ else
|
|||||||
|
|
||||||
$object->totalpaye = $alreadypaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
$object->totalpaye = $alreadypaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
@ -2229,9 +2257,9 @@ else
|
|||||||
// Other attributes
|
// Other attributes
|
||||||
$cols = 2;
|
$cols = 2;
|
||||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="fichehalfright">';
|
print '<div class="fichehalfright">';
|
||||||
print '<div class="ficheaddleft">';
|
print '<div class="ficheaddleft">';
|
||||||
@ -2245,12 +2273,12 @@ else
|
|||||||
print '<tr><td class="titlefieldmiddle">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
|
print '<tr><td class="titlefieldmiddle">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
|
||||||
print '<td class="nowrap">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
print '<td class="nowrap">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Multicurrency Amount VAT
|
// Multicurrency Amount VAT
|
||||||
print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>';
|
print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>';
|
||||||
print '<td>' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
print '<td>' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Multicurrency Amount TTC
|
// Multicurrency Amount TTC
|
||||||
print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
|
print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
|
||||||
print '<td>' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
print '<td>' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||||
@ -2288,13 +2316,13 @@ else
|
|||||||
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td colspan="3">'.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).'</td></tr>';
|
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td colspan="3">'.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).'</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* List of payments
|
* List of payments
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$totalpaye = 0;
|
$totalpaye = 0;
|
||||||
|
|
||||||
$sign = 1;
|
$sign = 1;
|
||||||
if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE) $sign = - 1;
|
if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE) $sign = - 1;
|
||||||
|
|
||||||
@ -2387,9 +2415,9 @@ else
|
|||||||
{
|
{
|
||||||
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('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.'" align="right">'.$langs->trans("Billed").' :</td><td align="right">'.price($object->total_ttc).'</td><td></td></tr>';
|
||||||
|
|
||||||
$resteapayer = $object->total_ttc - $totalpaye;
|
$resteapayer = $object->total_ttc - $totalpaye;
|
||||||
|
|
||||||
print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('RemainderToPay').' :</td>';
|
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 '<td align="right"'.($resteapayer?' class="amountremaintopay"':'').'>'.price($resteapayer).'</td><td></td></tr>';
|
||||||
}
|
}
|
||||||
@ -2402,7 +2430,7 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE)
|
if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE)
|
||||||
{
|
{
|
||||||
// Total already paid
|
// Total already paid
|
||||||
print '<tr><td colspan="' . $nbcols . '" align="right">';
|
print '<tr><td colspan="' . $nbcols . '" align="right">';
|
||||||
@ -2453,7 +2481,7 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Paye partiellement 'escompte'
|
// Paye partiellement 'escompte'
|
||||||
if (($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'discount_vat') {
|
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 . '" align="right" class="nowrap">';
|
||||||
@ -2502,7 +2530,7 @@ else
|
|||||||
print ' :</td>';
|
print ' :</td>';
|
||||||
print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopay"':$cssforamountpaymentcomplete).'>' . price($resteapayeraffiche) . '</td>';
|
print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopay"':$cssforamountpaymentcomplete).'>' . price($resteapayeraffiche) . '</td>';
|
||||||
print '<td class="nowrap"> </td></tr>';
|
print '<td class="nowrap"> </td></tr>';
|
||||||
}
|
}
|
||||||
else // Credit note
|
else // Credit note
|
||||||
{
|
{
|
||||||
// Total already paid back
|
// Total already paid back
|
||||||
@ -2534,9 +2562,9 @@ else
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<div class="clearboth"></div><br>';
|
print '<div class="clearboth"></div><br>';
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
|
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
|
||||||
{
|
{
|
||||||
$blocname = 'contacts';
|
$blocname = 'contacts';
|
||||||
|
|||||||
@ -84,9 +84,12 @@ $day_lim = GETPOST('day_lim','int');
|
|||||||
$month_lim = GETPOST('month_lim','int');
|
$month_lim = GETPOST('month_lim','int');
|
||||||
$year_lim = GETPOST('year_lim','int');
|
$year_lim = GETPOST('year_lim','int');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
|
$filter = GETPOST('filtre','alpha');
|
||||||
|
|
||||||
$option = GETPOST('option');
|
$option = GETPOST('option');
|
||||||
if ($option == 'late') $filter = 'paye:0';
|
if ($option == 'late') {
|
||||||
|
$filter = 'paye:0';
|
||||||
|
}
|
||||||
|
|
||||||
$search_all = GETPOST('sall', 'alphanohtml');
|
$search_all = GETPOST('sall', 'alphanohtml');
|
||||||
$search_label = GETPOST("search_label","alpha");
|
$search_label = GETPOST("search_label","alpha");
|
||||||
@ -232,7 +235,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -389,11 +392,12 @@ if ($resql)
|
|||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||||
|
|
||||||
if ($socid)
|
if ($socid)
|
||||||
{
|
{
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
$soc->fetch($socid);
|
$soc->fetch($socid);
|
||||||
|
if (empty($search_societe)) $search_societe = $soc->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
$param='&socid='.$socid;
|
$param='&socid='.$socid;
|
||||||
@ -423,9 +427,9 @@ if ($resql)
|
|||||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||||
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
$massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
|
$massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
@ -438,13 +442,13 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("BillsSuppliers").($socid?" - $soc->name":""), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
print_barre_liste($langs->trans("BillsSuppliers").($socid?" - $soc->name":""), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||||
|
|
||||||
if ($search_all)
|
if ($search_all)
|
||||||
{
|
{
|
||||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||||
print $langs->trans("FilterOnInto", $search_all) . join(', ',$fieldstosearchall);
|
print $langs->trans("FilterOnInto", $search_all) . join(', ',$fieldstosearchall);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the user can view prospects other than his'
|
// If the user can view prospects other than his'
|
||||||
$moreforfilter='';
|
$moreforfilter='';
|
||||||
if ($user->rights->societe->client->voir || $socid)
|
if ($user->rights->societe->client->voir || $socid)
|
||||||
@ -470,7 +474,7 @@ if ($resql)
|
|||||||
$moreforfilter.='<div class="divsearchfield">';
|
$moreforfilter.='<div class="divsearchfield">';
|
||||||
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
|
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
|
||||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
||||||
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1);
|
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
|
||||||
$moreforfilter.='</div>';
|
$moreforfilter.='</div>';
|
||||||
}
|
}
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
@ -487,7 +491,7 @@ if ($resql)
|
|||||||
|
|
||||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -693,7 +697,7 @@ if ($resql)
|
|||||||
$facturestatic=new FactureFournisseur($db);
|
$facturestatic=new FactureFournisseur($db);
|
||||||
$supplierstatic=new Fournisseur($db);
|
$supplierstatic=new Fournisseur($db);
|
||||||
$projectstatic=new Project($db);
|
$projectstatic=new Project($db);
|
||||||
|
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
$i=0;
|
$i=0;
|
||||||
@ -704,14 +708,14 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
$datelimit=$db->jdate($obj->datelimite);
|
$datelimit=$db->jdate($obj->datelimite);
|
||||||
$facturestatic->id=$obj->facid;
|
$facturestatic->id=$obj->facid;
|
||||||
$facturestatic->ref=$obj->ref;
|
$facturestatic->ref=$obj->ref;
|
||||||
$facturestatic->ref_supplier=$obj->ref_supplier;
|
$facturestatic->ref_supplier=$obj->ref_supplier;
|
||||||
$facturestatic->date_echeance = $db->jdate($obj->datelimite);
|
$facturestatic->date_echeance = $db->jdate($obj->datelimite);
|
||||||
$facturestatic->statut = $obj->fk_statut;
|
$facturestatic->statut = $obj->fk_statut;
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
if (! empty($arrayfields['f.ref']['checked']))
|
if (! empty($arrayfields['f.ref']['checked']))
|
||||||
{
|
{
|
||||||
@ -732,11 +736,11 @@ if ($resql)
|
|||||||
$subdir = 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);
|
||||||
print $formfile->getDocumentsLink('facture_fournisseur', $subdir, $filedir);
|
print $formfile->getDocumentsLink('facture_fournisseur', $subdir, $filedir);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Customer ref
|
// Customer ref
|
||||||
if (! empty($arrayfields['f.ref_supplier']['checked']))
|
if (! empty($arrayfields['f.ref_supplier']['checked']))
|
||||||
{
|
{
|
||||||
@ -745,7 +749,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
if (! empty($arrayfields['f.label']['checked']))
|
if (! empty($arrayfields['f.label']['checked']))
|
||||||
{
|
{
|
||||||
@ -754,7 +758,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
if (! empty($arrayfields['f.datef']['checked']))
|
if (! empty($arrayfields['f.datef']['checked']))
|
||||||
{
|
{
|
||||||
@ -763,7 +767,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Date limit
|
// Date limit
|
||||||
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
|
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
|
||||||
{
|
{
|
||||||
@ -775,7 +779,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Project
|
// Project
|
||||||
if (! empty($arrayfields['p.ref']['checked']))
|
if (! empty($arrayfields['p.ref']['checked']))
|
||||||
{
|
{
|
||||||
@ -789,7 +793,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
if (! empty($arrayfields['s.nom']['checked']))
|
if (! empty($arrayfields['s.nom']['checked']))
|
||||||
{
|
{
|
||||||
@ -843,7 +847,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Payment mode
|
// Payment mode
|
||||||
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
|
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
|
||||||
{
|
{
|
||||||
@ -852,7 +856,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Amount HT
|
// Amount HT
|
||||||
if (! empty($arrayfields['f.total_ht']['checked']))
|
if (! empty($arrayfields['f.total_ht']['checked']))
|
||||||
{
|
{
|
||||||
@ -893,7 +897,7 @@ if ($resql)
|
|||||||
if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield'];
|
if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield'];
|
||||||
$totalarray['totalrtp'] += $remaintopay;
|
$totalarray['totalrtp'] += $remaintopay;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
@ -941,7 +945,7 @@ if ($resql)
|
|||||||
print "</td>";
|
print "</td>";
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Action column
|
// Action column
|
||||||
print '<td class="nowrap" align="center">';
|
print '<td class="nowrap" align="center">';
|
||||||
$selected=0;
|
$selected=0;
|
||||||
@ -949,12 +953,12 @@ if ($resql)
|
|||||||
//print '<input id="cb'.$obj->facid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->facid.'"'.($selected?' checked="checked"':'').'>';
|
//print '<input id="cb'.$obj->facid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->facid.'"'.($selected?' checked="checked"':'').'>';
|
||||||
print '</td>' ;
|
print '</td>' ;
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show total line
|
// Show total line
|
||||||
if (isset($totalarray['totalhtfield'])
|
if (isset($totalarray['totalhtfield'])
|
||||||
|| isset($totalarray['totalvatfield'])
|
|| isset($totalarray['totalvatfield'])
|
||||||
@ -981,16 +985,16 @@ if ($resql)
|
|||||||
else print '<td></td>';
|
else print '<td></td>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|
||||||
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|||||||
@ -41,6 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
|
|||||||
$myparam = GETPOST("myparam");
|
$myparam = GETPOST("myparam");
|
||||||
$action=GETPOST('action', 'alpha');
|
$action=GETPOST('action', 'alpha');
|
||||||
$id=GETPOST('id', 'int');
|
$id=GETPOST('id', 'int');
|
||||||
|
$fuserid = (GETPOST('fuserid','int')?GETPOST('fuserid','int'):$user->id);
|
||||||
|
|
||||||
// Protection if external user
|
// Protection if external user
|
||||||
if ($user->societe_id > 0) accessforbidden();
|
if ($user->societe_id > 0) accessforbidden();
|
||||||
|
|||||||
@ -580,7 +580,7 @@ class TCPDI extends FPDF_TPL {
|
|||||||
* close all files opened by parsers
|
* close all files opened by parsers
|
||||||
*/
|
*/
|
||||||
function _closeParsers() {
|
function _closeParsers() {
|
||||||
if ($this->state > 2 && count($this->parsers) > 0) {
|
if ($this->state > 2 && is_array($this->parsers) && count($this->parsers) > 0) {
|
||||||
$this->cleanUp();
|
$this->cleanUp();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -306,7 +306,19 @@ else
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php';
|
require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php';
|
||||||
|
|
||||||
|
// If password is encoded, we decode it
|
||||||
|
if (preg_match('/crypted:/i',$dolibarr_main_db_pass) || ! empty($dolibarr_main_db_encrypted_pass))
|
||||||
|
{
|
||||||
|
require_once $dolibarr_main_document_root.'/core/lib/security.lib.php';
|
||||||
|
if (preg_match('/crypted:/i',$dolibarr_main_db_pass))
|
||||||
|
{
|
||||||
|
$dolibarr_main_db_encrypted_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass); // We need to set this as it is used to know the password was initially crypted
|
||||||
|
$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
|
||||||
|
}
|
||||||
|
else $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
|
||||||
|
}
|
||||||
|
|
||||||
// $conf is already instancied inside inc.php
|
// $conf is already instancied inside inc.php
|
||||||
$conf->db->type = $dolibarr_main_db_type;
|
$conf->db->type = $dolibarr_main_db_type;
|
||||||
@ -315,12 +327,12 @@ else
|
|||||||
$conf->db->name = $dolibarr_main_db_name;
|
$conf->db->name = $dolibarr_main_db_name;
|
||||||
$conf->db->user = $dolibarr_main_db_user;
|
$conf->db->user = $dolibarr_main_db_user;
|
||||||
$conf->db->pass = $dolibarr_main_db_pass;
|
$conf->db->pass = $dolibarr_main_db_pass;
|
||||||
$db=getDoliDBInstance($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
|
$db=getDoliDBInstance($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
|
||||||
if ($db->connected && $db->database_selected)
|
if ($db->connected && $db->database_selected)
|
||||||
{
|
{
|
||||||
$ok=true;
|
$ok=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -611,3 +611,7 @@ INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (14
|
|||||||
-- VMYSQL4.1 ALTER TABLE llx_c_type_resource CHANGE COLUMN rowid rowid integer NOT NULL AUTO_INCREMENT;
|
-- VMYSQL4.1 ALTER TABLE llx_c_type_resource CHANGE COLUMN rowid rowid integer NOT NULL AUTO_INCREMENT;
|
||||||
|
|
||||||
ALTER TABLE llx_import_model MODIFY COLUMN type varchar(50);
|
ALTER TABLE llx_import_model MODIFY COLUMN type varchar(50);
|
||||||
|
|
||||||
|
-- Negative buying prices
|
||||||
|
|
||||||
|
UPDATE llx_facturedet SET buy_price_ht = ABS(buy_price_ht)
|
||||||
|
|||||||
@ -34,6 +34,7 @@ ALTER TABLE llx_product_customer_price ADD COLUMN localtax1_type varchar(10) NO
|
|||||||
ALTER TABLE llx_product_customer_price ADD COLUMN localtax2_type varchar(10) NOT NULL DEFAULT '0' after localtax2_tx;
|
ALTER TABLE llx_product_customer_price ADD COLUMN localtax2_type varchar(10) NOT NULL DEFAULT '0' after localtax2_tx;
|
||||||
ALTER TABLE llx_product_customer_price_log ADD COLUMN localtax1_type varchar(10) NOT NULL DEFAULT '0' after localtax1_tx;
|
ALTER TABLE llx_product_customer_price_log ADD COLUMN localtax1_type varchar(10) NOT NULL DEFAULT '0' after localtax1_tx;
|
||||||
ALTER TABLE llx_product_customer_price_log ADD COLUMN localtax2_type varchar(10) NOT NULL DEFAULT '0' after localtax2_tx;
|
ALTER TABLE llx_product_customer_price_log ADD COLUMN localtax2_type varchar(10) NOT NULL DEFAULT '0' after localtax2_tx;
|
||||||
|
ALTER TABLE llx_supplier_proposaldet CHANGE COLUMN fk_askpricesupplier fk_supplier_proposal integer NOT NULL;
|
||||||
|
|
||||||
ALTER TABLE llx_opensurvey_sondage ADD COLUMN status integer DEFAULT 1 after date_fin;
|
ALTER TABLE llx_opensurvey_sondage ADD COLUMN status integer DEFAULT 1 after date_fin;
|
||||||
|
|
||||||
@ -547,4 +548,6 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (178,
|
|||||||
-- VMYSQL4.1 ALTER TABLE llx_establishment CHANGE COLUMN fk_user_mod fk_user_mod integer NULL;
|
-- VMYSQL4.1 ALTER TABLE llx_establishment CHANGE COLUMN fk_user_mod fk_user_mod integer NULL;
|
||||||
-- VPGSQL8.2 ALTER TABLE llx_establishment ALTER COLUMN fk_user_mod DROP NOT NULL;
|
-- VPGSQL8.2 ALTER TABLE llx_establishment ALTER COLUMN fk_user_mod DROP NOT NULL;
|
||||||
|
|
||||||
ALTER TABLE llx_multicurrency_rate ADD COLUMN entity integer DEFAULT 1;
|
ALTER TABLE llx_multicurrency_rate ADD COLUMN entity integer DEFAULT 1;
|
||||||
|
|
||||||
|
ALTER TABLE llx_user MODIFY COLUMN login varchar(50);
|
||||||
@ -4,6 +4,7 @@
|
|||||||
-- when current version is 4.0.0 or higher.
|
-- when current version is 4.0.0 or higher.
|
||||||
--
|
--
|
||||||
-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
|
-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
|
||||||
|
-- -- VPGSQL8.2 ALTER SEQUENCE IF EXISTS llx_table_rowid_seq RENAME TO llx_table_new_rowid_seq;
|
||||||
-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
|
-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
|
||||||
-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60);
|
-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60);
|
||||||
-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname;
|
-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname;
|
||||||
@ -60,6 +61,8 @@ ALTER TABLE llx_user DROP COLUMN phenix_login;
|
|||||||
ALTER TABLE llx_user DROP COLUMN phenix_pass;
|
ALTER TABLE llx_user DROP COLUMN phenix_pass;
|
||||||
ALTER TABLE llx_user ADD COLUMN dateemployment datetime;
|
ALTER TABLE llx_user ADD COLUMN dateemployment datetime;
|
||||||
|
|
||||||
|
ALTER TABLE llx_user MODIFY login varchar(50) NOT NULL;
|
||||||
|
|
||||||
ALTER TABLE llx_societe ADD COLUMN fk_account integer;
|
ALTER TABLE llx_societe ADD COLUMN fk_account integer;
|
||||||
|
|
||||||
ALTER TABLE llx_commandedet ADD COLUMN fk_commandefourndet integer DEFAULT NULL after import_key; -- link to detail line of commande fourn (resplenish)
|
ALTER TABLE llx_commandedet ADD COLUMN fk_commandefourndet integer DEFAULT NULL after import_key; -- link to detail line of commande fourn (resplenish)
|
||||||
@ -118,6 +121,8 @@ create table llx_expensereport_extrafields
|
|||||||
ALTER TABLE llx_expensereport_extrafields ADD INDEX idx_expensereport_extrafields (fk_object);
|
ALTER TABLE llx_expensereport_extrafields ADD INDEX idx_expensereport_extrafields (fk_object);
|
||||||
|
|
||||||
ALTER TABLE llx_cotisation RENAME TO llx_subscription;
|
ALTER TABLE llx_cotisation RENAME TO llx_subscription;
|
||||||
|
-- VPGSQL8.2 ALTER SEQUENCE IF EXISTS llx_cotisation_rowid_seq RENAME TO llx_subscription_rowid_seq;
|
||||||
|
|
||||||
ALTER TABLE llx_subscription ADD UNIQUE INDEX uk_subscription (fk_adherent,dateadh);
|
ALTER TABLE llx_subscription ADD UNIQUE INDEX uk_subscription (fk_adherent,dateadh);
|
||||||
ALTER TABLE llx_subscription CHANGE COLUMN cotisation subscription real;
|
ALTER TABLE llx_subscription CHANGE COLUMN cotisation subscription real;
|
||||||
ALTER TABLE llx_adherent_type CHANGE COLUMN cotisation subscription varchar(3) NOT NULL DEFAULT '1';
|
ALTER TABLE llx_adherent_type CHANGE COLUMN cotisation subscription varchar(3) NOT NULL DEFAULT '1';
|
||||||
|
|||||||
@ -13,11 +13,28 @@
|
|||||||
-- flush privileges;
|
-- flush privileges;
|
||||||
|
|
||||||
|
|
||||||
-- Requests to change character set and collation of a column
|
-- Request to change default pagecode + colation of database
|
||||||
|
-- ALTER DATABASE name_of_database CHARACTER SET utf8 COLLATE utf8_unicode_ci;
|
||||||
|
|
||||||
-- ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8;
|
-- Request to change default pagecode + colation of table
|
||||||
-- ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci;
|
-- ALTER TABLE name_of_table CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
|
||||||
-- You can check with "show full columns from llx_accountingaccount";
|
|
||||||
|
-- Request to change character set and collation of a varchar column.
|
||||||
|
-- utf8 and utf8_unicode_ci is recommended (or even better utf8mb4 and utf8mb4_unicode_ci with mysql 5.5.3+)
|
||||||
|
-- ALTER TABLE name_of_table MODIFY field VARCHAR(20) CHARACTER SET utf8;
|
||||||
|
-- ALTER TABLE name_of_table MODIFY field VARCHAR(20) COLLATE utf8_unicode_ci;
|
||||||
|
-- You can check with 'show full columns from mytablename';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8;
|
||||||
|
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci;
|
||||||
|
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) CHARACTER SET utf8;
|
||||||
|
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci;
|
||||||
|
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) CHARACTER SET utf8;
|
||||||
|
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci;
|
||||||
|
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batchlot MODIFY batch VARCHAR(30) CHARACTER SET utf8;
|
||||||
|
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@ create table llx_user
|
|||||||
tms timestamp,
|
tms timestamp,
|
||||||
fk_user_creat integer,
|
fk_user_creat integer,
|
||||||
fk_user_modif integer,
|
fk_user_modif integer,
|
||||||
login varchar(24) NOT NULL,
|
login varchar(50) NOT NULL,
|
||||||
pass varchar(128),
|
pass varchar(128),
|
||||||
pass_crypted varchar(128),
|
pass_crypted varchar(128),
|
||||||
pass_temp varchar(128), -- temporary password when asked for forget password
|
pass_temp varchar(128), -- temporary password when asked for forget password
|
||||||
|
|||||||
@ -510,7 +510,7 @@ if (! $error && $db->connected && $action == "set")
|
|||||||
print '<td><img src="../theme/eldy/img/tick.png" alt="Ok"></td></tr>';
|
print '<td><img src="../theme/eldy/img/tick.png" alt="Ok"></td></tr>';
|
||||||
|
|
||||||
// Si creation utilisateur admin demandee, on le cree
|
// Si creation utilisateur admin demandee, on le cree
|
||||||
if (isset($db_create_user) && $db_create_user == "on") {
|
if (isset($db_create_user) && ($db_create_user == "1" || $db_create_user == "on")) {
|
||||||
dolibarr_install_syslog("step1: create database user: " . $dolibarr_main_db_user);
|
dolibarr_install_syslog("step1: create database user: " . $dolibarr_main_db_user);
|
||||||
|
|
||||||
//print $conf->db->host." , ".$conf->db->name." , ".$conf->db->user." , ".$conf->db->port;
|
//print $conf->db->host." , ".$conf->db->name." , ".$conf->db->user." , ".$conf->db->port;
|
||||||
@ -614,7 +614,7 @@ if (! $error && $db->connected && $action == "set")
|
|||||||
|
|
||||||
|
|
||||||
// If database creation is asked, we create it
|
// If database creation is asked, we create it
|
||||||
if (!$error && (isset($db_create_database) && $db_create_database == "on")) {
|
if (!$error && (isset($db_create_database) && ($db_create_database == "1" || $db_create_database == "on"))) {
|
||||||
dolibarr_install_syslog("step1: create database: " . $dolibarr_main_db_name . " " . $dolibarr_main_db_character_set . " " . $dolibarr_main_db_collation . " " . $dolibarr_main_db_user);
|
dolibarr_install_syslog("step1: create database: " . $dolibarr_main_db_name . " " . $dolibarr_main_db_character_set . " " . $dolibarr_main_db_collation . " " . $dolibarr_main_db_user);
|
||||||
$newdb=getDoliDBInstance($conf->db->type,$conf->db->host,$userroot,$passroot,'',$conf->db->port);
|
$newdb=getDoliDBInstance($conf->db->type,$conf->db->host,$userroot,$passroot,'',$conf->db->port);
|
||||||
//print 'eee'.$conf->db->type." ".$conf->db->host." ".$userroot." ".$passroot." ".$conf->db->port." ".$newdb->connected." ".$newdb->forcecharset;exit;
|
//print 'eee'.$conf->db->type." ".$conf->db->host." ".$userroot." ".$passroot." ".$conf->db->port." ".$newdb->connected." ".$newdb->forcecharset;exit;
|
||||||
|
|||||||
@ -67,6 +67,7 @@ NoPredefinedProductToDispatch=No predefined products for this object. So no disp
|
|||||||
DispatchVerb=Dispatch
|
DispatchVerb=Dispatch
|
||||||
StockLimitShort=Limit for alert
|
StockLimitShort=Limit for alert
|
||||||
StockLimit=Stock limit for alert
|
StockLimit=Stock limit for alert
|
||||||
|
StockLimitDesc="" (empty) default value means no alert. <br>"0" can be used with 'Stock can be negative' configuration.
|
||||||
PhysicalStock=Physical stock
|
PhysicalStock=Physical stock
|
||||||
RealStock=Real Stock
|
RealStock=Real Stock
|
||||||
RealStockDesc=Physical or real stock is the stock you currently have into your internal warehouses/emplacements.
|
RealStockDesc=Physical or real stock is the stock you currently have into your internal warehouses/emplacements.
|
||||||
@ -142,4 +143,4 @@ OptionMULTIPRICESIsOn=Option "several prices per segment" is on. It means a prod
|
|||||||
ProductStockWarehouseCreated=Stock limit for alert and desired optimal stock correctly created
|
ProductStockWarehouseCreated=Stock limit for alert and desired optimal stock correctly created
|
||||||
ProductStockWarehouseUpdated=Stock limit for alert and desired optimal stock correctly updated
|
ProductStockWarehouseUpdated=Stock limit for alert and desired optimal stock correctly updated
|
||||||
ProductStockWarehouseDeleted=Stock limit for alert and desired optimal stock correctly deleted
|
ProductStockWarehouseDeleted=Stock limit for alert and desired optimal stock correctly deleted
|
||||||
AddNewProductStockWarehouse=Set new limit for alert and desired optimal stock
|
AddNewProductStockWarehouse=Set new limit for alert and desired optimal stock
|
||||||
|
|||||||
@ -46,7 +46,7 @@ $action = GETPOST('action','alpha');
|
|||||||
$value = GETPOST('value','alpha');
|
$value = GETPOST('value','alpha');
|
||||||
$type = GETPOST('type','alpha');
|
$type = GETPOST('type','alpha');
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label','alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scan_dir','alpha');
|
||||||
|
|
||||||
// Pricing Rules
|
// Pricing Rules
|
||||||
$select_pricing_rules=array(
|
$select_pricing_rules=array(
|
||||||
@ -479,7 +479,7 @@ if ($resql)
|
|||||||
if (in_array($name, $def))
|
if (in_array($name, $def))
|
||||||
{
|
{
|
||||||
print "<td align=\"center\">\n";
|
print "<td align=\"center\">\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&type=product&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&type=product&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@ -495,7 +495,7 @@ if ($resql)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<td align=\"center\">\n";
|
print "<td align=\"center\">\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&type=product&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&type=product&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -169,12 +169,12 @@ class Productcustomerprice extends CommonObject
|
|||||||
$sql .= " " . (empty($this->price_min_ttc) ? '0' : "'" . $this->price_min_ttc . "'") . ",";
|
$sql .= " " . (empty($this->price_min_ttc) ? '0' : "'" . $this->price_min_ttc . "'") . ",";
|
||||||
$sql .= " " . (! isset($this->price_base_type) ? 'NULL' : "'" . $this->db->escape($this->price_base_type) . "'") . ",";
|
$sql .= " " . (! isset($this->price_base_type) ? 'NULL' : "'" . $this->db->escape($this->price_base_type) . "'") . ",";
|
||||||
$sql .= " ".($this->default_vat_code ? "'".$this->db->escape($this->default_vat_code)."'" : "null").",";
|
$sql .= " ".($this->default_vat_code ? "'".$this->db->escape($this->default_vat_code)."'" : "null").",";
|
||||||
$sql .= " " . (! isset($this->tva_tx) ? 'NULL' : "'" . $this->tva_tx . "'") . ",";
|
$sql .= " " . (! isset($this->tva_tx) ? 'NULL' : (empty($this->tva_tx)?0:$this->tva_tx)) . ",";
|
||||||
$sql .= " " . (! isset($this->recuperableonly) ? 'NULL' : "'" . $this->recuperableonly . "'") . ",";
|
$sql .= " " . (! isset($this->recuperableonly) ? 'NULL' : "'" . $this->recuperableonly . "'") . ",";
|
||||||
$sql .= " " . (empty($this->localtax1_type) ? "'0'" : "'" . $this->localtax1_type . "'") . ",";
|
$sql .= " " . (empty($this->localtax1_type) ? "'0'" : "'" . $this->localtax1_type . "'") . ",";
|
||||||
$sql .= " " . (! isset($this->localtax1_tx) ? 'NULL' : "'" . $this->localtax1_tx . "'") . ",";
|
$sql .= " " . (! isset($this->localtax1_tx) ? 'NULL' : (empty($this->localtax1_tx)?0:$this->localtax1_tx)) . ",";
|
||||||
$sql .= " " . (empty($this->localtax2_type) ? "'0'" : "'" . $this->localtax2_type . "'") . ",";
|
$sql .= " " . (empty($this->localtax2_type) ? "'0'" : "'" . $this->localtax2_type . "'") . ",";
|
||||||
$sql .= " " . (! isset($this->localtax2_tx) ? 'NULL' : "'" . $this->localtax2_tx . "'") . ",";
|
$sql .= " " . (! isset($this->localtax2_tx) ? 'NULL' : (empty($this->localtax2_tx)?0:$this->localtax2_tx)) . ",";
|
||||||
$sql .= " " . $user->id . ",";
|
$sql .= " " . $user->id . ",";
|
||||||
$sql .= " " . (! isset($this->import_key) ? 'NULL' : "'" . $this->db->escape($this->import_key) . "'") . "";
|
$sql .= " " . (! isset($this->import_key) ? 'NULL' : "'" . $this->db->escape($this->import_key) . "'") . "";
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
@ -656,10 +656,10 @@ class Productcustomerprice extends CommonObject
|
|||||||
$sql .= " price_min_ttc=" . (isset($this->price_min_ttc) ? $this->price_min_ttc : "null") . ",";
|
$sql .= " price_min_ttc=" . (isset($this->price_min_ttc) ? $this->price_min_ttc : "null") . ",";
|
||||||
$sql .= " price_base_type=" . (isset($this->price_base_type) ? "'" . $this->db->escape($this->price_base_type) . "'" : "null") . ",";
|
$sql .= " price_base_type=" . (isset($this->price_base_type) ? "'" . $this->db->escape($this->price_base_type) . "'" : "null") . ",";
|
||||||
$sql .= " default_vat_code = ".($this->default_vat_code ? "'".$this->db->escape($this->default_vat_code)."'" : "null").",";
|
$sql .= " default_vat_code = ".($this->default_vat_code ? "'".$this->db->escape($this->default_vat_code)."'" : "null").",";
|
||||||
$sql .= " tva_tx=" . (isset($this->tva_tx) ? $this->tva_tx : "null") . ",";
|
$sql .= " tva_tx=" . (isset($this->tva_tx) ? (empty($this->tva_tx)?0:$this->tva_tx) : "null") . ",";
|
||||||
$sql .= " recuperableonly=" . (isset($this->recuperableonly) ? $this->recuperableonly : "null") . ",";
|
$sql .= " recuperableonly=" . (isset($this->recuperableonly) ? $this->recuperableonly : "null") . ",";
|
||||||
$sql .= " localtax1_tx=" . (isset($this->localtax1_tx) ? $this->localtax1_tx : "null") . ",";
|
$sql .= " localtax1_tx=" . (isset($this->localtax1_tx) ? (empty($this->localtax1_tx)?0:$this->localtax1_tx) : "null") . ",";
|
||||||
$sql .= " localtax2_tx=" . (isset($this->localtax2_tx) ? $this->localtax2_tx : "null") . ",";
|
$sql .= " localtax2_tx=" . (isset($this->localtax2_tx) ? (empty($this->localtax2_tx)?0:$this->localtax2_tx) : "null") . ",";
|
||||||
$sql .= " localtax1_type=" . (! empty($this->localtax1_type) ? "'".$this->localtax1_type."'": "'0'") . ",";
|
$sql .= " localtax1_type=" . (! empty($this->localtax1_type) ? "'".$this->localtax1_type."'": "'0'") . ",";
|
||||||
$sql .= " localtax2_type=" . (! empty($this->localtax2_type) ? "'".$this->localtax2_type."'": "'0'") . ",";
|
$sql .= " localtax2_type=" . (! empty($this->localtax2_type) ? "'".$this->localtax2_type."'": "'0'") . ",";
|
||||||
$sql .= " fk_user=" . $user->id . ",";
|
$sql .= " fk_user=" . $user->id . ",";
|
||||||
|
|||||||
@ -1172,6 +1172,9 @@ if ($action == 'edit_price' && $object->getRights()->creer)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
$parameters=array('colspan' => 2);
|
||||||
|
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|||||||
@ -43,7 +43,7 @@ if (!$user->admin) accessforbidden();
|
|||||||
$value = GETPOST('value','alpha');
|
$value = GETPOST('value','alpha');
|
||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label','alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scan_dir','alpha');
|
||||||
$type='project';
|
$type='project';
|
||||||
|
|
||||||
|
|
||||||
@ -672,7 +672,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
if (in_array($name, $def))
|
if (in_array($name, $def))
|
||||||
{
|
{
|
||||||
print "<td align=\"center\">\n";
|
print "<td align=\"center\">\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@ -680,7 +680,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<td align=\"center\">\n";
|
print "<td align=\"center\">\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -692,7 +692,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -831,7 +831,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
|||||||
if (in_array($name, $def))
|
if (in_array($name, $def))
|
||||||
{
|
{
|
||||||
print "<td align=\"center\">\n";
|
print "<td align=\"center\">\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=deltask&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=deltask&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@ -839,7 +839,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<td align=\"center\">\n";
|
print "<td align=\"center\">\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=settask&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=settask&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -851,7 +851,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoctask&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoctask&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -500,13 +500,13 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE))
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
// EMail
|
// EMail
|
||||||
print '<tr><td>'.$langs->trans("Email").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="email" size="40" value="'.dol_escape_htmltag(GETPOST('email')).'"></td></tr>'."\n";
|
print '<tr><td>'.$langs->trans("Email").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="email" maxlength="255" size="40" value="'.dol_escape_htmltag(GETPOST('email')).'"></td></tr>'."\n";
|
||||||
// Login
|
// Login
|
||||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("Login").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="login" size="20" value="'.dol_escape_htmltag(GETPOST('login')).'"></td></tr>'."\n";
|
print '<tr><td>'.$langs->trans("Login").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="login" maxlength="50" size="20" value="'.dol_escape_htmltag(GETPOST('login')).'"></td></tr>'."\n";
|
||||||
print '<tr><td>'.$langs->trans("Password").' <FONT COLOR="red">*</FONT></td><td><input type="password" name="pass1" size="20" value="'.GETPOST("pass1").'"></td></tr>'."\n";
|
print '<tr><td>'.$langs->trans("Password").' <FONT COLOR="red">*</FONT></td><td><input type="password" maxlength="128" name="pass1" size="20" value="'.GETPOST("pass1").'"></td></tr>'."\n";
|
||||||
print '<tr><td>'.$langs->trans("PasswordAgain").' <FONT COLOR="red">*</FONT></td><td><input type="password" name="pass2" size="20" value="'.GETPOST("pass2").'"></td></tr>'."\n";
|
print '<tr><td>'.$langs->trans("PasswordAgain").' <FONT COLOR="red">*</FONT></td><td><input type="password" maxlength="128" name="pass2" size="20" value="'.GETPOST("pass2").'"></td></tr>'."\n";
|
||||||
}
|
}
|
||||||
// Birthday
|
// Birthday
|
||||||
print '<tr id="trbirth" class="trbirth"><td>'.$langs->trans("DateToBirth").'</td><td>';
|
print '<tr id="trbirth" class="trbirth"><td>'.$langs->trans("DateToBirth").'</td><td>';
|
||||||
|
|||||||
@ -43,6 +43,8 @@ class Dolresource extends CommonObject
|
|||||||
var $type_label;
|
var $type_label;
|
||||||
var $tms='';
|
var $tms='';
|
||||||
|
|
||||||
|
var $oldcopy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
@ -230,85 +232,108 @@ class Dolresource extends CommonObject
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user=null, $notrigger=0)
|
function update($user=null, $notrigger=0)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $hookmanager;
|
global $conf, $langs, $hookmanager;
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
if (isset($this->ref)) $this->ref=trim($this->ref);
|
if (isset($this->ref)) $this->ref=trim($this->ref);
|
||||||
if (isset($this->fk_code_type_resource)) $this->fk_code_type_resource=trim($this->fk_code_type_resource);
|
if (isset($this->fk_code_type_resource)) $this->fk_code_type_resource=trim($this->fk_code_type_resource);
|
||||||
if (isset($this->description)) $this->description=trim($this->description);
|
if (isset($this->description)) $this->description=trim($this->description);
|
||||||
|
|
||||||
// Update request
|
if (empty($this->oldcopy))
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
|
{
|
||||||
$sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").",";
|
$org=new self($this->db);
|
||||||
$sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").",";
|
$org->fetch($this->id);
|
||||||
$sql.= " fk_code_type_resource=".(isset($this->fk_code_type_resource)?"'".$this->db->escape($this->fk_code_type_resource)."'":"null").",";
|
$this->oldcopy=$org;
|
||||||
$sql.= " tms=".(dol_strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null')."";
|
}
|
||||||
$sql.= " WHERE rowid=".$this->id;
|
|
||||||
|
|
||||||
$this->db->begin();
|
// Update request
|
||||||
|
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
|
||||||
|
$sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").",";
|
||||||
|
$sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").",";
|
||||||
|
$sql.= " fk_code_type_resource=".(isset($this->fk_code_type_resource)?"'".$this->db->escape($this->fk_code_type_resource)."'":"null").",";
|
||||||
|
$sql.= " tms=".(dol_strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null')."";
|
||||||
|
$sql.= " WHERE rowid=".$this->id;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
$this->db->begin();
|
||||||
$resql = $this->db->query($sql);
|
|
||||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
|
||||||
|
|
||||||
if (! $error)
|
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||||
{
|
$resql = $this->db->query($sql);
|
||||||
if (! $notrigger)
|
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||||
{
|
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
|
||||||
// want this action calls a trigger.
|
|
||||||
|
|
||||||
//// Call triggers
|
if (! $error)
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
{
|
||||||
$interface=new Interfaces($this->db);
|
if (! $notrigger)
|
||||||
$result=$interface->run_triggers('RESOURCE_MODIFY',$this,$user,$langs,$conf);
|
{
|
||||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
// Call trigger
|
||||||
//// End call triggers
|
$result=$this->call_trigger('RESOURCE_MODIFY',$user);
|
||||||
}
|
if ($result < 0) $error++;
|
||||||
}
|
// End call triggers
|
||||||
if (! $error)
|
}
|
||||||
{
|
}
|
||||||
$action='update';
|
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
if (! $error && (is_object($this->oldcopy) && $this->oldcopy->ref !== $this->ref))
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
{
|
||||||
$hookmanager->initHooks(array('actioncommdao'));
|
// We remove directory
|
||||||
$parameters=array('actcomm'=>$this->id);
|
if (! empty($conf->resource->dir_output))
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
{
|
||||||
if (empty($reshook))
|
$olddir = $conf->resource->dir_output . "/" . dol_sanitizeFileName($this->oldcopy->ref);
|
||||||
{
|
$newdir = $conf->resource->dir_output . "/" . dol_sanitizeFileName($this->ref);
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (file_exists($olddir))
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$res = @rename($olddir, $newdir);
|
||||||
if ($result < 0)
|
if (! $res)
|
||||||
{
|
{
|
||||||
$error++;
|
$langs->load("errors");
|
||||||
}
|
$this->error=$langs->trans('ErrorFailToRenameDir',$olddir,$newdir);
|
||||||
}
|
$error++;
|
||||||
}
|
}
|
||||||
else if ($reshook < 0) $error++;
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Commit or rollback
|
if (! $error)
|
||||||
if ($error)
|
{
|
||||||
{
|
$action='update';
|
||||||
foreach($this->errors as $errmsg)
|
|
||||||
{
|
// Actions on extra fields (by external module or standard code)
|
||||||
dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
|
// TODO le hook fait double emploi avec le trigger !!
|
||||||
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
$hookmanager->initHooks(array('actioncommdao'));
|
||||||
}
|
$parameters=array('actcomm'=>$this->id);
|
||||||
$this->db->rollback();
|
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
return -1*$error;
|
if (empty($reshook))
|
||||||
}
|
{
|
||||||
else
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$result=$this->insertExtraFields();
|
||||||
return 1;
|
if ($result < 0)
|
||||||
}
|
{
|
||||||
}
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ($reshook < 0) $error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Commit or rollback
|
||||||
|
if ($error)
|
||||||
|
{
|
||||||
|
foreach($this->errors as $errmsg)
|
||||||
|
{
|
||||||
|
dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
|
||||||
|
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
||||||
|
}
|
||||||
|
$this->db->rollback();
|
||||||
|
return -1*$error;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load object in memory from database
|
* Load object in memory from database
|
||||||
@ -375,65 +400,84 @@ class Dolresource extends CommonObject
|
|||||||
* @param int $notrigger Disable all triggers
|
* @param int $notrigger Disable all triggers
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function delete($rowid, $notrigger=0)
|
function delete($rowid, $notrigger=0)
|
||||||
{
|
{
|
||||||
global $user,$langs,$conf;
|
global $user,$langs,$conf;
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element;
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||||
$sql.= " WHERE rowid =".$rowid;
|
$sql.= " WHERE rowid =".$rowid;
|
||||||
|
|
||||||
dol_syslog(get_class($this), LOG_DEBUG);
|
dol_syslog(get_class($this), LOG_DEBUG);
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."element_resources";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."element_resources";
|
||||||
$sql.= " WHERE element_type='resource' AND resource_id =".$this->db->escape($rowid);
|
$sql.= " WHERE element_type='resource' AND resource_id =".$this->db->escape($rowid);
|
||||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if (!$resql)
|
if (!$resql)
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Removed extrafields
|
// Removed extrafields
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
$result=$this->deleteExtraFields();
|
$result=$this->deleteExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
dol_syslog(get_class($this)."::delete error -3 ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::delete error -3 ".$this->error, LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $notrigger)
|
if (! $notrigger)
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('RESOURCE_DELETE',$user);
|
$result=$this->call_trigger('RESOURCE_DELETE',$user);
|
||||||
if ($result < 0) $error++;
|
if ($result < 0) $error++;
|
||||||
// End call triggers
|
// End call triggers
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
// We remove directory
|
||||||
return 1;
|
$ref = dol_sanitizeFileName($this->ref);
|
||||||
}
|
if (! empty($conf->resource->dir_output))
|
||||||
else
|
{
|
||||||
{
|
$dir = $conf->resource->dir_output . "/" . dol_sanitizeFileName($this->ref);
|
||||||
$this->db->rollback();
|
if (file_exists($dir))
|
||||||
return -1;
|
{
|
||||||
}
|
$res=@dol_delete_dir_recursive($dir);
|
||||||
}
|
if (! $res)
|
||||||
|
{
|
||||||
|
$this->errors[] = 'ErrorFailToDeleteDir';
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->db->rollback();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load resource objects into $this->lines
|
* Load resource objects into $this->lines
|
||||||
|
|||||||
@ -134,7 +134,7 @@ if ($action == 'setModuleOptions')
|
|||||||
if ($action == 'set')
|
if ($action == 'set')
|
||||||
{
|
{
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label','alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scan_dir','alpha');
|
||||||
|
|
||||||
$type='company';
|
$type='company';
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||||
@ -161,7 +161,7 @@ if ($action== 'del')
|
|||||||
if ($action == 'setdoc')
|
if ($action == 'setdoc')
|
||||||
{
|
{
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label','alpha');
|
||||||
$scandir = GETPOST('scandir','alpha');
|
$scandir = GETPOST('scan_dir','alpha');
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
@ -547,7 +547,7 @@ foreach ($dirsociete as $dirroot)
|
|||||||
print "<td align=\"center\">\n";
|
print "<td align=\"center\">\n";
|
||||||
//if ($conf->global->COMPANY_ADDON_PDF != "$name")
|
//if ($conf->global->COMPANY_ADDON_PDF != "$name")
|
||||||
//{
|
//{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
//}
|
//}
|
||||||
@ -568,7 +568,7 @@ foreach ($dirsociete as $dirroot)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<td align=\"center\">\n";
|
print "<td align=\"center\">\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -140,7 +140,7 @@ if (empty($reshook))
|
|||||||
if (!$errors)
|
if (!$errors)
|
||||||
{
|
{
|
||||||
// TODO Move the merge function into class of object.
|
// TODO Move the merge function into class of object.
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
// Recopy some data
|
// Recopy some data
|
||||||
@ -157,26 +157,29 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
if (empty($object->$property)) $object->$property = $soc_origin->$property;
|
if (empty($object->$property)) $object->$property = $soc_origin->$property;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Concat some data
|
// Concat some data
|
||||||
$listofproperties=array(
|
$listofproperties=array(
|
||||||
'note_public', 'note_private'
|
'note_public', 'note_private'
|
||||||
);
|
);
|
||||||
foreach ($listofproperties as $property)
|
foreach ($listofproperties as $property)
|
||||||
{
|
{
|
||||||
$object->$property = dol_concatdesc($object->$property, $soc_origin->$property);
|
$object->$property = dol_concatdesc($object->$property, $soc_origin->$property);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Merge extrafields
|
// Merge extrafields
|
||||||
foreach ($soc_origin->array_options as $key => $val)
|
if (is_array($soc_origin->array_options))
|
||||||
{
|
{
|
||||||
if (empty($object->array_options[$key])) $object->array_options[$key] = $val;
|
foreach ($soc_origin->array_options as $key => $val)
|
||||||
|
{
|
||||||
|
if (empty($object->array_options[$key])) $object->array_options[$key] = $val;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Merge categories
|
// TODO Merge categories
|
||||||
$object->update($object->id, $user);
|
$object->update($object->id, $user);
|
||||||
|
|
||||||
// Move links
|
// Move links
|
||||||
$objects = array(
|
$objects = array(
|
||||||
'Adherent' => '/adherents/class/adherent.class.php',
|
'Adherent' => '/adherents/class/adherent.class.php',
|
||||||
'Societe' => '/societe/class/societe.class.php',
|
'Societe' => '/societe/class/societe.class.php',
|
||||||
@ -487,7 +490,7 @@ if (empty($reshook))
|
|||||||
if (empty($object->fournisseur)) $object->code_fournisseur='';
|
if (empty($object->fournisseur)) $object->code_fournisseur='';
|
||||||
|
|
||||||
$result = $object->create($user);
|
$result = $object->create($user);
|
||||||
|
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
if ($object->particulier)
|
if ($object->particulier)
|
||||||
@ -557,7 +560,7 @@ if (empty($reshook))
|
|||||||
$object->code_fournisseur = null;
|
$object->code_fournisseur = null;
|
||||||
$object->code_client = null;
|
$object->code_client = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$error=$object->error; $errors=$object->errors;
|
$error=$object->error; $errors=$object->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -852,7 +855,7 @@ else
|
|||||||
$object->particulier = $private;
|
$object->particulier = $private;
|
||||||
$object->prefix_comm = GETPOST('prefix_comm');
|
$object->prefix_comm = GETPOST('prefix_comm');
|
||||||
$object->client = GETPOST('client')?GETPOST('client'):$object->client;
|
$object->client = GETPOST('client')?GETPOST('client'):$object->client;
|
||||||
|
|
||||||
if(empty($duplicate_code_error)) {
|
if(empty($duplicate_code_error)) {
|
||||||
$object->code_client = GETPOST('code_client', 'alpha');
|
$object->code_client = GETPOST('code_client', 'alpha');
|
||||||
$object->fournisseur = GETPOST('fournisseur')?GETPOST('fournisseur'):$object->fournisseur;
|
$object->fournisseur = GETPOST('fournisseur')?GETPOST('fournisseur'):$object->fournisseur;
|
||||||
@ -860,7 +863,7 @@ else
|
|||||||
else {
|
else {
|
||||||
setEventMessages($langs->trans('NewCustomerSupplierCodeProposed'),'', 'warnings');
|
setEventMessages($langs->trans('NewCustomerSupplierCodeProposed'),'', 'warnings');
|
||||||
}
|
}
|
||||||
|
|
||||||
$object->code_fournisseur = GETPOST('code_fournisseur', 'alpha');
|
$object->code_fournisseur = GETPOST('code_fournisseur', 'alpha');
|
||||||
$object->address = GETPOST('address', 'alpha');
|
$object->address = GETPOST('address', 'alpha');
|
||||||
$object->zip = GETPOST('zipcode', 'alpha');
|
$object->zip = GETPOST('zipcode', 'alpha');
|
||||||
@ -1136,7 +1139,7 @@ else
|
|||||||
print '<td colspan="3"><input type="text" name="email" id="email" value="'.$object->email.'"></td></tr>';
|
print '<td colspan="3"><input type="text" name="email" id="email" value="'.$object->email.'"></td></tr>';
|
||||||
print '<tr><td>'.fieldLabel('Web','url').'</td>';
|
print '<tr><td>'.fieldLabel('Web','url').'</td>';
|
||||||
print '<td colspan="3"><input type="text" name="url" id="url" value="'.$object->url.'"></td></tr>';
|
print '<td colspan="3"><input type="text" name="url" id="url" value="'.$object->url.'"></td></tr>';
|
||||||
|
|
||||||
// Skype
|
// Skype
|
||||||
if (! empty($conf->skype->enabled))
|
if (! empty($conf->skype->enabled))
|
||||||
{
|
{
|
||||||
@ -1216,7 +1219,7 @@ else
|
|||||||
print '</td><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td>';
|
print '</td><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td>';
|
||||||
print $form->selectyesno('localtax2assuj_value',(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2)?$conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2:0),1);
|
print $form->selectyesno('localtax2assuj_value',(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2)?$conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2:0),1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
}
|
}
|
||||||
elseif($mysoc->localtax1_assuj=="1")
|
elseif($mysoc->localtax1_assuj=="1")
|
||||||
{
|
{
|
||||||
@ -1230,7 +1233,7 @@ else
|
|||||||
print $form->selectyesno('localtax2assuj_value',(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2)?$conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2:0),1);
|
print $form->selectyesno('localtax2assuj_value',(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2)?$conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2:0),1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Type - Size
|
// Type - Size
|
||||||
print '<tr><td>'.fieldLabel('ThirdPartyType','typent_id').'</td><td class="maxwidthonsmartphone">'."\n";
|
print '<tr><td>'.fieldLabel('ThirdPartyType','typent_id').'</td><td class="maxwidthonsmartphone">'."\n";
|
||||||
$sortparam=(empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label.
|
$sortparam=(empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label.
|
||||||
@ -1751,7 +1754,7 @@ else
|
|||||||
$formcompany->select_localtax(1,$object->localtax1_value, "lt1");
|
$formcompany->select_localtax(1,$object->localtax1_value, "lt1");
|
||||||
print '</span>';
|
print '</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td><td>'.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').'</td><td>';
|
print '</td><td>'.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').'</td><td>';
|
||||||
print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
|
print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
|
||||||
if (! isOnlyOneLocalTax(2))
|
if (! isOnlyOneLocalTax(2))
|
||||||
@ -1761,7 +1764,7 @@ else
|
|||||||
print '</span>';
|
print '</span>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
}
|
}
|
||||||
elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1")
|
elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1")
|
||||||
{
|
{
|
||||||
@ -1774,7 +1777,7 @@ else
|
|||||||
print '</span>';
|
print '</span>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
}
|
}
|
||||||
elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
|
elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
|
||||||
{
|
{
|
||||||
@ -1788,7 +1791,7 @@ else
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// VAT Code
|
// VAT Code
|
||||||
print '<tr><td>'.fieldLabel('VATIntra','intra_vat').'</td>';
|
print '<tr><td>'.fieldLabel('VATIntra','intra_vat').'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
@ -2090,7 +2093,7 @@ else
|
|||||||
print '</td></tr><tr><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td>';
|
print '</td></tr><tr><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td>';
|
||||||
print yn($object->localtax2_assuj);
|
print yn($object->localtax2_assuj);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1)))
|
if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1)))
|
||||||
{
|
{
|
||||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?socid='.$object->id.'">';
|
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?socid='.$object->id.'">';
|
||||||
@ -2144,7 +2147,7 @@ else
|
|||||||
print '<td>'.$object->localtax1_value.'</td>';
|
print '<td>'.$object->localtax1_value.'</td>';
|
||||||
}
|
}
|
||||||
print '</tr></form>';
|
print '</tr></form>';
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
|
elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
|
||||||
@ -2154,7 +2157,7 @@ else
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2)))
|
if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2)))
|
||||||
{
|
{
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?socid='.$object->id.'">';
|
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?socid='.$object->id.'">';
|
||||||
print '<input type="hidden" name="action" value="set_localtax2">';
|
print '<input type="hidden" name="action" value="set_localtax2">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
@ -2167,7 +2170,7 @@ else
|
|||||||
print '<td>'.$object->localtax2_value.'</td>';
|
print '<td>'.$object->localtax2_value.'</td>';
|
||||||
}
|
}
|
||||||
print '</tr></form>';
|
print '</tr></form>';
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -2178,7 +2181,7 @@ else
|
|||||||
print '</td><tr>';
|
print '</td><tr>';
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// VAT Code
|
// VAT Code
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="nowrap">'.$langs->trans('VATIntra').'</td><td>';
|
print '<td class="nowrap">'.$langs->trans('VATIntra').'</td><td>';
|
||||||
@ -2573,10 +2576,10 @@ else
|
|||||||
|
|
||||||
// Subsidiaries list
|
// Subsidiaries list
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_SUBSIDIARIES))
|
if (empty($conf->global->SOCIETE_DISABLE_SUBSIDIARIES))
|
||||||
{
|
{
|
||||||
$result=show_subsidiaries($conf,$langs,$db,$object);
|
$result=show_subsidiaries($conf,$langs,$db,$object);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Contacts list
|
// Contacts list
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -579,7 +579,7 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$productsupplier = new ProductFournisseur($db);
|
$productsupplier = new ProductFournisseur($db);
|
||||||
|
|
||||||
if (empty($conf->global->SUPPLIER_PROPOSAL_WITH_NOPRICEDEFINED))
|
if (empty($conf->global->SUPPLIER_PROPOSAL_WITH_NOPRICEDEFINED)) // TODO this test seems useless
|
||||||
{
|
{
|
||||||
$idprod=0;
|
$idprod=0;
|
||||||
if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...)
|
if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...)
|
||||||
@ -594,8 +594,9 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
elseif (GETPOST('idprodfournprice') > 0)
|
elseif (GETPOST('idprodfournprice') > 0)
|
||||||
{
|
{
|
||||||
//$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qty); // Just to see if a price exists for the quantity. Not used to found vat.
|
//$qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat.
|
||||||
$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), -1); // We force qty to -1 to be sure to find if a supplier price exist
|
$qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist
|
||||||
|
$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch);
|
||||||
$res=$productsupplier->fetch($idprod);
|
$res=$productsupplier->fetch($idprod);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -605,7 +606,7 @@ if (empty($reshook))
|
|||||||
$price_base_type = $productsupplier->fourn_price_base_type;
|
$price_base_type = $productsupplier->fourn_price_base_type;
|
||||||
$type = $productsupplier->type;
|
$type = $productsupplier->type;
|
||||||
$label = $productsupplier->label;
|
$label = $productsupplier->label;
|
||||||
$desc = $productsupplier->description;
|
$desc = $productsupplier->description;
|
||||||
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc);
|
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc);
|
||||||
|
|
||||||
$tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice'));
|
$tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice'));
|
||||||
|
|||||||
@ -43,6 +43,7 @@ if (! empty($conf->projet->enabled))
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
|
||||||
$langs->load('companies');
|
$langs->load('companies');
|
||||||
|
$langs->load('propal');
|
||||||
$langs->load('supplier_proposal');
|
$langs->load('supplier_proposal');
|
||||||
$langs->load('compta');
|
$langs->load('compta');
|
||||||
$langs->load('bills');
|
$langs->load('bills');
|
||||||
@ -322,11 +323,11 @@ if ($result)
|
|||||||
{
|
{
|
||||||
$title = $langs->trans('ListOfProposals');
|
$title = $langs->trans('ListOfProposals');
|
||||||
}
|
}
|
||||||
|
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
|
|
||||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||||
|
|
||||||
$param='';
|
$param='';
|
||||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||||
@ -358,7 +359,7 @@ if ($result)
|
|||||||
if ($user->rights->supplier_proposal->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
|
if ($user->rights->supplier_proposal->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
|
||||||
if ($massaction == 'presend') $arrayofmassactions=array();
|
if ($massaction == 'presend') $arrayofmassactions=array();
|
||||||
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||||
|
|
||||||
// Lignes des champs de filtre
|
// Lignes des champs de filtre
|
||||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
@ -367,13 +368,13 @@ if ($result)
|
|||||||
print '<input type="hidden" name="action" value="list">';
|
print '<input type="hidden" name="action" value="list">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit);
|
||||||
|
|
||||||
if ($massaction == 'presend')
|
if ($massaction == 'presend')
|
||||||
{
|
{
|
||||||
$langs->load("mails");
|
$langs->load("mails");
|
||||||
|
|
||||||
if (! GETPOST('cancel'))
|
if (! GETPOST('cancel'))
|
||||||
{
|
{
|
||||||
$objecttmp=new SupplierProposal($db);
|
$objecttmp=new SupplierProposal($db);
|
||||||
@ -392,17 +393,17 @@ if ($result)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<input type="hidden" name="massaction" value="confirm_presend">';
|
print '<input type="hidden" name="massaction" value="confirm_presend">';
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
$formmail = new FormMail($db);
|
$formmail = new FormMail($db);
|
||||||
|
|
||||||
dol_fiche_head(null, '', '');
|
dol_fiche_head(null, '', '');
|
||||||
|
|
||||||
$topicmail="SendProposalRef";
|
$topicmail="SendProposalRef";
|
||||||
$modelmail="propal_send";
|
$modelmail="propal_send";
|
||||||
|
|
||||||
// Cree l'objet formulaire mail
|
// Cree l'objet formulaire mail
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
$formmail = new FormMail($db);
|
$formmail = new FormMail($db);
|
||||||
@ -455,25 +456,25 @@ if ($result)
|
|||||||
$formmail->substit['__REFCLIENT__']='__REFCLIENT__'; // We want to keep the tag
|
$formmail->substit['__REFCLIENT__']='__REFCLIENT__'; // We want to keep the tag
|
||||||
$formmail->substit['__PERSONALIZED__']='';
|
$formmail->substit['__PERSONALIZED__']='';
|
||||||
$formmail->substit['__CONTACTCIVNAME__']='';
|
$formmail->substit['__CONTACTCIVNAME__']='';
|
||||||
|
|
||||||
// Tableau des parametres complementaires du post
|
// Tableau des parametres complementaires du post
|
||||||
$formmail->param['action']=$action;
|
$formmail->param['action']=$action;
|
||||||
$formmail->param['models']=$modelmail;
|
$formmail->param['models']=$modelmail;
|
||||||
$formmail->param['models_id']=GETPOST('modelmailselected','int');
|
$formmail->param['models_id']=GETPOST('modelmailselected','int');
|
||||||
$formmail->param['id']=join(',',$arrayofselected);
|
$formmail->param['id']=join(',',$arrayofselected);
|
||||||
//$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
|
//$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
|
||||||
|
|
||||||
print $formmail->get_form();
|
print $formmail->get_form();
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sall)
|
if ($sall)
|
||||||
{
|
{
|
||||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||||
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
||||||
}
|
}
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$moreforfilter='';
|
$moreforfilter='';
|
||||||
@ -499,20 +500,20 @@ if ($result)
|
|||||||
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
|
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
|
||||||
else $moreforfilter = $hookmanager->resPrint;
|
else $moreforfilter = $hookmanager->resPrint;
|
||||||
|
|
||||||
if (! empty($moreforfilter))
|
if (! empty($moreforfilter))
|
||||||
{
|
{
|
||||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||||
print $moreforfilter;
|
print $moreforfilter;
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">';
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">';
|
||||||
|
|
||||||
// Fields title
|
// Fields title
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'sp.ref','',$param,'',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'sp.ref','',$param,'',$sortfield,$sortorder);
|
||||||
@ -541,7 +542,7 @@ if ($result)
|
|||||||
$syearvalid = $yearvalid;
|
$syearvalid = $yearvalid;
|
||||||
$formother->select_year($syearvalid,'yearvalid',1, 20, 5);
|
$formother->select_year($syearvalid,'yearvalid',1, 20, 5);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
print '<td class="liste_titre" colspan="1" align="center">';
|
print '<td class="liste_titre" colspan="1" align="center">';
|
||||||
//print $langs->trans('Month').': ';
|
//print $langs->trans('Month').': ';
|
||||||
@ -632,7 +633,7 @@ if ($result)
|
|||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print dol_print_date($db->jdate($obj->date_valid), 'day');
|
print dol_print_date($db->jdate($obj->date_valid), 'day');
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Date delivery
|
// Date delivery
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print dol_print_date($db->jdate($obj->dp), 'day');
|
print dol_print_date($db->jdate($obj->dp), 'day');
|
||||||
@ -686,16 +687,16 @@ if ($result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|
||||||
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
print '</table>'."\n";
|
print '</table>'."\n";
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
|
|
||||||
print '</form>'."\n";
|
print '</form>'."\n";
|
||||||
|
|
||||||
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
|
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -703,18 +704,18 @@ if ($result)
|
|||||||
*/
|
*/
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
||||||
$urlsource.=str_replace('&','&',$param);
|
$urlsource.=str_replace('&','&',$param);
|
||||||
|
|
||||||
$filedir=$diroutputmassaction;
|
$filedir=$diroutputmassaction;
|
||||||
$genallowed=$user->rights->propal->lire;
|
$genallowed=$user->rights->propal->lire;
|
||||||
$delallowed=$user->rights->propal->lire;
|
$delallowed=$user->rights->propal->lire;
|
||||||
|
|
||||||
print $formfile->showdocuments('massfilesarea_proposals','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'','');
|
print $formfile->showdocuments('massfilesarea_proposals','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'','');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<br><a name="show_files"></a><a href="'.$_SERVER["PHP_SELF"].'?show_files=1'.$param.'#show_files">'.$langs->trans("ShowTempMassFilesArea").'</a>';
|
print '<br><a name="show_files"></a><a href="'.$_SERVER["PHP_SELF"].'?show_files=1'.$param.'#show_files">'.$langs->trans("ShowTempMassFilesArea").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user