diff --git a/ChangeLog b/ChangeLog index 8bdae25eac7..762487b6ac8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -85,6 +85,8 @@ For users: - New : Use of MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR to use disk cache for big excel export. - New : Option on extrafields to have them always editable regardless of the document status. - New : New module PrintIPP to print without opening document is available as stable. +- New : Introduce hidden option STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS to solve at no risk + a missing control on missing warehouse. - Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action - Fix: [ bug #1470, #1472, #1473] User trigger problem - Fix: [ bug #1489, #1491 ] Intervention trigger problem @@ -172,14 +174,14 @@ Dolibarr better: ***** ChangeLog for 3.6.3 compared to 3.6.2 ***** - Fix: ref_ext was not saved when recording a customer order from web service -- Fix: amarok is a bugged theme making dolidroid failed. We swith to eldy automatically with dolidroid. - Fix: withdrawal create error if in the same month are deleted previus withdrawals. +- Fix: amarok is a bugged theme making dolidroid failed. We switch to eldy automatically with dolidroid. - Fix: [ bug #1788 ] Duplicated doActions hook in product/fournisseurs.php -- Fix: withdrawal create error if in the same month are deleted previus withdrawals. +- Fix: withdrawal create error if in the same month are deleted previous withdrawals. - Fix: [ bug #1801 ] FAC_FORCE_DATE_VALIDATION constant alters supplier invoice date given to numeration modules - Fix: [ bug #1802 ] SQL error when updating a task with PostgreSQL database - Fix: [ bug #1785 ] Start date is lost in Project > Linked objects -- Fix: [ bug #1804 ] SQL error when sending email without addresee +- Fix: [ bug #1804 ] SQL error when sending email without address - Fix: [ bug #1803 ] AJAX company contact input is not aligned - Fix: [ bug #1787 ] Incorrect behaviour of doActions hook - Fix: [ bug #1796 ] Unable to use numeration modules from an external module @@ -187,18 +189,22 @@ Dolibarr better: - Fix: [ bug #1717 ] Sorting unpaid invoices by amount received brings due amount - Fix: [ bug #1784 ] MOTD doesn't show up in Amarok theme - Fix: Tracking number not visible on shipment pdf -- Fix: [ bug #1812 ] SQL Error message while sending emailing with PostgreSQL datatabase +- Fix: [ bug #1812 ] SQL Error message while sending emailing with PostgreSQL database - Fix: [ bug #1819 ] SQL error when searching for an invoice payment - Fix: [ bug #1827 ] Tax reports gives incorrect amounts when using external modules that create lines with special codes +- Fix: [ bug #1822 ] SQL error in clientfourn.php report with PostgreSQL +- Fix: [ bug #1832 ] SQL error when adding a product with no price defined to an object +- Fix: [ bug #1826 ] Supplier payment types are not translated into fourn/facture/paiement.php +- Fix: [ bug #1830 ] Salaries payment only allows checking accounts ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. - Fix: bug 1588 : relative discount. -- Fix: label of input method not tranlated. -- Fix: box of customer and propsects were not correctly disabled. +- Fix: label of input method not translated. +- Fix: box of customer and prospects were not correctly disabled. - Fix: [ bug #1618 ] PHP Error thrown when saving a barcode - Fix: Civility & birthdate wasn't save into adherent module. -- Fix: webservice Thirdparty parameter lastname for invidual creation is now lastname and not ref +- Fix: webservice Thirdparty parameter lastname for individual creation is now lastname and not ref - Fix: Chars - is no more allowed into value for code for extra fields. - Fix: [ bug #1622 ] Requesting holiday than spans across two years cause high CPU usage by Apache - Fix: [ bug #1595 ] Selected boolean extrafield in intervention creation page, does not save state @@ -226,14 +232,14 @@ For users: - Fix: Iban was used instead of Bic into SEPA file. - Fix: Must unaccent strings into SEPA file. - Fix: Extrafield feature select from table should try to translate multiple column when not needed -- Fix: cents for indian ruppes are calle paisa and paise. +- Fix: cents for indian ruppes are called paisa and paise. - Fix: Invoices payments may be older than invoices. - Fix: Withdrawal total amount is double - Fix: [ bug #1593 ] Spanish Localtax IRPF not being calculated since 3.6.0 in supplier invoices when adding a line - Fix: Web service categorie WDSL declaration is correct - Fix: ErrorBadValueForParamNotAString was displayed in virtual product if no base price defined - Fix: Category creation failed and no message output -- Fix: Lanf for Payment Type +- Fix: Lang for Payment Type - Fix: PHPCheckstyle 1.5.5 ***** ChangeLog for 3.6 compared to 3.5.* ***** @@ -255,12 +261,12 @@ For users: - New: Improved Opensurvey module: Added options to disable comments and disable public votes. Limit dates use calendar popup. - Description of survey use wysiwig editor. + Description of survey use wysiwyg editor. More information shown on result tab. Renamed "survey" into "poll" (better translation). - New: Add filter on text and status into survey list. Can also sort on id, text and date end. - New: The box "balance of bank accounts" show all opened accounts. -- New: Add option MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE to add sale represnative into public +- New: Add option MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE to add sale representative into public note of generated documents. - New: Add warning if supplier payment is higher that due amount. - New: Increase length of url into bookmark module. @@ -273,7 +279,7 @@ For users: - New: Add barcode fields into user database. - New: Add manager name (ceo, director, president...) into main company information page. - New: Add field url as product properties. -- New: More options to create a credit note (can be filled autatically according to remain to pay). +- New: More options to create a credit note (can be filled automatically according to remain to pay). - New: Can define custom fields for categories. - New: Prepare generation of SEPA files into module withdrawal. - New: [ task #1164 ] Add "Ref. supplier" search box in supplier orders @@ -290,7 +296,7 @@ For users: - New: [ task #926 ] Add extrafield feature on order lines. - New: [ task #927 ] Add extrafield feature on Proposal lines. - New: [ task #928 ] Add extrafield feature on invoice lines. -- New: Paypal/paybox email sent after backcall of a payment is now a formated and translated +- New: Paypal/paybox email sent after backcall of a payment is now a formatted and translated HTML content. For member subscription renewal, there is also a link to member. - New: When a subscription is recorded with invoice and payment: - the document (PDF) of invoice is also generated. @@ -346,11 +352,11 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f So check that return value is 0 to keep default standard behaviour after hook, or 1 to disable default standard behaviour. - Properties "civilite_id" were renamed into "civility_id". -- Remove add_photo_web() that is ot used anymore by core code. +- Remove add_photo_web() that is not used anymore by core code. ***** ChangeLog for 3.5.7 compared to 3.5.6 ***** -Fix: Paypal link were broken dur to SSL v3 closed. +Fix: Paypal link were broken due to SSL v3 closed. Fix: [ bug #1769 ] Error when installing to a PostgreSQL DB that contains numbers Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 00H Fix: [ bug #1757 ] Sorting breaks product/service statistics @@ -369,7 +375,7 @@ Fix: Bad days and month reported by function. Fix: Bad margin calculation. ***** ChangeLog for 3.5.5 compared to 3.5.4 ***** -Fix: Holiday module was broken. Initializaion of amount of holidays failed. +Fix: Holiday module was broken. Initialization of amount of holidays failed. Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas. Fix: Fusion PDF button on unpaid invoice is no more displayed. Fix: Unpaid invoice launch fusion PDF action even if it is only search (with enter keyboard input instead of lens click). @@ -404,7 +410,7 @@ Fix: When using option MAIN_MAIL_ALLOW_SENDMAIL_F, a mail was sent to sender. Fix: Question about warehouse must not be done when module stock is disabled. Fix: Option STOCK_SUPPORTS_SERVICES was not correctly implemented (missing test at some places). -Fix: Renaming a project with uplaoded files failed. +Fix: Renaming a project with uploaded files failed. Fix: [ bug #1476 ] Invoice creation form loses invoice date when there is a validation error. Fix: [ bug #1431 ] Reception and Send supplier order box has a weird top margin. Fix: [ bug #1428 ] "Nothing" is shown in the middle of the screen in a supplier order. @@ -425,7 +431,7 @@ Fix: [ bug #1449 ] Trigger ORDER_CREATE, LINEORDER_DELETE, LINEORDER_UPDATE and Fix: [ bug #1450 ] Several Customer order's triggers do not report the error from the trigger handler. Fix: [ bug #1451 ] Interrupted order clone through trigger, loads nonexistent order. Fix: [ bug #1454 ] Mention de bas de page erroné -Fix: Do not display dictionnay for non activated module +Fix: Do not display dictionary for non activated module Fix: Link element from element project pages Fix: [ bug #1509 ] Expedition admin free text & watermark submit error Fix: [ bug #1349 ] AJAX contact selector does not work fine in Project card diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 6a7e584f817..a8fe5bab327 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -951,6 +951,8 @@ if ($nboftargetok) { print "Remove target $FILENAMEEXEDOLIWAMP.exe...\n"; unlink "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"; + print "Check that in your Wine setup, you create a Z: drive that point to your /tmp directory.\n"; + $SOURCEBACK=$SOURCE; $SOURCEBACK =~ s/\//\\/g; @@ -958,7 +960,7 @@ if ($nboftargetok) { $ret=`cat "$SOURCE/build/exe/doliwamp/doliwamp.iss" | sed -e 's/__FILENAMEEXEDOLIWAMP__/$FILENAMEEXEDOLIWAMP/g' > "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`; print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"\n"; - $cmd= "ISCC.exe \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\""; + $cmd= "ISCC.exe \"Z:$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\""; print "$cmd\n"; $ret= `$cmd`; #print "$ret\n"; diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index 4c09e379d9b..bf78c7cc161 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -113,9 +113,9 @@ class modMyModule extends DolibarrModules $this->const = array(); // Array to add new pages in new tabs - // Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1 - // 'objecttype:+tabname2:Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2 - // 'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname + // Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1 + // 'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key. + // 'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname // where objecttype can be // 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) // 'contact' to add a tab in contact view diff --git a/dev/translation/txpull.sh b/dev/translation/txpull.sh index 6365aa23637..2e4470111e6 100755 --- a/dev/translation/txpull.sh +++ b/dev/translation/txpull.sh @@ -26,7 +26,7 @@ fi if [ "x$1" = "xall" ] then - for fic in ar_SA bg_BG bs_BA ca_ES cs_CZ da_DK de_DE el_GR es_ES et_EE eu_ES fa_IR fi_FI fr_FR he_IL hr_HR hu_HU id_ID is_IS it_IT ja_JP ko_KR lt_LT lv_LV mk_MK nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sk_SK sl_SI sq_AL sv_SE th_TH tr_TR uk_UA uz_UZ vi_VN zh_CN zh_TW + for fic in ar_SA bg_BG bs_BA ca_ES cs_CZ da_DK de_DE el_GR es_ES et_EE eu_ES fa_IR fi_FI fr_FR he_IL hr_HR hu_HU id_ID is_IS it_IT ja_JP ka_GE ko_KR lt_LT lv_LV mk_MK nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sk_SK sl_SI sq_AL sv_SE th_TH tr_TR uk_UA uz_UZ vi_VN zh_CN zh_TW do echo "tx pull -l $fic $2 $3" tx pull -l $fic $2 $3 diff --git a/dev/translation/txpush.sh b/dev/translation/txpush.sh index 2acc96b1d6f..34ab5c97f5d 100755 --- a/dev/translation/txpush.sh +++ b/dev/translation/txpush.sh @@ -25,7 +25,7 @@ fi if [ "x$1" = "xall" ] then - for fic in ar_SA bg_BG bs_BA ca_ES cs_CZ da_DK de_DE el_GR es_ES et_EE eu_ES fa_IR fi_FI fr_FR he_IL hr_HR hu_HU id_ID is_IS it_IT ja_JP ko_KR lt_LT lv_LV mk_MK nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sk_SK sl_SI sq_AL sv_SE th_TH tr_TR uk_UA uz_UZ vi_VN zh_CN zh_TW + for fic in ar_SA bg_BG bs_BA ca_ES cs_CZ da_DK de_DE el_GR es_ES et_EE eu_ES fa_IR fi_FI fr_FR he_IL hr_HR hu_HU id_ID is_IS it_IT ja_JP ka_GE ko_KR lt_LT lv_LV mk_MK nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sk_SK sl_SI sq_AL sv_SE th_TH tr_TR uk_UA uz_UZ vi_VN zh_CN zh_TW do echo "tx push --skip -t -l $fic $2 $3" tx push --skip -t -l $fic $2 $3 diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 4dd005fca85..e269bafae6c 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -94,7 +94,6 @@ if ($result) while ($i < $num && $i < $max) { $obj = $db->fetch_object($result); - $fiscalyearstatic->ref=$obj->rowid; $fiscalyearstatic->id=$obj->rowid; print '
| '.$langs->trans("Parameters").' | '.$langs->trans("Value").' | '; print ''; @@ -299,7 +300,8 @@ else // Show $var=true; // Language - print_fiche_titre($langs->trans("Language"),'','').' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Parameters").' | '.$langs->trans("Value").' | |||
| '.$langs->trans("DefaultMenuManager").' | '; print ''; - print $formadmin->select_menu(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED, 'MAIN_MENU_STANDARD', $dirstandard, empty($conf->global->MAIN_MENU_STANDARD_FORCED)?'':' disabled="disabled"'); + $formadmin->select_menu(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED, 'MAIN_MENU_STANDARD', $dirstandard, empty($conf->global->MAIN_MENU_STANDARD_FORCED)?'':' disabled="disabled"'); print ' | '; print ''; - print $formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?$conf->global->MAIN_MENUFRONT_STANDARD:$conf->global->MAIN_MENUFRONT_STANDARD_FORCED, 'MAIN_MENUFRONT_STANDARD', $dirstandard, empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?'':' disabled="disabled"'); + $formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?$conf->global->MAIN_MENUFRONT_STANDARD:$conf->global->MAIN_MENUFRONT_STANDARD_FORCED, 'MAIN_MENUFRONT_STANDARD', $dirstandard, empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?'':' disabled="disabled"'); print ' | '; print '||
| '.$langs->trans("DefaultMenuSmartphoneManager").' | '; print ''; - print $formadmin->select_menu(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED, 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?'':' disabled="disabled"'); + $formadmin->select_menu(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED, 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?'':' disabled="disabled"'); print ' | '; print ''; - print $formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED, 'MAIN_MENUFRONT_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?'':' disabled="disabled"'); + $formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED, 'MAIN_MENUFRONT_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?'':' disabled="disabled"'); print ' | '; print '||
| '.$langs->trans('MenuHandler').' | '; print ''; - print $formadmin->select_menu_families($menu_handler,'menu_handler',$dirmenu); + $formadmin->select_menu_families($menu_handler,'menu_handler',$dirmenu); print ' | '; print ''.$langs->trans('DetailMenuHandler').' | ||
| '.$langs->trans("BankToReceiveWithdraw").' | '; print ''; -print $form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT,'PRELEVEMENT_ID_BANKACCOUNT',0,"courant=1",1); +$form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT,'PRELEVEMENT_ID_BANKACCOUNT',0,"courant=1",1); print ' | |||
| "; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"bid","","",'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Title"),'','').""; - print_liste_field_titre($langs->trans("Link"),'','').""; - print_liste_field_titre($langs->trans("Target"),'','','','','align="center"').""; + print_liste_field_titre($langs->trans("Title"),'',''); + print ""; + print_liste_field_titre($langs->trans("Link"),'',''); + print ""; + print_liste_field_titre($langs->trans("Target"),'','','','','align="center"'); + print ""; print_liste_field_titre($langs->trans("Owner"),$_SERVER["PHP_SELF"],"u.lastname","","",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"b.dateb","","",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Position"),$_SERVER["PHP_SELF"],"b.position","","",'align="right"',$sortfield,$sortorder); diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php index 1ddde37b98b..7571befb121 100644 --- a/htdocs/cashdesk/admin/cashdesk.php +++ b/htdocs/cashdesk/admin/cashdesk.php @@ -130,7 +130,16 @@ if (! empty($conf->stock->enabled)) $var=!$var; print ' | ||||
| '.$langs->trans("CashDeskDoNotDecreaseStock").' | '; // Force warehouse (this is not a default value) print ''; - print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK',$conf->global->CASHDESK_NO_DECREASE_STOCK,1); + if (empty($conf->productbatch->enabled)) { + print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK',$conf->global->CASHDESK_NO_DECREASE_STOCK,1); + } + else + { + if (!$conf->global->CASHDESK_NO_DECREASE_STOCK) { + $res = dolibarr_set_const($db,"CASHDESK_NO_DECREASE_STOCK",1,'chaine',0,'',$conf->entity); + } + print $langs->trans('StockDecreaseForPointOfSaleDisabledbyBatch'); + } print ' | |||
| '.$langs->trans('Address').' | '; - print dol_print_address($soc->address,'gmap','thirdparty',$soc->id); + dol_print_address($soc->address,'gmap','thirdparty',$soc->id); print ' | |||
| contratid."\">".img_object($langs->trans("ShowContract","contract"))." ".$obj->ref." | "; + print "||||
| contratid."\">".img_object($langs->trans("ShowContract","contract"), 'contract')." ".$obj->ref." | "; print ''; $companystatic->id=$objp->rowid; $companystatic->name=$objp->name; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 75f2399017b..ff129a557e8 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -118,8 +118,7 @@ if ($action == 'add') if (GETPOST('clearlist')) { // Chargement de la classe - $classname = "MailingTargets"; - $obj = new $classname($db); + $obj = new MailingTargets($db); $obj->clear_target($id); header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); @@ -135,8 +134,7 @@ if ($action == 'delete') { if (!empty($id)) { - $classname = "MailingTargets"; - $obj = new $classname($db); + $obj = new MailingTargets($db); $obj->update_nb($id); header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 15ce2ccd330..ca4c51c3f4c 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -296,15 +296,15 @@ class Propal extends CommonObject * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) * * @param string $desc Description de la ligne - * @param double $pu_ht Prix unitaire - * @param double $qty Quantite - * @param double $txtva Taux de tva - * @param double $txlocaltax1 Local tax 1 rate - * @param double $txlocaltax2 Local tax 2 rate + * @param float $pu_ht Prix unitaire + * @param float $qty Quantite + * @param float $txtva Taux de tva + * @param float $txlocaltax1 Local tax 1 rate + * @param float $txlocaltax2 Local tax 2 rate * @param int $fk_product Id du produit/service predefini - * @param double $remise_percent Pourcentage de remise de la ligne + * @param float $remise_percent Pourcentage de remise de la ligne * @param string $price_base_type HT or TTC - * @param double $pu_ttc Prix unitaire TTC + * @param float $pu_ttc Prix unitaire TTC * @param int $info_bits Bits de type de lignes * @param int $type Type of line (product, service) * @param int $rang Position of line @@ -320,7 +320,7 @@ class Propal extends CommonObject * * @see add_product */ - function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$date_start='', $date_end='',$array_option=0) + function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$date_start='', $date_end='',$array_option=0) { global $mysoc; @@ -477,14 +477,14 @@ class Propal extends CommonObject * Update a proposal line * * @param int $rowid Id de la ligne - * @param double $pu Prix unitaire (HT ou TTC selon price_base_type) - * @param double $qty Quantity - * @param double $remise_percent Remise effectuee sur le produit - * @param double $txtva Taux de TVA - * @param double $txlocaltax1 Local tax 1 rate - * @param double $txlocaltax2 Local tax 2 rate + * @param float $pu Prix unitaire (HT ou TTC selon price_base_type) + * @param float $qty Quantity + * @param float $remise_percent Remise effectuee sur le produit + * @param float $txtva Taux de TVA + * @param float $txlocaltax1 Local tax 1 rate + * @param float $txlocaltax2 Local tax 2 rate * @param string $desc Description - * @param double $price_base_type HT ou TTC + * @param string $price_base_type HT ou TTC * @param int $info_bits Miscellaneous informations * @param int $special_code Special code (also used by externals modules!) * @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines). @@ -498,9 +498,9 @@ class Propal extends CommonObject * @param array $array_option extrafields array * @return int 0 if OK, <0 if KO */ - function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='', $array_option=0) + function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='', $array_option=0) { - global $conf,$user,$langs, $mysoc; + global $mysoc; dol_syslog(get_class($this)."::updateLine $rowid, $pu, $qty, $remise_percent, $txtva, $desc, $price_base_type, $info_bits"); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; @@ -1866,8 +1866,6 @@ class Propal extends CommonObject */ function set_draft($user) { - global $conf,$langs; - $sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fk_statut = 0"; $sql.= " WHERE rowid = ".$this->id; diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index dc8501c37ba..97256c840b1 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -193,8 +193,6 @@ class PropaleStats extends Stats */ function getAllByProduct($year) { - global $user; - $sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg"; $sql.= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product"; //if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 66b36e0320f..b7c856fdbf5 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -144,7 +144,9 @@ if (! $sortorder) $sortorder='DESC'; $limit = $conf->liste_limit; -$sql = 'SELECT s.rowid, s.nom as name, s.town, s.client, s.code_client,'; +if (! $sall) $sql = 'SELECT'; +else $sql = 'SELECT DISTINCT'; +$sql.= ' s.rowid, s.nom as name, s.town, s.client, s.code_client,'; $sql.= ' p.rowid as propalid, p.note_private, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,'; if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,"; $sql.= ' u.login'; diff --git a/htdocs/comm/prospect/class/prospect.class.php b/htdocs/comm/prospect/class/prospect.class.php index 19e56fe2cff..59f284408b8 100644 --- a/htdocs/comm/prospect/class/prospect.class.php +++ b/htdocs/comm/prospect/class/prospect.class.php @@ -41,8 +41,6 @@ class Prospect extends Societe */ function __construct($db) { - global $config; - $this->db = $db; return 0; @@ -56,7 +54,7 @@ class Prospect extends Societe */ function load_state_board() { - global $conf, $user; + global $user; $this->nb=array("customers" => 0,"prospects" => 0); $clause = "WHERE"; diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 79f952fe7fd..99bfcb3a072 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -534,7 +534,7 @@ if ($socid > 0) } else { - print dol_print_error($db); + dol_print_error($db); } } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6c5b6c020c7..35834419a74 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -162,7 +162,6 @@ class Commande extends CommonOrder } $obj = new $classname(); - $numref = ""; $numref = $obj->getNextValue($soc,$this); if ($numref != "") @@ -1079,19 +1078,19 @@ class Commande extends CommonOrder * Add an order line into database (linked to product/service or not) * * @param string $desc Description of line - * @param double $pu_ht Unit price (without tax) - * @param double $qty Quantite - * @param double $txtva Taux de tva force, sinon -1 - * @param double $txlocaltax1 Local tax 1 rate - * @param double $txlocaltax2 Local tax 2 rate + * @param float $pu_ht Unit price (without tax) + * @param float $qty Quantite + * @param float $txtva Taux de tva force, sinon -1 + * @param float $txlocaltax1 Local tax 1 rate + * @param float $txlocaltax2 Local tax 2 rate * @param int $fk_product Id du produit/service predefini - * @param double $remise_percent Pourcentage de remise de la ligne + * @param float $remise_percent Pourcentage de remise de la ligne * @param int $info_bits Bits de type de lignes * @param int $fk_remise_except Id remise * @param string $price_base_type HT or TTC - * @param double $pu_ttc Prix unitaire TTC - * @param timestamp $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html) - * @param timestamp $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html) + * @param float $pu_ttc Prix unitaire TTC + * @param int $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html) + * @param int $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html) * @param int $type Type of line (0=product, 1=service) * @param int $rang Position of line * @param int $special_code Special code (also used by externals modules!) @@ -1285,16 +1284,16 @@ class Commande extends CommonOrder * $this->client must be loaded * * @param int $idproduct Product Id - * @param double $qty Quantity - * @param double $remise_percent Product discount relative - * @param timestamp $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html) - * @param timestamp $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html) + * @param float $qty Quantity + * @param float $remise_percent Product discount relative + * @param int $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html) + * @param int $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html) * @return void * * TODO Remplacer les appels a cette fonction par generation objet Ligne * insere dans tableau $this->products */ - function add_product($idproduct, $qty, $remise_percent=0, $date_start='', $date_end='') + function add_product($idproduct, $qty, $remise_percent=0.0, $date_start='', $date_end='') { global $conf, $mysoc; @@ -1692,7 +1691,6 @@ class Commande extends CommonOrder */ function loadExpeditions($filtre_statut=-1) { - $num=0; $this->expeditions = array(); $sql = 'SELECT cd.rowid, cd.fk_product,'; @@ -1961,7 +1959,7 @@ class Commande extends CommonOrder * Set the order date * * @param User $user Object user making change - * @param timestamp $date Date + * @param int $date Date * @return int <0 if KO, >0 if OK */ function set_date($user, $date) @@ -1995,7 +1993,7 @@ class Commande extends CommonOrder * Set the planned delivery date * * @param User $user Objet utilisateur qui modifie - * @param timestamp $date_livraison Date de livraison + * @param int $date_livraison Date de livraison * @return int <0 si ko, >0 si ok */ function set_date_livraison($user, $date_livraison) @@ -2324,16 +2322,16 @@ class Commande extends CommonOrder * * @param int $rowid Id of line to update * @param string $desc Description de la ligne - * @param double $pu Prix unitaire - * @param double $qty Quantity - * @param double $remise_percent Pourcentage de remise de la ligne - * @param double $txtva Taux TVA - * @param double $txlocaltax1 Local tax 1 rate - * @param double $txlocaltax2 Local tax 2 rate + * @param float $pu Prix unitaire + * @param float $qty Quantity + * @param float $remise_percent Pourcentage de remise de la ligne + * @param float $txtva Taux TVA + * @param float $txlocaltax1 Local tax 1 rate + * @param float $txlocaltax2 Local tax 2 rate * @param string $price_base_type HT or TTC * @param int $info_bits Miscellaneous informations on line - * @param timestamp $date_start Start date of the line - * @param timestamp $date_end End date of the line + * @param int $date_start Start date of the line + * @param int $date_end End date of the line * @param int $type Type of line (0=product, 1=service) * @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines). * @param int $skip_update_total Keep fields total_xxx to 0 (used for special lines by some modules) @@ -2344,7 +2342,7 @@ class Commande extends CommonOrder * @param array $array_option extrafields array * @return int < 0 if KO, > 0 if OK */ - function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_option=0) + function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0,$txlocaltax2=0.0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_option=0) { global $conf, $mysoc; @@ -2578,6 +2576,8 @@ class Commande extends CommonOrder */ function update_extrafields($user) { + global $hookmanager, $conf; + $action='create'; // Actions on extra fields (by external module or standard code) @@ -3167,7 +3167,7 @@ class Commande extends CommonOrder */ public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) { - global $conf,$user,$langs,$hookmanager; + global $conf,$langs; $langs->load("orders"); diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index c36f19c166b..6a322e8681e 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -221,5 +221,5 @@ if ($id > 0 || ! empty($ref)) } -$db->close(); llxFooter(); +$db->close(); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index f42920850c2..0de3c54e1ba 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -500,7 +500,7 @@ if ($resql) } else { - print dol_print_error($db); + dol_print_error($db); } llxFooter(); diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 1009b030210..930fee833fa 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -696,7 +696,7 @@ if (($action != 'create' && $action != 'add') || !$error) } else { - print dol_print_error($db); + dol_print_error($db); } } diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 87b7d3e62c5..024e21510e1 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -432,7 +432,7 @@ if ($id > 0 || ! empty($ref)) print ' | '; //$filtertype=array('TIP'=>'TIP','PRE'=>'PRE',...) $filtertype=''; - print $form->select_types_paiements($paiementtype,'paiementtype',$filtertype,2,1,1,8); + $form->select_types_paiements($paiementtype,'paiementtype',$filtertype,2,1,1,8); print ' | '; print ''; print ' | '; diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index b1852785466..98c302f7320 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -250,7 +250,7 @@ if ($action == 'create') // Type print ' |
| '.$langs->trans("AccountType").' | '; print ''; - print $formbank->select_type_comptes_financiers(isset($_POST["type"])?$_POST["type"]:1,"type"); + $formbank->select_type_comptes_financiers(isset($_POST["type"])?$_POST["type"]:1,"type"); print ' | |||
| '.$langs->trans("AccountType").' | '; print ''; - print $formbank->select_type_comptes_financiers((isset($_POST["type"])?$_POST["type"]:$account->type),"type"); + $formbank->select_type_comptes_financiers((isset($_POST["type"])?$_POST["type"]:$account->type),"type"); print ' | '; - print $form->select_types_paiements($objp->fk_type,"value",'',2); + $form->select_types_paiements($objp->fk_type,"value",'',2); print ''; if ($objp->receiptid) { diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php index 601db34c964..3881efd5c9b 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/virement.php @@ -167,11 +167,11 @@ print ''; $var=false; print ' | ||
| '; -print $form->select_comptes($account_from,'account_from',0,'',1); +$form->select_comptes($account_from,'account_from',0,'',1); print " | "; print "\n"; -print $form->select_comptes($account_to,'account_to',0,'',1); +$form->select_comptes($account_to,'account_to',0,'',1); print " | \n"; print ""; diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 20433118bbf..407edf6332e 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -252,7 +252,7 @@ if ($action == 'create') print " | ||
| '.$langs->trans("Type").' | '; - print $form->select_type_fees(GETPOST('type','int'),'type',1); + $form->select_type_fees(GETPOST('type','int'),'type',1); print ' | |||
| '.$langs->trans("Type").' | '; - print $form->select_type_fees(GETPOST('type','int')?GETPOST('type','int'):$object->type,'type',0); + $form->select_type_fees(GETPOST('type','int')?GETPOST('type','int'):$object->type,'type',0); print ' | |||
| ".$langs->trans("PaymentMode")." | "; - print $form->form_modes_reglement(null, $don->modepaiementid,'none'); + $form->form_modes_reglement(null, $don->modepaiementid,'none'); print " | |||
| '.$langs->trans("Status").' | '.$don->getLibStatut(4).' | |||
| '.$langs->trans("BankAccount").' | '; - print $form->select_comptes($filteraccountid,'accountid',0,'courant <> 2',1); + $form->select_comptes($filteraccountid,'accountid',0,'courant <> 2',1); print ' | |||
| '; dol_print_object_info($object); diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 6c0de13d15b..d099d017ecd 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -244,8 +244,6 @@ class EcmDirectory // extends CommonObject */ function changeNbOfFiles($sign) { - global $conf, $langs; - // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."ecm_directories SET"; $sql.= " cachenbofdoc = cachenbofdoc ".$sign." 1"; @@ -320,7 +318,7 @@ class EcmDirectory // extends CommonObject * Delete object on database and/or on disk * * @param User $user User that delete - * @param int $mode 'all'=delete all, 'databaseonly'=only database entry, 'fileonly' (not implemented) + * @param string $mode 'all'=delete all, 'databaseonly'=only database entry, 'fileonly' (not implemented) * @return int <0 if KO, >0 if OK */ function delete($user, $mode='all') @@ -329,7 +327,6 @@ class EcmDirectory // extends CommonObject require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $error=0; - $result=0; if ($mode != 'databaseonly') $relativepath=$this->getRelativePath(1); // Ex: dir1/dir2/dir3 diff --git a/htdocs/ecm/class/htmlecm.form.class.php b/htdocs/ecm/class/htmlecm.form.class.php index 58286371941..87b4af190ae 100644 --- a/htdocs/ecm/class/htmlecm.form.class.php +++ b/htdocs/ecm/class/htmlecm.form.class.php @@ -51,7 +51,7 @@ class FormEcm * @param string $select_name Nom formulaire HTML * @return string String with HTML select */ - function select_all_sections($selected='',$select_name='') + function select_all_sections($selected=0,$select_name='') { global $langs; $langs->load("ecm"); diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index e6cc0e86d09..2eb5a61e3fc 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -732,10 +732,12 @@ class Expedition extends CommonObject } /** - * Add a expedition line + * Add a expedition line. + * If STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS is set, you can add a shipment line, with no stock source defined + * If STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT is not set, you can add a shipment line, even if not enough into stock * * @param int $entrepot_id Id of warehouse - * @param int $id Id of source line + * @param int $id Id of source line (order line) * @param int $qty Quantity * @return int <0 if KO, >0 if OK */ @@ -750,18 +752,26 @@ class Expedition extends CommonObject $line->origin_line_id = $id; $line->qty = $qty; - if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT) { - $orderline = new OrderLine($this->db); - $orderline->fetch($id); - $fk_product = $orderline->fk_product; + $orderline = new OrderLine($this->db); + $orderline->fetch($id); + $fk_product = $orderline->fk_product; - if (!empty($orderline->fk_product)) + if (! empty($orderline->fk_product)) + { + if (! ($entrepot_id > 0) && empty($conf->global->STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS)) + { + $this->error=$langs->trans("ErrorWarehouseRequiredIntoShipmentLine"); + return -1; + } + + if ($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT) // FIXME Check is done for stock of product, it must be done for stock of product into warehouse if $entrepot_id defined { $product=new Product($this->db); $result=$product->fetch($fk_product); $product_type=$product->type; - if($product_type == 0 && $product->stock_reel < $qty) { + if ($product_type == 0 && $product->stock_reel < $qty) + { $this->error=$langs->trans('ErrorStockIsNotEnough'); $this->db->rollback(); return -3; @@ -794,6 +804,12 @@ class Expedition extends CommonObject } $linebatch->dluo_qty=$value['q']; $tab[]=$linebatch; + + if ($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT) + { + // TODO + } + } } $line->entrepot_id = $linebatch->entrepot_id; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index d95816a1511..9051ab0bb27 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1261,18 +1261,19 @@ class CommandeFournisseur extends CommonOrder /** * Add a product into a stock warehouse. * - * @param User $user User object making change - * @param int $product Id of product to dispatch - * @param double $qty Qty to dispatch - * @param int $entrepot Id of warehouse to add product - * @param double $price Unit Price for PMP value calculation (Unit price without Tax and taking into account discount) - * @param string $comment Comment for stock movement - * @param date $eatby eat-by date - * @param date $sellby sell-by date - * @param string $batch Lot number + * @param User $user User object making change + * @param int $product Id of product to dispatch + * @param double $qty Qty to dispatch + * @param int $entrepot Id of warehouse to add product + * @param double $price Unit Price for PMP value calculation (Unit price without Tax and taking into account discount) + * @param string $comment Comment for stock movement + * @param date $eatby eat-by date + * @param date $sellby sell-by date + * @param string $batch Lot number + * @param int $fk_commandefourndet Id of supplier order line * @return int <0 if KO, >0 if OK */ - function DispatchProduct($user, $product, $qty, $entrepot, $price=0, $comment='', $eatby='', $sellby='', $batch='') + function DispatchProduct($user, $product, $qty, $entrepot, $price=0, $comment='', $eatby='', $sellby='', $batch='', $fk_commandefourndet='') { global $conf; $error = 0; @@ -1292,8 +1293,8 @@ class CommandeFournisseur extends CommonOrder $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX."commande_fournisseur_dispatch "; - $sql.= " (fk_commande,fk_product, qty, fk_entrepot, fk_user, datec) VALUES "; - $sql.= " ('".$this->id."','".$product."','".$qty."',".($entrepot>0?"'".$entrepot."'":"null").",'".$user->id."','".$this->db->idate($now)."')"; + $sql.= " (fk_commande,fk_product, qty, fk_entrepot, fk_user, datec, fk_commandefourndet) VALUES "; + $sql.= " ('".$this->id."','".$product."','".$qty."',".($entrepot>0?"'".$entrepot."'":"null").",'".$user->id."','".$this->db->idate($now)."','".$fk_commandefourndet."')"; dol_syslog(get_class($this)."::DispatchProduct", LOG_DEBUG); $resql = $this->db->query($sql); @@ -1609,9 +1610,9 @@ class CommandeFournisseur extends CommonOrder /** * Set the planned delivery date * - * @param User $user Objet utilisateur qui modifie - * @param timestamp $date_livraison Date de livraison - * @return int <0 si ko, >0 si ok + * @param User $user Objet user making change + * @param timestamp $date_livraison Planned delivery date + * @return int <0 if KO, >0 if OK */ function set_date_livraison($user, $date_livraison) { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 022b46f6a9b..ef78a9981c1 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -144,7 +144,7 @@ if ($action == 'setbankaccount' && $user->rights->fournisseur->commande->creer) // date de livraison if ($action == 'setdate_livraison' && $user->rights->fournisseur->commande->creer) { - $datelivraison=dol_mktime(0, 0, 0, GETPOST('liv_month','int'), GETPOST('liv_day','int'),GETPOST('liv_year','int')); + $datelivraison=dol_mktime(GETPOST('liv_hour','int'), GETPOST('liv_min','int'), GETPOST('liv_sec','int'), GETPOST('liv_month','int'), GETPOST('liv_day','int'),GETPOST('liv_year','int')); $result=$object->set_date_livraison($user,$datelivraison); if ($result < 0) @@ -1588,13 +1588,17 @@ elseif (! empty($object->id)) print ''; } else { - print $object->date_livraison ? dol_print_date($object->date_livraison,'daytext') : ' '; + $usehourmin='day'; + if (! empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin='dayhour'; + print $object->date_livraison ? dol_print_date($object->date_livraison, $usehourmin) : ' '; } print ' | |||
| '.$objp->qty.' | '; - print ''.$products_dispatched[$objp->fk_product].' | '; + print ''.$products_dispatched[$objp->rowid].' | '; if ( !(empty($conf->productbatch->enabled)) && $objp->tobatch==1) { print ''.img_picto_common($langs->trans('AddDispatchBatchLine'),'treemenu/plustop2.gif','onClick="AddLineBatch('.$i.')"').' | '; @@ -361,6 +363,7 @@ if ($id > 0 || ! empty($ref)) print '  | '; } else { print ''; + print ''; print ''; } diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 9f0a32c1113..edd91d91158 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -5,7 +5,11 @@ * Copyright (C) 2004 Christophe Combelles'.dol_trunc($objp->paiement_type.' '.$objp->num_paiement,32)." | \n"; + $payment_type = $langs->trans("PaymentType".$objp->paiement_type)!=("PaymentType".$objp->paiement_type)?$langs->trans("PaymentType".$objp->paiement_type):$objp->paiement_libelle; + + print ''.$payment_type.' '.dol_trunc($objp->num_paiement,32)." | \n"; print ''; if ($objp->bid) print ''.img_object($langs->trans("ShowAccount"),'account').' '.dol_trunc($objp->label,24).''; diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 671c3660594..70447a2a191 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -531,9 +531,11 @@ $("div#AShowChoices a").click(function() { }); +/* $(".runupgrade").click(function() { return confirm("'.dol_escape_js($langs->transnoentitiesnoconv("WarningUpgrade"), 0, 1).'"); }); +*/ '; diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 4421ad032eb..dc912be4286 100755 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -210,6 +210,8 @@ ALTER TABLE llx_product_price ADD INDEX idx_product_price_fk_product (fk_produc DELETE from llx_product_price where fk_product NOT IN (SELECT rowid from llx_product); ALTER TABLE llx_product_price ADD CONSTRAINT fk_product_price_product FOREIGN KEY (fk_product) REFERENCES llx_product (rowid); +ALTER TABLE llx_commande_fournisseur MODIFY COLUMN date_livraison datetime; + ALTER TABLE llx_commande_fournisseur ADD COLUMN fk_account integer AFTER date_livraison; ALTER TABLE llx_facture_fourn ADD COLUMN fk_account integer AFTER fk_projet; @@ -1155,3 +1157,8 @@ ALTER TABLE llx_resource MODIFY COLUMN entity integer DEFAULT 1 NOT NULL; -- This request make mysql drop (mysql bug, so we add it at end): ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type(rowid); +-- this update change the old formated url on llx_bank_url +UPDATE llx_bank_url set url = REPLACE( url, 'fiche.php', 'card.php'); + +-- Add id commandefourndet in llx_commande_fournisseur_dispatch to correct /fourn/commande/dispatch.php display when several times same product in supplier order +ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN fk_commandefourndet INT(11) NOT NULL DEFAULT '0' AFTER fk_product; diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseur.sql b/htdocs/install/mysql/tables/llx_commande_fournisseur.sql index ff87110c72a..f9f440d0db4 100644 --- a/htdocs/install/mysql/tables/llx_commande_fournisseur.sql +++ b/htdocs/install/mysql/tables/llx_commande_fournisseur.sql @@ -55,11 +55,11 @@ create table llx_commande_fournisseur note_public text, model_pdf varchar(255), - date_livraison date default NULL, + date_livraison datetime default NULL, fk_account integer, -- bank account fk_cond_reglement integer, -- condition de reglement fk_mode_reglement integer, -- mode de reglement - fk_input_method integer default 0, + fk_input_method integer default 0, import_key varchar(14), extraparams varchar(255) -- for stock other parameters with json format diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql b/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql index 7eeb02ab5cf..1c2cd348a74 100644 --- a/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql +++ b/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql @@ -21,6 +21,7 @@ create table llx_commande_fournisseur_dispatch rowid integer AUTO_INCREMENT PRIMARY KEY, fk_commande integer, fk_product integer, + fk_commandefourndet integer, qty float, -- qty fk_entrepot integer, fk_user integer, diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index e93b27ab6e9..89e54ef4443 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -83,7 +83,7 @@ if (! $versionfrom && ! $versionto) $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path=dirname(__FILE__).'/'; - if (substr($sapi_type, 0, 3) == 'cli') + if (substr($sapi_type, 0, 3) == 'cli') { print 'Syntax from command line: '.$script_file." x.y.z a.b.c\n"; } @@ -178,7 +178,7 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) print ' | '.$version.' | '; dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ServerVersion")." : $version"); - // Test database version + // Test database version requirement $versionmindb=$db::VERSIONMIN; //print join('.',$versionarray).' - '.join('.',$versionmindb); if (count($versionmindb) && count($versionarray) @@ -190,6 +190,32 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) $ok=0; } + // Test database version is not forbidden for migration + $dbversion_disallowed=array( + array('type'=>'mysql','version'=>array(5,5,40)), + array('type'=>'mysqli','version'=>array(5,5,40)) + //,array('type'=>'mysql','version'=>array(5,5,41)), + //array('type'=>'mysqli','version'=>array(5,5,41)) + ); + $listofforbiddenversion=''; + foreach ($dbversion_disallowed as $dbversion_totest) + { + if ($dbversion_totest['type'] == $db->type) $listofforbiddenversion.=($listofforbiddenversion?', ':'').join('.',$dbversion_totest['version']); + } + foreach ($dbversion_disallowed as $dbversion_totest) + { + //print $db->type.' - '.join('.',$versionarray).' - '.versioncompare($dbversion_totest['version'],$versionarray)."
'.$langs->trans("ErrorDatabaseVersionForbiddenForMigration",join('.',$versionarray),$listofforbiddenversion)." | ".$langs->trans("Error")." | ||
| '.$langs->trans("Warehouse").' | '; print ''; - print $formproduct->selectWarehouses(($_GET["dwid"]?$_GET["dwid"]:GETPOST('id_entrepot')),'id_entrepot','',1); + print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid",'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot','int'):'ifone')),'id_entrepot','',1); print ' | '; print ''; print ' | |