Debug v17
This commit is contained in:
parent
7510ed68a8
commit
247d950e6a
@ -274,24 +274,27 @@ function getDefaultDatesForTransfer()
|
|||||||
{
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
|
$date_start = '';
|
||||||
|
$date_end = '';
|
||||||
$pastmonth = 0;
|
$pastmonth = 0;
|
||||||
$pastmonthyear = 0;
|
$pastmonthyear = 0;
|
||||||
|
|
||||||
// Period by default on transfer (0: previous month | 1: current month | 2: fiscal year)
|
// Period by default on transfer (0: previous month | 1: current month | 2: fiscal year)
|
||||||
$periodbydefaultontransfer = (empty($conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER) ? 0 : $conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER);
|
$periodbydefaultontransfer = (empty($conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER) ? 0 : $conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER);
|
||||||
if ($periodbydefaultontransfer == 2) {
|
if ($periodbydefaultontransfer == 2) { // fiscal year
|
||||||
$sql = "SELECT date_start, date_end FROM ".MAIN_DB_PREFIX."accounting_fiscalyear";
|
$sql = "SELECT date_start, date_end FROM ".MAIN_DB_PREFIX."accounting_fiscalyear";
|
||||||
$sql .= " WHERE date_start < '".$db->idate(dol_now())."' AND date_end > '".$db->idate(dol_now())."'";
|
$sql .= " WHERE date_start < '".$db->idate(dol_now())."' AND date_end > '".$db->idate(dol_now())."'";
|
||||||
$sql .= $db->plimit(1);
|
$sql .= $db->plimit(1);
|
||||||
$res = $db->query($sql);
|
$res = $db->query($sql);
|
||||||
if ($res->num_rows > 0) {
|
if ($res->num_rows > 0) {
|
||||||
$fiscalYear = $db->fetch_object($res);
|
$obj = $db->fetch_object($res);
|
||||||
$date_start = strtotime($fiscalYear->date_start);
|
|
||||||
$date_end = strtotime($fiscalYear->date_end);
|
$date_start = $db->jdate($obj->date_start);
|
||||||
|
$date_end = $db->jdate($obj->date_end);
|
||||||
} else {
|
} else {
|
||||||
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
$month_start = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1);
|
||||||
$year_start = dol_print_date(dol_now(), '%Y');
|
$year_start = dol_print_date(dol_now(), '%Y');
|
||||||
if ($conf->global->SOCIETE_FISCAL_MONTH_START > dol_print_date(dol_now(), '%m')) {
|
if ($month_start > dol_print_date(dol_now(), '%m')) {
|
||||||
$year_start = $year_start - 1;
|
$year_start = $year_start - 1;
|
||||||
}
|
}
|
||||||
$year_end = $year_start + 1;
|
$year_end = $year_start + 1;
|
||||||
@ -303,17 +306,17 @@ function getDefaultDatesForTransfer()
|
|||||||
$date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start);
|
$date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start);
|
||||||
$date_end = dol_get_last_day($year_end, $month_end);
|
$date_end = dol_get_last_day($year_end, $month_end);
|
||||||
}
|
}
|
||||||
} elseif ($periodbydefaultontransfer == 1) {
|
} elseif ($periodbydefaultontransfer == 1) { // current month
|
||||||
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
$year_current = (int) dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||||
$pastmonth = strftime("%m", dol_now());
|
$pastmonth = (int) dol_print_date(dol_now('gmt'), '%m', 'gmt');
|
||||||
$pastmonthyear = $year_current;
|
$pastmonthyear = $year_current;
|
||||||
if ($pastmonth == 0) {
|
if ($pastmonth == 0) {
|
||||||
$pastmonth = 12;
|
$pastmonth = 12;
|
||||||
$pastmonthyear--;
|
$pastmonthyear--;
|
||||||
}
|
}
|
||||||
} else {
|
} else { // previous month
|
||||||
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
$year_current = (int) dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||||
$pastmonth = strftime("%m", dol_now()) - 1;
|
$pastmonth = (int) dol_print_date(dol_now('gmt'), '%m', 'gmt') - 1;
|
||||||
$pastmonthyear = $year_current;
|
$pastmonthyear = $year_current;
|
||||||
if ($pastmonth == 0) {
|
if ($pastmonth == 0) {
|
||||||
$pastmonth = 12;
|
$pastmonth = 12;
|
||||||
|
|||||||
@ -74,12 +74,12 @@ MemberTypeCanNotBeDeleted=Member type can not be deleted
|
|||||||
NewSubscription=New contribution
|
NewSubscription=New contribution
|
||||||
NewSubscriptionDesc=This form allows you to record your subscription as a new member of the foundation. If you want to renew your subscription (if already a member), please contact foundation board instead by email %s.
|
NewSubscriptionDesc=This form allows you to record your subscription as a new member of the foundation. If you want to renew your subscription (if already a member), please contact foundation board instead by email %s.
|
||||||
Subscription=Contribution
|
Subscription=Contribution
|
||||||
AnyAmountWithAdvisedAmount=Any amount with a recommended amount of %s %s
|
AnyAmountWithAdvisedAmount=Any amount of your choice, recommended %s
|
||||||
AnyAmountWithoutAdvisedAmount=Any amount
|
AnyAmountWithoutAdvisedAmount=Any amount of your choice
|
||||||
CanEditAmountShort=Any amount
|
CanEditAmountShort=Any amount
|
||||||
CanEditAmountShortForValues=recommended, any amount
|
CanEditAmountShortForValues=recommended, any amount
|
||||||
MembershipDuration=Duration
|
MembershipDuration=Duration
|
||||||
GetMembershipButtonLabel=Get membership
|
GetMembershipButtonLabel=Join
|
||||||
Subscriptions=Contributions
|
Subscriptions=Contributions
|
||||||
SubscriptionLate=Late
|
SubscriptionLate=Late
|
||||||
SubscriptionNotReceived=Contribution never received
|
SubscriptionNotReceived=Contribution never received
|
||||||
|
|||||||
@ -779,7 +779,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW
|
|||||||
if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT) || $caneditamount) {
|
if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT) || $caneditamount) {
|
||||||
print '<input type="text" name="amount" id="amount" class="flat amount width50" value="'.$showedamount.'">';
|
print '<input type="text" name="amount" id="amount" class="flat amount width50" value="'.$showedamount.'">';
|
||||||
print ' '.$langs->trans("Currency".$conf->currency).'<span class="opacitymedium"> – ';
|
print ' '.$langs->trans("Currency".$conf->currency).'<span class="opacitymedium"> – ';
|
||||||
print $amount>0? $langs->trans("AnyAmountWithAdvisedAmount", $amount, $langs->trans("Currency".$conf->currency)): $langs->trans("AnyAmountWithoutAdvisedAmount");
|
print $amount > 0 ? $langs->trans("AnyAmountWithAdvisedAmount", price($amount, 0, $langs, 1, -1, -1, $conf->currency)): $langs->trans("AnyAmountWithoutAdvisedAmount");
|
||||||
print '</span>';
|
print '</span>';
|
||||||
} else {
|
} else {
|
||||||
print '<input type="hidden" name="amount" id="amount" class="flat amount" value="'.$showedamount.'">';
|
print '<input type="hidden" name="amount" id="amount" class="flat amount" value="'.$showedamount.'">';
|
||||||
@ -815,12 +815,14 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW
|
|||||||
|
|
||||||
$publiccounters = getDolGlobalString("MEMBER_COUNTERS_ARE_PUBLIC");
|
$publiccounters = getDolGlobalString("MEMBER_COUNTERS_ARE_PUBLIC");
|
||||||
|
|
||||||
$sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.amount, d.caneditamount, d.vote, d.note, d.duration, d.statut as status, d.morphy, COUNT(a.rowid) AS membercount";
|
$sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.amount, d.caneditamount, d.vote, d.note, d.duration, d.statut as status, d.morphy,";
|
||||||
|
$sql .= " COUNT(a.rowid) AS membercount";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent as a";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent as a";
|
||||||
$sql .= " ON d.rowid = a.fk_adherent_type AND a.statut > 0";
|
$sql .= " ON d.rowid = a.fk_adherent_type AND a.statut > 0";
|
||||||
$sql .= " WHERE d.entity IN (".getEntity('member_type').")";
|
$sql .= " WHERE d.entity IN (".getEntity('member_type').")";
|
||||||
$sql .= " AND d.statut=1 GROUP BY d.rowid";
|
$sql .= " AND d.statut=1";
|
||||||
|
$sql .= " GROUP BY d.rowid, d.libelle, d.subscription, d.amount, d.caneditamount, d.vote, d.note, d.duration, d.statut, d.morphy";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user