From 2b7b7e014d5c7ae10985975d26284cca58d36995 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 22 Jan 2016 13:20:21 +0100 Subject: [PATCH 01/12] Fix: for avoid conflict with "global $m" in memory.lib.php --- htdocs/comm/mailing/cibles.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index b73f8a0743b..2a1defe5319 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -484,24 +484,24 @@ if ($object->fetch($id) >= 0) if ($obj->source_type == 'member') { include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; - $m=new Adherent($db); - $m->fetch($obj->source_id); - print $m->getNomUrl(2); + $objectstatic=new Adherent($db); + $objectstatic->fetch($obj->source_id); + print $objectstatic->getNomUrl(2); } else if ($obj->source_type == 'user') { include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; - $m=new User($db); - $m->fetch($obj->source_id); - $m->id=$obj->source_id; - print $m->getNomUrl(2); + $objectstatic=new User($db); + $objectstatic->fetch($obj->source_id); + $objectstatic->id=$obj->source_id; + print $objectstatic->getNomUrl(2); } else if ($obj->source_type == 'thirdparty') { include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; - $m=new Societe($db); - $m->fetch($obj->source_id); - print $m->getNomUrl(2); + $objectstatic=new Societe($db); + $objectstatic->fetch($obj->source_id); + print $objectstatic->getNomUrl(2); } else { From 83263e242e72effdcd4038e59971f3780895ed0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 23 Jan 2016 20:32:22 +0100 Subject: [PATCH 02/12] Corrected typo of PR #4444 --- htdocs/product/class/product.class.php | 4 ++-- htdocs/product/price.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 2bf92821c1e..37f7d228869 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1510,7 +1510,7 @@ class Product extends CommonObject $sql.= " WHERE entity IN (".getEntity('productprice', 1).")"; $sql.= " AND price_level=".$i; $sql.= " AND fk_product = '".$this->id."'"; - $sql.= " ORDER BY date_price, rowid DESC"; + $sql.= " ORDER BY date_price DESC, rowid DESC"; $sql.= " LIMIT 1"; $resql = $this->db->query($sql); if ($resql) @@ -1571,7 +1571,7 @@ class Product extends CommonObject $sql.= " price_base_type, tva_tx, tosell, price_by_qty, rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."product_price"; $sql.= " WHERE fk_product = '".$this->id."'"; - $sql.= " ORDER BY date_price, rowid DESC"; + $sql.= " ORDER BY date_price DESC, rowid DESC"; $sql.= " LIMIT 1"; $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 79ee0dd0f55..f338a0b4dd9 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -687,7 +687,7 @@ $sql .= " WHERE fk_product = " . $object->id; $sql .= " AND p.entity IN (" . getEntity('productprice', 1) . ")"; $sql .= " AND p.fk_user_author = u.rowid"; if (! empty($socid) && ! empty($conf->global->PRODUIT_MULTIPRICES)) $sql .= " AND p.price_level = " . $soc->price_level; -$sql .= " ORDER BY p.date_price, p.rowid DESC, p.price_level ASC"; +$sql .= " ORDER BY p.date_price DESC, p.rowid DESC, p.price_level ASC"; // $sql .= $db->plimit(); dol_syslog("sql=" . $sql); From c2efee8a2923be093f159dbb87f4a3aed693cab2 Mon Sep 17 00:00:00 2001 From: fmarcet Date: Tue, 26 Jan 2016 13:02:21 +0100 Subject: [PATCH 03/12] FIX: Contrat card don't consider user permissions to show active/unactive service button --- htdocs/contrat/card.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index e7075b4f22c..021479dd99d 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -6,7 +6,7 @@ * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2014 Ferran Marcet + * Copyright (C) 2014-2016 Ferran Marcet * Copyright (C) 2014 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -1548,9 +1548,11 @@ else { $tmpaction='activateline'; if ($objp->statut == 4) $tmpaction='unactivateline'; - print ''; - print img_edit(); - print ''; + if (($tmpaction=='activateline' && $user->rights->contrat->activer) || ($tmpaction=='unactivateline' && $user->rights->contrat->unactiver)) { + print ''; + print img_edit(); + print ''; + } } } print ''; From 8a80e065801686e3d9791cdd3c1f4cbbc737f4b1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 28 Jan 2016 11:42:00 +0100 Subject: [PATCH 04/12] Fix: missing field "label" --- htdocs/commande/orderstoinvoice.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 50bf0eefbb5..7a8814edd4d 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -300,7 +300,8 @@ if (($action == 'create' || $action == 'add') && !$error) $lines[$i]->rowid, $fk_parent_line, $lines[$i]->fk_fournprice, - $lines[$i]->pa_ht + $lines[$i]->pa_ht, + $lines[$i]->label ); if ($result > 0) { @@ -396,9 +397,9 @@ if ($action == 'create' && !$error) print ''; print ''; print ''; - + dol_fiche_head(); - + print ''; // Ref @@ -501,15 +502,15 @@ if ($action == 'create' && !$error) } dol_fiche_end(); - + // Button "Create Draft" print '
'; print "\n"; print ''; print "
\n"; - - + + } // Mode liste From 6eecf2f29a15fa15cc427bd1c84aae567270792f Mon Sep 17 00:00:00 2001 From: phf Date: Thu, 28 Jan 2016 12:30:49 +0100 Subject: [PATCH 05/12] FIX filter by socid if from customer card --- htdocs/expedition/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index aa629955f53..8794222c88e 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -30,6 +30,7 @@ $langs->load("sendings"); $langs->load("deliveries"); $langs->load('companies'); +$socid=GETPOST('socid','int'); // Security check $expeditionid = GETPOST('id','int'); if ($user->societe_id) $socid=$user->societe_id; From cd58c93de67446d912021b6cbbf02b959b335e00 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jan 2016 12:51:34 +0100 Subject: [PATCH 06/12] FIX If option to hide automatic ECM is on, dont show menu. --- htdocs/core/modules/modECM.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modECM.class.php b/htdocs/core/modules/modECM.class.php index 2bf3542186a..c1334b81e63 100644 --- a/htdocs/core/modules/modECM.class.php +++ b/htdocs/core/modules/modECM.class.php @@ -174,7 +174,7 @@ class modECM extends DolibarrModules 'langs'=>'ecm', 'position'=>103, 'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload', - 'enabled'=>'$user->rights->ecm->read || $user->rights->ecm->upload', + 'enabled'=>'($user->rights->ecm->read || $user->rights->ecm->upload) && ! empty($conf->global->ECM_AUTO_TREE_ENABLED)', 'target'=>'', 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both $r++; From cc7d105d88a70b528a5e0d3cd143e6550ab2d622 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 Jan 2016 15:07:22 +0100 Subject: [PATCH 07/12] Fix height in mapping impot step --- htdocs/imports/import.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 9e729fb36ac..c6fe3094b68 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -836,6 +836,7 @@ if ($step == 4 && $datatoimport) print ''; // List of targets fields + $height=24; $i = 0; $var=true; $mandatoryfieldshavesource=true; @@ -843,7 +844,7 @@ if ($step == 4 && $datatoimport) foreach($fieldstarget as $code=>$label) { $var=!$var; - print ''; + print ''; $i++; @@ -1704,13 +1705,15 @@ function show_elem($fieldssource,$pos,$key,$var,$nostyle='') { global $langs,$bc; + $height='24'; + print "\n\n\n"; print '
'."\n"; print ''."\n"; if ($pos && $pos > count($fieldssource)) // No fields { - print ''; + print ''; print ''; @@ -1721,7 +1724,7 @@ function show_elem($fieldssource,$pos,$key,$var,$nostyle='') } elseif ($key == 'none') // Empty line { - print ''; + print ''; print ''; @@ -1732,7 +1735,7 @@ function show_elem($fieldssource,$pos,$key,$var,$nostyle='') } else // Print field of source file { - print ''; + print ''; print ''; - if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) print ''; + if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) || ! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) print ''; print ''; print ''; if (! empty($conf->dynamicprices->enabled)) { @@ -1098,7 +1098,7 @@ if ($result) } print '"; - if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) print '"; + if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) || ! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) print '"; //Price if (! empty($objp->fk_price_expression) && ! empty($conf->dynamicprices->enabled)) From 8faeac611aece93d203ddd9ea240d285f2ff7939 Mon Sep 17 00:00:00 2001 From: mic9p Date: Sat, 30 Jan 2016 10:35:57 +0100 Subject: [PATCH 10/12] Do not select siren but tva_intra from societe VAT report by customer shows an empty field. --- htdocs/core/lib/tax.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 2387332e670..0a3c4942857 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -108,7 +108,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction if ($modetax == 1) { // If vat paid on due invoices (non draft) - $sql = "SELECT s.rowid as socid, s.nom as name, s.siren as tva_intra, s.tva_assuj as assuj,"; + $sql = "SELECT s.rowid as socid, s.nom as name, s.tva_intra as tva_intra, s.tva_assuj as assuj,"; $sql.= " sum(f.$total_ht) as amount, sum(f.".$total_tva.") as tva,"; $sql.= " sum(f.localtax1) as localtax1,"; $sql.= " sum(f.localtax2) as localtax2"; From 129f5aad8ea186fab41cc7a7492a6c901b93a92c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 Jan 2016 15:56:04 +0100 Subject: [PATCH 11/12] Fix bad translation --- htdocs/langs/ar_SA/main.lang | 98 ++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/htdocs/langs/ar_SA/main.lang b/htdocs/langs/ar_SA/main.lang index fc1543d5f3c..33eb00f16ba 100644 --- a/htdocs/langs/ar_SA/main.lang +++ b/htdocs/langs/ar_SA/main.lang @@ -1,5 +1,5 @@ # Dolibarr language file - Source file is en_US - main -DIRECTION=لتر +DIRECTION=ltr # Note for Chinese: # msungstdlight or cid0ct are for traditional Chinese (traditional does not render with Ubuntu pdf reader) # stsongstdlight or cid0cs are for simplified Chinese @@ -7,22 +7,22 @@ DIRECTION=لتر FONTFORPDF=DejaVuSans FONTSIZEFORPDF=9 SeparatorDecimal=. -SeparatorThousand=، -FormatDateShort=٪ م /٪ د /٪ Y -FormatDateShortInput=٪ م /٪ د /٪ Y -FormatDateShortJava=MM / DD / YYYY -FormatDateShortJavaInput=MM / DD / YYYY -FormatDateShortJQuery=شهر / يوم / سنة -FormatDateShortJQueryInput=شهر / يوم / سنة +SeparatorThousand=None +FormatDateShort=%d/%m/%Y +FormatDateShortInput=%d/%m/%Y +FormatDateShortJava=dd/MM/yyyy +FormatDateShortJavaInput=dd/MM/yyyy +FormatDateShortJQuery=dd/mm/yy +FormatDateShortJQueryInput=dd/mm/yy FormatHourShortJQuery=HH: MI -FormatHourShort=٪عفريت -FormatHourShortDuration=٪ H:٪ M -FormatDateTextShort=٪ ب٪ د،٪ Y -FormatDateText=٪ B٪ د،٪ Y -FormatDateHourShort=٪ م /٪ د /٪ Y٪ I:٪ M٪ ع -FormatDateHourSecShort=٪ م /٪ د /٪ Y٪ I:٪ M:٪ S٪ ع -FormatDateHourTextShort=٪ ب٪ د،٪ Y،٪ I:٪ M٪ ع -FormatDateHourText=٪ B٪ د،٪ Y،٪ I:٪ M٪ ع +FormatHourShort=%H:%M +FormatHourShortDuration=%H:%M +FormatDateTextShort=%d %b %Y +FormatDateText=%d %B %Y +FormatDateHourShort=%d/%m/%Y %H:%M +FormatDateHourSecShort=%d/%m/%Y %H:%M:%S +FormatDateHourTextShort=%d %b %Y %H:%M +FormatDateHourText=%d %B %Y %H:%M DatabaseConnection=اتصال قاعدة البيانات NoTemplateDefined=No template defined for this email type NoTranslation=لا يوجد ترجمة @@ -30,19 +30,19 @@ NoRecordFound=لا يوجد سجلات NoError=لا خطأ Error=خطأ Errors=أخطاء -ErrorFieldRequired=مطلوب حقل '٪ ق' -ErrorFieldFormat=حقل '٪ ق' له قيمة سيئة -ErrorFileDoesNotExists=الملف غير موجود٪ الصورة -ErrorFailedToOpenFile=فشل في فتح الملف٪ الصورة -ErrorCanNotCreateDir=لا يمكن إنشاء DIR٪ الصورة -ErrorCanNotReadDir=لا يمكن قراءة DIR٪ الصورة -ErrorConstantNotDefined=المعلمة٪ S غير معرف +ErrorFieldRequired=Field '%s' is required +ErrorFieldFormat=Field '%s' has a bad value +ErrorFileDoesNotExists=File %s does not exist +ErrorFailedToOpenFile=Failed to open file %s +ErrorCanNotCreateDir=Can not create dir %s +ErrorCanNotReadDir=Can not read dir %s +ErrorConstantNotDefined=Parameter %s not defined ErrorUnknown=خطأ غير معروف ErrorSQL=خطأ SQL -ErrorLogoFileNotFound=لم يتم العثور على ملف شعار '٪ ق' +ErrorLogoFileNotFound=Logo file '%s' was not found ErrorGoToGlobalSetup=اذهب إلى 'شركة / مؤسسة' الإعداد لإصلاح هذه ErrorGoToModuleSetup=الذهاب إلى الوحدة الإعداد لإصلاح هذه -ErrorFailedToSendMail=فشل في إرسال البريد (المرسل =٪ ق، استقبال =٪ ق) +ErrorFailedToSendMail=Failed to send mail (sender=%s, receiver=%s) ErrorAttachedFilesDisabled=تم تعطيل إرفاق ملف في هذا الخادم ErrorFileNotUploaded=ويتم تحميل الملف. تحقق لا يتجاوز هذا الحجم الأقصى المسموح به، أن المساحة الحرة المتوفرة على القرص والتي لا يوجد بالفعل ملف بنفس الاسم في هذا الدليل. ErrorInternalErrorDetected=خطأ الكشف عن @@ -51,20 +51,20 @@ ErrorWrongHostParameter=المعلمة المضيف خاطئة ErrorYourCountryIsNotDefined=لم يتم تعريف بلدك. الذهاب إلى الصفحة الرئيسية الإعداد-تحرير ومشاركة مرة أخرى في النموذج. ErrorRecordIsUsedByChild=فشل في حذف هذا السجل. ويستخدم هذا السجل من قبل واحد على الأقل السجلات التابعة. ErrorWrongValue=قيمة خاطئة -ErrorWrongValueForParameterX=قيمة خاطئة للمعلمة٪ الصورة +ErrorWrongValueForParameterX=Wrong value for parameter %s ErrorNoRequestInError=أي طلب في الخطأ ErrorServiceUnavailableTryLater=الخدمة غير متوفرة في الوقت الراهن. حاول مجددا لاحقا. ErrorDuplicateField=قيمة مكررة في حقل فريد ErrorSomeErrorWereFoundRollbackIsDone=تم العثور على بعض الأخطاء. نحن التراجع التغييرات. -ErrorConfigParameterNotDefined=لم يتم تعريف المعلمة٪ الصورة داخل ملف التكوين Dolibarr conf.php. -ErrorCantLoadUserFromDolibarrDatabase=فشل في العثور على المستخدم٪ الصورة في قاعدة بيانات Dolibarr. -ErrorNoVATRateDefinedForSellerCountry=خطأ، لا معدلات ضريبة القيمة المضافة المحددة للبلد '٪ ق'. -ErrorNoSocialContributionForSellerCountry=خطأ، لا الاجتماعي / المالي نوع الضرائب المحددة للبلد '٪ ق'. +ErrorConfigParameterNotDefined=Parameter %s is not defined inside Dolibarr config file conf.php. +ErrorCantLoadUserFromDolibarrDatabase=Failed to find user %s in Dolibarr database. +ErrorNoVATRateDefinedForSellerCountry=Error, no vat rates defined for country '%s'. +ErrorNoSocialContributionForSellerCountry=Error, no social/fiscal taxes type defined for country '%s'. ErrorFailedToSaveFile=خطأ، فشل في حفظ الملف. NotAuthorized=غير مصرح لك ان تفعل ذلك. SetDate=التاريخ المحدد SelectDate=تحديد تاريخ -SeeAlso=انظر أيضا الصورة٪ +SeeAlso=See also %s SeeHere=انظر هنا BackgroundColorByDefault=لون الخلفية الافتراضية FileNotUploaded=لم إيداع الملف @@ -79,7 +79,7 @@ LevelOfFeature=مستوى ميزات NotDefined=غير معرف DefinedAndHasThisValue=تعريف وقيمة ل IsNotDefined=غير محدد -DolibarrInHttpAuthenticationSoPasswordUseless=Dolibarr وضع مصادقة هو الإعداد إلى٪ s في ملف التكوين conf.php.
وهذا يعني أن قاعدة بيانات كلمة السر هي خارجي لDolibarr، لذلك تغيير هذا المجال يمكن أن يكون لها أي آثار. +DolibarrInHttpAuthenticationSoPasswordUseless=Dolibarr authentication mode is setup to %s in configuration file conf.php.
This means that password database is extern to Dolibarr, so changing this field may have no effects. Administrator=مدير Undefined=غير محدد PasswordForgotten=نسيت كلمة المرور؟ @@ -103,7 +103,7 @@ TechnicalInformation=المعلومات التقنية TechnicalID=ID الفني NotePublic=ملاحظة (الجمهور) NotePrivate=ملاحظة (خاص) -PrecisionUnitIsLimitedToXDecimals=كان Dolibarr الإعداد للحد من دقة أسعار الوحدات إلى العشرية٪ الصورة. +PrecisionUnitIsLimitedToXDecimals=Dolibarr was setup to limit precision of unit prices to %s decimals. DoTest=اختبار ToFilter=فلتر NoFilter=No filter @@ -140,7 +140,7 @@ AddActionDone=إضافة حدث القيام به Close=إغلاق Close2=إغلاق Confirm=تأكيد -ConfirmSendCardByMail=هل تريد حقا أن ترسل محتوى هذه البطاقة عن طريق البريد إلى٪ s؟ +ConfirmSendCardByMail=Do you really want to send content of this card by mail to %s ? Delete=حذف Remove=إزالة Resiliate=Resiliate @@ -218,7 +218,7 @@ Limit=حد Limits=حدود DevelopmentTeam=فريق التطوير Logout=تسجيل خروج -NoLogoutProcessWithAuthMode=أي ميزة قطع تطبيقية مع وضع المصادقة٪ الصورة +NoLogoutProcessWithAuthMode=No applicative disconnect feature with authentication mode %s Connection=الاتصال Setup=التثبيت Alert=إنذار @@ -388,15 +388,15 @@ ContactsAddressesForCompany=اتصالات / عناوين لهذا الطرف ا AddressesForCompany=عناوين لهذا الطرف الثالث ActionsOnCompany=الأحداث حول هذا الطرف الثالث ActionsOnMember=الأحداث عن هذا العضو -NActions=الأحداث٪ الصورة -NActionsLate=٪ في وقت متأخر الصورة +NActions=%s events +NActionsLate=%s late RequestAlreadyDone=طلب المسجل بالفعل Filter=فلتر -FilterOnInto=معايير البحث '٪ ق' إلى حقول٪ الصورة +FilterOnInto=Search criteria '%s' into fields %s RemoveFilter=إزالة فلتر ChartGenerated=الرسم البياني المتولدة ChartNotGenerated=الرسم البياني لم تولد -GeneratedOn=بناء على٪ الصورة +GeneratedOn=Build on %s Generate=توليد Duration=المدة الزمنية TotalDuration=المدة الإجمالية @@ -529,7 +529,7 @@ File=ملف Files=ملفات NotAllowed=غير مسموح ReadPermissionNotAllowed=إذن لا يسمح للقراءة -AmountInCurrency=المبلغ بالعملة ق ٪ +AmountInCurrency=Amount in %s currency Example=مثال Examples=أمثلة NoExample=على سبيل المثال لا @@ -541,9 +541,9 @@ NbOfObjects=عدد الأجسام NbOfReferers=عدد المشيرين Referers=اشارة الأجسام TotalQuantity=الكمية الإجمالية -DateFromTo=ل٪ من ق ق ٪ -DateFrom=من ق ٪ -DateUntil=حتى ق ٪ +DateFromTo=From %s to %s +DateFrom=From %s +DateUntil=Until %s Check=فحص Uncheck=قم بإلغاء التحديد Internal=الداخلية @@ -595,11 +595,11 @@ GoBack=العودة CanBeModifiedIfOk=يمكن تعديلها إذا كان صحيحا CanBeModifiedIfKo=يمكن تعديلها إذا لم يكن صحيحا RecordModifiedSuccessfully=سجل تعديل بنجاح -RecordsModified=السجلات٪ الصورة المعدلة +RecordsModified=%s records modified AutomaticCode=مدونة الآلي NotManaged=لم يفلح FeatureDisabled=سمة المعوقين -MoveBox=تحرك المربع ٪ ق +MoveBox=Move box %s Offered=عرض NotEnoughPermissions=ليس لديك إذن لهذا العمل SessionName=اسم الدورة @@ -623,7 +623,7 @@ MenuECM=وثائق MenuAWStats=AWStats MenuMembers=أعضاء MenuAgendaGoogle=جوجل جدول الأعمال -ThisLimitIsDefinedInSetup=Dolibarr الحد (القائمة الرئيسية الإعداد للأمن) : %s كيلو بايت ، PHP الحد : %s كيلو بايت +ThisLimitIsDefinedInSetup= NoFileFound=لا الوثائق المحفوظة في هذا المجلد CurrentUserLanguage=الصيغة الحالية CurrentTheme=الموضوع الحالي @@ -707,17 +707,17 @@ toward=نحو Access=وصول SelectAction=حدد العمل HelpCopyToClipboard=استخدم Ctrl + C لنسخ إلى الحافظة -SaveUploadedFileWithMask=حفظ الملف على الخادم مع اسم "٪ ق" (وإلا "٪ ق") +SaveUploadedFileWithMask=حفظ الملف على الخادم مع اسم "%s" (otherwise "%s") OriginFileName=اسم الملف الأصلي SetDemandReason=مجموعة مصدر SetBankAccount=تحديد الحساب المصرفي AccountCurrency=عملة الحساب ViewPrivateNote=عرض الملاحظات -XMoreLines=٪ ق خط (ق) مخبأة +XMoreLines=%s line(s) hidden PublicUrl=URL العام AddBox=إضافة مربع SelectElementAndClickRefresh=حدد عنصر وانقر فوق تحديث -PrintFile=طباعة ملف٪ الصورة +PrintFile=Print File %s ShowTransaction=عرض الصفقة على حساب مصرفي GoIntoSetupToChangeLogo=اذهب إلى الصفحة الرئيسية - إعداد - شركة لتغيير شعار أو الذهاب إلى الصفحة الرئيسية - إعداد - عرض للاختباء. Deny=رفض From 9a87d2bee55fdace1b26e58ee894ab3b921fc5b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 Jan 2016 16:28:48 +0100 Subject: [PATCH 12/12] Fix phpcs --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 47782297bf7..93559125874 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3055,7 +3055,7 @@ class Societe extends CommonObject * * @return boolean true or false */ - function useNPR($localTaxNum=0) + function useNPR() { $sql = "SELECT t.rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
'; print img_picto(($pos>0?$langs->trans("MoveField",$pos):''),'uparrow','class="boxhandle" style="cursor:move;"'); print '
'; print ' '; print '
'; // The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object print img_picto($langs->trans("MoveField",$pos),'uparrow','class="boxhandle" style="cursor:move;"'); From d21908755ee8add902e456b1abf2144b60cf0d51 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 Jan 2016 15:29:35 +0100 Subject: [PATCH 08/12] FIX Import/Export NPR VAT --- htdocs/core/modules/modProduct.class.php | 58 ++++++------------------ htdocs/societe/class/societe.class.php | 23 +++++++++- 2 files changed, 36 insertions(+), 45 deletions(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 295e348dc98..7616e6a36dd 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -44,7 +44,7 @@ class modProduct extends DolibarrModules */ function __construct($db) { - global $conf; + global $conf, $mysoc; $this->db = $db; $this->numero = 50; @@ -148,55 +148,20 @@ class modProduct extends DolibarrModules $this->export_label[$r]="Products"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r]=array(array("produit","export")); $this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.url'=>"PublicUrl",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode','p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification'); + if ($mysoc->useNPR()) $this->export_fields_array[$r]['p.recuperableonly']='NPR'; if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.stock'=>'Stock','p.pmp'=>'PMPValue')); if (! empty($conf->barcode->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.barcode'=>'BarCode')); if (! empty($conf->fournisseur->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('s.nom'=>'Supplier','pf.ref_fourn'=>'SupplierRef','pf.unitprice'=>'SuppliersPrices')); $this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.length'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date'); - if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.pmp'=>'Numeric')); + if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.stock'=>'Numeric','p.pmp'=>'Numeric')); if (! empty($conf->barcode->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.barcode'=>'Text')); if (! empty($conf->fournisseur->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('s.nom'=>'Text','pf.ref_fourn'=>'Text','pf.unitprice'=>'Numeric')); $this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",'p.label'=>"product",'p.description'=>"product",'p.url'=>"product",'p.accountancy_code_sell'=>'product','p.accountancy_code_sell'=>'product','p.note'=>"product",'p.length'=>"product",'p.surface'=>"product",'p.volume'=>"product",'p.weight'=>"product",'p.customcode'=>'product','p.price_base_type'=>"product",'p.price'=>"product",'p.price_ttc'=>"product",'p.tva_tx'=>"product",'p.tosell'=>"product",'p.tobuy'=>"product",'p.datec'=>"product",'p.tms'=>"product"); if (! empty($conf->stock->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.stock'=>'product','p.pmp'=>'product')); if (! empty($conf->barcode->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.barcode'=>'product')); if (! empty($conf->fournisseur->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('s.nom'=>'product','pf.ref_fourn'=>'product','pf.unitprice'=>'product')); - // Add extra fields - $sql="SELECT name, label, type FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity IN (0, ".$conf->entity.')'; - $resql=$this->db->query($sql); - if ($resql) // This can fail when class is used on old database (during migration for example) - { - while ($obj=$this->db->fetch_object($resql)) - { - $fieldname='extra.'.$obj->name; - $fieldlabel=ucfirst($obj->label); - $typeFilter="Text"; - switch($obj->type) - { - case 'int': - case 'double': - case 'price': - $typeFilter="Numeric"; - break; - case 'date': - case 'datetime': - $typeFilter="Date"; - break; - case 'boolean': - $typeFilter="Boolean"; - break; - case 'sellist': - $tmp=''; - $tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null - if ($tmpparam['options'] && is_array($tmpparam['options'])) $tmp=array_shift(array_keys($tmpparam['options'])); - if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp; - break; - } - $this->export_fields_array[$r][$fieldname]=$fieldlabel; - $this->export_TypeFields_array[$r][$fieldname]=$typeFilter; - $this->export_entities_array[$r][$fieldname]='product'; - } - } - // End add extra fields - + $keyforselect='product'; $keyforelement='product'; $keyforaliasextra='extra'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON p.rowid = extra.fk_object'; @@ -216,12 +181,14 @@ class modProduct extends DolibarrModules 'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC", 'pr.tva_tx'=>'PriceLevelVATRate', 'pr.date_price'=>'DateCreation'); + if ($mysoc->useNPR()) $this->export_fields_array[$r]['pr.recuperableonly']='NPR'; //$this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.length'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date'); $this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product", 'pr.price_base_type'=>"product",'pr.price_level'=>"product",'pr.price'=>"product", 'pr.price_ttc'=>"product", 'pr.price_min'=>"product",'pr.price_min_ttc'=>"product", 'pr.tva_tx'=>'product', + 'pr.recuperableonly'=>'product', 'pr.date_price'=>"product"); $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p'; @@ -244,6 +211,7 @@ class modProduct extends DolibarrModules $this->import_tables_creator_array[$r]=array('p'=>'fk_user_author'); // Fields to store import user id $this->import_fields_array[$r]=array('p.ref'=>"Ref*",'p.label'=>"Label*",'p.description'=>"Description",'p.url'=>"PublicUrl",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.duration'=>"Duration",'p.customcode'=>'CustomCode','p.price'=>"SellingPriceHT",'p.price_ttc'=>"SellingPriceTTC",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell*",'p.tobuy'=>"OnBuy*",'p.fk_product_type'=>"Type*",'p.finished'=>'Nature','p.datec'=>'DateCreation*'); if (! empty($conf->barcode->enabled)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('p.barcode'=>'BarCode')); + if ($mysoc->useNPR()) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('p.recuperableonly'=>'NPR')); // Add extra fields $import_extrafield_sample=array(); $sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity IN (0, ".$conf->entity.')'; @@ -260,8 +228,8 @@ class modProduct extends DolibarrModules } // End add extra fields $this->import_fieldshidden_array[$r]=array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'product'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) - $this->import_regex_array[$r]=array('p.ref'=>'[^ ]','p.tosell'=>'^[0|1]$','p.tobuy'=>'^[0|1]$','p.fk_product_type'=>'^[0|1]$','p.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); - $import_sample=array('p.ref'=>"PREF123456",'p.label'=>"My product",'p.description'=>"This is a description example for record",'p.note'=>"Some note",'p.price'=>"100",'p.price_ttc'=>"110",'p.tva_tx'=>'10','p.tosell'=>"0 or 1",'p.tobuy'=>"0 or 1",'p.fk_product_type'=>"0 for product/1 for service",'p.finished'=>'','p.duration'=>"1y",'p.datec'=>'2008-12-31'); + $this->import_regex_array[$r]=array('p.ref'=>'[^ ]','p.tosell'=>'^[0|1]$','p.tobuy'=>'^[0|1]$','p.fk_product_type'=>'^[0|1]$','p.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','p.recuperableonly'=>'^[0|1]$'); + $import_sample=array('p.ref'=>"PREF123456",'p.label'=>"My product",'p.description'=>"This is a description example for record",'p.note'=>"Some note",'p.price'=>"100",'p.price_ttc'=>"110",'p.tva_tx'=>'10','p.tosell'=>"0 or 1",'p.tobuy'=>"0 or 1",'p.fk_product_type'=>"0 for product/1 for service",'p.finished'=>'','p.duration'=>"1y",'p.datec'=>'2008-12-31','p.recuperableonly'=>'0 or 1'); $this->import_examplevalues_array[$r]=array_merge($import_sample,$import_extrafield_sample); if (! empty($conf->fournisseur->enabled)) @@ -309,12 +277,14 @@ class modProduct extends DolibarrModules 'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC", 'pr.tva_tx'=>'PriceLevelVATRate', 'pr.date_price'=>'DateCreation*'); - $this->import_regex_array[$r]=array('pr.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); + if ($mysoc->useNPR()) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('pr.recuperableonly'=>'NPR')); + $this->import_regex_array[$r]=array('pr.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','pr.recuperableonly'=>'^[0|1]$'); $this->import_examplevalues_array[$r]=array('pr.fk_product'=>"1", 'pr.price_base_type'=>"HT",'pr.price_level'=>"1", 'pr.price'=>"100",'pr.price_ttc'=>"110", 'pr.price_min'=>"100",'pr.price_min_ttc'=>"110", - 'pr.tva_tx'=>'19.6', + 'pr.tva_tx'=>'20', + 'pr.recuperableonly'=>'0', 'pr.date_price'=>'2013-04-10'); } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 1184a490495..47782297bf7 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3026,7 +3026,7 @@ class Societe extends CommonObject } /** - * Check if we must use localtax feature or not according to country (country of $mysocin most cases). + * Check if we must use localtax feature or not according to country (country of $mysoc in most cases). * * @param int $localTaxNum To get info for only localtax1 or localtax2 * @return boolean true or false @@ -3050,6 +3050,27 @@ class Societe extends CommonObject else return false; } + /** + * Check if we must use NPR Vat (french stupid rule) or not according to country (country of $mysoc in most cases). + * + * @return boolean true or false + */ + function useNPR($localTaxNum=0) + { + $sql = "SELECT t.rowid"; + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; + $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$this->country_code."'"; + $sql .= " AND t.active = 1 AND t.recuperableonly = 1"; + + dol_syslog("useNPR", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + return ($this->db->num_rows($resql) > 0); + } + else return false; + } + /** * Check if we must use revenue stamps feature or not according to country (country of $mysocin most cases). * From 6e69e99227e89d65c7df5963739b4f634c78fb30 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 Jan 2016 15:33:11 +0100 Subject: [PATCH 09/12] FIX VAT Rate was not visible in log of old price list --- htdocs/product/price.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 4e0079b491d..f10d8f17922 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1026,7 +1026,7 @@ $sql .= " WHERE fk_product = " . $object->id; $sql .= " AND p.entity IN (" . getEntity('productprice', 1) . ")"; $sql .= " AND p.fk_user_author = u.rowid"; if (! empty($socid) && ! empty($conf->global->PRODUIT_MULTIPRICES)) $sql .= " AND p.price_level = " . $soc->price_level; -$sql .= " ORDER BY p.date_price, p.rowid DESC, p.price_level ASC"; +$sql .= " ORDER BY p.date_price DESC, p.rowid DESC, p.price_level ASC"; // $sql .= $db->plimit(); $result = $db->query($sql); @@ -1063,7 +1063,7 @@ if ($result) } print '' . $langs->trans("PriceBase") . '' . $langs->trans("VATRate") . '' . $langs->trans("VATRate") . '' . $langs->trans("HT") . '' . $langs->trans("TTC") . '' . $langs->trans($objp->price_base_type) . "' . vatrate($objp->tva_tx, true, $objp->recuperableonly) . "' . vatrate($objp->tva_tx, true, $objp->recuperableonly) . "