From 06e931632d76c7a6c4b7df81822c5d4f30edaae5 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Mon, 11 Mar 2013 12:00:09 +0100 Subject: [PATCH 01/13] fix some translations --- htdocs/langs/en_US/admin.lang | 2 +- htdocs/societe/admin/societe_extrafields.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 7bcb30a2d62..5fba729d71d 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -924,7 +924,7 @@ MAIN_PROXY_HOST=Name/Address of proxy server MAIN_PROXY_PORT=Port of proxy server MAIN_PROXY_USER=Login to use the proxy server MAIN_PROXY_PASS=Password to use the proxy server -DefineHereComplementaryAttributes=Define here all atributes, not already available by default, and that you want to be supported for %s. +DefineHereComplementaryAttributes=Define here all attributes, not already available by default, and that you want to be supported for %s. ExtraFields=Complementary attributes ExtraFieldsThirdParties=Complementary attributes (thirdparty) ExtraFieldsContacts=Complementary attributes (contact/address) diff --git a/htdocs/societe/admin/societe_extrafields.php b/htdocs/societe/admin/societe_extrafields.php index cbac832ee3b..5f6aa8a2a0b 100755 --- a/htdocs/societe/admin/societe_extrafields.php +++ b/htdocs/societe/admin/societe_extrafields.php @@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $langs->load("companies"); $langs->load("admin"); +$langs->load("members"); $extrafields = new ExtraFields($db); $form = new Form($db); From 979a36e94131ad64db1d620cba2d20074238346e Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Mon, 11 Mar 2013 11:11:52 +0100 Subject: [PATCH 02/13] fix some translations --- htdocs/langs/en_US/admin.lang | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5fba729d71d..0bb4db3d24c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -967,7 +967,7 @@ NotificationsDesc=EMails notifications feature allows you to silently send autom ModelModules=Documents templates DocumentModelOdt=Generate documents from OpenDocuments templates (.ODT files for OpenOffice, KOffice, TextEdit,...) WatermarkOnDraft=Watermark on draft document -CompanyIdProfChecker=Rules ono Professional Ids +CompanyIdProfChecker=Rules on Professional Ids MustBeUnique=Must be unique ? MustBeMandatory=Must be mandatory ? Miscellanous=Miscellaneous @@ -1188,7 +1188,7 @@ LDAPDescUsers=This page allows you to define LDAP attributes name in LDAP tree f LDAPDescGroups=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr groups. LDAPDescMembers=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr members module. LDAPDescValues=Example values are designed for OpenLDAP with following loaded schemas: core.schema, cosine.schema, inetorgperson.schema). If you use thoose values and OpenLDAP, modify your LDAP config file slapd.conf to have all thoose schemas loaded. -ForANonAnonymousAccess=For an authenticated acces (for a write access for example) +ForANonAnonymousAccess=For an authenticated access (for a write access for example) ##### Products ##### ProductSetup=Products module setup ServiceSetup=Services module setup @@ -1198,7 +1198,7 @@ ConfirmDeleteProductLineAbility=Confirmation when removing product lines in form ModifyProductDescAbility=Personalization of product descriptions in forms ViewProductDescInFormAbility=Visualization of product descriptions in the forms (otherwise as popup tooltip) ViewProductDescInThirdpartyLanguageAbility=Visualization of products descriptions in the thirdparty language -UseSearchToSelectProduct=Use a search form to choose a product (instead of using a list box).
Also if you have a large number of product (> 100 000), you can increase speed by setting constant PRODUCT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. +UseSearchToSelectProduct=Use a search form to choose a product (rather than a drop-down list).
Also if you have a large number of product (> 100 000), you can increase speed by setting constant PRODUCT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. UseEcoTaxeAbility=Support Eco-Taxe (WEEE) SetDefaultBarcodeTypeProducts=Default barcode type to use for products SetDefaultBarcodeTypeThirdParties=Default barcode type to use for third parties From dd248e9d584a6302d056b1ed007e26e28c1717cf Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Mon, 11 Mar 2013 17:19:03 +0100 Subject: [PATCH 03/13] fix : dyslexia --- README | 2 +- README-FR | 2 +- README.md | 2 +- htdocs/install/mysql/migration/3.2.0-3.3.0.sql | 2 ++ htdocs/langs/ar_SA/admin.lang | 2 +- htdocs/langs/da_DK/admin.lang | 2 +- htdocs/langs/en_US/admin.lang | 2 +- htdocs/langs/et_EE/admin.lang | 2 +- htdocs/langs/fa_IR/admin.lang | 2 +- htdocs/langs/fi_FI/admin.lang | 2 +- htdocs/langs/he_IL/admin.lang | 2 +- htdocs/langs/hu_HU/admin.lang | 2 +- htdocs/langs/is_IS/admin.lang | 2 +- htdocs/langs/ja_JP/admin.lang | 2 +- htdocs/langs/pl_PL/admin.lang | 2 +- htdocs/langs/ro_RO/admin.lang | 2 +- htdocs/langs/ru_RU/admin.lang | 2 +- htdocs/product/stock/product.php | 8 ++++---- 18 files changed, 22 insertions(+), 20 deletions(-) diff --git a/README b/README index 05bf5b8b35f..ad883d9aa57 100644 --- a/README +++ b/README @@ -108,7 +108,7 @@ Other modules: - RSS Miscellanous: -- Mutli-user, with several permissions levels for each feature. +- Multi-user, with several permissions levels for each feature. - Serveral menu managers (can be used by internal users, as a back-office, with a particular menu, or by external users, as a front-office, with another menu and permissions). diff --git a/README-FR b/README-FR index e4dd3e09a90..6988f3f263d 100644 --- a/README-FR +++ b/README-FR @@ -122,7 +122,7 @@ V - CE QUE DOLIBARR NE PEUT PAS FAIRE (TACHES A FAIRE) Voici un liste de fonctionnalites pas encore gérées par Dolibarr: - Pas de compta analytique (uniquement gestion de trésorerie). - Dolibarr ne gère qu'une seule monnaie à la fois (mono-devise). -- Dolibarr ne gère en standard qu'une société/institution/association (mono-société). Pour en gérer plusieurs (comme vos filiales), il faut, soit faire plusieurs installations de Dolibarr, soit installer le module MutliCompany qui permet de gérer n société/institutions/associations dans une seule instance par une isolation logique des données. +- Dolibarr ne gère en standard qu'une société/institution/association (mono-société). Pour en gérer plusieurs (comme vos filiales), il faut, soit faire plusieurs installations de Dolibarr, soit installer le module MultiCompany qui permet de gérer n société/institutions/associations dans une seule instance par une isolation logique des données. - Ne gère pas la double tva (Fédérale / provinciale) du canada. - Dolibarr ne contient pas de module de Gestion de la paie. - Les taches du module de gestion de projets n'ont pas de dépendance entre elle. diff --git a/README.md b/README.md index 18f451da3a0..0a8be8fd8fa 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ See ChangeLog file found into package. ### Miscellanous: -- Mutli-user, with several permissions levels for each feature. +- Multi-user, with several permissions levels for each feature. - Serveral menu managers (can be used by internal users, as a back-office, with a particular menu, or by external users, as a front-office, with another menu and permissions). - Very user friendly and easy to use. - Optional WYSIWYG forms, optional Ajax forms. diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index 7053bd6e4ef..b756659d987 100755 --- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql +++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql @@ -925,3 +925,5 @@ UPDATE llx_c_action_trigger SET code='FICHINTER_VALIDATE' WHERE code='FICHEINTER UPDATE llx_c_departements SET ncc='ALAVA', nom='Álava' WHERE code_departement='01' AND fk_region=419; ALTER TABLE llx_product_fournisseur_price DROP FOREIGN KEY fk_product_fournisseur; + +UPDATE llx_const set name='PRODUIT_MULTI_PRICES' where name='PRODUIT_MUTLI_PRICES'; diff --git a/htdocs/langs/ar_SA/admin.lang b/htdocs/langs/ar_SA/admin.lang index b83575bc21d..1869540d58b 100644 --- a/htdocs/langs/ar_SA/admin.lang +++ b/htdocs/langs/ar_SA/admin.lang @@ -213,7 +213,7 @@ ModuleFamilyProducts=إدارة المنتجات ModuleFamilyHr=إدارة الموارد البشرية ModuleFamilyProjects=مشاريع / العمل التعاوني ModuleFamilyOther=أخرى -ModuleFamilyTechnic=Mutli بين وحدات وأدوات +ModuleFamilyTechnic=Multi بين وحدات وأدوات ModuleFamilyExperimental=نماذج تجريبية ModuleFamilyFinancial=الوحدات المالية (المحاسبة / الخزانة) ModuleFamilyECM=إدارة المحتوى في المؤسسة diff --git a/htdocs/langs/da_DK/admin.lang b/htdocs/langs/da_DK/admin.lang index abfb3251cd5..a710c6cfda8 100644 --- a/htdocs/langs/da_DK/admin.lang +++ b/htdocs/langs/da_DK/admin.lang @@ -199,7 +199,7 @@ ModuleFamilyProducts=Produkter Management ModuleFamilyHr=Human Resource Management ModuleFamilyProjects=Projekter / samarbejde ModuleFamilyOther=Anden -ModuleFamilyTechnic=Mutli-moduler værktøjer +ModuleFamilyTechnic=Multi-moduler værktøjer ModuleFamilyExperimental=Eksperimentel moduler ModuleFamilyFinancial=Finansielle Modules (Regnskabsmæssig / Treasury) ModuleFamilyECM=ECM diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 0bb4db3d24c..1a7ce8c76b6 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -261,7 +261,7 @@ ModuleFamilyProducts=Products Management ModuleFamilyHr=Human Resource Management ModuleFamilyProjects=Projects/Collaborative work ModuleFamilyOther=Other -ModuleFamilyTechnic=Mutli-modules tools +ModuleFamilyTechnic=Multi-modules tools ModuleFamilyExperimental=Experimental modules ModuleFamilyFinancial=Financial Modules (Accounting/Treasury) ModuleFamilyECM=Electronic Content Management (ECM) diff --git a/htdocs/langs/et_EE/admin.lang b/htdocs/langs/et_EE/admin.lang index 24054238d4f..763bc5b6eac 100644 --- a/htdocs/langs/et_EE/admin.lang +++ b/htdocs/langs/et_EE/admin.lang @@ -259,7 +259,7 @@ ModuleFamilyProducts=Tooted juhtimine ModuleFamilyHr=Human Resource Management ModuleFamilyProjects=Projektid / koostööprojektid töö ModuleFamilyOther=Teine -ModuleFamilyTechnic=Mutli-moodulid tööriistad +ModuleFamilyTechnic=Multi-moodulid tööriistad ModuleFamilyExperimental=Eksperimentaalse moodulid ModuleFamilyFinancial=Financial Modules (Raamatupidamine / Treasury) ModuleFamilyECM=Electronic sisuhaldus (ECM) diff --git a/htdocs/langs/fa_IR/admin.lang b/htdocs/langs/fa_IR/admin.lang index 515b6d2dc04..f3a038532d4 100644 --- a/htdocs/langs/fa_IR/admin.lang +++ b/htdocs/langs/fa_IR/admin.lang @@ -221,7 +221,7 @@ ModuleFamilyProducts= سیسیتم کالاها ModuleFamilyHr= سیستم استخدامی ModuleFamilyProjects= سیستم پروژه ها ModuleFamilyOther= دیگر سیستم ها -ModuleFamilyTechnic=Mutli بين وحدات وأدوات +ModuleFamilyTechnic=Multi بين وحدات وأدوات ModuleFamilyExperimental=نماذج تجريبية ModuleFamilyFinancial=الوحدات المالية (المحاسبة / الخزانة) ModuleFamilyECM=تولید محتوی الکترونیکی diff --git a/htdocs/langs/fi_FI/admin.lang b/htdocs/langs/fi_FI/admin.lang index b06d90b9675..06cd7ef8817 100644 --- a/htdocs/langs/fi_FI/admin.lang +++ b/htdocs/langs/fi_FI/admin.lang @@ -197,7 +197,7 @@ ModuleFamilyProducts=Tuotteet Management ModuleFamilyHr=Human Resource Management ModuleFamilyProjects=Projektit / Yhteistyöhankkeet työn ModuleFamilyOther=Muu -ModuleFamilyTechnic=Mutli-modules työkalut +ModuleFamilyTechnic=Multi-modules työkalut ModuleFamilyExperimental=Kokeellinen modules ModuleFamilyFinancial=Financial Modules (kirjanpidon / Treasury) ModuleFamilyECM=ECM diff --git a/htdocs/langs/he_IL/admin.lang b/htdocs/langs/he_IL/admin.lang index 2d262771b7e..c84af3ec434 100644 --- a/htdocs/langs/he_IL/admin.lang +++ b/htdocs/langs/he_IL/admin.lang @@ -259,7 +259,7 @@ ModuleFamilyProducts=מוצרי ניהול ModuleFamilyHr=ניהול משאבי אנוש ModuleFamilyProjects=פרויקטים / עבודה שיתופית ModuleFamilyOther=אחר -ModuleFamilyTechnic=Mutli מודולים כלים +ModuleFamilyTechnic=Multi מודולים כלים ModuleFamilyExperimental=הניסוי מודולים ModuleFamilyFinancial=מודולים פיננסיים (חשבונאות / משרד האוצר) ModuleFamilyECM=ניהול תוכן אלקטרוני (ECM) diff --git a/htdocs/langs/hu_HU/admin.lang b/htdocs/langs/hu_HU/admin.lang index ba14cfc58a2..0445f9fb8e9 100644 --- a/htdocs/langs/hu_HU/admin.lang +++ b/htdocs/langs/hu_HU/admin.lang @@ -259,7 +259,7 @@ ModuleFamilyProducts=Termékek kezelése ModuleFamilyHr=Az emberi erőforrás menedzsment ModuleFamilyProjects=Projektek / kollaboratív munkát ModuleFamilyOther=Más -ModuleFamilyTechnic=Mutli-modulok eszközök +ModuleFamilyTechnic=Multi-modulok eszközök ModuleFamilyExperimental=Kísérleti modulok ModuleFamilyFinancial=Pénzügyi modulok (Számviteli / Kincstár) ModuleFamilyECM=Elektronikus Content Management (ECM) diff --git a/htdocs/langs/is_IS/admin.lang b/htdocs/langs/is_IS/admin.lang index b6124f64739..3b4af098b57 100644 --- a/htdocs/langs/is_IS/admin.lang +++ b/htdocs/langs/is_IS/admin.lang @@ -234,7 +234,7 @@ ModuleFamilyProducts=Vörur Stjórn ModuleFamilyHr=Mannauðsstjórnun ModuleFamilyProjects=Verkefni / samvinna vinna ModuleFamilyOther=Önnur -ModuleFamilyTechnic=Mutli-einingar verkfæri +ModuleFamilyTechnic=Multi-einingar verkfæri ModuleFamilyExperimental=Experimental mát ModuleFamilyFinancial=Financial einingar (Bókhald / ríkissjóðs) ModuleFamilyECM=ECM diff --git a/htdocs/langs/ja_JP/admin.lang b/htdocs/langs/ja_JP/admin.lang index 9044b1657d5..6422a0c9634 100644 --- a/htdocs/langs/ja_JP/admin.lang +++ b/htdocs/langs/ja_JP/admin.lang @@ -259,7 +259,7 @@ ModuleFamilyProducts=製品の管理 ModuleFamilyHr=人的資源管理 ModuleFamilyProjects=プロジェクト/共同作業 ModuleFamilyOther=その他 -ModuleFamilyTechnic=Mutli-モジュールツール +ModuleFamilyTechnic=Multi-モジュールツール ModuleFamilyExperimental=実験的なモジュール ModuleFamilyFinancial=金融モジュール(会計/財務) ModuleFamilyECM=電子コンテンツ管理(ECM) diff --git a/htdocs/langs/pl_PL/admin.lang b/htdocs/langs/pl_PL/admin.lang index 61697021fea..3e98c2e19c8 100644 --- a/htdocs/langs/pl_PL/admin.lang +++ b/htdocs/langs/pl_PL/admin.lang @@ -200,7 +200,7 @@ ModuleFamilyProducts=Produkty Management ModuleFamilyHr=Zarządzanie zasobami ludzkimi ModuleFamilyProjects=Projekty / współpracy ModuleFamilyOther=Inny -ModuleFamilyTechnic=Mutli-modules narzędzia +ModuleFamilyTechnic=Multi-modules narzędzia ModuleFamilyExperimental=Eksperymentalne modules ModuleFamilyFinancial=Moduły finansowe (Księgowość / Skarbu) ModuleFamilyECM=ECM diff --git a/htdocs/langs/ro_RO/admin.lang b/htdocs/langs/ro_RO/admin.lang index ac210903a1a..907e7c10e7b 100644 --- a/htdocs/langs/ro_RO/admin.lang +++ b/htdocs/langs/ro_RO/admin.lang @@ -198,7 +198,7 @@ ModuleFamilyProducts=Produse de Management ModuleFamilyHr=Managementul resurselor umane ModuleFamilyProjects=Proiecte / Colaborativă munca ModuleFamilyOther=Alt -ModuleFamilyTechnic=Mutli-module de unelte +ModuleFamilyTechnic=Multi-module de unelte ModuleFamilyExperimental=Experimentale module ModuleFamilyFinancial=Module financiar (Contabilitate / Trezoreriei) ModuleFamilyECM=ECM diff --git a/htdocs/langs/ru_RU/admin.lang b/htdocs/langs/ru_RU/admin.lang index 14a0aa39d26..76591925e57 100644 --- a/htdocs/langs/ru_RU/admin.lang +++ b/htdocs/langs/ru_RU/admin.lang @@ -197,7 +197,7 @@ ModuleFamilyProducts=Продукты управления ModuleFamilyHr=Кадровый менеджмент ModuleFamilyProjects=Проекты / Совместная работа ModuleFamilyOther=Другой -ModuleFamilyTechnic=Mutli-модулей инструменты +ModuleFamilyTechnic=Multi-модулей инструменты ModuleFamilyExperimental=Экспериментальный модуль ModuleFamilyFinancial=Финансовые модули (Бухгалтерия / Казначейство) ModuleFamilyECM=ECM diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 81786c2e482..6ac507b2070 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -539,11 +539,11 @@ if ($resql) print ''.(price2num($obj->pmp)?price(price2num($obj->pmp*$obj->reel,'MT')):'').''; // Ditto : Show PMP from movement or from product // Sell price print ''; - if (empty($conf->global->PRODUIT_MUTLI_PRICES)) print price(price2num($product->price,'MU')); + if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($product->price,'MU')); else print $langs->trans("Variable"); print ''; // Ditto : Show PMP from movement or from product print ''; - if (empty($conf->global->PRODUIT_MUTLI_PRICES)) print price(price2num($product->price*$obj->reel,'MT')).''; // Ditto : Show PMP from movement or from product + if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($product->price*$obj->reel,'MT')).''; // Ditto : Show PMP from movement or from product else print $langs->trans("Variable"); print ''; ; $total += $obj->reel; @@ -564,11 +564,11 @@ print ''; print price(price2num($totalvalue,'MT')); print ''; print ''; -if (empty($conf->global->PRODUIT_MUTLI_PRICES)) print ($total?price($totalvaluesell/$total):' '); +if (empty($conf->global->PRODUIT_MULTI_PRICES)) print ($total?price($totalvaluesell/$total):' '); else print $langs->trans("Variable"); print ''; print ''; -if (empty($conf->global->PRODUIT_MUTLI_PRICES)) print price(price2num($totalvaluesell,'MT')); +if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($totalvaluesell,'MT')); else print $langs->trans("Variable"); print ''; print ""; From 425ed19e209bce55ce8ce992ca5cebbd2d3f699d Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Mon, 11 Mar 2013 21:01:04 +0100 Subject: [PATCH 04/13] Update sendings.lib.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit delivery_prepare_head complete_head_from_modules object->id but the good one is $object->origin_id so we temporary change it --- htdocs/core/lib/sendings.lib.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 5a0ce136ca3..78fd0b9f0e0 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -108,11 +108,14 @@ function delivery_prepare_head($object) // 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 - // $this->tabs = array('entity:-tabname); to remove a tab + // $this->tabs = array('entity:-tabname); to remove a tab + // complete_head_from_modules use $object->id for this link so we temporary change it + $tmpObjectId = $object->id; + $object->id = $object->origin_id; complete_head_from_modules($conf,$langs,$object,$head,$h,'delivery'); complete_head_from_modules($conf,$langs,$object,$head,$h,'delivery','remove'); - + $object->id = $tmpObjectId; return $head; } @@ -322,4 +325,4 @@ function show_list_sending_receive($origin,$origin_id,$filter='') return 1; } -?> \ No newline at end of file +?> From fe072d992cb5add7b848408324e65271bd46939b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2013 10:31:28 +0100 Subject: [PATCH 05/13] Fix: WSDL of productorservice was not valid. Normalize field names. --- .../webservices/server_productorservice.php | 69 +++++++++---------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index d440256bcf2..04708072d0e 100755 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -113,15 +113,13 @@ $server->wsdl->addComplexType( 'price_net' => array('name'=>'price_net','type'=>'xsd:string'), 'price' => array('name'=>'price','type'=>'xsd:string'), - 'price_ttc' => array('name'=>'price_ttc','type'=>'xsd:string'), + 'price_min_net' => array('name'=>'price_min_net','type'=>'xsd:string'), 'price_min' => array('name'=>'price_min','type'=>'xsd:string'), - 'price_min_ttc' => array('name'=>'price_min_ttc','type'=>'xsd:string'), 'price_base_type' => array('name'=>'price_base_type','type'=>'xsd:string'), 'vat_rate' => array('name'=>'vat_rate','type'=>'xsd:string'), - 'tva_tx' => array('name'=>'tva_tx','type'=>'xsd:string'), - 'tva_npr' => array('name'=>'tva_npr','type'=>'xsd:string'), + 'vat_npr' => array('name'=>'vat_npr','type'=>'xsd:string'), 'localtax1_tx' => array('name'=>'localtax1_tx','type'=>'xsd:string'), 'localtax2_tx' => array('name'=>'localtax2_tx','type'=>'xsd:string'), @@ -132,41 +130,44 @@ $server->wsdl->addComplexType( 'import_key' => array('name'=>'import_key','type'=>'xsd:string'), 'dir' => array('name'=>'dir','type'=>'xsd:string'), - 'photos' => array('name'=>'photos','type'=>'tns:PhotosArray') + 'images' => array('name'=>'images','type'=>'tns:ImagesArray') ) ); /* * Image of product -*/ + */ $server->wsdl->addComplexType( - 'PhotosArray', + 'ImagesArray', 'complexType', 'array', + 'sequence', '', - 'SOAP-ENC:Array', - array(), array( - array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:image[]') + 'image' => array( + 'name' => 'image', + 'type' => 'tns:image', + 'minOccurs' => '0', + 'maxOccurs' => 'unbounded' + ) ) ); /* * An image -*/ + */ $server->wsdl->addComplexType( 'image', 'complexType', - 'array', + 'struct', + 'all', '', - 'SOAP-ENC:Array', - array(), array( - 'photo' => array('name'=>'photo','type'=>'xsd:string'), - 'photo_vignette' => array('name'=>'photo_vignette','type'=>'xsd:string'), - 'imgWidth' => array('name'=>'imgWidth','type'=>'xsd:string'), - 'imgHeight' => array('name'=>'imgHeight','type'=>'xsd:string') + 'photo' => array('name'=>'photo','type'=>'xsd:string'), + 'photo_vignette' => array('name'=>'photo_vignette','type'=>'xsd:string'), + 'imgWidth' => array('name'=>'imgWidth','type'=>'xsd:string'), + 'imgHeight' => array('name'=>'imgHeight','type'=>'xsd:string') ) ); @@ -186,7 +187,7 @@ $server->wsdl->addComplexType( ) ); -$server->wsdl->addComplexType( +/*$server->wsdl->addComplexType( 'ProductsArray', 'complexType', 'array', @@ -197,7 +198,7 @@ $server->wsdl->addComplexType( array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:product[]') ), 'tns:product' -); +);*/ $server->wsdl->addComplexType( 'ProductsArray2', 'complexType', @@ -272,7 +273,7 @@ $server->register( // Entry values array('authentication'=>'tns:authentication','id'=>'xsd:string'), // Exit values - array('result'=>'tns:result','products'=>'ProductsArray'), + array('result'=>'tns:result','products'=>'tns:ProductsArray2'), $ns, $ns.'#getProductsForCategory', $styledoc, @@ -345,22 +346,18 @@ function getProductOrService($authentication,$id='',$ref='',$ref_ext='') 'country_code' => $product->country_code, 'custom_code' => $product->customcode, - 'price_net' => $product->price, // todo : DEPRECATED ? - //'price' => ($product->price_ttc-$product->price), - 'price' => $product->price, - 'price_ttc' => $product->price_ttc, - 'price_min' => $product->price_min, - 'price_min_ttc' => $product->price_min_ttc, + 'price_net' => $product->price, + 'price' => $product->price_ttc, + 'price_min_net' => $product->price_min, + 'price_min' => $product->price_min_ttc, 'price_base_type' => $product->price_base_type, - 'vat_rate' => $product->tva_tx, // todo : DEPRECATED ? - 'tva_tx' => $product->tva_tx, + 'vat_rate' => $product->tva_tx, //! French VAT NPR - 'tva_npr' => $product->tva_npr, + 'vat_npr' => $product->tva_npr, //! Spanish local taxes 'localtax1_tx' => $product->localtax1_tx, 'localtax2_tx' => $product->localtax2_tx, - 'price_ttc' => $product->price_ttc, 'price_base_type' => $product->price_base_type, 'stock_real' => $product->stock_reel, @@ -368,7 +365,7 @@ function getProductOrService($authentication,$id='',$ref='',$ref_ext='') 'pmp' => $product->pmp, 'import_key' => $product->import_key, 'dir' => $pdir, - 'photos' => $product->liste_photos($dir,$nbmax=10) + 'images' => $product->liste_photos($dir,$nbmax=10) )); } else @@ -651,17 +648,17 @@ function getProductsForCategory($authentication,$id) 'custom_code' => $obj->customcode, 'price_net' => $obj->price, - 'price' => ($obj->price_ttc-$obj->price), + 'price' => $obj->price_ttc, 'vat_rate' => $obj->tva_tx, - 'price_ttc' => $obj->price_ttc, - 'price_base_type' => $obj->price_base_type, + + 'price_base_type' => $obj->price_base_type, 'stock_real' => $obj->stock_reel, 'stock_alert' => $obj->seuil_stock_alerte, 'pmp' => $obj->pmp, 'import_key' => $obj->import_key, 'dir' => $pdir, - 'photos' => $obj->liste_photos($dir,$nbmax=10) + 'images' => $obj->liste_photos($dir,$nbmax=10) ); } From 5c4b537a65768ccfc33005e8fe24e7032844aa69 Mon Sep 17 00:00:00 2001 From: simnandez Date: Tue, 12 Mar 2013 11:49:15 +0100 Subject: [PATCH 06/13] Fix: [ bug #762 ] Bad profit calculation in Reporting --- ChangeLog | 1 + htdocs/compta/resultat/index.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3e0961118f8..6e3fc51de0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ English Dolibarr ChangeLog - Fix: Package for launchpad - Fix: [ bug #736 ] Missing column in llx_c_chargesociales - Fix: Localtax2 for Spain must be based into buyer +- Fix: [ bug #762 ] Bad profit calculation in Reporting diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 42c4e5d066e..afc7e7d3eba 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -555,7 +555,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) if (isset($totentrees[$annee]) || isset($totsorties[$annee])) { $in=(isset($totentrees[$annee])?price2num($totentrees[$annee], 'MT'):0); - $out=(isset($totsorties[$annee])?price2num($totsorties[$annee],' MT'):0); + $out=(isset($totsorties[$annee])?price2num($totsorties[$annee],'MT'):0); print price($in-$out).''; // print ' '; } From 7138c6b0f966b2ac457c955e0152eb4769253837 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2013 11:59:52 +0100 Subject: [PATCH 07/13] T --- htdocs/install/mysql/data/llx_00_c_pays.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/data/llx_00_c_pays.sql b/htdocs/install/mysql/data/llx_00_c_pays.sql index 7799ad1cf70..5ab387cb2aa 100644 --- a/htdocs/install/mysql/data/llx_00_c_pays.sql +++ b/htdocs/install/mysql/data/llx_00_c_pays.sql @@ -57,10 +57,10 @@ insert into llx_c_pays (rowid,code,libelle) values (22, 'SN', 'Sénégal' insert into llx_c_pays (rowid,code,libelle) values (23, 'AR', 'Argentine' ); insert into llx_c_pays (rowid,code,libelle) values (24, 'CM', 'Cameroun' ); insert into llx_c_pays (rowid,code,libelle) values (25, 'PT', 'Portugal' ); -insert into llx_c_pays (rowid,code,libelle) values (26, 'SA', 'Arabie Saoudite'); +insert into llx_c_pays (rowid,code,libelle) values (26, 'SA', 'Saudi Arabia' ); insert into llx_c_pays (rowid,code,libelle) values (27, 'MC', 'Monaco' ); insert into llx_c_pays (rowid,code,libelle) values (28, 'AU', 'Australia' ); -insert into llx_c_pays (rowid,code,libelle) values (29, 'SG', 'Singapour' ); +insert into llx_c_pays (rowid,code,libelle) values (29, 'SG', 'Singapour' ); insert into llx_c_pays (rowid,code,libelle) values (30, 'AF', 'Afghanistan' ); insert into llx_c_pays (rowid,code,libelle) values (31, 'AX', 'Iles Aland' ); insert into llx_c_pays (rowid,code,libelle) values (32, 'AL', 'Albanie' ); From e731d954b3723afd704949b7b17164fc64cc77de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2013 12:00:53 +0100 Subject: [PATCH 08/13] Translation --- htdocs/install/mysql/data/llx_00_c_pays.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_00_c_pays.sql b/htdocs/install/mysql/data/llx_00_c_pays.sql index 5ab387cb2aa..990aa15aa52 100644 --- a/htdocs/install/mysql/data/llx_00_c_pays.sql +++ b/htdocs/install/mysql/data/llx_00_c_pays.sql @@ -53,7 +53,7 @@ insert into llx_c_pays (rowid,code,libelle) values (18, 'HU', 'Hongrie' ) insert into llx_c_pays (rowid,code,libelle) values (19, 'RU', 'Russia' ); insert into llx_c_pays (rowid,code,libelle) values (20, 'SE', 'Sweden' ); insert into llx_c_pays (rowid,code,libelle) values (21, 'CI', 'Côte d''Ivoire' ); -insert into llx_c_pays (rowid,code,libelle) values (22, 'SN', 'Sénégal' ); +insert into llx_c_pays (rowid,code,libelle) values (22, 'SN', 'Senegal' ); insert into llx_c_pays (rowid,code,libelle) values (23, 'AR', 'Argentine' ); insert into llx_c_pays (rowid,code,libelle) values (24, 'CM', 'Cameroun' ); insert into llx_c_pays (rowid,code,libelle) values (25, 'PT', 'Portugal' ); From c215974c8c0653bd0bc0c9f27f6b276598920412 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2013 12:20:06 +0100 Subject: [PATCH 09/13] Add missing vat rate for saudi arabia --- htdocs/install/mysql/data/llx_c_tva.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index 4e301564db8..b5f578f579b 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -183,6 +183,9 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (18 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1884,188, '5','0','VAT reduced rate',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1883,188, '0','0','VAT Rate 0', 1); +-- SAUDI ARABIA (id country=26) +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 261, 26, '0', '0', 'VAT Rate 0', 1); + -- SAN SALVADOR (id country=86) INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (861, 86, '13', '0', 'IVA 13', 1); INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (862, 86, '0', '0', 'SIN IVA', 1); From bb2776f4cc184e053e75bd9c053124647ab609a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2013 13:37:34 +0100 Subject: [PATCH 10/13] Fix: Bad field --- htdocs/webservices/server_user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/webservices/server_user.php b/htdocs/webservices/server_user.php index 777f0d9b5b2..8b505111509 100644 --- a/htdocs/webservices/server_user.php +++ b/htdocs/webservices/server_user.php @@ -304,7 +304,7 @@ function getUser($authentication,$id,$ref='',$ref_ext='') 'datec' => dol_print_date($user->datec,'dayhourrfc'), 'datem' => dol_print_date($user->datem,'dayhourrfc'), 'societe_id' => $user->societe_id, -'fk_socpeople' => $user->fk_socpeople, +'fk_socpeople' => $user->contact_id, 'fk_member' => $user->fk_member, 'webcal_login' => $user->webcal_login, 'phenix_login' => $user->phenix_login, From 8114249fca4016855ecbf65cd4fb5a5cd2dfc92c Mon Sep 17 00:00:00 2001 From: simnandez Date: Tue, 12 Mar 2013 15:06:38 +0100 Subject: [PATCH 11/13] [ task #652 ] Reduce clicks into creaton of orders, invoices, etc. Supplier order --- htdocs/core/menus/standard/eldy.lib.php | 2 +- .../class/fournisseur.commande.class.php | 8 +- htdocs/fourn/commande/fiche.php | 118 ++++++++++++++---- htdocs/langs/ca_ES/admin.lang | 1 + htdocs/langs/es_ES/admin.lang | 1 + 5 files changed, 106 insertions(+), 24 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index a4dd6bbab9c..d333e2cc6d7 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -650,7 +650,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu { $langs->load("orders"); $newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers",$langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers'); - $newmenu->add("/societe/societe.php?leftmenu=orders_suppliers", $langs->trans("NewOrder"), 1, $user->rights->fournisseur->commande->creer); + $newmenu->add("/fourn/commande/fiche.php?action=create", $langs->trans("NewOrder"), 1, $user->rights->fournisseur->commande->creer); $newmenu->add("/fourn/commande/liste.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire); $newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); } diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 97d20d54d48..b74511f1419 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke - * Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2010-2012 Philippe Grand * Copyright (C) 2012 Marcos García * @@ -926,6 +926,9 @@ class CommandeFournisseur extends CommonOrder $sql = "INSERT INTO ".MAIN_DB_PREFIX."commande_fournisseur ("; $sql.= "ref"; + $sql.= ", ref_supplier"; + $sql.= ", note"; + $sql.= ", note_public"; $sql.= ", entity"; $sql.= ", fk_soc"; $sql.= ", date_creation"; @@ -938,6 +941,9 @@ class CommandeFournisseur extends CommonOrder $sql.= ") "; $sql.= " VALUES ("; $sql.= "''"; + $sql.= ", '".$this->ref_supplier."'"; + $sql.= ", '".$this->note."'"; + $sql.= ", '".$this->note_public."'"; $sql.= ", ".$conf->entity; $sql.= ", ".$this->socid; $sql.= ", ".$this->db->idate($now); diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 1afb3fddb00..4baa7ac50f5 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010-2012 Juanjo Menent + * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2011 Philippe Grand * Copyright (C) 2012 Marcos García * @@ -82,7 +82,7 @@ if ($id > 0 || ! empty($ref)) $ret = $object->fetch_thirdparty(); if ($ret < 0) dol_print_error($db,$object->error); } -else if (! empty($socid)) +else if (! empty($socid) && $socid > 0) { $fourn = new Fournisseur($db); $ret=$fourn->fetch($socid); @@ -657,33 +657,47 @@ else if ($action == 'remove_file' && $object->id > 0 && $user->rights->fournisse /* * Create an order */ -else if ($action == 'create' && ! empty($object->socid) && $user->rights->fournisseur->commande->creer) +else if ($action == 'add' && $user->rights->fournisseur->commande->creer) { - $error=0; + $error=0; - $db->begin(); - - $id=$object->create($user); - if (! $id > 0) + if ($socid <1) { - $error++; - setEventMessage($object->error, 'errors'); + $mesg='
'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('Supplier')).'
'; + $action='create'; + $error++; } if (! $error) { - if ($comclientid != '') + $db->begin(); + + // Creation commande + $object->ref_supplier = GETPOST('refsupplier'); + $object->socid = $socid; + $object->note = GETPOST('note'); + $object->note_public = GETPOST('note_public'); + + $id = $object->create($user); + if ($id < 0) + { + $error++; + } + + if ($error) { - $object->updateFromCommandeClient($user, $id, $comclientid); + $langs->load("errors"); + $db->rollback(); + $mesg='
'.$langs->trans($object->error).'
'; + $action='create'; + $_GET['socid']=$_POST['socid']; + } + else + { + $db->commit(); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + exit; } - - $ret=$object->fetch($id); // Reload to get new records - - $db->commit(); - } - else - { - $db->rollback(); } } @@ -942,8 +956,68 @@ $productstatic = new Product($db); /* *************************************************************************** */ $now=dol_now(); - -if (! empty($object->id)) +if ($action=="create") +{ + print_fiche_titre($langs->trans('NewOrder')); + + dol_htmloutput_mesg($mesg); + + $societe=''; + if ($socid>0) + { + $societe=new Societe($db); + $societe->fetch($socid); + } + + print '
'; + print ''; + print ''; + print ''; + + // Ref + print ''; + + // Third party + print ''; + print ''; + + // Ref supplier + print ''; + print ''; + + print ''; + + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + + // Other options + $parameters=array(); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + + // Bouton "Create Draft" + print "
'.$langs->trans('Ref').''.$langs->trans('Draft').'
'.$langs->trans('Supplier').''; + + if ($socid > 0) + { + print $societe->getNomUrl(1); + print ''; + } + else + { + print $form->select_company((empty($socid)?'':$socid),'socid','s.fournisseur = 1',1); + } + print '
'.$langs->trans('RefSupplier').'
'.$langs->trans('Note').'
'.$langs->trans('NotePublic').'
\n"; + + print '
'; + + print "
\n"; +} +elseif (! empty($object->id)) { $author = new User($db); $author->fetch($object->user_author_id); diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index adbce991781..70af2933354 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -937,6 +937,7 @@ ExtraFieldsThirdParties=Atributs adicionals (tercers) ExtraFieldsContacts=Atributs adicionals (contactes/adreçes) ExtraFieldsMember=Atributs complementaris (membres) ExtraFieldsMemberType=Atributs complementaris (tipus de membres) +ExtraFieldsCustomerInvoices=Atributs complementaris (factures a clients) ExtraFieldHasWrongValue=L'atribut %s te un valor incorrecte. AlphaNumOnlyCharsAndNoSpace=només carateres alfanumèrics sense espais SendingMailSetup=Configuració de l'enviament per mail diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 587ba2d3679..42d01cae8d9 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -938,6 +938,7 @@ ExtraFieldsThirdParties=Atributos adicionales (terceros) ExtraFieldsContacts=Atributos adicionales (contactos/direcciones) ExtraFieldsMember=Atributos complementarios (miembros) ExtraFieldsMemberType=Atributos complementarios (tipos de miembros) +ExtraFieldsCustomerInvoices=Atributos complementarios (facturas a clientes) ExtraFieldHasWrongValue=El atributo %s tiene un valor incorrecto. AlphaNumOnlyCharsAndNoSpace=solamente caracteres alfanuméricos sin espacios SendingMailSetup=Configuración del envío por mail From 484c39435c3adc612a4acd8789e9449d19d82541 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2013 15:25:58 +0100 Subject: [PATCH 12/13] Fix: Bad format of WSDL for orders. Miscellaneous fixes into WS. --- htdocs/webservices/server_invoice.php | 20 ++- htdocs/webservices/server_order.php | 183 +++++++++++++------------- 2 files changed, 110 insertions(+), 93 deletions(-) diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index 1005c6951ec..ef7384a11c7 100755 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -67,7 +67,7 @@ $server->wsdl->addComplexType( 'sourceapplication' => array('name'=>'sourceapplication','type'=>'xsd:string'), 'login' => array('name'=>'login','type'=>'xsd:string'), 'password' => array('name'=>'password','type'=>'xsd:string'), - 'entity' => array('name'=>'entity','type'=>'xsd:string'), + 'entity' => array('name'=>'entity','type'=>'xsd:string') ) ); // Define WSDL Return object @@ -377,7 +377,10 @@ function getInvoicesForThirdParty($authentication,$idthirdparty) $errorcode='';$errorlabel=''; $error=0; $fuser=check_authentication($authentication,$error,$errorcode,$errorlabel); - // Check parameters + + if ($fuser->societe_id) $socid=$fuser->societe_id; + + // Check parameters if (! $error && empty($idthirdparty)) { $error++; @@ -394,9 +397,9 @@ function getInvoicesForThirdParty($authentication,$idthirdparty) //$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product = p.rowid'; //$sql.=" WHERE f.fk_soc = s.rowid AND nom = '".$db->escape($idthirdparty)."'"; //$sql.=" WHERE f.fk_soc = s.rowid AND nom = '".$db->escape($idthirdparty)."'"; - $sql.=" WHERE f.fk_soc = ".$db->escape($idthirdparty); - $sql.=" AND f.entity = ".$conf->entity; - + $sql.=" WHERE f.entity = ".$conf->entity; + if ($idthirdparty != 'all' ) $sql.=" AND f.fk_soc = ".$db->escape($idthirdparty); + $resql=$db->query($sql); if ($resql) { @@ -410,6 +413,13 @@ function getInvoicesForThirdParty($authentication,$idthirdparty) $invoice=new Facture($db); $invoice->fetch($obj->facid); + // Sécurité pour utilisateur externe + if( $socid && ( $socid != $order->socid) ) + { + $error++; + $errorcode='PERMISSION_DENIED'; $errorlabel=$order->socid.' User does not have permission for this request'; + } + // Define lines of invoice $linesresp=array(); foreach($invoice->lines as $line) diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 33993771102..6ba0fa2cd5e 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -35,6 +35,8 @@ require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"); dol_syslog("Call Dolibarr webservices interfaces"); +$langs->load("main"); + // Enable and test if module web services is enabled if (empty($conf->global->MAIN_MODULE_WEBSERVICES)) { @@ -54,7 +56,7 @@ $server->configureWSDL('WebServicesDolibarrOrder',$ns); $server->wsdl->schemaTargetNamespace=$ns; -// Define WSDL content +// Define WSDL Authentication object $server->wsdl->addComplexType( 'authentication', 'complexType', @@ -69,7 +71,20 @@ $server->wsdl->addComplexType( 'entity' => array('name'=>'entity','type'=>'xsd:string') ) ); +// Define WSDL Return object +$server->wsdl->addComplexType( + 'result', + 'complexType', + 'struct', + 'all', + '', + array( + 'result_code' => array('name'=>'result_code','type'=>'xsd:string'), + 'result_label' => array('name'=>'result_label','type'=>'xsd:string'), + ) +); +// Define other specific objects $server->wsdl->addComplexType( 'line', 'complexType', @@ -78,34 +93,34 @@ $server->wsdl->addComplexType( '', array( 'id' => array('name'=>'id','type'=>'xsd:string'), + 'type' => array('name'=>'type','type'=>'xsd:int'), 'fk_commande' => array('name'=>'fk_commande','type'=>'xsd:int'), 'fk_parent_line' => array('name'=>'fk_parent_line','type'=>'xsd:int'), 'desc' => array('name'=>'desc','type'=>'xsd:string'), - 'qty' => array('name'=>'qty','type'=>'xsd:int'), + 'qty' => array('name'=>'qty','type'=>'xsd:double'), 'price' => array('name'=>'price','type'=>'xsd:double'), - 'subprice' => array('name'=>'subprice','type'=>'xsd:double'), - 'tva_tx' => array('name'=>'tva_tx','type'=>'xsd:double'), + 'unitprice' => array('name'=>'unitprice','type'=>'xsd:double'), + 'vat_rate' => array('name'=>'vat_rate','type'=>'xsd:double'), 'remise' => array('name'=>'remise','type'=>'xsd:double'), 'remise_percent' => array('name'=>'remise_percent','type'=>'xsd:double'), - 'fk_product' => array('name'=>'fk_product','type'=>'xsd:int'), - 'product_type' => array('name'=>'product_type','type'=>'xsd:int'), - 'total_ht' => array('name'=>'total_ht','type'=>'xsd:double'), - 'total_tva' => array('name'=>'totaltva','type'=>'xsd:double'), - 'total_ttc' => array('name'=>'total_ttc','type'=>'xsd:double'), + 'total_net' => array('name'=>'total_net','type'=>'xsd:double'), + 'total_vat' => array('name'=>'total_vat','type'=>'xsd:double'), + 'total' => array('name'=>'total','type'=>'xsd:double'), - 'date_start' => array('name'=>'date_start','type'=>'xsd:string'), - 'date_end' => array('name'=>'date_end','type'=>'xsd:string'), + 'date_start' => array('name'=>'date_start','type'=>'xsd:date'), + 'date_end' => array('name'=>'date_end','type'=>'xsd:date'), // From product + 'product_id' => array('name'=>'product_id','type'=>'xsd:int'), 'product_ref' => array('name'=>'product_ref','type'=>'xsd:string'), 'product_label' => array('name'=>'product_label','type'=>'xsd:string'), 'product_desc' => array('name'=>'product_desc','type'=>'xsd:string') ) ); -$server->wsdl->addComplexType( +/*$server->wsdl->addComplexType( 'LinesArray', 'complexType', 'array', @@ -119,8 +134,7 @@ $server->wsdl->addComplexType( ) ), 'tns:line' -); - +);*/ $server->wsdl->addComplexType( 'LinesArray2', 'complexType', @@ -149,23 +163,25 @@ $server->wsdl->addComplexType( 'ref_client' => array('name'=>'ref_client','type'=>'xsd:string'), 'ref_ext' => array('name'=>'ref_ext','type'=>'xsd:string'), 'ref_int' => array('name'=>'ref_int','type'=>'xsd:string'), - 'socid' => array('name'=>'socid','type'=>'xsd:int'), - 'statut' => array('name'=>'statut','type'=>'xsd:int'), + 'thirdparty_id' => array('name'=>'thirdparty_id','type'=>'xsd:int'), + 'status' => array('name'=>'status','type'=>'xsd:int'), 'facturee' => array('name'=>'facturee','type'=>'xsd:string'), - 'total_ht' => array('name'=>'total_ht','type'=>'xsd:double'), - 'total_tva' => array('name'=>'total_tva','type'=>'xsd:double'), + 'total_net' => array('name'=>'total_net','type'=>'xsd:double'), + 'total_vat' => array('name'=>'total_vat','type'=>'xsd:double'), 'total_localtax1' => array('name'=>'total_localtax1','type'=>'xsd:double'), 'total_localtax2' => array('name'=>'total_localtax2','type'=>'xsd:double'), - 'total_ttc' => array('name'=>'total_ttc','type'=>'xsd:double'), + 'total' => array('name'=>'total','type'=>'xsd:double'), 'date' => array('name'=>'date','type'=>'xsd:date'), - 'date_commande' => array('name'=>'date_commande','type'=>'xsd:date'), + 'date_creation' => array('name'=>'date_creation','type'=>'xsd:dateTime'), + 'date_validation' => array('name'=>'date_validation','type'=>'xsd:dateTime'), + 'date_modification' => array('name'=>'date_modification','type'=>'xsd:dateTime'), 'remise' => array('name'=>'remise','type'=>'xsd:string'), 'remise_percent' => array('name'=>'remise_percent','type'=>'xsd:string'), 'remise_absolue' => array('name'=>'remise_absolue','type'=>'xsd:string'), 'source' => array('name'=>'source','type'=>'xsd:string'), 'note' => array('name'=>'note','type'=>'xsd:string'), 'note_public' => array('name'=>'note_public','type'=>'xsd:string'), - 'fk_project' => array('name'=>'fk_project','type'=>'xsd:string'), + 'project_id' => array('name'=>'project_id','type'=>'xsd:string'), 'mode_reglement_id' => array('name'=>'mode_reglement_id','type'=>'xsd:string'), 'mode_reglement_code' => array('name'=>'mode_reglement_code','type'=>'xsd:string'), @@ -179,10 +195,10 @@ $server->wsdl->addComplexType( 'fk_delivery_address' => array('name'=>'fk_delivery_address','type'=>'xsd:int'), 'demand_reason_id' => array('name'=>'demand_reason_id','type'=>'xsd:string'), - 'lines' => array('name'=>'lines','type'=>'tns:LinesArray') + 'lines' => array('name'=>'lines','type'=>'tns:LinesArray2') ) ); - +/* $server->wsdl->addComplexType( 'OrdersArray', 'complexType', @@ -197,8 +213,7 @@ $server->wsdl->addComplexType( ) ), 'tns:order' -); - +);*/ $server->wsdl->addComplexType( 'OrdersArray2', 'complexType', @@ -207,32 +222,14 @@ $server->wsdl->addComplexType( '', array( 'order' => array( - 'name' => 'invoice', - 'type' => 'tns:invoice', + 'name' => 'order', + 'type' => 'tns:order', 'minOccurs' => '0', 'maxOccurs' => 'unbounded' ) ) ); -$server->wsdl->addComplexType( - 'result', - 'complexType', - 'struct', - 'all', - '', - array( - 'result_code' => array( - 'name'=>'result_code', - 'type'=>'xsd:string' - ), - 'result_label' => array( - 'name'=>'result_label', - 'type'=>'xsd:string' - ), - ) -); - // 5 styles: RPC/encoded, RPC/literal, Document/encoded (not WS-I compliant), Document/literal, Document/literal wrapped @@ -268,7 +265,7 @@ $server->register( $server->register( 'createOrder', array('authentication'=>'tns:authentication','order'=>'tns:order'), // Entry values - array('result'=>'tns:result','id'=>'xsd:string'), // Exit values + array('result'=>'tns:result','id'=>'xsd:string','ref'=>'xsd:string'), // Exit values $ns, $ns.'#createOrder', $styledoc, @@ -355,14 +352,14 @@ function getOrder($authentication,$id='',$ref='',$ref_ext='') 'qty'=>$line->qty, 'price'=>$line->price, 'subprice'=>$line->subprice, - 'tva_tx'=>$line->tva_tx, + 'vat_rate'=>$line->tva_tx, 'remise'=>$line->remise, 'remise_percent'=>$line->remise_percent, 'fk_product'=>$line->fk_product, 'product_type'=>$line->product_type, - 'total_ht'=>$line->total_ht, - 'total_tva'=>$line->total_tva, - 'total_ttc'=>$line->total_ttc, + 'total_net'=>$line->total_ht, + 'total_vat'=>$line->total_tva, + 'total'=>$line->total_ttc, 'date_start'=>$line->date_start, 'date_end'=>$line->date_end, 'product_ref'=>$line->product_ref, @@ -381,19 +378,21 @@ function getOrder($authentication,$id='',$ref='',$ref_ext='') 'ref_client' => $order->ref_client, 'ref_ext' => $order->ref_ext, 'ref_int' => $order->ref_int, - 'socid' => $order->socid, - 'statut' => $order->statut, + 'thirdparty_id' => $order->socid, + 'status' => $order->statut, - 'total_ht' => $order->total_ht, - 'total_tva' => $order->total_tva, + 'total_net' => $order->total_ht, + 'total_vat' => $order->total_tva, 'total_localtax1' => $order->total_localtax1, 'total_localtax2' => $order->total_localtax2, - 'total_ttc' => $order->total_ttc, - 'fk_project' => $order->fk_project, - - 'date' => $order->date?dol_print_date($order->date,'dayrfc'):'', - 'date_commande' => $order->date_commande?dol_print_date($order->date_commande,'dayrfc'):'', + 'total' => $order->total_ttc, + 'project_id' => $order->fk_project, + 'date' => $order->date_commande?dol_print_date($order->date_commande,'dayrfc'):'', + 'date_creation' => $invoice->date_creation?dol_print_date($invoice->date_creation,'dayhourrfc'):'', + 'date_validation' => $invoice->date_validation?dol_print_date($invoice->date_creation,'dayhourrfc'):'', + 'date_modification' => $invoice->datem?dol_print_date($invoice->datem,'dayhourrfc'):'', + 'remise' => $order->remise, 'remise_percent' => $order->remise_percent, 'remise_absolue' => $order->remise_absolue, @@ -403,13 +402,12 @@ function getOrder($authentication,$id='',$ref='',$ref_ext='') 'note' => $order->note, 'note_public' => $order->note_public, 'cond_reglement_id' => $order->cond_reglement_id, - 'cond_reglement' => $order->cond_reglement, - 'cond_reglement_doc' => $order->cond_reglement_doc, 'cond_reglement_code' => $order->cond_reglement_code, + 'cond_reglement' => $order->cond_reglement, 'mode_reglement_id' => $order->mode_reglement_id, - 'mode_reglement' => $order->mode_reglement, 'mode_reglement_code' => $order->mode_reglement_code, - + 'mode_reglement' => $order->mode_reglement, + 'date_livraison' => $order->date_livraison, 'fk_delivery_address' => $order->fk_delivery_address, @@ -466,7 +464,7 @@ function getOrdersForThirdParty($authentication,$idthirdparty) if ($fuser->societe_id) $socid=$fuser->societe_id; // Check parameters - if (! $error && !$idthirdparty) + if (! $error && empty($idthirdparty)) { $error++; $errorcode='BAD_PARAMETERS'; $errorlabel='Parameter id is not provided'; @@ -499,7 +497,7 @@ function getOrdersForThirdParty($authentication,$idthirdparty) if( $socid && ( $socid != $order->socid) ) { $error++; - $errorcode='PERMISSION_DENIED'; $errorlabel=$order->socid.'User does not have permission for this request'; + $errorcode='PERMISSION_DENIED'; $errorlabel=$order->socid.' User does not have permission for this request'; } if(!$error) @@ -511,6 +509,7 @@ function getOrdersForThirdParty($authentication,$idthirdparty) { $linesresp[]=array( 'id'=>$line->rowid, + 'type'=>$line->product_type, 'fk_commande'=>$line->fk_commande, 'fk_parent_line'=>$line->fk_parent_line, 'desc'=>$line->desc, @@ -520,13 +519,12 @@ function getOrdersForThirdParty($authentication,$idthirdparty) 'tva_tx'=>$line->tva_tx, 'remise'=>$line->remise, 'remise_percent'=>$line->remise_percent, - 'fk_product'=>$line->fk_product, - 'product_type'=>$line->product_type, - 'total_ht'=>$line->total_ht, - 'total_tva'=>$line->total_tva, - 'total_ttc'=>$line->total_ttc, + 'total_net'=>$line->total_ht, + 'total_vat'=>$line->total_tva, + 'total'=>$line->total_ttc, 'date_start'=>$line->date_start, 'date_end'=>$line->date_end, + 'product_id'=>$line->fk_product, 'product_ref'=>$line->product_ref, 'product_label'=>$line->product_label, 'product_desc'=>$line->product_desc @@ -541,17 +539,16 @@ function getOrdersForThirdParty($authentication,$idthirdparty) 'ref_ext' => $order->ref_ext, 'ref_int' => $order->ref_int, 'socid' => $order->socid, - 'statut' => $order->statut, + 'status' => $order->statut, - 'total_ht' => $order->total_ht, - 'total_tva' => $order->total_tva, + 'total_net' => $order->total_ht, + 'total_vat' => $order->total_tva, 'total_localtax1' => $order->total_localtax1, 'total_localtax2' => $order->total_localtax2, - 'total_ttc' => $order->total_ttc, - 'fk_project' => $order->fk_project, + 'total' => $order->total_ttc, + 'project_id' => $order->fk_project, - 'date' => $order->date?dol_print_date($order->date,'dayrfc'):'', - 'date_commande' => $order->date_commande?dol_print_date($order->date_commande,'dayrfc'):'', + 'date' => $order->date_commande?dol_print_date($order->date_commande,'dayrfc'):'', 'remise' => $order->remise, 'remise_percent' => $order->remise_percent, @@ -570,7 +567,6 @@ function getOrdersForThirdParty($authentication,$idthirdparty) 'mode_reglement_code' => $order->mode_reglement_code, 'date_livraison' => $order->date_livraison, - 'fk_delivery_address' => $order->fk_delivery_address, 'demand_reason_id' => $order->demand_reason_id, 'demand_reason_code' => $order->demand_reason_code, @@ -618,11 +614,12 @@ function createOrder($authentication,$order) dol_syslog("Function: createOrder login=".$authentication['login']." socid :".$order['socid']); + if ($authentication['entity']) $conf->entity=$authentication['entity']; + // Init and check authentication $objectresp=array(); $errorcode='';$errorlabel=''; $error=0; - if ($authentication['entity']) $conf->entity=$authentication['entity']; $fuser=check_authentication($authentication,$error,$errorcode,$errorlabel); // Check parameters @@ -631,19 +628,19 @@ function createOrder($authentication,$order) if (! $error) { $newobject=new Commande($db); - $newobject->socid=$order['socid']; + $newobject->socid=$order['thirdparty_id']; $newobject->type=$order['type']; $newobject->ref_ext=$order['ref_ext']; - $newobject->date=$order['date']; - $newobject->date_lim_reglement=$order['date_due']; + $newobject->date=dol_stringtotime($order['date'],'dayrfc'); + $newobject->date_lim_reglement=dol_stringtotime($order['date_due'],'dayrfc'); $newobject->note=$order['note']; $newobject->note_public=$order['note_public']; - $newobject->statut=$order['statut']; + $newobject->statut=$order['status']; $newobject->facturee=$order['facturee']; $newobject->fk_project=$order['project_id']; $newobject->cond_reglement_id=$order['cond_reglement_id']; $newobject->demand_reason_id=$order['demand_reason_id']; - $newobject->date_commande=$now; + $newobject->date_creation=$now; // Trick because nusoap does not store data with same structure if there is one or several lines $arrayoflines=array(); @@ -670,17 +667,26 @@ function createOrder($authentication,$order) $db->begin(); - $object_id=$newobject->create($fuser,0,0); - if ($object_id < 0) + $result=$newobject->create($fuser,0,0); + if ($result < 0) { $error++; } + if ($newobject->statut == 1) // We want order validated + { + $result=$newobject->validate($fuser); + if ($result < 0) + { + $error++; + } + } + if (! $error) { $db->commit(); - $objectresp=array('result'=>array('result_code'=>'OK', 'result_label'=>''),'id'=>$object_id); + $objectresp=array('result'=>array('result_code'=>'OK', 'result_label'=>''),'id'=>$newobject->id,'ref'=>$newobject->ref); } else { @@ -689,6 +695,7 @@ function createOrder($authentication,$order) $errorcode='KO'; $errorlabel=$newobject->error; } + } if ($error) @@ -784,6 +791,6 @@ function validOrder($authentication,$id='') // Return the results. -$server->service($HTTP_RAW_POST_DATA); +$server->service((isset($HTTP_RAW_POST_DATA)?$HTTP_RAW_POST_DATA:'')); ?> From 6ce82bc723374f3845c5d136901f2b075178ef42 Mon Sep 17 00:00:00 2001 From: simnandez Date: Tue, 12 Mar 2013 16:55:21 +0100 Subject: [PATCH 13/13] Update ChangeLog --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b2adcc39713..7f41de40a97 100644 --- a/ChangeLog +++ b/ChangeLog @@ -61,7 +61,7 @@ WARNING: If you used external modules, some of them may need to be upgraded due - Fix: Package for launchpad - Fix: [ bug #736 ] Missing column in llx_c_chargesociales - Fix: Localtax2 for Spain must be based into buyer - +- Fix: [ bug #762 ] Bad profit calculation in Reporting