From f22b1d3678e05d50b77a4d95a2cf6721a5c4dfcd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Apr 2013 03:40:55 +0200 Subject: [PATCH 01/10] Enhance specimens --- htdocs/contact/class/contact.class.php | 7 ++++++- htdocs/societe/class/societe.class.php | 7 +++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 58ddbd4e84d..28e23fd791f 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -75,7 +75,7 @@ class Contact extends CommonObject var $user_login; var $import_key; - var $oldcopy; // To contains a clone of this when we need to save old properties of object + var $oldcopy; // To contains a clone of this when we need to save old properties of object /** @@ -1037,6 +1037,11 @@ class Contact extends CommonObject $this->country = 'France'; $this->email = 'specimen@specimen.com'; + $this->phone_pro = '0909090901'; + $this->phone_perso = '0909090902'; + $this->phone_mobile = '0909090903'; + $this->fax = '0909090909'; + $this->note_public='This is a comment (public)'; $this->note='This is a comment (private)'; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 205e88c8272..24339b08f79 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -140,7 +140,7 @@ class Societe extends CommonObject var $array_options; - var $oldcopy; + var $oldcopy; // To contains a clone of this when we need to save old properties of object /** @@ -251,7 +251,7 @@ class Societe extends CommonObject // Fin appel triggers } else $error++; - + if (! $error) { dol_syslog(get_class($this)."::Create success id=".$this->id); @@ -2585,6 +2585,9 @@ class Societe extends CommonObject $this->email='specimen@specimen.com'; $this->url='http://www.specimen.com'; + $this->phone='0909090901'; + $this->fax='0909090909'; + $this->code_client='CC-'.dol_print_date($now,'dayhourlog'); $this->code_fournisseur='SC-'.dol_print_date($now,'dayhourlog'); $this->capital=10000; From 25ec7eed6d651ca3f2121e85ae36ede7cfa62bb1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Apr 2013 16:14:28 +0200 Subject: [PATCH 02/10] New: Can send email to warn when payment for subscription is payed. --- htdocs/adherents/admin/public.php | 78 +++++++++++++++++++++--------- htdocs/langs/en_US/members.lang | 1 + htdocs/langs/fr_FR/members.lang | 2 +- htdocs/public/paybox/paymentko.php | 26 ++++++++++ htdocs/public/paybox/paymentok.php | 50 +++++++++++++++++++ htdocs/public/paypal/paymentko.php | 25 ++++++++++ htdocs/public/paypal/paymentok.php | 45 +++++++++++++---- 7 files changed, 193 insertions(+), 34 deletions(-) diff --git a/htdocs/adherents/admin/public.php b/htdocs/adherents/admin/public.php index daa5c76554f..1bb11d41c40 100755 --- a/htdocs/adherents/admin/public.php +++ b/htdocs/adherents/admin/public.php @@ -48,11 +48,13 @@ if ($action == 'update') $amount=GETPOST('MEMBER_NEWFORM_AMOUNT'); $editamount=GETPOST('MEMBER_NEWFORM_EDITAMOUNT'); $payonline=GETPOST('MEMBER_NEWFORM_PAYONLINE'); + $email=GETPOST('MEMBER_PAYONLINE_SENDEMAIL'); $res=dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC",$public,'chaine',0,'',$conf->entity); $res=dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT",$amount,'chaine',0,'',$conf->entity); $res=dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT",$editamount,'chaine',0,'',$conf->entity); $res=dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE",$payonline,'chaine',0,'',$conf->entity); + $res=dolibarr_set_const($db, "MEMBER_PAYONLINE_SENDEMAIL",$email,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; @@ -90,22 +92,39 @@ if ($conf->use_javascript_ajax) { print "\n".''."\n"; } @@ -119,7 +138,7 @@ print ''; print ''; print ''; -print ''; +print ''; print "\n"; $var=true; @@ -128,14 +147,14 @@ $var=! $var; print ''; print '\n"; // Type /*$var=! $var; print ''; -print '\n"; */ // Amount $var=! $var; print ''; -print '\n"; // Can edit $var=! $var; print ''; -print '\n"; +if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled)) +{ + // Jump to an online payment page + $var=! $var; + print '\n"; +} + if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled)) { // Jump to an online payment page $var=! $var; - print '\n"; } diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index e1eda16c790..35848399e79 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -202,3 +202,4 @@ MembersStatisticsByProperties=Members statistics by characteristics MembersByNature=Members by nature VATToUseForSubscriptions=VAT rate to use for subscriptions NoVatOnSubscription=No TVA for subscriptions +MEMBER_PAYONLINE_SENDEMAIL=Email to warn when Dolibarr receive a confirmation of a validated payment for subscription diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang index 9a047a30ae6..5cd7890df1e 100644 --- a/htdocs/langs/fr_FR/members.lang +++ b/htdocs/langs/fr_FR/members.lang @@ -207,4 +207,4 @@ MembersStatisticsByProperties=Statistiques des adhérents par caractéristiques MembersByNature=Adhérents par nature VATToUseForSubscriptions=Taux de TVA pour les adhésions NoVatOnSubscription=Pas de TVA sur les adhésions - +MEMBER_PAYONLINE_SENDEMAIL=Email à avertir en cas de retour de paiement validé pour une cotisation diff --git a/htdocs/public/paybox/paymentko.php b/htdocs/public/paybox/paymentko.php index 5afeab8d639..4db0684005b 100644 --- a/htdocs/public/paybox/paymentko.php +++ b/htdocs/public/paybox/paymentko.php @@ -62,6 +62,32 @@ $tracepost = ""; foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n"; dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_paybox'); + +// Send an email +if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fulltag)) +{ + $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL; + $from=$conf->global->MAILING_EMAIL_FROM; + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $mailfile = new CMailFile( + 'New subscription payed', + $sendto, + $from, + 'New subscription payed '.$fulltag + ); + + $result=$mailfile->sendfile(); + if ($result) + { + dol_syslog("EMail sent to ".$sendto); + } + else + { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR); + } +} + + llxHeaderPayBox($langs->trans("PaymentForm")); diff --git a/htdocs/public/paybox/paymentok.php b/htdocs/public/paybox/paymentok.php index 5553956ce82..ebd3c834d09 100644 --- a/htdocs/public/paybox/paymentok.php +++ b/htdocs/public/paybox/paymentok.php @@ -41,6 +41,15 @@ $langs->load("companies"); $langs->load("paybox"); $langs->load("paypal"); +/*$source=GETPOST('source'); +$ref=GETPOST('ref'); +$PAYBOXTOKEN=GETPOST('TOKEN'); +if (empty($PAYBOXTOKEN)) $PAYBOXTOKEN=GETPOST('token'); +$PAYBOXPAYERID=GETPOST('PAYERID'); +if (empty($PAYBOXPAYERID)) $PAYBOXPAYERID=GETPOST('PayerID'); +*/ +$PAYBOXFULLTAG=GETPOST('FULLTAG'); +if (empty($PAYBOXFULLTAG)) $PAYBOXFULLTAG=GETPOST('fulltag'); /* @@ -68,6 +77,47 @@ llxHeaderPayBox($langs->trans("PaymentForm")); print ''."\n"; print '
'."\n"; +// Get on url call +/* +$token = $PAYBOXTOKEN; +*/ +$fulltag = $PAYBOXFULLTAG; +/*$payerID = $PAYBOXPAYERID; +// Set by newpayment.php +$paymentType = $_SESSION['PaymentType']; +$currencyCodeType = $_SESSION['currencyCodeType']; +$FinalPaymentAmt = $_SESSION["Payment_Amount"]; +// From env +$ipaddress = $_SESSION['ipaddress']; + +dol_syslog("Call newpaymentok with token=".$token." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag); +*/ + +// Send an email +if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fulltag)) +{ + $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL; + $from=$conf->global->MAILING_EMAIL_FROM; + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $mailfile = new CMailFile( + 'New subscription payed', + $sendto, + $from, + 'New subscription payed '.$fulltag + ); + + $result=$mailfile->sendfile(); + if ($result) + { + dol_syslog("EMail sent to ".$sendto); + } + else + { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR); + } +} + + print $langs->trans("YourPaymentHasBeenRecorded")."
\n"; if (! empty($conf->global->PAYBOX_MESSAGE_OK)) print $conf->global->PAYBOX_MESSAGE_OK; diff --git a/htdocs/public/paypal/paymentko.php b/htdocs/public/paypal/paymentko.php index 13c4718c361..c6fe53ac7b0 100755 --- a/htdocs/public/paypal/paymentko.php +++ b/htdocs/public/paypal/paymentko.php @@ -71,6 +71,31 @@ foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n"; dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_paypal'); +// Send an email +if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fulltag)) +{ + $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL; + $from=$conf->global->MAILING_EMAIL_FROM; + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $mailfile = new CMailFile( + 'New subscription payed', + $sendto, + $from, + 'New subscription payed '.$fulltag + ); + + $result=$mailfile->sendfile(); + if ($result) + { + dol_syslog("EMail sent to ".$sendto); + } + else + { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR); + } +} + + llxHeaderPaypal($langs->trans("PaymentForm")); diff --git a/htdocs/public/paypal/paymentok.php b/htdocs/public/paypal/paymentok.php index 45cd6f46014..ca11bcb5422 100755 --- a/htdocs/public/paypal/paymentok.php +++ b/htdocs/public/paypal/paymentok.php @@ -81,6 +81,15 @@ if (empty($PAYPAL_API_SIGNATURE)) return -1; } +$source=GETPOST('source'); +$ref=GETPOST('ref'); +$PAYPALTOKEN=GETPOST('TOKEN'); +if (empty($PAYPALTOKEN)) $PAYPALTOKEN=GETPOST('token'); +$PAYPALPAYERID=GETPOST('PAYERID'); +if (empty($PAYPALPAYERID)) $PAYPALPAYERID=GETPOST('PayerID'); +$PAYPALFULLTAG=GETPOST('FULLTAG'); +if (empty($PAYPALFULLTAG)) $PAYPALFULLTAG=GETPOST('fulltag'); + /* * Actions @@ -105,15 +114,6 @@ llxHeaderPaypal($langs->trans("PaymentForm")); print ''."\n"; print '
'."\n"; -$source=GETPOST('source'); -$ref=GETPOST('ref'); -$PAYPALTOKEN=GETPOST('TOKEN'); -if (empty($PAYPALTOKEN)) $PAYPALTOKEN=GETPOST('token'); -$PAYPALPAYERID=GETPOST('PAYERID'); -if (empty($PAYPALPAYERID)) $PAYPALPAYERID=GETPOST('PayerID'); -$PAYPALFULLTAG=GETPOST('FULLTAG'); -if (empty($PAYPALFULLTAG)) $PAYPALFULLTAG=GETPOST('fulltag'); - if ($PAYPALTOKEN) { // Get on url call @@ -129,6 +129,33 @@ if ($PAYPALTOKEN) dol_syslog("Call newpaymentok with token=".$token." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag); + + // Send an email + if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fulltag)) + { + $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL; + $from=$conf->global->MAILING_EMAIL_FROM; + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $mailfile = new CMailFile( + 'New subscription payed', + $sendto, + $from, + 'New subscription payed '.$fulltag + ); + + $result=$mailfile->sendfile(); + if ($result) + { + dol_syslog("EMail sent to ".$sendto); + } + else + { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR); + } + } + + + // Validate record if (! empty($paymentType)) { dol_syslog("We call GetExpressCheckoutDetails"); From d863a0b1bd0c99d85644f2f46dabdffaa4d99301 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Apr 2013 16:21:34 +0200 Subject: [PATCH 03/10] Fix: syntax error --- htdocs/install/mysql/migration/3.3.0-3.4.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index 348698972e9..f83ab168987 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -219,7 +219,7 @@ CREATE TABLE llx_printer_ipp printer_uri varchar(256) NOT NULL, copy int(11) NOT NULL DEFAULT '1', module varchar(16) NOT NULL, - login varchar(32) NOT NULL, + login varchar(32) NOT NULL )ENGINE=innodb; ALTER TABLE llx_socpeople ADD COLUMN ref_ext varchar(128) after entity; From ee2a2f7b484d78d5ac70bd7c77afddad2f49fea2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Apr 2013 16:43:26 +0200 Subject: [PATCH 04/10] Missing space --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3004e8c6398..9e58dfe4e5c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3478,7 +3478,7 @@ class Form // If reset_scripts is not empty, print the button with the reset_scripts in OnClick if ($reset_scripts) { - $retstring.=' '; } From 88858136fc28a7b83ada5a00f8942407a01f2bc8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Apr 2013 17:39:31 +0200 Subject: [PATCH 05/10] New: Enhance agenda module to reach RFC2445 (add busy information). --- ChangeLog | 1 + htdocs/comm/action/class/actioncomm.class.php | 13 +++- htdocs/comm/action/fiche.php | 70 +++++++++++-------- .../install/mysql/migration/3.3.0-3.4.0.sql | 3 + .../install/mysql/tables/llx_actioncomm.sql | 1 + 5 files changed, 57 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9d014f14e97..24f8f332207 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,6 +29,7 @@ For users: and a delay. - New: Can define a different clicktodial setup per user. - New: Add option INVOICE_CAN_NEVER_BE_REMOVED. +- New: Enhance agenda module to reach RFC2445 (add busy information). - First change to prepare feature click to print for PDF. For translators: diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index a6199580353..52620f4445b 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -59,7 +59,7 @@ class ActionComm extends CommonObject var $punctual = 1; // Milestone var $percentage; // Percentage var $location; // Location - + var $transparency; // Transparency (ical standard). Used to say if people assigned to event are busy or not by event. 0=available, 1=busy, 2=busy (refused events) var $priority; // Free text ('' By default) var $note; // Description @@ -121,6 +121,7 @@ class ActionComm extends CommonObject if (empty($this->priority)) $this->priority = 0; if (empty($this->fulldayevent)) $this->fulldayevent = 0; if (empty($this->punctual)) $this->punctual = 0; + if (empty($this->transparency)) $this->transparency = 0; if ($this->percentage > 100) $this->percentage = 100; if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date; if (! empty($this->datep) && ! empty($this->datef)) $this->durationp=($this->datef - $this->datep); @@ -178,6 +179,7 @@ class ActionComm extends CommonObject $sql.= "fk_user_action,"; $sql.= "fk_user_done,"; $sql.= "label,percent,priority,fulldayevent,location,punctual,"; + $sql.= "transparency,"; $sql.= "fk_element,"; $sql.= "elementtype,"; $sql.= "entity"; @@ -196,6 +198,7 @@ class ActionComm extends CommonObject $sql.= (isset($this->usertodo->id) && $this->usertodo->id > 0?"'".$this->usertodo->id."'":"null").","; $sql.= (isset($this->userdone->id) && $this->userdone->id > 0?"'".$this->userdone->id."'":"null").","; $sql.= "'".$this->db->escape($this->label)."','".$this->percentage."','".$this->priority."','".$this->fulldayevent."','".$this->db->escape($this->location)."','".$this->punctual."',"; + $sql.= "'".$this->transparency."',"; $sql.= (! empty($this->fk_element)?$this->fk_element:"null").","; $sql.= (! empty($this->elementtype)?"'".$this->elementtype."'":"null").","; $sql.= $conf->entity; @@ -282,7 +285,7 @@ class ActionComm extends CommonObject $sql.= " a.fk_user_action, a.fk_user_done,"; $sql.= " a.fk_contact, a.percent as percentage,"; $sql.= " a.fk_element, a.elementtype,"; - $sql.= " a.priority, a.fulldayevent, a.location,"; + $sql.= " a.priority, a.fulldayevent, a.location, a.transparency,"; $sql.= " c.id as type_id, c.code as type_code, c.libelle,"; $sql.= " s.nom as socname,"; $sql.= " u.firstname, u.lastname as lastname"; @@ -331,6 +334,7 @@ class ActionComm extends CommonObject $this->priority = $obj->priority; $this->fulldayevent = $obj->fulldayevent; $this->location = $obj->location; + $this->transparency = $obj->transparency; $this->socid = $obj->fk_soc; // To have fetch_thirdparty method working $this->societe->id = $obj->fk_soc; @@ -437,6 +441,7 @@ class ActionComm extends CommonObject $this->note=trim($this->note); if (empty($this->percentage)) $this->percentage = 0; if (empty($this->priority)) $this->priority = 0; + if (empty($this->transparency)) $this->transparency = 0; if (empty($this->fulldayevent)) $this->fulldayevent = 0; if ($this->percentage > 100) $this->percentage = 100; if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date; @@ -471,6 +476,7 @@ class ActionComm extends CommonObject $sql.= ", priority = '".$this->priority."'"; $sql.= ", fulldayevent = '".$this->fulldayevent."'"; $sql.= ", location = ".($this->location ? "'".$this->db->escape($this->location)."'":"null"); + $sql.= ", transparency = '".$this->transparency."'"; $sql.= ", fk_user_mod = '".$user->id."'"; $sql.= ", fk_user_action=".($this->usertodo->id > 0 ? "'".$this->usertodo->id."'":"null"); $sql.= ", fk_user_done=".($this->userdone->id > 0 ? "'".$this->userdone->id."'":"null"); @@ -952,7 +958,7 @@ class ActionComm extends CommonObject $event['priority']=$obj->priority; $event['fulldayevent']=$obj->fulldayevent; $event['location']=$obj->location; - $event['transparency']='TRANSPARENT'; // OPAQUE (busy) or TRANSPARENT (not busy) + $event['transparency']=(($obj->transparency > 0)?'OPAQUE':'TRANSPARENT'); // OPAQUE (busy) or TRANSPARENT (not busy) $event['category']=$obj->libelle; // libelle type action // Define $urlwithroot $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); @@ -1058,6 +1064,7 @@ class ActionComm extends CommonObject $this->punctual=0; $this->percentage=0; $this->location='Location'; + $this->transparency=0; $this->priority='Priority X'; $this->note = 'Note'; } diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 5530c1f02b0..5ed00c1fd6e 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -136,6 +136,7 @@ if ($action == 'add_action') $actioncomm->priority = GETPOST("priority")?GETPOST("priority"):0; $actioncomm->fulldayevent = (! empty($fulldayevent)?1:0); $actioncomm->location = GETPOST("location"); + $actioncomm->transparency = (GETPOST("transparency")=='on'?1:0); $actioncomm->label = trim(GETPOST('label')); if (! GETPOST('label')) { @@ -313,7 +314,7 @@ if ($action == 'update') $actioncomm->percentage = $percentage; $actioncomm->priority = $_POST["priority"]; $actioncomm->fulldayevent= $_POST["fullday"]?1:0; - $actioncomm->location = isset($_POST["location"])?$_POST["location"]:''; + $actioncomm->location = GETPOST('location'); $actioncomm->societe->id = $_POST["socid"]; $actioncomm->contact->id = $_POST["contactid"]; $actioncomm->fk_project = $_POST["projectid"]; @@ -333,6 +334,8 @@ if ($action == 'update') $usertodo->fetch($_POST["affectedto"]); } $actioncomm->usertodo = $usertodo; + $actioncomm->transparency=(GETPOST("transparency")=='on'?1:0); + $userdone=new User($db); if ($_POST["doneby"]) { @@ -509,16 +512,24 @@ if ($action == 'create') print '
'.$langs->trans("Parameter").''.$langs->trans("Value").''.$langs->trans("Value").'
'; print $langs->trans("EnablePublicSubscriptionForm"); -print ''; +print ''; print $form->selectyesno("MEMBER_ENABLE_PUBLIC",(! empty($conf->global->MEMBER_ENABLE_PUBLIC)?$conf->global->MEMBER_ENABLE_PUBLIC:0),1); print "
'; +print '
'; print $langs->trans("EnablePublicSubscriptionForm"); print ''; print $form->selectyesno("forcedate",$conf->global->MEMBER_NEWFORM_FORCETYPE,1); @@ -144,32 +163,43 @@ print "
'; +print '
'; print $langs->trans("DefaultAmount"); -print ''; +print ''; print '';; print "
'; +print '
'; print $langs->trans("CanEditAmount"); -print ''; +print ''; print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT",(! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)?$conf->global->MEMBER_NEWFORM_EDITAMOUNT:0),1); print "
'; + print $langs->trans("MEMBER_NEWFORM_PAYONLINE"); + print ''; + $listofval=array(); + if (! empty($conf->paybox->enabled)) $listofval['paybox']='Paybox'; + if (! empty($conf->paypal->enabled)) $listofval['paypal']='PayPal'; + print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,(! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)?$conf->global->MEMBER_NEWFORM_PAYONLINE:''),1); + print "
'; - print $langs->trans("MEMBER_NEWFORM_PAYONLINE"); - print ''; - $listofval=array(); - if (! empty($conf->paybox->enabled)) $listofval['paybox']='Paybox'; - if (! empty($conf->paypal->enabled)) $listofval['paypal']='PayPal'; - print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,(! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)?$conf->global->MEMBER_NEWFORM_PAYONLINE:''),1); + print '
'; + print $langs->trans("MEMBER_PAYONLINE_SENDEMAIL"); + print ''; + print '';; print "
'; - // Affected by + // Assigned to $var=false; print ''; + // Busy + print ''; + // Realised by - print ''; + if ($conf->global->AGENDA_ENABLE_DONEBY) + { + print ''; + } print '
'.$langs->trans("ActionAffectedTo").''; $form->select_users(GETPOST("affectedto")?GETPOST("affectedto"):(! empty($actioncomm->usertodo->id) && $actioncomm->usertodo->id > 0 ? $actioncomm->usertodo->id : $user->id),'affectedto',1); print '
'.$langs->trans("Busy").''; + print ''; + print '
'.$langs->trans("ActionDoneBy").''; - $form->select_users(GETPOST("doneby")?GETPOST("doneby"):(! empty($actioncomm->userdone->id) && $percent==100?$actioncomm->userdone->id:0),'doneby',1); - print '
'.$langs->trans("ActionDoneBy").''; + $form->select_users(GETPOST("doneby")?GETPOST("doneby"):(! empty($actioncomm->userdone->id) && $percent==100?$actioncomm->userdone->id:0),'doneby',1); + print '
'; print '

'; @@ -745,21 +756,23 @@ if ($id > 0) print '

'; - // Input by - $var=false; - print ''; - - // Affected to - print ''; + // Busy + print ''; + // Realised by - print ''; + if ($conf->global->AGENDA_ENABLE_DONEBY) + { + print ''; + } print '
'.$langs->trans("ActionAskedBy").''; - print $act->author->getNomUrl(1); - print '
'.$langs->trans("ActionAffectedTo").''; + // Assigned to + print '
'.$langs->trans("ActionAffectedTo").''; print $form->select_dolusers($act->usertodo->id>0?$act->usertodo->id:-1,'affectedto',1); print '
'.$langs->trans("Busy").''; + print 'transparency?' checked="checked"':'').'">'; + print '
'.$langs->trans("ActionDoneBy").''; - print $form->select_dolusers($act->userdone->id> 0?$act->userdone->id:-1,'doneby',1); - print '
'.$langs->trans("ActionDoneBy").''; + print $form->select_dolusers($act->userdone->id> 0?$act->userdone->id:-1,'doneby',1); + print '


'; @@ -909,23 +922,24 @@ if ($id > 0) print '

'; - // Input by - $var=false; - print ''; - - // Affecte a - print ''; - // Done by - print ''; + // Done by + if ($conf->global->AGENDA_ENABLE_DONEBY) + { + print ''; + } + print '
'.$langs->trans("ActionAskedBy").''; - if ($act->author->id > 0) print $act->author->getNomUrl(1); - else print ' '; - print '
'.$langs->trans("ActionAffectedTo").''; + // Assigned to + print '
'.$langs->trans("ActionAffectedTo").''; if ($act->usertodo->id > 0) print $act->usertodo->getNomUrl(1); print '
'.$langs->trans("ActionDoneBy").''; - if ($act->userdone->id > 0) print $act->userdone->getNomUrl(1); + // Busy + print '
'.$langs->trans("Busy").''; + print yn(($act->transparency > 0)?1:0); print '
'.$langs->trans("ActionDoneBy").''; + if ($act->userdone->id > 0) print $act->userdone->getNomUrl(1); + print '


'; // Third party - Contact diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index f83ab168987..4910ab463f4 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -227,3 +227,6 @@ ALTER TABLE llx_socpeople ADD COLUMN ref_ext varchar(128) after entity; ALTER TABLE llx_socpeople ADD COLUMN note_public text after note; ALTER TABLE llx_societe ADD COLUMN note_public text after note; +ALTER TABLE llx_actioncomm ADD COLUMN transparency integer after fk_user_action; + + diff --git a/htdocs/install/mysql/tables/llx_actioncomm.sql b/htdocs/install/mysql/tables/llx_actioncomm.sql index ab2183ca262..59b31bcc389 100644 --- a/htdocs/install/mysql/tables/llx_actioncomm.sql +++ b/htdocs/install/mysql/tables/llx_actioncomm.sql @@ -45,6 +45,7 @@ create table llx_actioncomm fk_parent integer NOT NULL default 0, fk_user_action integer, -- id de la personne qui doit effectuer l'action + transparency integer, -- transparency (ical standard). used to say if people assigned to event are busy or not by event. fk_user_done integer, -- id de la personne qui a effectue l'action priority smallint, fulldayevent smallint NOT NULL default 0, From eaab6d0caa4983d30a5907af8d7e0338bff13c72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Apr 2013 18:51:07 +0200 Subject: [PATCH 06/10] Trans: For peru, IVA is IGV --- htdocs/langs/es_PU/admin.lang | 13 +++++++++++++ htdocs/langs/es_PU/bills.lang | 10 ++++++++++ htdocs/langs/es_PU/companies.lang | 4 ++++ htdocs/langs/es_PU/compta.lang | 26 ++++++++++++++++++++++++++ htdocs/langs/es_PU/main.lang | 10 ++++++++++ htdocs/langs/es_PU/propal.lang | 3 +++ 6 files changed, 66 insertions(+) create mode 100644 htdocs/langs/es_PU/admin.lang create mode 100644 htdocs/langs/es_PU/bills.lang create mode 100644 htdocs/langs/es_PU/companies.lang create mode 100644 htdocs/langs/es_PU/compta.lang create mode 100644 htdocs/langs/es_PU/main.lang create mode 100644 htdocs/langs/es_PU/propal.lang diff --git a/htdocs/langs/es_PU/admin.lang b/htdocs/langs/es_PU/admin.lang new file mode 100644 index 00000000000..f71f1e2a171 --- /dev/null +++ b/htdocs/langs/es_PU/admin.lang @@ -0,0 +1,13 @@ +# Dolibarr language file - es_PU - admin +CHARSET=UTF-8 +Permission91=Consultar impuestos e IGV +Permission92=Crear/modificar impuestos e IGV +Permission93=Eliminar impuestos e IGV +DictionnaryVAT=Tasa de IGV (Impuesto sobre ventas en EEUU) +VATManagement=Gestión IGV +VATIsUsedDesc=El tipo de IGV propuesto por defecto en las creaciones de presupuestos, facturas, pedidos, etc. Responde a la siguiente regla:
Si el vendedor no está sujeto a IVU, IVU por defecto=0. Final de regla.
Si el país del vendedor= país del comprador entonces IVU por defecto=IVU del producto vendido. Final de regla.
Si vendedor y comprador residen en la Comunidad Europea y el bien vendido= nuevo medio de transportes (auto, barco, avión), IVU por defecto=0 (el IVU debe ser pagado por comprador a la hacienda pública de su país y no al vendedor). Final de regla
Si vendedor y comprador residen en la Comunidad Europea y comprador= particular o empresa sin NIF intracomunitario entonces IVU por defecto=IVU del producto vendido. Final de regla.
Si vendedor y comprador residen en la Comunidad Europea y comprador= empresa con NIF intracomunitario entonces IVU por defecto=0. Final de regla.
Si no, IVU propuesto por defecto=0. Final de regla.
+VATIsNotUsedDesc=El tipo de IGV propuesto por defecto es 0. Este es el caso de asociaciones, particulares o algunas pequeñas sociedades. +UnitPriceOfProduct=Precio unitario sin IGV de un producto +OptionVatMode=Opción de carga de IGV +OptionVatDefaultDesc=La carga del IGV es:
-en el envío de los bienes (en la práctica se usa la fecha de la factura)
-sobre el pago por los servicios +OptionVatDebitOptionDesc=La carga del IGV es:
-en el envío de los bienes (en la práctica se usa la fecha de la factura)
-sobre la facturación de los servicios diff --git a/htdocs/langs/es_PU/bills.lang b/htdocs/langs/es_PU/bills.lang new file mode 100644 index 00000000000..6a707aed164 --- /dev/null +++ b/htdocs/langs/es_PU/bills.lang @@ -0,0 +1,10 @@ +# Dolibarr language file - es_PU - bills +CHARSET=UTF-8 +ErrorVATIntraNotConfigured=Número de IGV intracomunitario aún no configurado +ConfirmClassifyPaidPartiallyReasonDiscountNoVat=El resto a pagar (%s %s) es un descuento acordado después de la factura. Acepto perder el IGV de este descuento +AmountOfBillsByMonthHT=Importe de las facturas por mes (Sin IGV) +IntracommunityVATNumber=Número de IGV intracomunitario +VATIsNotUsedForInvoice=* IGV no aplicable art-293B del CGI +PDFBerniqueDescription=Modelo para las facturas con varios tipos de IGV, incluido también el número de IGV Intracomunitario +PDFCrabeDescription=Modelo de factura completo (IGV, método de pago a mostrar, logotipo...) +PDFOursinDescription=Modelo de factura completo (IGV, métodos de pago, entregas, nombre del proyecto, referencias de presupuesto, logotipo...) diff --git a/htdocs/langs/es_PU/companies.lang b/htdocs/langs/es_PU/companies.lang new file mode 100644 index 00000000000..81d0eff2c55 --- /dev/null +++ b/htdocs/langs/es_PU/companies.lang @@ -0,0 +1,4 @@ +# Dolibarr language file - es_PU - companies +CHARSET=UTF-8 +VATIsUsed=Sujeto a IGV +VATIsNotUsed=No sujeto a IGV \ No newline at end of file diff --git a/htdocs/langs/es_PU/compta.lang b/htdocs/langs/es_PU/compta.lang new file mode 100644 index 00000000000..9a7218a5a41 --- /dev/null +++ b/htdocs/langs/es_PU/compta.lang @@ -0,0 +1,26 @@ +# Dolibarr language file - es_PU - compta +CHARSET=UTF-8 +VATToPay=IGV ventas +VATReceived=IGV repercutido +VATToCollect=IGV compras +VATSummary=Balance de IGV +VATPaid=IGV Pagado +VATCollected=IGV recuperado +PaymentVat=Pago IGV +NewVATPayment=Nuevo pago de IGV +VATPayment=Pago IGV +VATPayments=Pagos IGV +SocialContributionsPayments=Pagos cargas sociales +ShowVatPayment=Ver pagos IGV +TotalVATReceived=Total IGV percibido +RulesResultDue=- Los importes mostrados son importes totales
- Incluye las facturas, cargas e IGV debidos, que estén pagadas o no.
- Se basa en la fecha de validación para las facturas y el IGV y en la fecha de vencimiento para las cargas.
+RulesResultInOut=- Los importes mostrados son importes totales
- Incluye los pagos realizados para las facturas, cargas e IGV.
- Se basa en la fecha de pago de las mismas.
+VATReportByCustomersInInputOutputMode=Informe por cliente del IGV repercutido y pagado (IGV pagado) +VATReportByCustomersInDueDebtMode=Informe por cliente del IGV repercutido y pagado (IGV debido) +VATReportByQuartersInInputOutputMode=Informe por tasa del IGV repercutido y pagado (IGV pagado) +VATReportByQuartersInDueDebtMode=Informe por tasa del IGV repercutido y pagado (IGV debido) +SeeVATReportInInputOutputMode=Ver el informe %sIGV pagado%s para un modo de cálculo estandard +SeeVATReportInDueDebtMode=Ver el informe %sIGV debido%s para un modo de cálculo con la opción sobre lo debido +RulesVATIn=- Para los servicios, el informe incluye el IGV de los pagos efectivamente recibidos o emitidos basándose en la fecha del pago.
- Para los bienes materiales, incluye el IGV de las facturas basándose en la fecha de la factura. +RulesVATDue=- Para los servicios, el informe incluye el IGV de las facturas debidas, pagadas o no basándose en la fecha de estas facturas.
- Para los bienes materiales, incluye el IGV de las facturas basándose en la fecha de la factura. +COMPTA_VAT_ACCOUNT=Código contable por defecto para el IGV (si no está definido en el diccionario "Tasas de IGV") diff --git a/htdocs/langs/es_PU/main.lang b/htdocs/langs/es_PU/main.lang new file mode 100644 index 00000000000..db48b924a4c --- /dev/null +++ b/htdocs/langs/es_PU/main.lang @@ -0,0 +1,10 @@ +Dolibarr language file - es_PU - main +CHARSET=UTF-8 +DIRECTION=ltr +AmountVAT=Importe IGV +TotalVAT=Total IGV +IncludedVAT=IGV incluido +HT=Sin IGV +TTC=IGV incluido +VAT=IGV +VATRate=Tasa IGV \ No newline at end of file diff --git a/htdocs/langs/es_PU/propal.lang b/htdocs/langs/es_PU/propal.lang new file mode 100644 index 00000000000..6ca55b3afbf --- /dev/null +++ b/htdocs/langs/es_PU/propal.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - es_PU - propal +CHARSET=UTF-8 +AmountOfProposalsByMonthHT=Importe por mes (Sin IGV) \ No newline at end of file From 4e5a71fb221960937a082705efea8d96d3fa5e5c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Apr 2013 18:59:22 +0200 Subject: [PATCH 07/10] New: Add local and vat rate for peru --- htdocs/install/mysql/data/llx_00_c_pays.sql | 4 ++-- htdocs/install/mysql/data/llx_c_tva.sql | 4 ++++ htdocs/langs/{es_PU => es_PE}/admin.lang | 0 htdocs/langs/{es_PU => es_PE}/bills.lang | 0 htdocs/langs/{es_PU => es_PE}/companies.lang | 0 htdocs/langs/{es_PU => es_PE}/compta.lang | 0 htdocs/langs/{es_PU => es_PE}/main.lang | 0 htdocs/langs/{es_PU => es_PE}/propal.lang | 0 8 files changed, 6 insertions(+), 2 deletions(-) rename htdocs/langs/{es_PU => es_PE}/admin.lang (100%) rename htdocs/langs/{es_PU => es_PE}/bills.lang (100%) rename htdocs/langs/{es_PU => es_PE}/companies.lang (100%) rename htdocs/langs/{es_PU => es_PE}/compta.lang (100%) rename htdocs/langs/{es_PU => es_PE}/main.lang (100%) rename htdocs/langs/{es_PU => es_PE}/propal.lang (100%) diff --git a/htdocs/install/mysql/data/llx_00_c_pays.sql b/htdocs/install/mysql/data/llx_00_c_pays.sql index 990aa15aa52..37fc7043252 100644 --- a/htdocs/install/mysql/data/llx_00_c_pays.sql +++ b/htdocs/install/mysql/data/llx_00_c_pays.sql @@ -207,12 +207,12 @@ insert into llx_c_pays (rowid,code,libelle) values (172, 'MP', 'Mariannes du Nor insert into llx_c_pays (rowid,code,libelle) values (173, 'NO', 'Norvège' ); insert into llx_c_pays (rowid,code,libelle) values (174, 'OM', 'Oman' ); insert into llx_c_pays (rowid,code,libelle) values (175, 'PK', 'Pakistan' ); -insert into llx_c_pays (rowid,code,libelle) values (176, 'PW', 'Palaos' ); +insert into llx_c_pays (rowid,code,libelle) values (176, 'PW', 'Palaos' ); insert into llx_c_pays (rowid,code,libelle) values (177, 'PS', 'Territoire Palestinien Occupé'); insert into llx_c_pays (rowid,code,libelle) values (178, 'PA', 'Panama' ); insert into llx_c_pays (rowid,code,libelle) values (179, 'PG', 'Papouasie-Nouvelle-Guinée'); insert into llx_c_pays (rowid,code,libelle) values (180, 'PY', 'Paraguay' ); -insert into llx_c_pays (rowid,code,libelle) values (181, 'PE', 'Pérou' ); +insert into llx_c_pays (rowid,code,libelle) values (181, 'PE', 'Peru' ); insert into llx_c_pays (rowid,code,libelle) values (182, 'PH', 'Philippines' ); insert into llx_c_pays (rowid,code,libelle) values (183, 'PN', 'Iles Pitcairn' ); insert into llx_c_pays (rowid,code,libelle) values (184, 'PL', 'Pologne' ); diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index 7cc8c36549e..33b5e84a563 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -165,6 +165,10 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (17 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1733, 173, '8','0','VAT reduced rate', 1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1734, 173, '0','0','VAT Rate 0', 1); +-- PERU (id country=181) +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1841, 181, '18','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1843, 181, '0','0','VAT Rate 0',1); + -- POLAND (id country=184) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1841, 184, '20','0','VAT standard rate',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1842, 184, '7','0','VAT reduced rate',1); diff --git a/htdocs/langs/es_PU/admin.lang b/htdocs/langs/es_PE/admin.lang similarity index 100% rename from htdocs/langs/es_PU/admin.lang rename to htdocs/langs/es_PE/admin.lang diff --git a/htdocs/langs/es_PU/bills.lang b/htdocs/langs/es_PE/bills.lang similarity index 100% rename from htdocs/langs/es_PU/bills.lang rename to htdocs/langs/es_PE/bills.lang diff --git a/htdocs/langs/es_PU/companies.lang b/htdocs/langs/es_PE/companies.lang similarity index 100% rename from htdocs/langs/es_PU/companies.lang rename to htdocs/langs/es_PE/companies.lang diff --git a/htdocs/langs/es_PU/compta.lang b/htdocs/langs/es_PE/compta.lang similarity index 100% rename from htdocs/langs/es_PU/compta.lang rename to htdocs/langs/es_PE/compta.lang diff --git a/htdocs/langs/es_PU/main.lang b/htdocs/langs/es_PE/main.lang similarity index 100% rename from htdocs/langs/es_PU/main.lang rename to htdocs/langs/es_PE/main.lang diff --git a/htdocs/langs/es_PU/propal.lang b/htdocs/langs/es_PE/propal.lang similarity index 100% rename from htdocs/langs/es_PU/propal.lang rename to htdocs/langs/es_PE/propal.lang From 7e46a74facae394b40d10a810c0c41e4ec835a55 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Apr 2013 13:44:04 +0200 Subject: [PATCH 08/10] Fix: Remove warnings --- htdocs/install/upgrade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 811f41f64e8..69168ff2425 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -378,12 +378,12 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) $modulesfile = array(); foreach ($conf->file->dol_document_root as $type => $dirroot) { - $handlemodule=@opendir($dirroot); + $handlemodule=@opendir($dirroot); // $dirroot may be '..' if (is_resource($handlemodule)) { while (($filemodule = readdir($handlemodule))!==false) { - if (is_dir($dirroot.'/'.$filemodule.'/sql')) + if (! preg_match('/\./',$filemodule) && is_dir($dirroot.'/'.$filemodule.'/sql')) // We exclude filemodule that contains . (are not directories) and are not directories. { //print "Scan for ".$dirroot . '/' . $filemodule . '/sql/'.$file; if (is_file($dirroot . '/' . $filemodule . '/sql/'.$file)) From 87b50f9ced37cdcf926993730bd1325868c42cf0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Apr 2013 14:36:22 +0200 Subject: [PATCH 09/10] Fix: Can't reset payment due date --- htdocs/fourn/facture/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index a73ab937e01..3d984757072 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -198,7 +198,7 @@ elseif ($action == 'setdate_lim_reglement' && $user->rights->fournisseur->factur { $object->fetch($id); $object->date_echeance=dol_mktime(12,0,0,$_POST['date_lim_reglementmonth'],$_POST['date_lim_reglementday'],$_POST['date_lim_reglementyear']); - if ($object->date_echeance < $object->date) + if (! empty($object->date_echeance) && $object->date_echeance < $object->date) { $object->date_echeance=$object->date; setEventMessage($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"),'warnings'); From fafd4269032da024d92027dfbe2bc97c056ebea2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Apr 2013 14:40:13 +0200 Subject: [PATCH 10/10] Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment --- htdocs/core/boxes/box_factures_fourn.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 5fbb2f62a87..458d9a66bca 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -86,7 +86,7 @@ class box_factures_fourn extends ModeleBoxes $now=dol_now(); $i = 0; - $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)'; + $l_due_date = $langs->trans('Late').' ('.$langs->trans('DateEcheance').': %s)'; while ($i < $num) { @@ -95,7 +95,7 @@ class box_factures_fourn extends ModeleBoxes $datec=$db->jdate($objp->datec); $late = ''; - if ($objp->paye == 0 && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dol_print_date($datelimite,'day'))); + if ($objp->paye == 0 && $datelimite && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dol_print_date($datelimite,'day'))); $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg,