diff --git a/htdocs/compta/salaries/fiche.php b/htdocs/compta/salaries/fiche.php index 9ff49c2ad114aa16668432a6ccdb03586839f913..2cdca50a71fd3526a7b6111a253588613ed13802 100644 --- a/htdocs/compta/salaries/fiche.php +++ b/htdocs/compta/salaries/fiche.php @@ -22,6 +22,7 @@ */ require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/salaries.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; @@ -155,6 +156,23 @@ if ($id) // Formulaire saisie salaire if ($action == 'create') { + $year_current = strftime("%Y",dol_now()); + $pastmonth = strftime("%m",dol_now()) - 1; + $pastmonthyear = $year_current; + if ($pastmonth == 0) + { + $pastmonth = 12; + $pastmonthyear--; + } + + $datesp=dol_mktime(0, 0, 0, $datespmonth, $datespday, $datespyear); + $dateep=dol_mktime(23, 59, 59, $dateepmonth, $dateepday, $dateepyear); + + if (empty($datesp) || empty($dateep)) // We define date_start and date_end + { + $datesp=dol_get_first_day($pastmonthyear,$pastmonth,false); $dateep=dol_get_last_day($pastmonthyear,$pastmonth,false); + } + print "<form name='add' action=\"fiche.php\" method=\"post\">\n"; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="action" value="add">'; diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 909a5cb39aaad92288df8b633fe474d0092c8720..ffa1db78b34e39dd0c119ed92be1d003f1be3d12 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -52,6 +52,7 @@ TaxAndDividendsArea=Tax, social contributions and dividends area SocialContribution=Social contribution SocialContributions=Social contributions MenuTaxAndDividends=Taxes and dividends +MenuSalaries=Salaries MenuSocialContributions=Social contributions MenuNewSocialContribution=New contribution NewSocialContribution=New social contribution @@ -70,8 +71,8 @@ ListOfPayments=List of payments ListOfCustomerPayments=List of customer payments ListOfSupplierPayments=List of supplier payments DatePayment=Payment date -Datesp=Date start period -Dateep=Date end period +DateStartPeriod=Date start period +DateEndPeriod=Date end period NewVATPayment=New VAT payment NewSalPayment=New Salary payment newLT2PaymentES=New IRPF payment diff --git a/htdocs/langs/fr_FR/compta.lang b/htdocs/langs/fr_FR/compta.lang index 99cc954ab6d3dc0d9498ee252d2d2d48a761ae56..f3d23f5f437d60f3666fba5b6ea8605ea89104b1 100644 --- a/htdocs/langs/fr_FR/compta.lang +++ b/htdocs/langs/fr_FR/compta.lang @@ -51,6 +51,7 @@ TaxAndDividendsArea=Espace taxes, charges sociales et dividendes SocialContribution=Charge sociale SocialContributions=Charges sociales MenuTaxAndDividends=Taxes et charges +MenuSalaries=Salaires MenuSocialContributions=Charges sociales MenuNewSocialContribution=Nouvelle charge NewSocialContribution=Nouvelle charge sociale @@ -69,6 +70,8 @@ ListOfPayments=Liste des règlements ListOfCustomerPayments=Liste des règlements clients ListOfSupplierPayments=Liste des règlements fournisseurs DatePayment=Date de règlement +DateStartPeriod=Date de début période +DateEndPeriod=Date de fin période NewVATPayment=Nouveau règlement de TVA NewSalPayment=Nouveau règlement de salaire newLT2PaymentES=Nouveau règlement de IRPF