From df0ec95b22d43fffa54e2c6894d74d09860c6a35 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Oct 2018 21:21:10 +0200 Subject: [PATCH 1/5] Code comment and better error message --- htdocs/expedition/card.php | 6 +++--- htdocs/install/repair.php | 9 +++++---- htdocs/product/stock/class/productlot.class.php | 8 ++++---- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 0b03f8fc608..49bded5a45b 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -504,7 +504,7 @@ if (empty($reshook)) // Action update else if ( - ($action == 'settracking_number' + ($action == 'settracking_number' || $action == 'settracking_url' || $action == 'settrueWeight' || $action == 'settrueWidth' @@ -1503,11 +1503,11 @@ if ($action == 'create') print ''; print ''; - //print $line->fk_product.' - '.$dbatch->batch; + //print '|'.$line->fk_product.'|'.$dbatch->batch.'|
'; print $langs->trans("Batch").': '; $result = $productlotObject->fetch(0, $line->fk_product, $dbatch->batch); if ($result > 0) print $productlotObject->getNomUrl(1); - else print 'TableLotIncompleteRunRepair'; + else print 'TableLotIncompleteRunRepairWithParamStandardEqualConfirmed'; print ' ('.$dbatch->qty.')'; $quantityToBeDelivered -= $deliverableQty; if ($quantityToBeDelivered < 0) diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 1ad1beca350..1fbda8e8abb 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -811,7 +811,7 @@ if ($ok && GETPOST('clean_product_stock_batch','alpha')) } -// clean_linked_elements: Check and clean linked elements +// clean_product_stock_negative_if_batch if ($ok && GETPOST('clean_product_stock_negative_if_batch','alpha')) { print '
Clean table product_batch, methodtofix='.$methodtofix.' (possible values: updatestock or updatebatch)'; @@ -835,12 +835,13 @@ if ($ok && GETPOST('clean_product_stock_negative_if_batch','alpha')) $obj=$db->fetch_object($resql); print ''.$obj->rowid.'-'.$obj->ref.'-'.$obj->fk_entrepot.' -> '.$obj->psrowid.': '.$obj->reel.' != '.$obj->reelbatch; + // TODO } } } } -// clean_linked_elements: Check and clean linked elements +// set_empty_time_spent_amount if ($ok && GETPOST('set_empty_time_spent_amount','alpha')) { print '
*** Set value of time spent without amount'; @@ -901,7 +902,7 @@ if ($ok && GETPOST('set_empty_time_spent_amount','alpha')) } -// clean_old_module_entries: Clean data into const when files of module were removed without being +// force_disable_of_modules_not_found if ($ok && GETPOST('force_disable_of_modules_not_found','alpha')) { print '
*** Force modules not found to be disabled (only modules adding js, css or hooks can be detected as removed)'; @@ -1072,7 +1073,7 @@ if ($ok && GETPOST('clean_perm_table','alpha')) -// clean_linked_elements: Check and clean linked elements +// force utf8 on tables if ($ok && GETPOST('force_utf8_on_tables','alpha')) { print '
*** Force page code and collation of tables into utf8/utf8_unicode_ci (for mysql/mariadb only)'; diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 8370e8ce080..2ac89def512 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -166,7 +166,7 @@ class Productlot extends CommonObject $error++; } } - + if (! $error && ! $notrigger) { // Uncomment this and change MYOBJECT to your own tag if you // want this action to call a trigger. @@ -234,7 +234,7 @@ class Productlot extends CommonObject //$this->ref = $obj->fk_product.'_'.$obj->batch; $this->batch = $obj->batch; - $this->entity = (!empty($obj->entity)?$obj->entity:$conf->entity); // Prevent "null" entity + $this->entity = (!empty($obj->entity)?$obj->entity:$conf->entity); // Prevent "null" entity $this->fk_product = $obj->fk_product; $this->eatby = $this->db->jdate($obj->eatby); $this->sellby = $this->db->jdate($obj->sellby); @@ -300,7 +300,7 @@ class Productlot extends CommonObject // Check parameters // Put here code to add a control on parameters values - + if (empty($this->oldcopy)) { $org=new self($this->db); @@ -340,7 +340,7 @@ class Productlot extends CommonObject $error++; } } - + if (!$error && !$notrigger) { // Uncomment this and change MYOBJECT to your own tag if you // want this action calls a trigger. From 2539f0047fdbd4865427cb7bb481c4e7b85b1378 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Oct 2018 23:10:39 +0200 Subject: [PATCH 2/5] FIX Sending of reminder for expired subscriptions --- htdocs/adherents/class/adherent.class.php | 202 ++++++++++++---------- htdocs/core/lib/functions.lib.php | 9 +- htdocs/langs/en_US/members.lang | 4 +- 3 files changed, 122 insertions(+), 93 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index a7d350e971d..833afff415d 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -79,7 +79,6 @@ class Adherent extends CommonObject var $datec; var $datem; - var $datefin; var $datevalid; var $birth; @@ -95,6 +94,8 @@ class Adherent extends CommonObject var $fk_soc; + var $datefin; // From member table + // Fields loaded by fetch_subscriptions() var $first_subscription_date; var $first_subscription_amount; @@ -1188,11 +1189,9 @@ class Adherent extends CommonObject /** - * Fonction qui recupere pour un adherent les parametres - * first_subscription_date - * first_subscription_amount - * last_subscription_date - * last_subscription_amount + * Function to get member subscriptions data + * first_subscription_date, first_subscription_date_start, first_subscription_date_end, first_subscription_amount + * last_subscription_date, last_subscription_date_start, last_subscription_date_end, last_subscription_amount * * @return int <0 si KO, >0 si OK */ @@ -1222,11 +1221,15 @@ class Adherent extends CommonObject { if ($i==0) { - $this->first_subscription_date=$obj->dateh; - $this->first_subscription_amount=$obj->subscription; + $this->first_subscription_date=$this->db->jdate($obj->datec); + $this->first_subscription_date_start=$this->db->jdate($obj->dateh); + $this->first_subscription_date_end=$this->db->jdate($obj->datef); + $this->first_subscription_amount=$this->db->jdate($obj->subscription); } - $this->last_subscription_date=$obj->dateh; - $this->last_subscription_amount=$obj->subscription; + $this->last_subscription_date=$this->db->jdate($obj->datec); + $this->last_subscription_date_start=$this->db->jdate($obj->datef); + $this->last_subscription_date_end=$this->db->jdate($obj->datef); + $this->last_subscription_amount=$this->db->jdate($obj->subscription); $subscription=new Subscription($this->db); $subscription->id=$obj->rowid; @@ -1310,9 +1313,9 @@ class Adherent extends CommonObject { // Change properties of object (used by triggers) $this->last_subscription_date=dol_now(); - $this->last_subscription_amount=$amount; $this->last_subscription_date_start=$date; $this->last_subscription_date_end=$datefin; + $this->last_subscription_amount=$amount; } if (! $error) @@ -2241,8 +2244,13 @@ class Adherent extends CommonObject $this->need_subscription=0; $this->first_subscription_date=time(); + $this->first_subscription_date_start=$this->first_subscription_date; + $this->first_subscription_date_end=dol_time_plus_duree($this->first_subscription_date_start, 1, 'y'); $this->first_subscription_amount=10; - $this->last_subscription_date=time(); + + $this->last_subscription_date=$this->first_subscription_date; + $this->last_subscription_date_start=$this->first_subscription_date; + $this->last_subscription_date_end=dol_time_plus_duree($this->last_subscription_date_start, 1, 'y'); $this->last_subscription_amount=10; } @@ -2542,10 +2550,10 @@ class Adherent extends CommonObject * Send reminders by emails before subscription end * CAN BE A CRON TASK * - * @param int $daysbeforeend Nb of days before end of subscription (negative number = after subscription) - * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) + * @param string $daysbeforeendlist Nb of days before end of subscription (negative number = after subscription). Can be a list of delay, separated by a semicolon, for example '10;5;0;-5' + * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) */ - public function sendReminderForExpiredSubscription($daysbeforeend=10) + public function sendReminderForExpiredSubscription($daysbeforeendlist='10') { global $conf, $langs, $mysoc, $user; @@ -2563,96 +2571,110 @@ class Adherent extends CommonObject }*/ $now = dol_now(); + $nbok = 0; + $nbko = 0; - dol_syslog(__METHOD__, LOG_DEBUG); - - $tmp=dol_getdate($now); - $datetosearchfor = dol_time_plus_duree(dol_mktime(0, 0, 0, $tmp['mon'], $tmp['mday'], $tmp['year']), -1 * $daysbeforeend, 'd'); - - $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'adherent'; - $sql.= " WHERE datefin = '".$this->db->idate($datetosearchfor)."'"; - - $resql = $this->db->query($sql); - if ($resql) + $arraydaysbeforeend=explode(';',$daysbeforeendlist); + foreach($arraydaysbeforeend as $daysbeforeend) // Loop on each delay { - $num_rows = $this->db->num_rows($resql); + dol_syslog(__METHOD__.' - Process delta = '.$daysbeforeend, LOG_DEBUG); - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $adherent = new Adherent($this->db); - $formmail = new FormMail($this->db); - - $i=0; - $nbok = 0; - $nbko = 0; - while ($i < $num_rows) + if (! is_numeric($daysbeforeend)) { - $obj = $this->db->fetch_object($resql); + $blockingerrormsg="Value for delta is not a positive or negative numeric"; + $nbko++; + break; + } - $adherent->fetch($obj->rowid); + $tmp=dol_getdate($now); + $datetosearchfor = dol_time_plus_duree(dol_mktime(0, 0, 0, $tmp['mon'], $tmp['mday'], $tmp['year']), $daysbeforeend, 'd'); - if (empty($adherent->email)) + $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'adherent'; + $sql.= " WHERE datefin = '".$this->db->idate($datetosearchfor)."'"; + + $resql = $this->db->query($sql); + if ($resql) + { + $num_rows = $this->db->num_rows($resql); + + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $adherent = new Adherent($this->db); + $formmail = new FormMail($this->db); + + $i=0; + while ($i < $num_rows) { - $nbko++; - } - else - { - $adherent->fetch_thirdparty(); + $obj = $this->db->fetch_object($resql); - // Send reminder email - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang); - $outputlangs->loadLangs(array("main", "members")); - dol_syslog("sendReminderForExpiredSubscription Language set to ".$outputlangs->defaultlang); + $adherent->fetch($obj->rowid, '', '', '', true, true); - $arraydefaultmessage=null; - $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION; - - if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($this->db, 'member', $user, $outputlangs, 0, 1, $labeltouse); - - if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + if (empty($adherent->email)) { - $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $adherent); - //if (is_array($adherent->thirdparty)) $substitutionarraycomp = ... - complete_substitutions_array($substitutionarray, $outputlangs, $adherent); - - $subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs); - $msg = make_substitutions($arraydefaultmessage->content, $substitutionarray, $outputlangs); - $from = $conf->global->ADHERENT_MAIL_FROM; - $to = $adherent->email; - - $trackid = 'mem'.$adherent->id; - $moreinheader='X-Dolibarr-Info: sendReminderForExpiredSubscription'."\r\n"; - - include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $cmail = new CMailFile($subject, $to, $from, $msg, array(), array(), array(), '', '', 0, 1, '', '', $trackid, $moreinheader); - $result = $cmail->sendfile(); - if (! $result) - { - $error++; - $this->error = $cmail->error; - $this->errors += $cmail->errors; - $nbko++; - } - else - { - $nbok++; - } + $nbko++; } else { - $blockingerrormsg="Can't find email template, defined into member module setup, to use for reminding"; - $nbko++; - break; - } - } + $adherent->fetch_thirdparty(); - $i++; + // Send reminder email + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang); + $outputlangs->loadLangs(array("main", "members")); + dol_syslog("sendReminderForExpiredSubscription Language set to ".$outputlangs->defaultlang); + + $arraydefaultmessage=null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION; + + if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($this->db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + + if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + { + $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $adherent); + //if (is_array($adherent->thirdparty)) $substitutionarraycomp = ... + complete_substitutions_array($substitutionarray, $outputlangs, $adherent); + + $subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs); + $msg = make_substitutions($arraydefaultmessage->content, $substitutionarray, $outputlangs); + $from = $conf->global->ADHERENT_MAIL_FROM; + $to = $adherent->email; + + $trackid = 'mem'.$adherent->id; + $moreinheader='X-Dolibarr-Info: sendReminderForExpiredSubscription'."\r\n"; + + include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $cmail = new CMailFile($subject, $to, $from, $msg, array(), array(), array(), '', '', 0, 1, '', '', $trackid, $moreinheader); + $result = $cmail->sendfile(); + if (! $result) + { + $error++; + $this->error = $cmail->error; + $this->errors += $cmail->errors; + $nbko++; + } + else + { + $nbok++; + + // TODO Add event email sent for member + + } + } + else + { + $blockingerrormsg="Can't find email template, defined into member module setup, to use for reminding"; + $nbko++; + break; + } + } + + $i++; + } + } + else + { + $this->error = $this->db->lasterror(); + return 1; } - } - else - { - $this->error = $this->db->lasterror(); - return 1; } if ($blockingerrormsg) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 512a4158ef0..abb069d6fce 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5938,6 +5938,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $substitutionarray['__THIRDPARTY_ID__'] = '__THIRDPARTY_ID__'; $substitutionarray['__THIRDPARTY_NAME__'] = '__THIRDPARTY_NAME__'; + $substitutionarray['__THIRDPARTY_NAME_ALIAS__'] = '__THIRDPARTY_NAME_ALIAS__'; $substitutionarray['__THIRDPARTY_EMAIL__'] = '__THIRDPARTY_EMAIL__'; if (is_object($object) && $object->element == 'member') @@ -6000,6 +6001,12 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $substitutionarray['__MEMBER_PHONE__']=$msgishtml?dol_htmlentitiesbr($object->phone):$object->phone; $substitutionarray['__MEMBER_PHONEPRO__']=$msgishtml?dol_htmlentitiesbr($object->phone_perso):$object->phone_perso; $substitutionarray['__MEMBER_PHONEMOBILE__']=$msgishtml?dol_htmlentitiesbr($object->phone_mobile):$object->phone_mobile; + $substitutionarray['__MEMBER_FIRST_SUBSCRIPTION_DATE__'] = dol_print_date($object->first_subscription_date, 'dayrfc'); + $substitutionarray['__MEMBER_FIRST_SUBSCRIPTION_DATE_START__'] = dol_print_date($object->first_subscription_date_start, 'dayrfc'); + $substitutionarray['__MEMBER_FIRST_SUBSCRIPTION_DATE_END__'] = dol_print_date($object->first_subscription_date_end, 'dayrfc'); + $substitutionarray['__MEMBER_LAST_SUBSCRIPTION_DATE__'] = dol_print_date($object->last_subscription_date, 'dayrfc'); + $substitutionarray['__MEMBER_LAST_SUBSCRIPTION_DATE_START__'] = dol_print_date($object->last_subscription_date_start, 'dayrfc'); + $substitutionarray['__MEMBER_LAST_SUBSCRIPTION_DATE_END__'] = dol_print_date($object->last_subscription_date_end, 'dayrfc'); if (is_object($object) && $object->element == 'societe') { @@ -6162,7 +6169,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob * @param array $substitutionarray Array with key->val to substitute. Example: array('__MYKEY__' => 'MyVal', ...) * @param Translate $outputlangs Output language * @return string Output string after substitutions - * @see complete_substitutions_array + * @see complete_substitutions_array, getCommonSubstitutionArray */ function make_substitutions($text, $substitutionarray, $outputlangs=null) { diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 20695a1856e..b74ad44b45f 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -124,7 +124,7 @@ CardContent=Content of your member card ThisIsContentOfYourMembershipRequestWasReceived=We want to let you know that your membership request was received.

ThisIsContentOfYourMembershipWasValidated=We want to let you know that your membership was validated with the following information:

ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded.

-ThisIsContentOfSubscriptionReminderEmail=We want to let you know thet your subscription is about to expire. We hope you can make a renewal of it.

+ThisIsContentOfSubscriptionReminderEmail=We want to let you know that your subscription is about to expire or is already expired (__MEMBER_LAST_SUBSCRIPTION_DATE_END__). We hope you can make a renewal of it.

ThisIsContentOfYourCard=This is a remind of the information we get about you. Feel free to contact us if something looks wrong.

DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT=Subject of the e-mail received in case of auto-inscription of a guest DescADHERENT_AUTOREGISTER_NOTIF_MAIL=E-mail received in case of auto-inscription of a guest @@ -194,4 +194,4 @@ SubscriptionRecorded=Subscription recorded NoEmailSentToMember=No email sent to member EmailSentToMember=Email sent to member at %s SendReminderForExpiredSubscriptionTitle=Send reminder by email for expired subscription -SendReminderForExpiredSubscription=Send reminder by email to members when subscription is about to expire (parameter is number of days before end of subscription to send the remind) +SendReminderForExpiredSubscription=Send reminder by email to members when subscription is about to expire (parameter is number of days before end of subscription to send the remind. It can be a list of days separated by a semicolon, for example '10;5;0;-5') From b73a2a24ef76b5f7f81a7a5b73463bead231ab3f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Oct 2018 01:16:53 +0200 Subject: [PATCH 3/5] FIX Tooltip on invoice widget --- htdocs/compta/facture/class/facture.class.php | 8 ++++---- htdocs/core/boxes/box_factures.php | 18 +++++++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 8897d98cb1a..5432dfdab5a 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1177,6 +1177,10 @@ class Facture extends CommonInvoice if ($user->rights->facture->lire) { $label = '' . $langs->trans("ShowInvoice") . ''; + if ($this->type == self::TYPE_REPLACEMENT) $label='' . $langs->transnoentitiesnoconv("ShowInvoiceReplace") . ''; + if ($this->type == self::TYPE_CREDIT_NOTE) $label='' . $langs->transnoentitiesnoconv("ShowInvoiceAvoir") . ''; + if ($this->type == self::TYPE_DEPOSIT) $label='' . $langs->transnoentitiesnoconv("ShowInvoiceDeposit") . ''; + if ($this->type == self::TYPE_SITUATION) $label='' . $langs->transnoentitiesnoconv("ShowInvoiceSituation") . ''; if (! empty($this->ref)) $label .= '
'.$langs->trans('Ref') . ': ' . $this->ref; if (! empty($this->ref_client)) @@ -1191,10 +1195,6 @@ class Facture extends CommonInvoice $label.= '
' . $langs->trans('LT2') . ': ' . price($this->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency); if (! empty($this->total_ttc)) $label.= '
' . $langs->trans('AmountTTC') . ': ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); - if ($this->type == self::TYPE_REPLACEMENT) $label=$langs->transnoentitiesnoconv("ShowInvoiceReplace").': '.$this->ref; - if ($this->type == self::TYPE_CREDIT_NOTE) $label=$langs->transnoentitiesnoconv("ShowInvoiceAvoir").': '.$this->ref; - if ($this->type == self::TYPE_DEPOSIT) $label=$langs->transnoentitiesnoconv("ShowInvoiceDeposit").': '.$this->ref; - if ($this->type == self::TYPE_SITUATION) $label=$langs->transnoentitiesnoconv("ShowInvoiceSituation").': '.$this->ref; if ($moretitle) $label.=' - '.$moretitle; } diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index a5da051d9d7..9b457bab856 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -72,9 +72,11 @@ class box_factures extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; - $facturestatic=new Facture($db); + $facturestatic = new Facture($db); $societestatic = new Societe($db); + $langs->load("bills"); + $text = $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."CustomerBills",$max); $this->info_box_head = array( 'text' => $text, @@ -88,9 +90,7 @@ class box_factures extends ModeleBoxes $sql.= ", f.total_ttc"; $sql.= ", f.datef as df"; $sql.= ", f.paye, f.fk_statut, f.datec, f.tms"; - $sql.= ", s.nom as name"; - $sql.= ", s.rowid as socid"; - $sql.= ", s.code_client"; + $sql.= ", s.rowid as socid, s.nom as name, s.code_client, s.email, s.tva_intra, s.code_compta, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6"; $sql.= ", f.date_lim_reglement as datelimite"; $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -117,6 +117,7 @@ class box_factures extends ModeleBoxes $datelimite = $db->jdate($objp->datelimite); $date = $db->jdate($objp->df); $datem = $db->jdate($objp->tms); + $facturestatic->id = $objp->facid; $facturestatic->ref = $objp->facnumber; $facturestatic->type = $objp->type; @@ -129,7 +130,14 @@ class box_factures extends ModeleBoxes $societestatic->id = $objp->socid; $societestatic->name = $objp->name; $societestatic->code_client = $objp->code_client; - + $societestatic->tva_intra = $objp->tva_intra; + $societestatic->email = $objp->email; + $societestatic->idprof1 = $objp->idprof1; + $societestatic->idprof2 = $objp->idprof2; + $societestatic->idprof3 = $objp->idprof3; + $societestatic->idprof4 = $objp->idprof4; + $societestatic->idprof5 = $objp->idprof5; + $societestatic->idprof6 = $objp->idprof6; $late = ''; if ($facturestatic->hasDelay()) { From b1289632e081d7b1089d4a32bd5d1edbd327b9a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Oct 2018 01:27:31 +0200 Subject: [PATCH 4/5] CSS --- htdocs/public/payment/newpayment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 6c44d0e57eb..cedca6cae73 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1427,7 +1427,7 @@ if ($action != 'dopayment') { if ($source == 'invoice' && $object->paye) { - print '

'.$langs->trans("InvoicePaid"); + print '

'.$langs->trans("InvoicePaid").''; } else { From d75828567cf58eb6c9cd7f84dad5abfe17e9c736 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Oct 2018 01:44:56 +0200 Subject: [PATCH 5/5] Fix amount last subscription --- htdocs/adherents/class/adherent.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 833afff415d..a5ca1691096 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1224,12 +1224,12 @@ class Adherent extends CommonObject $this->first_subscription_date=$this->db->jdate($obj->datec); $this->first_subscription_date_start=$this->db->jdate($obj->dateh); $this->first_subscription_date_end=$this->db->jdate($obj->datef); - $this->first_subscription_amount=$this->db->jdate($obj->subscription); + $this->first_subscription_amount=$obj->subscription; } $this->last_subscription_date=$this->db->jdate($obj->datec); $this->last_subscription_date_start=$this->db->jdate($obj->datef); $this->last_subscription_date_end=$this->db->jdate($obj->datef); - $this->last_subscription_amount=$this->db->jdate($obj->subscription); + $this->last_subscription_amount=$obj->subscription; $subscription=new Subscription($this->db); $subscription->id=$obj->rowid;