From 74d3fdae151c80aa336b7f4209781661e6eb9b96 Mon Sep 17 00:00:00 2001 From: aspangaro <alexandre.spangaro@gmail.com> Date: Fri, 7 Mar 2014 06:42:48 +0100 Subject: [PATCH] Update langs & fix period for salaries in tax module --- htdocs/compta/salaries/fiche.php | 18 ++++++++++++++++++ htdocs/langs/en_US/compta.lang | 5 +++-- htdocs/langs/fr_FR/compta.lang | 3 +++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/salaries/fiche.php b/htdocs/compta/salaries/fiche.php index 9ff49c2ad11..2cdca50a71f 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 909a5cb39aa..ffa1db78b34 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 99cc954ab6d..f3d23f5f437 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 -- GitLab