diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 8f2ea3f0706..43398d335d3 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1490,10 +1490,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Password if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { print ''.$langs->trans("Password").''.preg_replace('/./i', '*', $object->pass); - if ($object->pass) print preg_replace('/./i', '*', $object->pass); - else { - if ($user->admin) print $langs->trans("Crypted").': '.$object->pass_indatabase_crypted; - else print $langs->trans("Hidden"); + if ($object->pass) { + print preg_replace('/./i', '*', $object->pass); + } else { + if ($user->admin) { + print $langs->trans("Crypted").': '.$object->pass_indatabase_crypted; + } else { + print $langs->trans("Hidden"); + } } if ((!empty($object->pass) || !empty($object->pass_crypted)) && empty($object->user_id)) { $langs->load("errors"); @@ -1523,6 +1527,32 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } print ''; + print ''; + + print ''; + + print '
'; + print '
'; + + print ''; + + // Birth Date + print ''; + + // Public + print ''; + + // Categories + if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + print ''; + print ''; + } + + // Other attributes + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; + // Third party Dolibarr if (!empty($conf->societe->enabled)) { print ''; - print '
'.$langs->trans("DateOfBirth").''.dol_print_date($object->birth, 'day').'
'.$langs->trans("Public").''.yn($object->public).'
'.$langs->trans("Categories").''; + print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1); + print '
'; @@ -1571,29 +1601,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } print '
'; - - print '
'; - - print '
'; - print '
'; - - print ''; - - // Birth Date - print ''; - - // Public - print ''; - - // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { - print ''; - print ''; - } - //VCard print ''; - // Other attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; - print "
'.$langs->trans("DateOfBirth").''.dol_print_date($object->birth, 'day').'
'.$langs->trans("Public").''.yn($object->public).'
'.$langs->trans("Categories").''; - print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1); - print '
'; print $langs->trans("VCard").''; @@ -1603,9 +1610,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print '
\n"; print "
\n"; diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index e19f01779aa..3ba6f3ade89 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -471,6 +471,12 @@ if ($rowid > 0) { print ''.$langs->trans("MemberNature").''.$object->getmorphylib().''; print ''; + // Gender + print ''.$langs->trans("Gender").''; + print ''; + if ($object->gender) print $langs->trans("Gender".$object->gender); + print ''; + // Company print ''.$langs->trans("Company").''.$object->company.''; @@ -481,6 +487,15 @@ if ($rowid > 0) { // Password if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { print ''.$langs->trans("Password").''.preg_replace('/./i', '*', $object->pass); + if ($object->pass) { + print preg_replace('/./i', '*', $object->pass); + } else { + if ($user->admin) { + print $langs->trans("Crypted").': '.$object->pass_indatabase_crypted; + } else { + print $langs->trans("Hidden"); + } + } if ((!empty($object->pass) || !empty($object->pass_crypted)) && empty($object->user_id)) { $langs->load("errors"); $htmltext = $langs->trans("WarningPasswordSetWithNoAccount"); @@ -489,32 +504,6 @@ if ($rowid > 0) { print ''; } - print ''; - - print ''; - print '
'; - - print '
'; - print ''; - - // Birthday - print ''; - - // Public - print ''; - - // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { - print ''; - print ''; - } - - // Other attributes - $cols = 2; - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; - // Date end subscription print ''; + print '
'.$langs->trans("Birthday").''.dol_print_date($object->birth, 'day').'
'.$langs->trans("Public").''.yn($object->public).'
'.$langs->trans("Categories").''; - print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1); - print '
'.$langs->trans("SubscriptionEndDate").''; if ($object->datefin) { @@ -533,6 +522,32 @@ if ($rowid > 0) { } print '
'; + + print '
'; + print '
'; + + print '
'; + print ''; + + // Birthday + print ''; + + // Public + print ''; + + // Categories + if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + print ''; + print ''; + } + + // Other attributes + $cols = 2; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; + // Third party Dolibarr if (!empty($conf->societe->enabled)) { print ''; + print ''; if (!$i) $totalarray['nbfield']++; } // Type diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 7919f3c60df..8be1c392426 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017-2021 Alexandre Spangaro * Copyright (C) 2018-2020 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -70,6 +70,8 @@ class PaymentVarious extends CommonObject public $amount; public $type_payment; public $num_payment; + public $chqemetteur; + public $chqbank; public $category_transaction; /** @@ -504,8 +506,8 @@ class PaymentVarious extends CommonObject $this->num_payment, ($this->category_transaction > 0 ? $this->category_transaction : 0), $user, - '', - '', + $this->chqemetteur, + $this->chqbank, '', $this->datev ); diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 19b56169f8d..27dfe941f88 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -49,7 +49,7 @@ $accountid = GETPOST("accountid") > 0 ? GETPOST("accountid", "int") : 0; $label = GETPOST("label", "alpha"); $sens = GETPOST("sens", "int"); $amount = price2num(GETPOST("amount", "alpha")); -$paymenttype = GETPOST("paymenttype", "int"); +$paymenttype = GETPOST("paymenttype", "aZ09"); $accountancy_code = GETPOST("accountancy_code", "alpha"); $projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int')); if (!empty($conf->accounting->enabled) && !empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { @@ -116,8 +116,10 @@ if (empty($reshook)) { $object->amount = price2num(GETPOST("amount", 'alpha')); $object->label = GETPOST("label", 'restricthtml'); $object->note = GETPOST("note", 'restricthtml'); - $object->type_payment = GETPOST("paymenttype", 'int') > 0 ? GETPOST("paymenttype", "int") : 0; + $object->type_payment = dol_getIdFromCode($db, GETPOST('paymenttype'), 'c_paiement', 'code', 'id', 1); $object->num_payment = GETPOST("num_payment", 'alpha'); + $object->chqemetteur = GETPOST("chqemetteur", 'alpha'); + $object->chqbank = GETPOST("chqbank", 'alpha'); $object->fk_user_author = $user->id; $object->category_transaction = GETPOST("category_transaction", 'alpha'); @@ -338,6 +340,43 @@ foreach ($bankcateg->fetchAll() as $bankcategory) { /* */ /* ************************************************************************** */ if ($action == 'create') { + // Update fields properties in realtime + if (!empty($conf->use_javascript_ajax)) + { + print "\n".''."\n"; + } + print '
'; print ''; print ''; @@ -382,18 +421,29 @@ if ($action == 'create') { } // Type payment - print '
'; + print '\n"; + print ''; // Number if (!empty($conf->banque->enabled)) { - // Number print ''; print ''."\n"; + + // Check transmitter + print ''; + print ''; + + // Bank name + print ''; + print ''; } // Accountancy account diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5f2497a5827..08a83d5ad0a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7634,7 +7634,7 @@ class Form 'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('invoice').')'), 'invoice_template'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToTemplateInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('invoice').')'), 'contrat'=>array('enabled'=>$conf->contrat->enabled, 'perms'=>1, 'label'=>'LinkToContract', - 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, '' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('contract').')'), + 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t, ".MAIN_DB_PREFIX."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('contract').')'), 'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('intervention').')'), 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled, 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('supplier_proposal').')'), 'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled, 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('commande_fournisseur').')'), @@ -7700,7 +7700,12 @@ class Form print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; $i++; diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index 2cbd00c8522..9fd6f176c7a 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -307,24 +307,26 @@ print '\n"; print ''; print "\n"; +if (!empty($conf->societe->enabled)) { + print ''; + print ''; + print '\n"; + print "\n"; +} + print ''; print ''; print ''; -print ''; -print ''; -print '\n"; -print "\n"; - print ''; print ''; // Ref - print ''; + print ''; // Company if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) { // Thirdparty - print ''; - if ($soc->id > 0 && !GETPOST('fac_rec', 'alpha')) { - print ''; + print ''; } else { - print ''; + print ''; } print ''."\n"; @@ -540,11 +547,15 @@ if (!empty($id) && $action == 'edit') { print ""; print "\n"; - if ($object->socid && !empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) { + if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) { $company = new Societe($db); - $result = $company->fetch($object->socid); - print ''; + print ''; } else { $langs->load("companies"); print ''; @@ -700,11 +711,15 @@ if (!empty($id) && $action != 'edit') { print yn($object->public); print ''; - if ($object->socid) { + if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) { $company = new Societe($db); - $result = $company->fetch($object->socid); - print ''; + print ''; } else { print ''; print ''; diff --git a/htdocs/langs/en_US/dict.lang b/htdocs/langs/en_US/dict.lang index ec315d97142..0524cf1ca18 100644 --- a/htdocs/langs/en_US/dict.lang +++ b/htdocs/langs/en_US/dict.lang @@ -21,7 +21,7 @@ CountryNL=Netherlands CountryHU=Hungary CountryRU=Russia CountrySE=Sweden -CountryCI=Ivoiry Coast +CountryCI=Ivory Coast CountrySN=Senegal CountryAR=Argentina CountryCM=Cameroon diff --git a/htdocs/langs/en_US/donations.lang b/htdocs/langs/en_US/donations.lang index de4bdf68f03..d512abb2eea 100644 --- a/htdocs/langs/en_US/donations.lang +++ b/htdocs/langs/en_US/donations.lang @@ -32,3 +32,4 @@ DONATION_ART238=Show article 238 from CGI if you are concerned DONATION_ART885=Show article 885 from CGI if you are concerned DonationPayment=Donation payment DonationValidated=Donation %s validated +DonationUseThirdparties=Use an existing thirdparty as coordinates of donators diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 67544b46328..58f5307255a 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1125,3 +1125,4 @@ ConfirmAffectTag=Bulk Tag Affect ConfirmAffectTagQuestion=Are you sure you want to affect tags to the %s selected record(s)? CategTypeNotFound=No tag type found for type of records CopiedToClipboard=Copied to clipboard +InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into consideration. diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index df0bb4ed95c..85ad11bb74b 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -871,7 +871,7 @@ if (!$source) { } print '
'.$langs->trans("DateOfBirth").''.dol_print_date($object->birth, 'day').'
'.$langs->trans("Public").''.yn($object->public).'
'.$langs->trans("Categories").''; + print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1); + print '
'; diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 4dbfdd5c851..efdeec7c371 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -419,7 +419,7 @@ while ($i < min($num, $limit)) { // Ref if (!empty($arrayfields['d.ref']['checked'])) { - print ''.$subscription->getNomUrl(1).''.$subscription->getNomUrl(1).'
'; - print $form->editfieldkey('PaymentMode', 'selectpaymenttype', '', $object, 0, 'string', '', 1).''; - $form->select_types_paiements($paymenttype, "paymenttype"); - print '
'.$langs->trans('PaymentMode').''; + $form->select_types_paiements($paymenttype, 'paymenttype', '', 2); + print "
'.$objp->ref.''.$objp->ref_client.''.price($objp->total_ht).''; + if ($possiblelink[label] == 'LinkToContract') { + $form = new Form($db); + print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; + } + print price($objp->total_ht).''.$objp->name.'
'.$langs->trans("Value")."
'; + print $langs->trans("DonationUseThirdparties"); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('DONATION_USE_THIRDPARTIES'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("DONATION_USE_THIRDPARTIES", $arrval, $conf->global->DONATION_USE_THIRDPARTIES); + } + print "
'; -print $form->textwithpicto($langs->trans("DonationUserThirdparties"), $langs->trans("DonationUserThirdpartiesDesc")); -print ''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('DONATION_USE_THIRDPARTIES'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("DONATION_USE_THIRDPARTIES", $arrval, $conf->global->DONATION_USE_THIRDPARTIES); -} -print "
'; $label = $langs->trans("AccountAccounting"); diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 093e478e2c4..0fcd4d98230 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -44,7 +44,7 @@ if (!empty($conf->projet->enabled)) { } require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -$langs->loadLangs(array("bills", "companies", "donations")); +$langs->loadLangs(array("bills", "companies", "donations", "users")); $id = GETPOST('rowid') ?GETPOST('rowid', 'int') : GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); @@ -178,6 +178,11 @@ if ($action == 'add') { $error = 0; + if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES) && !(GETPOST("socid", 'int') > 0)) { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdParty")), null, 'errors'); + $action = "create"; + $error++; + } if (empty($donation_date)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $action = "create"; @@ -346,14 +351,15 @@ if ($action == 'create') { print '
'.$langs->trans('Ref').''.$langs->trans('Draft').'
'.$langs->trans('Ref').''.$langs->trans('Draft').'
'.$langs->trans('Customer').''; + if ($soc->id > 0) + { + print ''.$langs->trans('ThirdParty').''; print $soc->getNomUrl(1); print ''; // Outstanding Bill @@ -370,7 +376,8 @@ if ($action == 'create') { print ')'; print ''; + print ''.$langs->trans('ThirdParty').''; print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); // Option to reload page to retrieve customer informations. Note, this clear other input if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED)) { @@ -386,7 +393,7 @@ if ($action == 'create') { }); '; } - print ' '.$langs->trans("AddThirdParty").''; + print ' '; print '
'.$langs->trans("LinkedToDolibarrThirdParty").''.$company->getNomUrl(1).'
'.$langs->trans("ThirdParty").''; + if ($object->socid > 0) { + $result = $company->fetch($object->socid); + print $company->getNomUrl(1); + } + print '
'.$langs->trans("Company").'
'.$langs->trans("LinkedToDolibarrThirdParty").''.$company->getNomUrl(1).'
'.$langs->trans("ThirdParty").''; + if ($object->socid > 0) { + $result = $company->fetch($object->socid); + print $company->getNomUrl(1); + } + print '
'.$langs->trans("Company").''.$object->societe.'
'.$langs->trans("Lastname").''.$object->lastname.'
'; if (empty($amount) || !is_numeric($amount)) { - print ''; + print ''; print ''; } else { print ''.price($amount).''; @@ -914,9 +914,13 @@ if ($source == 'order') { if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment $amount = $order->total_ttc; +<<<<<<< HEAD if (GETPOST("amount", 'int')) { $amount = GETPOST("amount", 'int'); } +======= + if (GETPOST("amount", 'alpha')) $amount = GETPOST("amount", 'alpha'); +>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git $amount = price2num($amount); } @@ -965,8 +969,14 @@ if ($source == 'order') { print ' ('.$langs->trans("ToComplete").')'; } print ''; +<<<<<<< HEAD if (empty($amount) || !is_numeric($amount)) { print ''; +======= + if (empty($amount) || !is_numeric($amount)) + { + print ''; +>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git print ''; } else { print ''.price($amount).''; @@ -1038,9 +1048,13 @@ if ($source == 'invoice') { if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment $amount = price2num($invoice->total_ttc - ($invoice->getSommePaiement() + $invoice->getSumCreditNotesUsed() + $invoice->getSumDepositsUsed())); +<<<<<<< HEAD if (GETPOST("amount", 'int')) { $amount = GETPOST("amount", 'int'); } +======= + if (GETPOST("amount", 'int')) $amount = GETPOST("amount", 'alpha'); +>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git $amount = price2num($amount); } @@ -1092,8 +1106,14 @@ if ($source == 'invoice') { if ($object->type == $object::TYPE_CREDIT_NOTE) { print ''.$langs->trans("CreditNote").''; } elseif (empty($object->paye)) { +<<<<<<< HEAD if (empty($amount) || !is_numeric($amount)) { print ''; +======= + if (empty($amount) || !is_numeric($amount)) + { + print ''; +>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git print ''; } else { print ''.price($amount).''; @@ -1204,9 +1224,13 @@ if ($source == 'contractline') { } } +<<<<<<< HEAD if (GETPOST("amount", 'int')) { $amount = GETPOST("amount", 'int'); } +======= + if (GETPOST("amount", 'alpha')) $amount = GETPOST("amount", 'alpha'); +>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git $amount = price2num($amount); } @@ -1296,8 +1320,14 @@ if ($source == 'contractline') { print ' ('.$langs->trans("ToComplete").')'; } print ''; +<<<<<<< HEAD if (empty($amount) || !is_numeric($amount)) { print ''; +======= + if (empty($amount) || !is_numeric($amount)) + { + print ''; +>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git print ''; } else { print ''.price($amount).''; @@ -1370,10 +1400,15 @@ if ($source == 'membersubscription') { if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment $amount = $subscription->total_ttc; +<<<<<<< HEAD if (GETPOST("amount", 'int')) { $amount = GETPOST("amount", 'int'); } $amount = price2num($amount); +======= + if (GETPOST("amount", 'alpha')) $amount = GETPOST("amount", 'alpha'); + $amount = price2num($amount, 'MT'); +>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git } if (GETPOST('fulltag', 'alpha')) { @@ -1470,15 +1505,30 @@ if ($source == 'membersubscription') { } if (empty($amount) || !is_numeric($amount)) { //$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT'); +<<<<<<< HEAD if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) { $valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow); } print ''; print ''; +======= + if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow); + print ''; + if (empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { + print ''; + print ''; + } else { + print ''; + } +>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git } else { $valtoshow = $amount; if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) { $valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow); +<<<<<<< HEAD +======= + $amount = $valtoshow; +>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git } print ''.price($valtoshow).''; print ''; @@ -1548,9 +1598,13 @@ if ($source == 'donation') { if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment $amount = $subscription->total_ttc; +<<<<<<< HEAD if (GETPOST("amount", 'int')) { $amount = GETPOST("amount", 'int'); } +======= + if (GETPOST("amount", 'alpha')) $amount = GETPOST("amount", 'alpha'); +>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git $amount = price2num($amount); } @@ -1624,15 +1678,24 @@ if ($source == 'donation') { } if (empty($amount) || !is_numeric($amount)) { //$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT'); +<<<<<<< HEAD if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) { $valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow); } print ''; +======= + if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow); + print ''; +>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git print ''; } else { $valtoshow = $amount; if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) { $valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow); +<<<<<<< HEAD +======= + $amount = $valtoshow; +>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git } print ''.price($valtoshow).''; print ''; @@ -2118,6 +2181,7 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme console.log("We click on buttontopay"); event.preventDefault(); +<<<<<<< HEAD if (cardholderName.value == '') { console.log("Field Card holder is empty"); @@ -2176,6 +2240,59 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme }); } }); +======= + if (cardholderName.value == '') + { + console.log("Field Card holder is empty"); + var displayError = document.getElementById('card-errors'); + displayError.textContent = 'trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CardOwner"))); ?>'; + } + else + { + /* Disable button to pay and show hourglass cursor */ + jQuery('#hourglasstopay').show(); + jQuery('#buttontopay').hide(); + + stripe.handleCardPayment( + clientSecret, cardElement, { + payment_method_data: { + billing_details: { + name: cardholderName.value + thirdparty) && !empty($object->thirdparty->email))) { ?>, email: 'thirdparty->email); ?>' + thirdparty) && !empty($object->thirdparty->phone)) { ?>, phone: 'thirdparty->phone); ?>' + thirdparty)) { ?>, address: { + city: 'thirdparty->town); ?>', + thirdparty->country_code) { ?>country: 'thirdparty->country_code); ?>', + line1: 'thirdparty->address)); ?>', + postal_code: 'thirdparty->zip); ?>' + } + + } + }, + save_payment_method: /* true when a customer was provided when creating payment intent. true ask to save the card */ + } + ).then(function(result) { + console.log(result); + if (result.error) { + console.log("Error on result of handleCardPayment"); + jQuery('#buttontopay').show(); + jQuery('#hourglasstopay').hide(); + // Inform the user if there was an error + var errorElement = document.getElementById('card-errors'); + errorElement.textContent = result.error.message; + } else { + // The payment has succeeded. Display a success message. + console.log("No error on result of handleCardPayment, so we submit the form"); + // Submit the form + jQuery('#buttontopay').hide(); + jQuery('#hourglasstopay').show(); + // Send form (action=charge that will do nothing) + jQuery('#payment-form').submit(); + } + }); + } + }); +>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git - +
control->tpl['help_customercode']; ?>
@@ -89,7 +89,7 @@ if (empty($conf) || !is_object($conf))
- +
control->tpl['help_suppliercode']; ?>
diff --git a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php index 57b8a06b019..e03d0fa7b6e 100644 --- a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php @@ -75,7 +75,7 @@ $contact = $GLOBALS['objcanvas']->control->object;
control->tpl['ismodifiable_customercode']) { ?> - + control->tpl['customercode']; ?> @@ -96,7 +96,7 @@ $contact = $GLOBALS['objcanvas']->control->object;
control->tpl['ismodifiable_suppliercode']) { ?> - + control->tpl['suppliercode']; ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php index 649d1bf8aca..389b36e50f5 100644 --- a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php @@ -84,7 +84,7 @@ if (empty($conf) || !is_object($conf)) - +
control->tpl['help_customercode']; ?>
@@ -99,7 +99,7 @@ if (empty($conf) || !is_object($conf))
- +
control->tpl['help_suppliercode']; ?>
diff --git a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php index b5f57544c5f..ffdbe2c3016 100644 --- a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php @@ -73,7 +73,7 @@ if (empty($conf) || !is_object($conf))
control->tpl['ismodifiable_customercode']) { ?> - + control->tpl['customercode']; ?> @@ -94,7 +94,7 @@ if (empty($conf) || !is_object($conf))
control->tpl['ismodifiable_suppliercode']) { ?> - + control->tpl['suppliercode']; ?> diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 8b54144cbff..014959656db 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1289,7 +1289,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print '
'; $tmpcode = $object->code_client; if (empty($tmpcode) && !empty($modCodeClient->code_auto)) $tmpcode = $modCodeClient->getNextValue($object, 0); - print ''; + print ''; print ''; $s = $modCodeClient->getToolTip($langs, $object, 0); print $form->textwithpicto('', $s, 1); @@ -1321,7 +1321,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print '
'; $tmpcode = $object->code_fournisseur; if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) $tmpcode = $modCodeFournisseur->getNextValue($object, 1); - print ''; + print ''; print ''; $s = $modCodeFournisseur->getToolTip($langs, $object, 1); print $form->textwithpicto('', $s, 1); @@ -1942,10 +1942,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) $tmpcode = $object->code_client; if (empty($tmpcode) && !empty($object->oldcopy->code_client)) $tmpcode = $object->oldcopy->code_client; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value. if (empty($tmpcode) && !empty($modCodeClient->code_auto)) $tmpcode = $modCodeClient->getNextValue($object, 0); - print ''; + print ''; } elseif ($object->codeclient_modifiable()) { - print ''; + print ''; } else { print $object->code_client; print ''; @@ -1980,10 +1980,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) $tmpcode = $object->code_fournisseur; if (empty($tmpcode) && !empty($object->oldcopy->code_fournisseur)) $tmpcode = $object->oldcopy->code_fournisseur; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value. if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) $tmpcode = $modCodeFournisseur->getNextValue($object, 1); - print ''; + print ''; } elseif ($object->codefournisseur_modifiable()) { - print ''; + print ''; } else { print $object->code_fournisseur; print ''; diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php index b5cc638631c..03eacd13745 100644 --- a/test/phpunit/DateLibTest.php +++ b/test/phpunit/DateLibTest.php @@ -334,7 +334,6 @@ class DateLibTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertSame('1 '.strtolower(dol_substr($langs->trans("Day"), 0, 1).'.'), $result); - return $result; } diff --git a/test/phpunit/DateLibTzFranceTest.php b/test/phpunit/DateLibTzFranceTest.php index 63893a9c881..7b1e4caa440 100644 --- a/test/phpunit/DateLibTzFranceTest.php +++ b/test/phpunit/DateLibTzFranceTest.php @@ -82,9 +82,9 @@ class DateLibTzFranceTest extends PHPUnit\Framework\TestCase { global $conf,$user,$langs,$db; - if (getServerTimeZoneString() != 'Europe/Paris') { - print "\n".__METHOD__." This PHPUnit test can be launched manually only onto a server with PHP timezone set to TZ+1 Europe/Paris, not a TZ=".getServerTimeZoneString().".\n"; die(); - } + if (getServerTimeZoneString() != 'Europe/Paris' && getServerTimeZoneString() != 'Europe/Berlin') { + print "\n".__METHOD__." This PHPUnit test can be launched manually only onto a server with PHP timezone set to TZ=Europe/Paris, not a TZ=".getServerTimeZoneString().".\n"; die(); + } $db->begin(); // This is to have all actions inside a transaction even if test launched without suite.