Skip to content

Commit

Permalink
Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into develop
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/accountancy/bookkeeping/balance.php
	htdocs/expedition/class/expeditionbatch.class.php
	htdocs/public/payment/newpayment.php
	htdocs/stripe/config.php
  • Loading branch information
eldy committed Oct 16, 2018
2 parents 502c52b + 08fa0de commit 2c1e8d6
Show file tree
Hide file tree
Showing 22 changed files with 252 additions and 102 deletions.
88 changes: 88 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,68 @@ Following changes may create regressions for some external modules, but were nec
where {TYPE} is contact type code (BILLING, SHIPPING, CUSTOMER, ... see contact type dictionnary).



***** ChangeLog for 7.0.4 compared to 7.0.3 *****
FIX: #8984 button create expense report
FIX: #9032
FIX: #9161
FIX: #9328
FIX: According to french law, if seller is in France and buyer isn't in UE and isn't a company, TVA used = TVA product
FIX: Add calls to fetchComments function
FIX: better compatibility with multicompany
FIX: case when we valid form with keyboard
FIX: character making error on bill list
FIX: check !empty exclude select element
FIX: combo into popup become crazy with IE10
FIX: combo of stock in popup are crazy in IE
FIX: Deletion of files in migration
FIX: exclude element of the select
FIX: extrafieldkey
FIX: Fetch function will fetch comments
FIX: Fetch task will now fetch comments
FIX: filter supplier invoice list by societe name.
FIX: $fk_account is always empty, must be $soc->fk_account
FIX: Force stripe api version to avoid trouble if we update stripe api
FIX: getEntity project and not projet
FIX: Get templates in a forced language
FIX: global $mysoc missing (to avoid php notice on lines 279, 280 & 281)
FIX: Injection
FIX: invoice stats: situation invoices were not counted
FIX: keep context filter on contact list on change column displayed
FIX: Keep same project when creating shipping from order
FIX: langs fr
FIX: Lose filter on payment type or category after a sort on invoice list
FIX: Missing behavior
FIX: missing hook to edit sql
FIX: multicompany compatibility !
FIX: need to filter on current entity on replenish
FIX: Option MAIN_DISABLE_NOTES_TAB #9611
FIX: page must always be 0 when we search (to avoid case : when we're on page 3 and we're looking for a precise thirdparty, we stay on page 3 and nothing's displaied)
FIX: Pagination on related item pages
FIX: Pagination on withdraw request list
FIX: PDF address: handle when contact thirdparty different from document thirdparty
FIX: PHP warning, undefined index notnull
FIX: Product marge tabs on product card
FIX: Product margin tab and credit note
FIX: propal: correctly preset project when creating with origin/originid
FIX: remain to pay for credit note was wrong on invoice list
FIX: remove debug
FIX: Remove fetchComments from project and task fetch function
FIX: remove rowid for multicompany compatibility
FIX: Search on Ref project on order list
FIX: search on ref project on propal list
FIX: showOptionals: column mismatches
FIX: SQL Injections reported by mu shcor (ADLab of Venustech)
FIX: stock replenish with multientity
FIX: table llx_chargessociales doesn't exists
FIX: we must see number of all shared projects
FIX: when stock is empty for current entity but > 0 in other entity, until this commit product wasn't displaied on replenishment, it must depends on multientity stock sharing
FIX: when we're just admin and not super admin, if we create new user with transverse mode, we don't see it then we can't add him in usergroup
FIX: wrong function name
FIX: Wrong position of firstname lastname
FIX: wrong value for module part and return access denied
FIX: Wrong variable and trigger name

***** ChangeLog for 7.0.3 compared to 7.0.2 *****
FIX: 7.0 task contact card without withproject parameters
FIX: #8722
Expand Down Expand Up @@ -766,6 +828,32 @@ Following changes may create regressions for some external modules, but were nec
multicompany module to a version that support Dolibarr v7, everything should work as expected.


***** ChangeLog for 6.0.8 compared to 6.0.7 *****
FIX: #8762
FIX: #9032
FIX: case when we valid form with keyboard
FIX: clause must not be there
FIX: dol_delete_file must work in a context without db handler loaded
FIX: entity test must be on product_fourn_price table and not product table
FIX: Fetch shipping will now fetch project id
FIX: $fk_account is always empty, must be $soc->fk_account
FIX: getEntity project and not projet
FIX: If we enable 3 steps for supplier order approbation, we must not delete all fourn rights def.
FIX: Keep supplier proposal price for supplier order
FIX: langs fr
FIX: missing filters during reordering
FIX: need to filter on aa.entity for same accounting accounts available in several entities
FIX: page must always be 0 when we search (to avoid case : when we're on page 3 and we're looking for a precise thirdparty, we stay on page 3 and nothing's displaied)
FIX: PDF address: handle when contact thirdparty different from document thirdparty
FIX: propal: correctly preset project when creating with origin/originid
FIX: pu_ht_devise was not converted to numeric so decimals were lost when calculating total_ht_devise
FIX: remain to pay for credit note was wrong on invoice list
FIX: shipment: fk_proje(c)t not handled in fetch() and update() methods
FIX: showOptionals: column mismatches
FIX: sometimes amounts are identical but php find them different.
FIX: test is_erasable() must be done before call function delete() too to avoid delete invoice with &action=delete in url
FIX: we must see number of all shared projects
FIX: wrong var name

***** ChangeLog for 6.0.7 compared to 6.0.6 *****
FIX: #8023
Expand Down
10 changes: 5 additions & 5 deletions htdocs/accountancy/bookkeeping/balance.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@
$filter = array();
}


/*
* View
*/

if ($action == 'export_csv')
{
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
Expand All @@ -167,11 +172,6 @@
}



/*
* View
*/

$title_page = $langs->trans("AccountBalance");

llxHeader('', $title_page);
Expand Down
9 changes: 5 additions & 4 deletions htdocs/admin/mails_templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,11 @@
if ($i) $sql.=",";
$sql.= $field."=";

// print $keycode.' - '.$_POST[$keycode].'<br>';
if ($_POST[$keycode] == '' || ($keycode != 'langcode' && $keycode != 'private' && empty($_POST[$keycode]))) $sql.="null"; // lang must be '' if not defined so the unique key that include lang will work
elseif ($_POST[$keycode] == '0' && $keycode == 'langcode') $sql.="''"; // lang must be '' if not defined so the unique key that include lang will work
elseif ($keycode == 'private') $sql.=((int) $_POST[$keycode]); // private must be 0 or 1
//print $keycode.' - '.$_POST[$keycode].'<br>';
if ($_POST[$keycode] == '' || ($keycode != 'langcode' && $keycode != 'position' && $keycode != 'private' && empty($_POST[$keycode]))) $sql.="null"; // lang must be '' if not defined so the unique key that include lang will work
elseif ($_POST[$keycode] == '0' && $keycode == 'langcode') $sql.="''"; // lang must be '' if not defined so the unique key that include lang will work
elseif ($keycode == 'private') $sql.=((int) $_POST[$keycode]); // private must be 0 or 1
elseif ($keycode == 'position') $sql.=((int) $_POST[$keycode]);
else $sql.="'".$db->escape($_POST[$keycode])."'";
$i++;
}
Expand Down
1 change: 1 addition & 0 deletions htdocs/comm/propal/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,7 @@
// Add custom code and origin country into description
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
{
$tmptxt = '(';
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs;
Expand Down
4 changes: 2 additions & 2 deletions htdocs/compta/facture/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,7 @@
{
$line->origin = $object->origin;
$line->origin_id = $line->id;
$line->fk_prev_id = $line->id;
$line->fetch_optionals($line->id);
$line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note

Expand Down Expand Up @@ -3299,8 +3300,7 @@
print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1);
// We check if Origin document (id and type is known) has already at least one invoice attached to it
$objectsrc->fetchObjectLinked($originid,$origin,'','facture');
$cntinvoice=count($objectsrc->linkedObjects['facture']);
if ($cntinvoice>=1)
if (is_array($objectsrc->linkedObjects['facture']) && count($objectsrc->linkedObjects['facture']) >= 1)
{
setEventMessages('WarningBillExist', null, 'warnings');
echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')';
Expand Down
37 changes: 20 additions & 17 deletions htdocs/core/class/notify.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ function send($notifcode, $object, $filename_list=array(), $mimetype_list=array(
{
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang($obj->default_lang);
$outputlangs->loadLangs(array("main","other"));
}

$subject = '['.$mysoc->name.'] '.$outputlangs->transnoentitiesnoconv("DolibarrNotification").($projtitle?' '.$projtitle:'');
Expand All @@ -405,72 +406,72 @@ function send($notifcode, $object, $filename_list=array(), $mimetype_list=array(
$link='/compta/facture/card.php?facid='.$object->id;
$dir_output = $conf->facture->dir_output;
$object_type = 'facture';
$mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated",$newref);
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoiceValidated",$newref);
break;
case 'BILL_PAYED':
$link='/compta/facture/card.php?facid='.$object->id;
$dir_output = $conf->facture->dir_output;
$object_type = 'facture';
$mesg = $langs->transnoentitiesnoconv("EMailTextInvoicePayed",$newref);
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoicePayed",$newref);
break;
case 'ORDER_VALIDATE':
$link='/commande/card.php?id='.$object->id;
$dir_output = $conf->commande->dir_output;
$object_type = 'order';
$mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated",$newref);
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextOrderValidated",$newref);
break;
case 'PROPAL_VALIDATE':
$link='/comm/propal/card.php?id='.$object->id;
$dir_output = $conf->propal->multidir_output[$object->entity];
$object_type = 'propal';
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$newref);
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalValidated",$newref);
break;
case 'PROPAL_CLOSE_SIGNED':
$link='/comm/propal/card.php?id='.$object->id;
$dir_output = $conf->propal->multidir_output[$object->entity];
$object_type = 'propal';
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalClosedSigned",$newref);
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalClosedSigned",$newref);
break;
case 'FICHINTER_ADD_CONTACT':
$link='/fichinter/card.php?id='.$object->id;
$dir_output = $conf->ficheinter->dir_output;
$object_type = 'ficheinter';
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionAddedContact",$object->ref);
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextInterventionAddedContact",$newref);
break;
case 'FICHINTER_VALIDATE':
$link='/fichinter/card.php?id='.$object->id;
$dir_output = $conf->ficheinter->dir_output;
$object_type = 'ficheinter';
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref);
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextInterventionValidated",$newref);
break;
case 'ORDER_SUPPLIER_VALIDATE':
$link='/fourn/commande/card.php?id='.$object->id;
$dir_output = $conf->fournisseur->commande->dir_output;
$object_type = 'order_supplier';
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$object->ref,$user->getFullName($langs));
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
$mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n";
$mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$newref,$user->getFullName($langs));
$mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n";
break;
case 'ORDER_SUPPLIER_APPROVE':
$link='/fourn/commande/card.php?id='.$object->id;
$dir_output = $conf->fournisseur->commande->dir_output;
$object_type = 'order_supplier';
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs));
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
$mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n";
$mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs));
$mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n";
break;
case 'ORDER_SUPPLIER_REFUSE':
$link='/fourn/commande/card.php?id='.$object->id;
$dir_output = $conf->fournisseur->commande->dir_output;
$object_type = 'order_supplier';
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$newref,$user->getFullName($langs));
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
$mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n";
$mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$newref,$user->getFullName($langs));
$mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n";
break;
case 'SHIPPING_VALIDATE':
$dir_output = $conf->expedition->dir_output.'/sending/';
$object_type = 'order_supplier';
$mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$newref);
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpeditionValidated",$newref);
break;
}
$ref = dol_sanitizeFileName($newref);
Expand Down Expand Up @@ -679,6 +680,8 @@ function send($notifcode, $object, $filename_list=array(), $mimetype_list=array(
$message.= $langs->transnoentities("YouReceiveMailBecauseOfNotification2",$application,$mysoc->name)."\n";
$message.= "\n";
$message.= $mesg;
//if ($link) $message.= "\n" . $urlwithroot . $link; // link already added around the ref into the text

$message = nl2br($message);

// Replace keyword __SUPERVISOREMAIL__
Expand Down
22 changes: 22 additions & 0 deletions htdocs/core/lib/date.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,8 @@ function dol_get_first_day_week($day,$month,$year,$gm=false)
*/
function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR', $lastday=0)
{
global $conf;

$nbFerie = 0;

// Check to ensure we use correct parameters
Expand All @@ -587,6 +589,26 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR', $
$jour = date("d", $timestampStart);
$mois = date("m", $timestampStart);
$annee = date("Y", $timestampStart);


// Check into var $conf->global->HOLIDAY_MORE_DAYS MM-DD,YYYY-MM-DD, ...
if (! empty($conf->global->HOLIDAY_MORE_PUBLIC_HOLIDAYS))
{
$arrayofdaystring=explode(',',$conf->global->HOLIDAY_MORE_PUBLIC_HOLIDAYS);
foreach($arrayofdaystring as $daystring)
{
$tmp=explode('-',$daystring);
if ($tmp[2])
{
if ($tmp[0] == $annee && $tmp[1] == $mois && $tmp[2] == $jour) $ferie=true;
}
else
{
if ($tmp[0] == $mois && $tmp[1] == $jour) $ferie=true;
}
}
}

if ($countrycode == 'FR')
{
$countryfound=1;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/files.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2496,7 +2496,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
//$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity;
}
// Wrapping pour les propales
else if ($modulepart == 'propal' && !empty($conf->propal->multidir_output[$entity]))
else if (($modulepart == 'propal' || $modulepart == 'propale') && !empty($conf->propal->multidir_output[$entity]))
{
if ($fuser->rights->propale->{$lire} || preg_match('/^specimen/i',$original_file))
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/pdf.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
if ($detail->eatby) $dte[]=$outputlangs->transnoentitiesnoconv('printEatby',dol_print_date($detail->eatby, $format, false, $outputlangs));
if ($detail->sellby) $dte[]=$outputlangs->transnoentitiesnoconv('printSellby',dol_print_date($detail->sellby, $format, false, $outputlangs));
if ($detail->batch) $dte[]=$outputlangs->transnoentitiesnoconv('printBatch',$detail->batch);
$dte[]=$outputlangs->transnoentitiesnoconv('printQty',$detail->dluo_qty);
$dte[]=$outputlangs->transnoentitiesnoconv('printQty',$detail->qty);
$libelleproduitservice.= "__N__ ".implode(" - ", $dte);
}
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/sendings.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ function show_list_sending_receive($origin,$origin_id,$filter='')
$detail.= $langs->trans("Batch").': '.$dbatch->batch;
$detail.= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby,"day");
$detail.= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby,"day");
$detail.= ' - '.$langs->trans("Qty").': '.$dbatch->dluo_qty;
$detail.= ' - '.$langs->trans("Qty").': '.$dbatch->qty;
$detail.= '<br>';
}
print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"),$detail);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/tpl/extrafields_list_print_fields.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
if ($align) print ' align="'.$align.'"';
print '>';
$tmpkey='options_'.$key;
if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')))
if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !is_numeric($obj->$tmpkey))
{
$datenotinstring = $obj->$tmpkey;
if (! is_numeric($obj->$tmpkey)) // For backward compatibility
Expand Down
Loading

0 comments on commit 2c1e8d6

Please sign in to comment.