Merge remote-tracking branch 'upstream/develop' into add_rule
This commit is contained in:
commit
f2cdbf6bb2
34
DCO
Normal file
34
DCO
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
Developer Certificate of Origin
|
||||||
|
Version 1.1
|
||||||
|
|
||||||
|
Copyright (C) 2002 - Today, The Dolibarr team and its contributors.
|
||||||
|
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies of this
|
||||||
|
license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
|
||||||
|
Developer's Certificate of Origin 1.1
|
||||||
|
|
||||||
|
By making a contribution to this project, I certify that:
|
||||||
|
|
||||||
|
(a) The contribution was created in whole or in part by me and I
|
||||||
|
have the right to submit it under the open source license
|
||||||
|
indicated in the file; or
|
||||||
|
|
||||||
|
(b) The contribution is based upon previous work that, to the best
|
||||||
|
of my knowledge, is covered under an appropriate open source
|
||||||
|
license and I have the right under that license to submit that
|
||||||
|
work with modifications, whether created in whole or in part
|
||||||
|
by me, under the same open source license (unless I am
|
||||||
|
permitted to submit under a different license), as indicated
|
||||||
|
in the file; or
|
||||||
|
|
||||||
|
(c) The contribution was provided directly to me by some other
|
||||||
|
person who certified (a), (b) or (c) and I have not modified
|
||||||
|
it.
|
||||||
|
|
||||||
|
(d) I understand and agree that this project and the contribution
|
||||||
|
are public and that a record of the contribution (including all
|
||||||
|
personal information I submit with it, including my sign-off) is
|
||||||
|
maintained indefinitely and may be redistributed consistent with
|
||||||
|
this project or the open source license(s) involved.
|
||||||
@ -1601,6 +1601,32 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print '<div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
|
print '<table class="border tableforfield tableforfield" width="100%">';
|
||||||
|
|
||||||
|
// Birth Date
|
||||||
|
print '<tr><td class="titlefield">'.$langs->trans("DateOfBirth").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
|
||||||
|
|
||||||
|
// Public
|
||||||
|
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
|
||||||
|
|
||||||
|
// Categories
|
||||||
|
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
||||||
|
print '<tr><td>'.$langs->trans("Categories").'</td>';
|
||||||
|
print '<td colspan="2">';
|
||||||
|
print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1);
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Other attributes
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||||
|
|
||||||
// Third party Dolibarr
|
// Third party Dolibarr
|
||||||
if (!empty($conf->societe->enabled)) {
|
if (!empty($conf->societe->enabled)) {
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
@ -1649,29 +1675,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
|
||||||
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '<div class="fichehalfright"><div class="ficheaddleft">';
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
|
||||||
|
|
||||||
print '<table class="border tableforfield tableforfield" width="100%">';
|
|
||||||
|
|
||||||
// Birth Date
|
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("DateOfBirth").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
|
|
||||||
|
|
||||||
// Public
|
|
||||||
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
|
|
||||||
|
|
||||||
// Categories
|
|
||||||
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
|
||||||
print '<tr><td>'.$langs->trans("Categories").'</td>';
|
|
||||||
print '<td colspan="2">';
|
|
||||||
print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1);
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
//VCard
|
//VCard
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print $langs->trans("VCard").'</td><td colspan="3">';
|
print $langs->trans("VCard").'</td><td colspan="3">';
|
||||||
@ -1681,9 +1684,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
print '</a>';
|
print '</a>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Other attributes
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
print "</div></div></div>\n";
|
print "</div></div></div>\n";
|
||||||
|
|||||||
@ -493,6 +493,12 @@ if ($rowid > 0) {
|
|||||||
print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
|
print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
// Gender
|
||||||
|
print '<tr><td>'.$langs->trans("Gender").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
if ($object->gender) print $langs->trans("Gender".$object->gender);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// Company
|
// Company
|
||||||
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->company.'</td></tr>';
|
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->company.'</td></tr>';
|
||||||
|
|
||||||
@ -503,6 +509,15 @@ if ($rowid > 0) {
|
|||||||
// Password
|
// Password
|
||||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
||||||
print '<tr><td>'.$langs->trans("Password").'</td><td>'.preg_replace('/./i', '*', $object->pass);
|
print '<tr><td>'.$langs->trans("Password").'</td><td>'.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)) {
|
if ((!empty($object->pass) || !empty($object->pass_crypted)) && empty($object->user_id)) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$htmltext = $langs->trans("WarningPasswordSetWithNoAccount");
|
$htmltext = $langs->trans("WarningPasswordSetWithNoAccount");
|
||||||
@ -511,32 +526,6 @@ if ($rowid > 0) {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
|
||||||
|
|
||||||
print '</div>';
|
|
||||||
print '<div class="fichehalfright"><div class="ficheaddleft">';
|
|
||||||
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
|
||||||
print '<table class="border tableforfield" width="100%">';
|
|
||||||
|
|
||||||
// Birthday
|
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
|
|
||||||
|
|
||||||
// Public
|
|
||||||
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
|
|
||||||
|
|
||||||
// Categories
|
|
||||||
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
|
||||||
print '<tr><td>'.$langs->trans("Categories").'</td>';
|
|
||||||
print '<td colspan="2">';
|
|
||||||
print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1);
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Other attributes
|
|
||||||
$cols = 2;
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
|
||||||
|
|
||||||
// Date end subscription
|
// Date end subscription
|
||||||
print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
|
print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
|
||||||
if ($object->datefin) {
|
if ($object->datefin) {
|
||||||
@ -559,6 +548,32 @@ if ($rowid > 0) {
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
print '<div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
|
// Birthday
|
||||||
|
print '<tr><td class="titlefield">'.$langs->trans("DateOfBirth").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
|
||||||
|
|
||||||
|
// Public
|
||||||
|
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
|
||||||
|
|
||||||
|
// Categories
|
||||||
|
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
||||||
|
print '<tr><td>'.$langs->trans("Categories").'</td>';
|
||||||
|
print '<td colspan="2">';
|
||||||
|
print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1);
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Other attributes
|
||||||
|
$cols = 2;
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||||
|
|
||||||
// Third party Dolibarr
|
// Third party Dolibarr
|
||||||
if (!empty($conf->societe->enabled)) {
|
if (!empty($conf->societe->enabled)) {
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2017-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
/* Copyright (C) 2017-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -70,6 +70,8 @@ class PaymentVarious extends CommonObject
|
|||||||
public $amount;
|
public $amount;
|
||||||
public $type_payment;
|
public $type_payment;
|
||||||
public $num_payment;
|
public $num_payment;
|
||||||
|
public $chqemetteur;
|
||||||
|
public $chqbank;
|
||||||
public $category_transaction;
|
public $category_transaction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -504,8 +506,8 @@ class PaymentVarious extends CommonObject
|
|||||||
$this->num_payment,
|
$this->num_payment,
|
||||||
($this->category_transaction > 0 ? $this->category_transaction : 0),
|
($this->category_transaction > 0 ? $this->category_transaction : 0),
|
||||||
$user,
|
$user,
|
||||||
'',
|
$this->chqemetteur,
|
||||||
'',
|
$this->chqbank,
|
||||||
'',
|
'',
|
||||||
$this->datev
|
$this->datev
|
||||||
);
|
);
|
||||||
|
|||||||
@ -49,7 +49,7 @@ $accountid = GETPOST("accountid") > 0 ? GETPOST("accountid", "int") : 0;
|
|||||||
$label = GETPOST("label", "alpha");
|
$label = GETPOST("label", "alpha");
|
||||||
$sens = GETPOST("sens", "int");
|
$sens = GETPOST("sens", "int");
|
||||||
$amount = price2num(GETPOST("amount", "alpha"));
|
$amount = price2num(GETPOST("amount", "alpha"));
|
||||||
$paymenttype = GETPOST("paymenttype", "int");
|
$paymenttype = GETPOST("paymenttype", "aZ09");
|
||||||
$accountancy_code = GETPOST("accountancy_code", "alpha");
|
$accountancy_code = GETPOST("accountancy_code", "alpha");
|
||||||
$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int'));
|
$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int'));
|
||||||
if (!empty($conf->accounting->enabled) && !empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
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->amount = price2num(GETPOST("amount", 'alpha'));
|
||||||
$object->label = GETPOST("label", 'restricthtml');
|
$object->label = GETPOST("label", 'restricthtml');
|
||||||
$object->note = GETPOST("note", '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->num_payment = GETPOST("num_payment", 'alpha');
|
||||||
|
$object->chqemetteur = GETPOST("chqemetteur", 'alpha');
|
||||||
|
$object->chqbank = GETPOST("chqbank", 'alpha');
|
||||||
$object->fk_user_author = $user->id;
|
$object->fk_user_author = $user->id;
|
||||||
$object->category_transaction = GETPOST("category_transaction", 'alpha');
|
$object->category_transaction = GETPOST("category_transaction", 'alpha');
|
||||||
|
|
||||||
@ -338,6 +340,43 @@ foreach ($bankcateg->fetchAll() as $bankcategory) {
|
|||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
if ($action == 'create') {
|
if ($action == 'create') {
|
||||||
|
// Update fields properties in realtime
|
||||||
|
if (!empty($conf->use_javascript_ajax))
|
||||||
|
{
|
||||||
|
print "\n".'<script type="text/javascript" language="javascript">';
|
||||||
|
print '$(document).ready(function () {
|
||||||
|
setPaymentType();
|
||||||
|
$("#selectpaymenttype").change(function() {
|
||||||
|
setPaymentType();
|
||||||
|
});
|
||||||
|
function setPaymentType()
|
||||||
|
{
|
||||||
|
var code = $("#selectpaymenttype option:selected").val();
|
||||||
|
if (code == \'CHQ\' || code == \'VIR\')
|
||||||
|
{
|
||||||
|
if (code == \'CHQ\')
|
||||||
|
{
|
||||||
|
$(\'.fieldrequireddyn\').addClass(\'fieldrequired\');
|
||||||
|
}
|
||||||
|
if ($(\'#fieldchqemetteur\').val() == \'\')
|
||||||
|
{
|
||||||
|
var emetteur = jQuery(\'#thirdpartylabel\').val();
|
||||||
|
$(\'#fieldchqemetteur\').val(emetteur);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$(\'.fieldrequireddyn\').removeClass(\'fieldrequired\');
|
||||||
|
$(\'#fieldchqemetteur\').val(\'\');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
';
|
||||||
|
|
||||||
|
print ' });'."\n";
|
||||||
|
|
||||||
|
print ' </script>'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
@ -382,18 +421,29 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Type payment
|
// Type payment
|
||||||
print '<tr><td>';
|
print '<tr><td><span class="fieldrequired">'.$langs->trans('PaymentMode').'</span></td><td>';
|
||||||
print $form->editfieldkey('PaymentMode', 'selectpaymenttype', '', $object, 0, 'string', '', 1).'</td><td>';
|
$form->select_types_paiements($paymenttype, 'paymenttype', '', 2);
|
||||||
$form->select_types_paiements($paymenttype, "paymenttype");
|
print "</td>\n";
|
||||||
print '</td></tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Number
|
// Number
|
||||||
if (!empty($conf->banque->enabled)) {
|
if (!empty($conf->banque->enabled)) {
|
||||||
// Number
|
|
||||||
print '<tr><td><label for="num_payment">'.$langs->trans('Numero');
|
print '<tr><td><label for="num_payment">'.$langs->trans('Numero');
|
||||||
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
|
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
|
||||||
print '</label></td>';
|
print '</label></td>';
|
||||||
print '<td><input name="num_payment" class="maxwidth150onsmartphone" id="num_payment" type="text" value="'.GETPOST("num_payment").'"></td></tr>'."\n";
|
print '<td><input name="num_payment" class="maxwidth150onsmartphone" id="num_payment" type="text" value="'.GETPOST("num_payment").'"></td></tr>'."\n";
|
||||||
|
|
||||||
|
// Check transmitter
|
||||||
|
print '<tr><td class="'.(GETPOST('paymenttype') == 'CHQ' ? 'fieldrequired ' : '').'fieldrequireddyn"><label for="fieldchqemetteur">'.$langs->trans('CheckTransmitter');
|
||||||
|
print ' <em>('.$langs->trans("ChequeMaker").')</em>';
|
||||||
|
print '</label></td>';
|
||||||
|
print '<td><input id="fieldchqemetteur" name="chqemetteur" size="30" type="text" value="'.GETPOST('chqemetteur', 'alphanohtml').'"></td></tr>';
|
||||||
|
|
||||||
|
// Bank name
|
||||||
|
print '<tr><td><label for="chqbank">'.$langs->trans('Bank');
|
||||||
|
print ' <em>('.$langs->trans("ChequeBank").')</em>';
|
||||||
|
print '</label></td>';
|
||||||
|
print '<td><input id="chqbank" name="chqbank" size="30" type="text" value="'.GETPOST('chqbank', 'alphanohtml').'"></td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Accountancy account
|
// Accountancy account
|
||||||
|
|||||||
@ -7645,7 +7645,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'=>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').')'),
|
'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',
|
'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').')'),
|
'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').')'),
|
'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').')'),
|
'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').')'),
|
||||||
@ -7711,7 +7711,12 @@ class Form
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="center">'.$objp->ref.'</td>';
|
print '<td class="center">'.$objp->ref.'</td>';
|
||||||
print '<td>'.$objp->ref_client.'</td>';
|
print '<td>'.$objp->ref_client.'</td>';
|
||||||
print '<td class="right">'.price($objp->total_ht).'</td>';
|
print '<td class="right">';
|
||||||
|
if ($possiblelink[label] == 'LinkToContract') {
|
||||||
|
$form = new Form($db);
|
||||||
|
print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
|
||||||
|
}
|
||||||
|
print price($objp->total_ht).'</td>';
|
||||||
print '<td>'.$objp->name.'</td>';
|
print '<td>'.$objp->name.'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -307,24 +307,26 @@ print '<td width="60" class="center">'.$langs->trans("Value")."</td>\n";
|
|||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
if (!empty($conf->societe->enabled)) {
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print '<td colspan="2">';
|
||||||
|
print $langs->trans("DonationUseThirdparties");
|
||||||
|
print '</td>';
|
||||||
|
print '<td class="center">';
|
||||||
|
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 "</td>\n";
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'" />';
|
print '<input type="hidden" name="token" value="'.newToken().'" />';
|
||||||
print '<input type="hidden" name="action" value="set_DONATION_ACCOUNTINGACCOUNT" />';
|
print '<input type="hidden" name="action" value="set_DONATION_ACCOUNTINGACCOUNT" />';
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
|
||||||
print '<td colspan="2">';
|
|
||||||
print $form->textwithpicto($langs->trans("DonationUserThirdparties"), $langs->trans("DonationUserThirdpartiesDesc"));
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="center">';
|
|
||||||
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 "</td>\n";
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$label = $langs->trans("AccountAccounting");
|
$label = $langs->trans("AccountAccounting");
|
||||||
|
|||||||
@ -44,7 +44,7 @@ if (!empty($conf->projet->enabled)) {
|
|||||||
}
|
}
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
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');
|
$id = GETPOST('rowid') ?GETPOST('rowid', 'int') : GETPOST('id', 'int');
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
@ -178,6 +178,11 @@ if ($action == 'add') {
|
|||||||
|
|
||||||
$error = 0;
|
$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)) {
|
if (empty($donation_date)) {
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
|
||||||
$action = "create";
|
$action = "create";
|
||||||
@ -346,14 +351,15 @@ if ($action == 'create') {
|
|||||||
print '<tbody>';
|
print '<tbody>';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans('Draft').'</td></tr>';
|
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans('Ref').'</td><td>'.$langs->trans('Draft').'</td></tr>';
|
||||||
|
|
||||||
// Company
|
// Company
|
||||||
if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
|
if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
print '<td>'.$langs->trans('Customer').'</td>';
|
if ($soc->id > 0)
|
||||||
if ($soc->id > 0 && !GETPOST('fac_rec', 'alpha')) {
|
{
|
||||||
print '<td colspan="2">';
|
print '<td class="fieldrequired">'.$langs->trans('ThirdParty').'</td>';
|
||||||
|
print '<td>';
|
||||||
print $soc->getNomUrl(1);
|
print $soc->getNomUrl(1);
|
||||||
print '<input type="hidden" name="socid" value="'.$soc->id.'">';
|
print '<input type="hidden" name="socid" value="'.$soc->id.'">';
|
||||||
// Outstanding Bill
|
// Outstanding Bill
|
||||||
@ -370,7 +376,8 @@ if ($action == 'create') {
|
|||||||
print ')';
|
print ')';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td colspan="2">';
|
print '<td class="fieldrequired">'.$langs->trans('ThirdParty').'</td>';
|
||||||
|
print '<td>';
|
||||||
print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
|
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
|
// Option to reload page to retrieve customer informations. Note, this clear other input
|
||||||
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED)) {
|
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED)) {
|
||||||
@ -386,7 +393,7 @@ if ($action == 'create') {
|
|||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
}
|
}
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddThirdParty").'</span><span class="fa fa-plus-circle valignmiddle paddingleft"></span></a>';
|
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddThirdParty").'"></span></a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
@ -540,11 +547,15 @@ if (!empty($id) && $action == 'edit') {
|
|||||||
print "</td>";
|
print "</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\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);
|
$company = new Societe($db);
|
||||||
$result = $company->fetch($object->socid);
|
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td colspan="2">'.$company->getNomUrl(1).'</td></tr>';
|
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td colspan="2">';
|
||||||
|
if ($object->socid > 0) {
|
||||||
|
$result = $company->fetch($object->socid);
|
||||||
|
print $company->getNomUrl(1);
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
} else {
|
} else {
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
print '<tr><td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="maxwidth200" value="'.dol_escape_htmltag($object->societe).'"></td></tr>';
|
print '<tr><td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="maxwidth200" value="'.dol_escape_htmltag($object->societe).'"></td></tr>';
|
||||||
@ -700,11 +711,15 @@ if (!empty($id) && $action != 'edit') {
|
|||||||
print yn($object->public);
|
print yn($object->public);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
if ($object->socid) {
|
if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
|
||||||
$company = new Societe($db);
|
$company = new Societe($db);
|
||||||
$result = $company->fetch($object->socid);
|
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td colspan="2">'.$company->getNomUrl(1).'</td></tr>';
|
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td colspan="2">';
|
||||||
|
if ($object->socid > 0) {
|
||||||
|
$result = $company->fetch($object->socid);
|
||||||
|
print $company->getNomUrl(1);
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
} else {
|
} else {
|
||||||
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="2">'.$object->societe.'</td></tr>';
|
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="2">'.$object->societe.'</td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td colspan="2">'.$object->lastname.'</td></tr>';
|
print '<tr><td>'.$langs->trans("Lastname").'</td><td colspan="2">'.$object->lastname.'</td></tr>';
|
||||||
|
|||||||
@ -21,7 +21,7 @@ CountryNL=Netherlands
|
|||||||
CountryHU=Hungary
|
CountryHU=Hungary
|
||||||
CountryRU=Russia
|
CountryRU=Russia
|
||||||
CountrySE=Sweden
|
CountrySE=Sweden
|
||||||
CountryCI=Ivoiry Coast
|
CountryCI=Ivory Coast
|
||||||
CountrySN=Senegal
|
CountrySN=Senegal
|
||||||
CountryAR=Argentina
|
CountryAR=Argentina
|
||||||
CountryCM=Cameroon
|
CountryCM=Cameroon
|
||||||
|
|||||||
@ -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
|
DONATION_ART885=Show article 885 from CGI if you are concerned
|
||||||
DonationPayment=Donation payment
|
DonationPayment=Donation payment
|
||||||
DonationValidated=Donation %s validated
|
DonationValidated=Donation %s validated
|
||||||
|
DonationUseThirdparties=Use an existing thirdparty as coordinates of donators
|
||||||
|
|||||||
@ -1125,3 +1125,4 @@ ConfirmAffectTag=Bulk Tag Affect
|
|||||||
ConfirmAffectTagQuestion=Are you sure you want to affect tags to the %s selected record(s)?
|
ConfirmAffectTagQuestion=Are you sure you want to affect tags to the %s selected record(s)?
|
||||||
CategTypeNotFound=No tag type found for type of records
|
CategTypeNotFound=No tag type found for type of records
|
||||||
CopiedToClipboard=Copied to clipboard
|
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.
|
||||||
|
|||||||
@ -871,7 +871,7 @@ if (!$source) {
|
|||||||
}
|
}
|
||||||
print '</td><td class="CTableRow'.($var ? '1' : '2').'">';
|
print '</td><td class="CTableRow'.($var ? '1' : '2').'">';
|
||||||
if (empty($amount) || !is_numeric($amount)) {
|
if (empty($amount) || !is_numeric($amount)) {
|
||||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount", 'int').'">';
|
print '<input type="hidden" name="amount" value="'.price2num(GETPOST("amount", 'alpha'), 'MT').'">';
|
||||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount", "alpha"), 'MT').'">';
|
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount", "alpha"), 'MT').'">';
|
||||||
} else {
|
} else {
|
||||||
print '<b>'.price($amount).'</b>';
|
print '<b>'.price($amount).'</b>';
|
||||||
@ -914,8 +914,8 @@ if ($source == 'order') {
|
|||||||
|
|
||||||
if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment
|
if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment
|
||||||
$amount = $order->total_ttc;
|
$amount = $order->total_ttc;
|
||||||
if (GETPOST("amount", 'int')) {
|
if (GETPOST("amount", 'alpha')) {
|
||||||
$amount = GETPOST("amount", 'int');
|
$amount = GETPOST("amount", 'alpha');
|
||||||
}
|
}
|
||||||
$amount = price2num($amount);
|
$amount = price2num($amount);
|
||||||
}
|
}
|
||||||
@ -966,7 +966,7 @@ if ($source == 'order') {
|
|||||||
}
|
}
|
||||||
print '</td><td class="CTableRow'.($var ? '1' : '2').'">';
|
print '</td><td class="CTableRow'.($var ? '1' : '2').'">';
|
||||||
if (empty($amount) || !is_numeric($amount)) {
|
if (empty($amount) || !is_numeric($amount)) {
|
||||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount", 'int').'">';
|
print '<input type="hidden" name="amount" value="'.price2num(GETPOST("amount", 'alpha'), 'MT').'">';
|
||||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount", "alpha"), 'MT').'">';
|
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount", "alpha"), 'MT').'">';
|
||||||
} else {
|
} else {
|
||||||
print '<b>'.price($amount).'</b>';
|
print '<b>'.price($amount).'</b>';
|
||||||
@ -1038,8 +1038,8 @@ if ($source == 'invoice') {
|
|||||||
|
|
||||||
if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment
|
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()));
|
$amount = price2num($invoice->total_ttc - ($invoice->getSommePaiement() + $invoice->getSumCreditNotesUsed() + $invoice->getSumDepositsUsed()));
|
||||||
if (GETPOST("amount", 'int')) {
|
if (GETPOST("amount", 'alpha')) {
|
||||||
$amount = GETPOST("amount", 'int');
|
$amount = GETPOST("amount", 'alpha');
|
||||||
}
|
}
|
||||||
$amount = price2num($amount);
|
$amount = price2num($amount);
|
||||||
}
|
}
|
||||||
@ -1093,7 +1093,7 @@ if ($source == 'invoice') {
|
|||||||
print '<b>'.$langs->trans("CreditNote").'</b>';
|
print '<b>'.$langs->trans("CreditNote").'</b>';
|
||||||
} elseif (empty($object->paye)) {
|
} elseif (empty($object->paye)) {
|
||||||
if (empty($amount) || !is_numeric($amount)) {
|
if (empty($amount) || !is_numeric($amount)) {
|
||||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount", 'int').'">';
|
print '<input type="hidden" name="amount" value="'.price2num(GETPOST("amount", 'alpha'), 'MT').'">';
|
||||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount", "alpha"), 'MT').'">';
|
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount", "alpha"), 'MT').'">';
|
||||||
} else {
|
} else {
|
||||||
print '<b>'.price($amount).'</b>';
|
print '<b>'.price($amount).'</b>';
|
||||||
@ -1204,8 +1204,8 @@ if ($source == 'contractline') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST("amount", 'int')) {
|
if (GETPOST("amount", 'alpha')) {
|
||||||
$amount = GETPOST("amount", 'int');
|
$amount = GETPOST("amount", 'alpha');
|
||||||
}
|
}
|
||||||
$amount = price2num($amount);
|
$amount = price2num($amount);
|
||||||
}
|
}
|
||||||
@ -1297,7 +1297,7 @@ if ($source == 'contractline') {
|
|||||||
}
|
}
|
||||||
print '</td><td class="CTableRow'.($var ? '1' : '2').'">';
|
print '</td><td class="CTableRow'.($var ? '1' : '2').'">';
|
||||||
if (empty($amount) || !is_numeric($amount)) {
|
if (empty($amount) || !is_numeric($amount)) {
|
||||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount", 'int').'">';
|
print '<input type="hidden" name="amount" value="'.price2num(GETPOST("amount", 'alpha'), 'MT').'">';
|
||||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount", "alpha"), 'MT').'">';
|
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount", "alpha"), 'MT').'">';
|
||||||
} else {
|
} else {
|
||||||
print '<b>'.price($amount).'</b>';
|
print '<b>'.price($amount).'</b>';
|
||||||
@ -1370,10 +1370,10 @@ if ($source == 'membersubscription') {
|
|||||||
|
|
||||||
if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment
|
if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment
|
||||||
$amount = $subscription->total_ttc;
|
$amount = $subscription->total_ttc;
|
||||||
if (GETPOST("amount", 'int')) {
|
if (GETPOST("amount", 'alpha')) {
|
||||||
$amount = GETPOST("amount", 'int');
|
$amount = GETPOST("amount", 'alpha');
|
||||||
}
|
}
|
||||||
$amount = price2num($amount);
|
$amount = price2num($amount, 'MT');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST('fulltag', 'alpha')) {
|
if (GETPOST('fulltag', 'alpha')) {
|
||||||
@ -1473,12 +1473,18 @@ if ($source == 'membersubscription') {
|
|||||||
if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) {
|
if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) {
|
||||||
$valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
|
$valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
|
||||||
}
|
}
|
||||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount", 'int').'">';
|
print '<input type="hidden" name="amount" value="'.price2num(GETPOST("amount", 'alpha'), 'MT').'">';
|
||||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.$valtoshow.'">';
|
if (empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) {
|
||||||
|
print '<input class="flat maxwidth75" type="text" name="newamountbis" value="'.$valtoshow.'" disabled>';
|
||||||
|
print '<input type="hidden" name="newamount" value="'.$valtoshow.'">';
|
||||||
|
} else {
|
||||||
|
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.$valtoshow.'">';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$valtoshow = $amount;
|
$valtoshow = $amount;
|
||||||
if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) {
|
if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) {
|
||||||
$valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
|
$valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
|
||||||
|
$amount = $valtoshow;
|
||||||
}
|
}
|
||||||
print '<b>'.price($valtoshow).'</b>';
|
print '<b>'.price($valtoshow).'</b>';
|
||||||
print '<input type="hidden" name="amount" value="'.$valtoshow.'">';
|
print '<input type="hidden" name="amount" value="'.$valtoshow.'">';
|
||||||
@ -1548,8 +1554,8 @@ if ($source == 'donation') {
|
|||||||
|
|
||||||
if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment
|
if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment
|
||||||
$amount = $subscription->total_ttc;
|
$amount = $subscription->total_ttc;
|
||||||
if (GETPOST("amount", 'int')) {
|
if (GETPOST("amount", 'alpha')) {
|
||||||
$amount = GETPOST("amount", 'int');
|
$amount = GETPOST("amount", 'alpha');
|
||||||
}
|
}
|
||||||
$amount = price2num($amount);
|
$amount = price2num($amount);
|
||||||
}
|
}
|
||||||
@ -1627,12 +1633,13 @@ if ($source == 'donation') {
|
|||||||
if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) {
|
if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) {
|
||||||
$valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
|
$valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
|
||||||
}
|
}
|
||||||
print '<input type="hidden" name="amount" value="'.GETPOST("amount", 'int').'">';
|
print '<input type="hidden" name="amount" value="'.price2num(GETPOST("amount", 'alpha'), 'MT').'">';
|
||||||
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.$valtoshow.'">';
|
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.$valtoshow.'">';
|
||||||
} else {
|
} else {
|
||||||
$valtoshow = $amount;
|
$valtoshow = $amount;
|
||||||
if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) {
|
if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) {
|
||||||
$valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
|
$valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
|
||||||
|
$amount = $valtoshow;
|
||||||
}
|
}
|
||||||
print '<b>'.price($valtoshow).'</b>';
|
print '<b>'.price($valtoshow).'</b>';
|
||||||
print '<input type="hidden" name="amount" value="'.$valtoshow.'">';
|
print '<input type="hidden" name="amount" value="'.$valtoshow.'">';
|
||||||
@ -2126,6 +2133,10 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* Disable button to pay and show hourglass cursor */
|
||||||
|
jQuery('#hourglasstopay').show();
|
||||||
|
jQuery('#buttontopay').hide();
|
||||||
|
|
||||||
stripe.handleCardPayment(
|
stripe.handleCardPayment(
|
||||||
clientSecret, cardElement, {
|
clientSecret, cardElement, {
|
||||||
payment_method_data: {
|
payment_method_data: {
|
||||||
|
|||||||
@ -75,7 +75,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
<td width="25%">
|
<td width="25%">
|
||||||
<table class="nobordernopadding">
|
<table class="nobordernopadding">
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="15"></td>
|
<td><input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="24"></td>
|
||||||
<td><?php echo $this->control->tpl['help_customercode']; ?></td>
|
<td><?php echo $this->control->tpl['help_customercode']; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -86,14 +86,14 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
<tr>
|
<tr>
|
||||||
<td><span class="fieldrequired"><?php echo $langs->trans('Supplier'); ?></span></td>
|
<td><span class="fieldrequired"><?php echo $langs->trans('Supplier'); ?></span></td>
|
||||||
<td><?php echo $this->control->tpl['yn_supplier']; ?></td>
|
<td><?php echo $this->control->tpl['yn_supplier']; ?></td>
|
||||||
<td><?php echo $langs->trans('SupplierCode'); ?></td>
|
<td><?php echo $langs->trans('SupplierCode'); ?></td>
|
||||||
<td>
|
<td>
|
||||||
<table class="nobordernopadding">
|
<table class="nobordernopadding">
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="15"></td>
|
<td><input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="24"></td>
|
||||||
<td><?php echo $this->control->tpl['help_suppliercode']; ?></td>
|
<td><?php echo $this->control->tpl['help_suppliercode']; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@ -76,7 +76,7 @@ $contact = $GLOBALS['objcanvas']->control->object;
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<?php if ($this->control->tpl['ismodifiable_customercode']) { ?>
|
<?php if ($this->control->tpl['ismodifiable_customercode']) { ?>
|
||||||
<input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="15">
|
<input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="24">
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<?php echo $this->control->tpl['customercode']; ?>
|
<?php echo $this->control->tpl['customercode']; ?>
|
||||||
<input type="hidden" name="code_client" value="<?php echo $this->control->tpl['customercode']; ?>">
|
<input type="hidden" name="code_client" value="<?php echo $this->control->tpl['customercode']; ?>">
|
||||||
@ -97,7 +97,7 @@ $contact = $GLOBALS['objcanvas']->control->object;
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<?php if ($this->control->tpl['ismodifiable_suppliercode']) { ?>
|
<?php if ($this->control->tpl['ismodifiable_suppliercode']) { ?>
|
||||||
<input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="15">
|
<input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="24">
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<?php echo $this->control->tpl['suppliercode']; ?>
|
<?php echo $this->control->tpl['suppliercode']; ?>
|
||||||
<input type="hidden" name="code_fournisseur" value="<?php echo $this->control->tpl['suppliercode']; ?>">
|
<input type="hidden" name="code_fournisseur" value="<?php echo $this->control->tpl['suppliercode']; ?>">
|
||||||
|
|||||||
@ -83,7 +83,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
<td width="25%">
|
<td width="25%">
|
||||||
<table class="nobordernopadding">
|
<table class="nobordernopadding">
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="15"></td>
|
<td><input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="24"></td>
|
||||||
<td><?php echo $this->control->tpl['help_customercode']; ?></td>
|
<td><?php echo $this->control->tpl['help_customercode']; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -94,14 +94,14 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
<tr>
|
<tr>
|
||||||
<td><span class="fieldrequired"><?php echo $langs->trans('Supplier'); ?></span></td>
|
<td><span class="fieldrequired"><?php echo $langs->trans('Supplier'); ?></span></td>
|
||||||
<td><?php echo $this->control->tpl['yn_supplier']; ?></td>
|
<td><?php echo $this->control->tpl['yn_supplier']; ?></td>
|
||||||
<td><?php echo $langs->trans('SupplierCode'); ?></td>
|
<td><?php echo $langs->trans('SupplierCode'); ?></td>
|
||||||
<td>
|
<td>
|
||||||
<table class="nobordernopadding">
|
<table class="nobordernopadding">
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="15"></td>
|
<td><input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="24"></td>
|
||||||
<td><?php echo $this->control->tpl['help_suppliercode']; ?></td>
|
<td><?php echo $this->control->tpl['help_suppliercode']; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@ -72,7 +72,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<?php if ($this->control->tpl['ismodifiable_customercode']) { ?>
|
<?php if ($this->control->tpl['ismodifiable_customercode']) { ?>
|
||||||
<input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="15">
|
<input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="24">
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<?php echo $this->control->tpl['customercode']; ?>
|
<?php echo $this->control->tpl['customercode']; ?>
|
||||||
<input type="hidden" name="code_client" value="<?php echo $this->control->tpl['customercode']; ?>">
|
<input type="hidden" name="code_client" value="<?php echo $this->control->tpl['customercode']; ?>">
|
||||||
@ -93,7 +93,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<?php if ($this->control->tpl['ismodifiable_suppliercode']) { ?>
|
<?php if ($this->control->tpl['ismodifiable_suppliercode']) { ?>
|
||||||
<input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="15">
|
<input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="24">
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<?php echo $this->control->tpl['suppliercode']; ?>
|
<?php echo $this->control->tpl['suppliercode']; ?>
|
||||||
<input type="hidden" name="code_fournisseur" value="<?php echo $this->control->tpl['suppliercode']; ?>">
|
<input type="hidden" name="code_fournisseur" value="<?php echo $this->control->tpl['suppliercode']; ?>">
|
||||||
|
|||||||
@ -1270,7 +1270,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
if (empty($tmpcode) && !empty($modCodeClient->code_auto)) {
|
if (empty($tmpcode) && !empty($modCodeClient->code_auto)) {
|
||||||
$tmpcode = $modCodeClient->getNextValue($object, 0);
|
$tmpcode = $modCodeClient->getNextValue($object, 0);
|
||||||
}
|
}
|
||||||
print '<input type="text" name="customer_code" id="customer_code" class="maxwidthonsmartphone" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
|
print '<input type="text" name="customer_code" id="customer_code" class="maxwidthonsmartphone" value="'.dol_escape_htmltag($tmpcode).'" maxlength="24">';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
$s = $modCodeClient->getToolTip($langs, $object, 0);
|
$s = $modCodeClient->getToolTip($langs, $object, 0);
|
||||||
print $form->textwithpicto('', $s, 1);
|
print $form->textwithpicto('', $s, 1);
|
||||||
@ -1305,7 +1305,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) {
|
if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) {
|
||||||
$tmpcode = $modCodeFournisseur->getNextValue($object, 1);
|
$tmpcode = $modCodeFournisseur->getNextValue($object, 1);
|
||||||
}
|
}
|
||||||
print '<input type="text" name="supplier_code" id="supplier_code" class="maxwidthonsmartphone" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
|
print '<input type="text" name="supplier_code" id="supplier_code" class="maxwidthonsmartphone" value="'.dol_escape_htmltag($tmpcode).'" maxlength="24">';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
$s = $modCodeFournisseur->getToolTip($langs, $object, 1);
|
$s = $modCodeFournisseur->getToolTip($langs, $object, 1);
|
||||||
print $form->textwithpicto('', $s, 1);
|
print $form->textwithpicto('', $s, 1);
|
||||||
@ -1944,9 +1944,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
if (empty($tmpcode) && !empty($modCodeClient->code_auto)) {
|
if (empty($tmpcode) && !empty($modCodeClient->code_auto)) {
|
||||||
$tmpcode = $modCodeClient->getNextValue($object, 0);
|
$tmpcode = $modCodeClient->getNextValue($object, 0);
|
||||||
}
|
}
|
||||||
print '<input type="text" name="customer_code" id="customer_code" size="16" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
|
print '<input type="text" name="customer_code" id="customer_code" size="16" value="'.dol_escape_htmltag($tmpcode).'" maxlength="24">';
|
||||||
} elseif ($object->codeclient_modifiable()) {
|
} elseif ($object->codeclient_modifiable()) {
|
||||||
print '<input type="text" name="customer_code" id="customer_code" size="16" value="'.dol_escape_htmltag($object->code_client).'" maxlength="15">';
|
print '<input type="text" name="customer_code" id="customer_code" size="16" value="'.dol_escape_htmltag($object->code_client).'" maxlength="24">';
|
||||||
} else {
|
} else {
|
||||||
print $object->code_client;
|
print $object->code_client;
|
||||||
print '<input type="hidden" name="customer_code" value="'.dol_escape_htmltag($object->code_client).'">';
|
print '<input type="hidden" name="customer_code" value="'.dol_escape_htmltag($object->code_client).'">';
|
||||||
@ -1984,9 +1984,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) {
|
if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) {
|
||||||
$tmpcode = $modCodeFournisseur->getNextValue($object, 1);
|
$tmpcode = $modCodeFournisseur->getNextValue($object, 1);
|
||||||
}
|
}
|
||||||
print '<input type="text" name="supplier_code" id="supplier_code" size="16" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
|
print '<input type="text" name="supplier_code" id="supplier_code" size="16" value="'.dol_escape_htmltag($tmpcode).'" maxlength="24">';
|
||||||
} elseif ($object->codefournisseur_modifiable()) {
|
} elseif ($object->codefournisseur_modifiable()) {
|
||||||
print '<input type="text" name="supplier_code" id="supplier_code" size="16" value="'.dol_escape_htmltag($object->code_fournisseur).'" maxlength="15">';
|
print '<input type="text" name="supplier_code" id="supplier_code" size="16" value="'.dol_escape_htmltag($object->code_fournisseur).'" maxlength="24">';
|
||||||
} else {
|
} else {
|
||||||
print $object->code_fournisseur;
|
print $object->code_fournisseur;
|
||||||
print '<input type="hidden" name="supplier_code" value="'.$object->code_fournisseur.'">';
|
print '<input type="hidden" name="supplier_code" value="'.$object->code_fournisseur.'">';
|
||||||
|
|||||||
@ -334,7 +334,6 @@ class DateLibTest extends PHPUnit\Framework\TestCase
|
|||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertSame('1 '.strtolower(dol_substr($langs->trans("Day"), 0, 1).'.'), $result);
|
$this->assertSame('1 '.strtolower(dol_substr($langs->trans("Day"), 0, 1).'.'), $result);
|
||||||
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -82,9 +82,9 @@ class DateLibTzFranceTest extends PHPUnit\Framework\TestCase
|
|||||||
{
|
{
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
|
|
||||||
if (getServerTimeZoneString() != 'Europe/Paris') {
|
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+1 Europe/Paris, not a TZ=".getServerTimeZoneString().".\n"; die();
|
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.
|
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user