FIX Date of payment of subscription must not be set to 1970-01-01.

Fix look and feel v14
This commit is contained in:
Laurent Destailleur 2021-08-23 15:00:29 +02:00
parent 983d7e5177
commit a25346e302
5 changed files with 29 additions and 26 deletions

View File

@ -1822,7 +1822,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$result = $company->fetch($object->socid);
print $company->getNomUrl(1);
} else {
print $langs->trans("NoThirdPartyAssociatedToMember");
print '<span class="opacitymedium">'.$langs->trans("NoThirdPartyAssociatedToMember").'</span>';
}
}
print '</td></tr>';
@ -1846,7 +1846,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
print '</td></tr>';
//VCard
// VCard
print '<tr><td>';
print $langs->trans("VCard").'</td><td colspan="3">';
print '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'">';

View File

@ -209,7 +209,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
// Subscription informations
$datesubscription = 0;
$datesubend = 0;
$paymentdate = 0;
$paymentdate = ''; // Do not use 0 here, default value is '' that means not filled where 0 means 1970-01-01
if (GETPOST("reyear", "int") && GETPOST("remonth", "int") && GETPOST("reday", "int")) {
$datesubscription = dol_mktime(0, 0, 0, GETPOST("remonth", "int"), GETPOST("reday", "int"), GETPOST("reyear", "int"));
}
@ -602,7 +602,7 @@ if ($rowid > 0) {
$result = $company->fetch($object->fk_soc);
print $company->getNomUrl(1);
} else {
print $langs->trans("NoThirdPartyAssociatedToMember");
print '<span class="opacitymedium">'.$langs->trans("NoThirdPartyAssociatedToMember").'</span>';
}
}
print '</td></tr>';
@ -628,7 +628,7 @@ if ($rowid > 0) {
if ($object->user_id) {
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none');
} else {
print $langs->trans("NoDolibarrAccess");
print '<span class="opacitymedium">'.$langs->trans("NoDolibarrAccess").'</span>';
}
}
print '</td></tr>';
@ -970,17 +970,18 @@ if ($rowid > 0) {
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('MoreActions');
print '</td>';
print '<td>';
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice) ? ' checked' : '').'> '.$langs->trans("None").'<br>';
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice) ? ' checked' : '').'>';
print '<label for="none"> '.$langs->trans("None").'</label><br>';
// Add entry into bank accoun
if (!empty($conf->banque->enabled)) {
print '<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.(!empty($bankdirect) ? ' checked' : '');
print '> '.$langs->trans("MoreActionBankDirect").'<br>';
print '><label for="bankdirect"> '.$langs->trans("MoreActionBankDirect").'</label><br>';
}
// Add invoice with no payments
if (!empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.(!empty($invoiceonly) ? ' checked' : '');
//if (empty($object->fk_soc)) print ' disabled';
print '> '.$langs->trans("MoreActionInvoiceOnly");
print '><label for="invoiceonly"> '.$langs->trans("MoreActionInvoiceOnly");
if ($object->fk_soc) {
print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
} else {
@ -1004,13 +1005,13 @@ if ($rowid > 0) {
}
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
}
print '<br>';
print '</label><br>';
}
// Add invoice with payments
if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.(!empty($bankviainvoice) ? ' checked' : '');
//if (empty($object->fk_soc)) print ' disabled';
print '> '.$langs->trans("MoreActionBankViaInvoice");
print '><label for="bankviainvoice"> '.$langs->trans("MoreActionBankViaInvoice");
if ($object->fk_soc) {
print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
} else {
@ -1034,7 +1035,7 @@ if ($rowid > 0) {
}
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
}
print '<br>';
print '</label><br>';
}
print '</td></tr>';

View File

@ -272,6 +272,19 @@ function societe_prepare_head(Societe $object)
$h++;
}
if (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'thirdparty') {
if (!empty($user->rights->partnership->read)) {
$nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0;
$head[$h][0] = DOL_URL_ROOT.'/societe/partnership.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Partnership");
$head[$h][2] = 'partnership';
if ($nbPartnership > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbPartnership.'</span>';
}
$h++;
}
}
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab

View File

@ -63,9 +63,7 @@ function member_prepare_head(Adherent $object)
$h++;
}
$tabtoadd = (!empty(getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR')) && getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') ? 'member' : 'thirdparty';
if ($tabtoadd == 'member') {
if (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') {
if (!empty($user->rights->partnership->read)) {
$nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0;
$head[$h][0] = DOL_URL_ROOT.'/adherents/partnership.php?rowid='.$object->id;
@ -76,20 +74,8 @@ function member_prepare_head(Adherent $object)
}
$h++;
}
} else {
if (!empty($user->rights->partnership->read)) {
$nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0;
$head[$h][0] = DOL_URL_ROOT.'/societe/partnership.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Partnership");
$head[$h][2] = 'partnership';
if ($nbPartnership > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbPartnership.'</span>';
}
$h++;
}
}
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab

View File

@ -50,6 +50,9 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
$socid = GETPOST('socid', 'int');
if (!empty($user->socid)) {
$socid = $user->socid;
}
if (empty($id) && $socid && (empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) || $conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'thirdparty')) {
$id = $socid;
}