Skip to content

Commit

Permalink
Merge branch 'develop' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Apr 19, 2019
2 parents 5dbf31d + 6ed616a commit a0cd053
Show file tree
Hide file tree
Showing 74 changed files with 146 additions and 120 deletions.
3 changes: 2 additions & 1 deletion htdocs/accountancy/admin/productaccount.php
Expand Up @@ -279,7 +279,8 @@
if ($search_desc > 0) $param.="&search_desc=".urlencode($search_desc);
if ($search_current_account > 0) $param.="&search_current_account=".urlencode($search_current_account);
if ($search_current_account_valid && $search_current_account_valid != '-1') $param.="&search_current_account_valid=".urlencode($search_current_account_valid);

if ($accounting_product_mode) $param.='&accounting_product_mode='.urlencode($accounting_product_mode);

print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
Expand Down
18 changes: 11 additions & 7 deletions htdocs/accountancy/customer/list.php
Expand Up @@ -421,6 +421,8 @@
$facture_static = new Facture($db);
$product_static = new Product($db);

$isSellerInEEC = isInEEC($mysoc);

while ( $i < min($num_lines, $limit) ) {
$objp = $db->fetch_object($result);

Expand All @@ -440,7 +442,7 @@
$code_sell_p_notset = '';
$objp->aarowid_suggest = $objp->aarowid;

$isinEEC = isInEEC($objp->country_code);
$isBuyerInEEC = isInEEC($objp);

if ($objp->type_l == 1) {
$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
Expand All @@ -455,15 +457,17 @@
}
if ($objp->code_sell_l == -1) $objp->code_sell_l='';

if ($objp->country_sell == '1') {
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
$objp->code_sell_p = $objp->code_sell;
$objp->aarowid_suggest = $objp->aarowid;
} elseif ($isinEEC === true) {
$objp->code_sell_p = $objp->code_sell_intra;
$objp->aarowid_suggest = $objp->aarowid_intra;
} else {
$objp->code_sell_p = $objp->code_sell_export;
$objp->aarowid_suggest = $objp->aarowid_export;
if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
$objp->code_sell_p = $objp->code_sell_intra;
$objp->aarowid_suggest = $objp->aarowid_intra;
} else { // Foreign sale
$objp->code_sell_p = $objp->code_sell_export;
$objp->aarowid_suggest = $objp->aarowid_export;
}
}

if (! empty($objp->code_sell)) {
Expand Down
10 changes: 9 additions & 1 deletion htdocs/asset/list.php
Expand Up @@ -295,6 +295,14 @@ function init_myfunc()
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);

$newcardbutton='';
if ($user->rights->asset->write)
{
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/asset/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewAsset').'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
}

print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
Expand All @@ -305,7 +313,7 @@ function init_myfunc()
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';

print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton, '', $limit);

// Add code for pre mass action (confirmation or email presend form)
$topicmail="SendAssetsRef";
Expand Down
10 changes: 9 additions & 1 deletion htdocs/asset/type.php
Expand Up @@ -220,6 +220,14 @@

$param = '';

$newcardbutton='';
if ($user->rights->asset->configurer)
{
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/asset/type.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewAssetType').'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
}

print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
Expand All @@ -229,7 +237,7 @@
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';

print_barre_liste($langs->trans("AssetsTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit);
print_barre_liste($langs->trans("AssetsTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic.png', 0, $newcardbutton, '', $limit);

$moreforfilter = '';

Expand Down

0 comments on commit a0cd053

Please sign in to comment.