Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
ca1340b5ed
@ -93,6 +93,7 @@ $search_categ_cus = trim(GETPOST("search_categ_cus", 'int'));
|
||||
$search_categ_sup = trim(GETPOST("search_categ_sup", 'int'));
|
||||
$search_country = GETPOST("search_country", 'intcomma');
|
||||
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
|
||||
$search_price_level = GETPOST('search_prive_level', 'int');
|
||||
$search_staff = GETPOST("search_staff", 'int');
|
||||
$search_status = GETPOST("search_status", 'int');
|
||||
$search_type = GETPOST('search_type', 'alpha');
|
||||
@ -188,8 +189,8 @@ $arrayfields = array(
|
||||
's.code_compta'=>array('label'=>"CustomerAccountancyCodeShort", 'position'=>13, 'checked'=>$checkedcustomeraccountcode),
|
||||
's.code_compta_fournisseur'=>array('label'=>"SupplierAccountancyCodeShort", 'position'=>14, 'checked'=>$checkedsupplieraccountcode, 'enabled'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
|
||||
's.address'=>array('label'=>"Address", 'position'=>19, 'checked'=>0),
|
||||
's.town'=>array('label'=>"Town", 'position'=>20, 'checked'=>0),
|
||||
's.zip'=>array('label'=>"Zip", 'position'=>21, 'checked'=>1),
|
||||
's.zip'=>array('label'=>"Zip", 'position'=>20, 'checked'=>1),
|
||||
's.town'=>array('label'=>"Town", 'position'=>21, 'checked'=>0),
|
||||
'state.nom'=>array('label'=>"State", 'position'=>22, 'checked'=>0),
|
||||
'region.nom'=>array('label'=>"Region", 'position'=>23, 'checked'=>0),
|
||||
'country.code_iso'=>array('label'=>"Country", 'position'=>24, 'checked'=>0),
|
||||
@ -198,7 +199,7 @@ $arrayfields = array(
|
||||
's.phone'=>array('label'=>"Phone", 'position'=>27, 'checked'=>1),
|
||||
's.fax'=>array('label'=>"Fax", 'position'=>28, 'checked'=>0),
|
||||
'typent.code'=>array('label'=>"ThirdPartyType", 'position'=>29, 'checked'=>$checkedtypetiers),
|
||||
'staff.code'=>array('label'=>"Staff", 'position'=>30, 'checked'=>0),
|
||||
'staff.code'=>array('label'=>"Staff", 'position'=>31, 'checked'=>0),
|
||||
's.siren'=>array('label'=>"ProfId1Short", 'position'=>40, 'checked'=>$checkedprofid1),
|
||||
's.siret'=>array('label'=>"ProfId2Short", 'position'=>41, 'checked'=>$checkedprofid2),
|
||||
's.ape'=>array('label'=>"ProfId3Short", 'position'=>42, 'checked'=>$checkedprofid3),
|
||||
@ -215,6 +216,11 @@ $arrayfields = array(
|
||||
's.status'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||
's.import_key'=>array('label'=>"ImportId", 'checked'=>0, 'position'=>1100),
|
||||
);
|
||||
if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))
|
||||
{
|
||||
$arrayfields['s.price_level'] =array('label'=>"PriceLevel", 'position'=>30, 'checked'=>0);
|
||||
}
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
@ -308,6 +314,7 @@ if (empty($reshook))
|
||||
$search_idprof6 = '';
|
||||
$search_vat = '';
|
||||
$search_type = '';
|
||||
$search_prive_level = '';
|
||||
$search_type_thirdparty = '';
|
||||
$search_staff = '';
|
||||
$search_status = -1;
|
||||
@ -395,7 +402,7 @@ $sql .= " s.entity,";
|
||||
$sql .= " st.libelle as stcomm, st.picto as stcomm_picto, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,";
|
||||
$sql .= " s.email, s.phone, s.fax, s.url, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4 as idprof4, s.idprof5 as idprof5, s.idprof6 as idprof6, s.tva_intra, s.fk_pays,";
|
||||
$sql .= " s.tms as date_update, s.datec as date_creation,";
|
||||
$sql .= " s.code_compta, s.code_compta_fournisseur, s.parent as fk_parent,";
|
||||
$sql .= " s.code_compta, s.code_compta_fournisseur, s.parent as fk_parent,s.price_level,";
|
||||
$sql .= " s2.nom as name2,";
|
||||
$sql .= " typent.code as typent_code,";
|
||||
$sql .= " staff.code as staff_code,";
|
||||
@ -475,6 +482,7 @@ if ($search_type > 0 && in_array($search_type, array('4'))) $sql .= " AN
|
||||
if ($search_type == '0') $sql .= " AND s.client = 0 AND s.fournisseur = 0";
|
||||
if ($search_status != '' && $search_status >= 0) $sql .= natural_search("s.status", $search_status, 2);
|
||||
if (!empty($conf->barcode->enabled) && $search_barcode) $sql .= natural_search("s.barcode", $search_barcode);
|
||||
if ($search_prive_level && $search_prive_level != '-1') $sql .= natural_search("s.price_level", $search_prive_level, 2);
|
||||
if ($search_type_thirdparty && $search_type_thirdparty != '-1') $sql .= natural_search("s.fk_typent", $search_type_thirdparty, 2);
|
||||
if (!empty($search_staff) && $search_staff != '-1') $sql .= natural_search("s.fk_effectif", $search_staff, 2);
|
||||
if ($search_level) $sql .= natural_search("s.fk_prospectlevel", join(',', $search_level), 3);
|
||||
@ -571,6 +579,7 @@ if ($search_idprof4 != '') $param .= '&search_idprof4='.urlencode($search_idprof
|
||||
if ($search_idprof5 != '') $param .= '&search_idprof5='.urlencode($search_idprof5);
|
||||
if ($search_idprof6 != '') $param .= '&search_idprof6='.urlencode($search_idprof6);
|
||||
if ($search_vat != '') $param .= '&search_vat='.urlencode($search_vat);
|
||||
if ($search_prive_level != '') $param .= '&search_prive_level='.urlencode($search_prive_level);
|
||||
if ($search_type_thirdparty != '') $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty);
|
||||
if ($search_type != '') $param .= '&search_type='.urlencode($search_type);
|
||||
if (is_array($search_level) && count($search_level)) foreach ($search_level as $slevel) $param .= '&search_level[]='.urlencode($slevel);
|
||||
@ -779,13 +788,6 @@ if (!empty($arrayfields['s.address']['checked']))
|
||||
print '<input class="flat searchstring maxwidth50imp" type="text" name="search_address" value="'.dol_escape_htmltag($search_address).'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Town
|
||||
if (!empty($arrayfields['s.town']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat searchstring maxwidth50imp" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Zip
|
||||
if (!empty($arrayfields['s.zip']['checked']))
|
||||
{
|
||||
@ -793,6 +795,13 @@ if (!empty($arrayfields['s.zip']['checked']))
|
||||
print '<input class="flat searchstring maxwidth50imp" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Town
|
||||
if (!empty($arrayfields['s.town']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat searchstring maxwidth50imp" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).'">';
|
||||
print '</td>';
|
||||
}
|
||||
// State
|
||||
if (!empty($arrayfields['state.nom']['checked']))
|
||||
{
|
||||
@ -821,6 +830,13 @@ if (!empty($arrayfields['typent.code']['checked']))
|
||||
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), 'maxwidth75', 1);
|
||||
print '</td>';
|
||||
}
|
||||
// Multiprice level
|
||||
if (!empty($arrayfields['s.price_level']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat searchstring maxwidth50imp" type="text" name="search_prive_level" value="'.dol_escape_htmltag($search_prive_level).'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Staff
|
||||
if (!empty($arrayfields['staff.code']['checked']))
|
||||
{
|
||||
@ -989,16 +1005,17 @@ if (!empty($arrayfields['s.code_fournisseur']['checked'])) print_liste_fi
|
||||
if (!empty($arrayfields['s.code_compta']['checked'])) print_liste_field_titre($arrayfields['s.code_compta']['label'], $_SERVER["PHP_SELF"], "s.code_compta", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['s.code_compta_fournisseur']['checked'])) print_liste_field_titre($arrayfields['s.code_compta_fournisseur']['label'], $_SERVER["PHP_SELF"], "s.code_compta_fournisseur", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['s.address']['checked'])) print_liste_field_titre($arrayfields['s.address']['label'], $_SERVER['PHP_SELF'], 's.address', '', $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], "s.town", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], "s.zip", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], "s.town", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['region.nom']['checked'])) print_liste_field_titre($arrayfields['region.nom']['label'], $_SERVER["PHP_SELF"], "region.nom", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (!empty($arrayfields['staff.code']['checked'])) print_liste_field_titre($arrayfields['staff.code']['label'], $_SERVER["PHP_SELF"], "staff.code", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (!empty($arrayfields['s.price_level']['checked'])) print_liste_field_titre($arrayfields['s.price_level']['label'], $_SERVER["PHP_SELF"], "s.price_level", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['s.email']['checked'])) print_liste_field_titre($arrayfields['s.email']['label'], $_SERVER["PHP_SELF"], "s.email", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['s.phone']['checked'])) print_liste_field_titre($arrayfields['s.phone']['label'], $_SERVER["PHP_SELF"], "s.phone", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['s.fax']['checked'])) print_liste_field_titre($arrayfields['s.fax']['label'], $_SERVER["PHP_SELF"], "s.fax", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['s.fax']['checked'])) print_liste_field_titre($arrayfields['s.fax']['label'], $_SERVER["PHP_SELF"], "s.fax", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['s.url']['checked'])) print_liste_field_titre($arrayfields['s.url']['label'], $_SERVER["PHP_SELF"], "s.url", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['s.siren']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId1Short"), $textprofid[1], 1, 0), $_SERVER["PHP_SELF"], "s.siren", "", $param, '', $sortfield, $sortorder, 'nowrap ');
|
||||
if (!empty($arrayfields['s.siret']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId2Short"), $textprofid[2], 1, 0), $_SERVER["PHP_SELF"], "s.siret", "", $param, '', $sortfield, $sortorder, 'nowrap ');
|
||||
@ -1011,6 +1028,7 @@ if (!empty($arrayfields['customerorsupplier']['checked'])) print_liste_fi
|
||||
if (!empty($arrayfields['s.fk_prospectlevel']['checked'])) print_liste_field_titre($arrayfields['s.fk_prospectlevel']['label'], $_SERVER["PHP_SELF"], "s.fk_prospectlevel", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (!empty($arrayfields['s.fk_stcomm']['checked'])) print_liste_field_titre($arrayfields['s.fk_stcomm']['label'], $_SERVER["PHP_SELF"], "s.fk_stcomm", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (!empty($arrayfields['s2.nom']['checked'])) print_liste_field_titre($arrayfields['s2.nom']['label'], $_SERVER["PHP_SELF"], "s2.nom", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
// Hook fields
|
||||
@ -1123,18 +1141,18 @@ while ($i < min($num, $limit))
|
||||
print '<td>'.$obj->address.'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Town
|
||||
if (!empty($arrayfields['s.town']['checked']))
|
||||
{
|
||||
print "<td>".$obj->town."</td>\n";
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Zip
|
||||
if (!empty($arrayfields['s.zip']['checked']))
|
||||
{
|
||||
print "<td>".$obj->zip."</td>\n";
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Town
|
||||
if (!empty($arrayfields['s.town']['checked']))
|
||||
{
|
||||
print "<td>".$obj->town."</td>\n";
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
// State
|
||||
if (!empty($arrayfields['state.nom']['checked']))
|
||||
{
|
||||
@ -1165,6 +1183,12 @@ while ($i < min($num, $limit))
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Multiprice level
|
||||
if (!empty($arrayfields['s.price_level']['checked']))
|
||||
{
|
||||
print '<td class="center">'.$obj->price_level."</td>\n";
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Staff
|
||||
if (!empty($arrayfields['staff.code']['checked']))
|
||||
{
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2013 Peter Fontaine <contact@peterfontaine.fr>
|
||||
* Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018 ptibogxiv <support@ptibogxiv.net>
|
||||
* Copyright (C) 2018 -2021Thibault FOUCART <support@ptibogxiv.net>
|
||||
*
|
||||
* 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
|
||||
@ -957,12 +957,16 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
||||
|
||||
try {
|
||||
if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage
|
||||
$paymentmethodobjs = \Stripe\PaymentMethod::all(array("customer" => $customerstripe->id, "type" => "card"));
|
||||
$paymentmethodobjsA = \Stripe\PaymentMethod::all(array("customer" => $customerstripe->id, "type" => "card"));
|
||||
$paymentmethodobjsB = \Stripe\PaymentMethod::all(array("customer" => $customerstripe->id, "type" => "sepa_debit"));
|
||||
} else {
|
||||
$paymentmethodobjs = \Stripe\PaymentMethod::all(array("customer" => $customerstripe->id, "type" => "card"), array("stripe_account" => $stripeacc));
|
||||
$paymentmethodobjsA = \Stripe\PaymentMethod::all(array("customer" => $customerstripe->id, "type" => "card"), array("stripe_account" => $stripeacc));
|
||||
$paymentmethodobjsB = \Stripe\PaymentMethod::all(array("customer" => $customerstripe->id, "type" => "sepa_debit"), array("stripe_account" => $stripeacc));
|
||||
}
|
||||
|
||||
$listofsources = $paymentmethodobjs->data;
|
||||
if ($paymentmethodobjsA->data != null && $paymentmethodobjsB->data != null) { $listofsources = array_merge((array) $paymentmethodobjsA->data, (array) $paymentmethodobjsB->data);
|
||||
} elseif ($paymentmethodobjsB->data != null) { $listofsources = $paymentmethodobjsB->data; }
|
||||
else { $listofsources = $paymentmethodobjsA->data; }
|
||||
} catch (Exception $e)
|
||||
{
|
||||
$error++;
|
||||
@ -1181,7 +1185,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
||||
print getCountry($src->card->country, 1);
|
||||
} else print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
|
||||
} elseif ($src->object == 'source' && $src->type == 'sepa_debit') {
|
||||
print 'SEPA debit';
|
||||
print '<span class="opacitymedium">'.$src->billing_details->name.'</span><br>....'.$src->sepa_debit->last4;
|
||||
print '</td><td>';
|
||||
if ($src->sepa_debit->country) {
|
||||
$img = picto_from_langcode($src->sepa_debit->country);
|
||||
@ -1198,7 +1202,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
||||
print getCountry($src->card->country, 1);
|
||||
} else print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
|
||||
} elseif ($src->object == 'payment_method' && $src->type == 'sepa_debit') {
|
||||
print 'SEPA debit';
|
||||
print '<span class="opacitymedium">'.$src->billing_details->name.'</span><br>....'.$src->sepa_debit->last4;
|
||||
print '</td><td>';
|
||||
if ($src->sepa_debit->country) {
|
||||
$img = picto_from_langcode($src->sepa_debit->country);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user