diff --git a/.travis.yml b/.travis.yml index d660f89e79d..b4621de8a81 100644 --- a/.travis.yml +++ b/.travis.yml @@ -342,6 +342,9 @@ script: php upgrade.php 8.0.0 9.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade800900.log php upgrade2.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-2.log php step5.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-3.log + php upgrade.php 9.0.0 10.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade9001000.log + php upgrade2.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-2.log + php step5.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-3.log cd - set +e echo diff --git a/dev/resources/dbmodel/dolibarr.uml b/dev/resources/dbmodel/dolibarr.uml deleted file mode 100644 index 57078d6668b..00000000000 --- a/dev/resources/dbmodel/dolibarr.uml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/dev/resources/dbmodel/dolibarr.umldi b/dev/resources/dbmodel/dolibarr.umldi deleted file mode 100644 index ff97a2a25b1..00000000000 --- a/dev/resources/dbmodel/dolibarr.umldi +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/resources/dbmodel/dolibarr_schema.mwb b/dev/resources/dbmodel/dolibarr_schema.mwb index aec0f2d2299..80d1d612d65 100644 Binary files a/dev/resources/dbmodel/dolibarr_schema.mwb and b/dev/resources/dbmodel/dolibarr_schema.mwb differ diff --git a/doc/install/README b/doc/install/README index 83bc6484cea..0c7341b196c 100644 --- a/doc/install/README +++ b/doc/install/README @@ -7,12 +7,12 @@ Download -------------------------------- * Dolibarr ERP/CRM can be downloaded at sourceforge: -http://sourceforge.net/projects/dolibarr/files -or from Dolibarr official web site: -http://www.dolibarr.org + https://sourceforge.net/projects/dolibarr/files + or from Dolibarr official web site: + https://www.dolibarr.org * Most external modules are only available on DoliStore: -http://www.dolistore.org + https://www.dolistore.com -------------------------------- @@ -22,4 +22,4 @@ Install * For a Quick guide, take a look at README file into root directory. * More complete documentations are also available on line on the Dolibarr Wiki: -http://wiki.dolibarr.org + https://wiki.dolibarr.org diff --git a/doc/install/README-DE b/doc/install/README-DE new file mode 100644 index 00000000000..c7ece3891f3 --- /dev/null +++ b/doc/install/README-DE @@ -0,0 +1,33 @@ +README (deutsch / german / allemand) +-------------------------------- + + +-------------------------------- +Download / Herunterladen +-------------------------------- + +* Dolibarr ERP/CRM kann man über die offizielle Dolibarr Website + https://www.dolibarr.org/downloads + oder direkt von Sourceforge + https://sourceforge.net/projects/dolibarr/files/ + herunterladen. + + + +* Die meisten externen Module/Themens sind über den DoliStore verfügbar: + https://www.dolistore.com/de/ + + +-------------------------------- +Installation +-------------------------------- + +* Für eine kurze Einleitung, schau auf die README Datei im Hauptverzeichnis. + +* Umfangreiche Dokumentationen sind im Dolibarr Wiki zu finden: + https://wiki.dolibarr.org/index.php/Hauptseite + +* eine Deutsche Community bietet der Dolibarr e.V. unter + https://www.dolibarr.de/ + + diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 677bc627c80..ebe88712949 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -94,7 +94,7 @@ $facture_static = new Facture($db); $formaccounting = new FormAccounting($db); if (! empty($id)) { - $sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price,"; + $sql = "SELECT f.ref, f.rowid as facid, l.fk_product, l.description, l.price,"; $sql .= " l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice, p.accountancy_code_sell as code_sell,"; $sql .= " l.fk_code_ventilation, aa.account_number, aa.label"; $sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as l"; @@ -128,7 +128,7 @@ if (! empty($id)) { // Ref facture print '' . $langs->trans("Invoice") . ''; - $facture_static->ref = $objp->facnumber; + $facture_static->ref = $objp->ref; $facture_static->id = $objp->facid; print '' . $facture_static->getNomUrl(1) . ''; print ''; diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 7d8599b683c..06a1f11dcbc 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -64,7 +64,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; $offset = $limit * $page; if (! $sortfield) - $sortfield = "f.datef, f.facnumber, fd.rowid"; + $sortfield = "f.datef, f.ref, fd.rowid"; if (! $sortorder) { if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) { $sortorder = "DESC"; @@ -167,7 +167,7 @@ print ' +'; +print ''; +print ''; +if(count($echeance->lines)>0) +{ + print ''; +}else{ + print ''; +} +print ''; +print ''; +$colspan = 6; +if (count($echeance->lines)>0) $colspan++; +print ''; +print ''; + +print ''; +Print ''; +Print ''; +print ''; +Print ''; +Print ''; +if (count($echeance->lines)>0) print ''; +print ''."\n"; + +if ($object->nbterm > 0 && count($echeance->lines)==0) +{ + $i=1; + $capital = $object->capital; + $insurance = $object->insurance_amount/$object->nbterm; + $insurance = price2num($insurance, 'MT'); + $regulInsurance = price2num($object->insurance_amount - ($insurance * $object->nbterm)); + while($i <$object->nbterm+1) + { + $mens = price2num($echeance->calcMonthlyPayments($capital, $object->rate/100, $object->nbterm-$i+1), 'MT'); + $int = ($capital*($object->rate/12))/100; + $int = price2num($int, 'MT'); + $insu = ($insurance+(($i == 1) ? $regulInsurance : 0)); + $cap_rest = price2num($capital - ($mens-$int), 'MT'); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''."\n"; + $i++; + $capital = $cap_rest; + } +} +elseif(count($echeance->lines)>0) +{ + $i=1; + $capital = $object->capital; + $insurance = $object->insurance_amount/$object->nbterm; + $insurance = price2num($insurance, 'MT'); + $regulInsurance = price2num($object->insurance_amount - ($insurance * $object->nbterm)); + $printed = false; + foreach ($echeance->lines as $line){ + $mens = $line->amount_capital+$line->amount_interest; + $int = $line->amount_interest; + $insu = ($insurance+(($i == 1) ? $regulInsurance : 0)); + $cap_rest = price2num($capital - ($mens-$int), 'MT'); + + print ''; + print ''; + print ''; + print ''; + print ''; + if($line->datep > dol_now() && empty($line->fk_bank)){ + print ''; + }else{ + print ''; + } + + print ''; + print ''; + print ''."\n"; + $i++; + $capital = $cap_rest; + } +} + +print '
'; +print $langs->trans("FinancialCommitment"); +print '
'.$langs->trans("Term").''.$langs->trans("Date").''.$langs->trans("Insurance"); +Print ''.$langs->trans("InterestAmount").''.$langs->trans("Amount").''.$langs->trans("CapitalRemain"); +print ' ('.price2num($object->capital).')'; +print ''; +print ''.$langs->trans('DoPayment').'
' . $i .'' . dol_print_date(dol_time_plus_duree($object->datestart, $i-1, 'm'),'day') . ''.price($insurance+(($i == 1) ? $regulInsurance : 0),0,'',1).' €'.price($int,0,'',1).' €'.price($cap_rest).' €
' . $i .'' . dol_print_date($line->datep,'day') . ''.price($insu,0,'',1).' €'.price($int,0,'',1).' €' . price($mens) . ' €'.price($cap_rest).' €'; + if (!empty($line->fk_bank)) print $langs->trans('Paid'); + elseif (!$printed) + { + print ''.$langs->trans('DoPayment').''; + $printed = true; + } + print '
'; +print '
'; +print '
'; +if (count($echeance->lines)==0) $label = $langs->trans("Create"); +else $label = $langs->trans("Save"); +print '
'; +print ''; + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 06f67a9b79f..0f2f8af452e 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -500,6 +500,17 @@ if (! defined('NOLOGIN')) $_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadValueForCode"); $test=false; + // Call trigger for the "security events" log + $user->trigger_mesg='ErrorBadValueForCode - login='.GETPOST("username","alpha",2); + // Call of triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf); + if ($result < 0) { + $error++; + } + // End Call of triggers + // Hooks on failed login $action=''; $hookmanager->initHooks(array('login')); @@ -568,6 +579,17 @@ if (! defined('NOLOGIN')) // We set a generic message if not defined inside function checkLoginPassEntity or subfunctions if (empty($_SESSION["dol_loginmesg"])) $_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword"); + // Call trigger for the "security events" log + $user->trigger_mesg=$langs->trans("ErrorBadLoginPassword").' - login='.GETPOST("username","alpha",2); + // Call of triggers + include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf,GETPOST("username","alpha",2)); + if ($result < 0) { + $error++; + } + // End Call of triggers + // Hooks on failed login $action=''; $hookmanager->initHooks(array('login')); @@ -604,12 +626,25 @@ if (! defined('NOLOGIN')) $langs->loadLangs(array('main', 'errors')); $_SESSION["dol_loginmesg"]=$langs->trans("ErrorCantLoadUserFromDolibarrDatabase",$login); + + $user->trigger_mesg='ErrorCantLoadUserFromDolibarrDatabase - login='.$login; } if ($resultFetchUser < 0) { $_SESSION["dol_loginmesg"]=$user->error; + + $user->trigger_mesg=$user->error; } + // Call triggers for the "security events" log + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf); + if ($result < 0) { + $error++; + } + // End call triggers + // Hooks on failed login $action=''; $hookmanager->initHooks(array('login')); @@ -648,12 +683,25 @@ if (! defined('NOLOGIN')) $langs->loadLangs(array('main', 'errors')); $_SESSION["dol_loginmesg"]=$langs->trans("ErrorCantLoadUserFromDolibarrDatabase",$login); + + $user->trigger_mesg='ErrorCantLoadUserFromDolibarrDatabase - login='.$login; } if ($resultFetchUser < 0) { $_SESSION["dol_loginmesg"]=$user->error; + + $user->trigger_mesg=$user->error; } + // Call triggers for the "security events" log + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf); + if ($result < 0) { + $error++; + } + // End call triggers + // Hooks on failed login $action=''; $hookmanager->initHooks(array('login')); @@ -741,6 +789,17 @@ if (! defined('NOLOGIN')) $loginfo = 'TZ='.$_SESSION["dol_tz"].';TZString='.$_SESSION["dol_tz_string"].';Screen='.$_SESSION["dol_screenwidth"].'x'.$_SESSION["dol_screenheight"]; + // Call triggers for the "security events" log + $user->trigger_mesg = $loginfo; + // Call triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN',$user,$user,$langs,$conf); + if ($result < 0) { + $error++; + } + // End call triggers + // Hooks on successfull login $action=''; $hookmanager->initHooks(array('login')); @@ -752,7 +811,7 @@ if (! defined('NOLOGIN')) { $db->rollback(); session_destroy(); - dol_print_error($db,'Error in some hooks afterLogin'); + dol_print_error($db,'Error in some triggers USER_LOGIN or in some hooks afterLogin'); exit; } else @@ -1015,7 +1074,7 @@ if (! function_exists("llxHeader")) if (empty($conf->dol_hide_leftmenu)) { - left_menu('', $help_url, '', '', 1, $title, 1); + left_menu('', $help_url, '', '', 1, $title, 1); // $menumanager is retreived with a global $menumanager inside this function } // main area diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php index 06527f42b91..fcd5cd4102c 100644 --- a/htdocs/margin/checkMargins.php +++ b/htdocs/margin/checkMargins.php @@ -49,7 +49,7 @@ $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder = "DESC"; -if (! $sortfield) $sortfield = 'f.facnumber'; +if (! $sortfield) $sortfield = 'f.ref'; $startdate = $enddate = ''; @@ -185,7 +185,7 @@ $massactionbutton=''; $sql = "SELECT"; -$sql .= " f.facnumber, f.rowid as invoiceid, d.rowid as invoicedetid, d.buy_price_ht, d.total_ht, d.subprice, d.label, d.description , d.qty"; +$sql .= " f.ref, f.rowid as invoiceid, d.rowid as invoicedetid, d.buy_price_ht, d.total_ht, d.subprice, d.label, d.description , d.qty"; $sql .= " ,d.fk_product"; $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f "; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as d ON d.fk_facture = f.rowid"; @@ -194,7 +194,7 @@ $sql .= " WHERE f.fk_statut > 0"; $sql .= " AND f.entity IN (" . getEntity('facture') . ") "; if (! empty($startdate)) $sql .= " AND f.datef >= '" . $db->idate($startdate) . "'"; if (! empty($enddate)) $sql .= " AND f.datef <= '" . $db->idate($enddate) . "'"; -if ($search_ref) $sql.=natural_search('f.facnumber', $search_ref); +if ($search_ref) $sql.=natural_search('f.ref', $search_ref); $sql .= " AND d.buy_price_ht IS NOT NULL"; $sql .= $db->order($sortfield, $sortorder); @@ -249,7 +249,7 @@ if ($result) { print "\n"; print ''; - print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "", "", $param, 'width=20%', $sortfield, $sortorder); print_liste_field_titre("UnitPriceHT", $_SERVER["PHP_SELF"], "d.subprice", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "d.buy_price_ht", "", $param, 'align="right"', $sortfield, $sortorder); diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 675fe527a47..5e04ebff091 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -202,7 +202,7 @@ print ''; $sql = "SELECT"; $sql.= " s.rowid as socid, s.nom as name, s.code_client, s.client,"; -if ($client) $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,"; +if ($client) $sql.= " f.rowid as facid, f.ref, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,"; $sql.= " sum(d.total_ht) as selling_price,"; // Note: qty and buy_price_ht is always positive (if not, your database may be corrupted, you can update this) $sql.= " sum(".$db->ifsql('d.total_ht < 0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,"; @@ -235,7 +235,7 @@ $sql.= " AND f.datef <= '".$db->idate($enddate)."'"; $sql .= " AND d.buy_price_ht IS NOT NULL"; if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; -if ($client) $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut"; +if ($client) $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, f.rowid, f.ref, f.total, f.datef, f.paye, f.fk_statut"; else $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client"; $sql.=$db->order($sortfield,$sortorder); // TODO: calculate total to display then restore pagination @@ -260,7 +260,7 @@ if ($result) print ''; if (! empty($client)) { - print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],"f.facnumber","","&socid=".$socid,'',$sortfield,$sortorder); + print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],"f.ref","","&socid=".$socid,'',$sortfield,$sortorder); print_liste_field_titre("DateInvoice",$_SERVER["PHP_SELF"],"f.datef","","&socid=".$socid,'align="center"',$sortfield,$sortorder); } else @@ -304,7 +304,7 @@ if ($result) if ($client) { print ''; $invoicestatic->id=$objp->facid; - $invoicestatic->ref=$objp->facnumber; + $invoicestatic->ref=$objp->ref; print $invoicestatic->getNomUrl(1); print "\n"; print ""; diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 23c9de6c321..22dec6dd277 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -176,7 +176,7 @@ print ''; $sql = "SELECT p.label, p.rowid, p.fk_product_type, p.ref, p.entity as pentity,"; if ($id > 0) $sql.= " d.fk_product,"; -if ($id > 0) $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,"; +if ($id > 0) $sql.= " f.rowid as facid, f.ref, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,"; $sql.= " SUM(d.total_ht) as selling_price,"; // Note: qty and buy_price_ht is always positive (if not your database may be corrupted, you can update this) $sql.= " SUM(".$db->ifsql('d.total_ht < 0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,"; @@ -204,7 +204,7 @@ if (!empty($enddate)) $sql .= " AND d.buy_price_ht IS NOT NULL"; if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; -if ($id > 0) $sql.= " GROUP BY p.label, p.rowid, p.fk_product_type, p.ref, p.entity, d.fk_product, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut"; +if ($id > 0) $sql.= " GROUP BY p.label, p.rowid, p.fk_product_type, p.ref, p.entity, d.fk_product, f.rowid, f.ref, f.total, f.datef, f.paye, f.fk_statut"; else $sql.= " GROUP BY p.label, p.rowid, p.fk_product_type, p.ref, p.entity"; $sql.=$db->order($sortfield,$sortorder); // TODO: calculate total to display then restore pagination @@ -233,7 +233,7 @@ if ($result) print ''; if ($id > 0) { - print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],"f.facnumber","","&id=".$id,'',$sortfield,$sortorder); + print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],"f.ref","","&id=".$id,'',$sortfield,$sortorder); print_liste_field_titre("DateInvoice",$_SERVER["PHP_SELF"],"f.datef","","&id=".$id,'align="center"',$sortfield,$sortorder); } else @@ -277,7 +277,7 @@ if ($result) if ($id > 0) { print ''; $invoicestatic->id=$objp->facid; - $invoicestatic->ref=$objp->facnumber; + $invoicestatic->ref=$objp->ref; print $invoicestatic->getNomUrl(1); print "\n"; print ""; diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 5659be448de..1d922473036 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -131,7 +131,7 @@ if ($id > 0 || ! empty($ref)) if ($user->rights->facture->lire) { $sql = "SELECT s.nom as name, s.rowid as socid, s.code_client,"; - $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht,"; + $sql.= " f.rowid as facid, f.ref, f.total as total_ht,"; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.type,"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " sc.fk_soc, sc.fk_user,"; $sql.= " sum(d.total_ht) as selling_price,"; // may be negative or positive @@ -151,7 +151,7 @@ if ($id > 0 || ! empty($ref)) if (! empty($socid)) $sql.= " AND f.fk_soc = $socid"; $sql .= " AND d.buy_price_ht IS NOT NULL"; if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; - $sql.= " GROUP BY s.nom, s.rowid, s.code_client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut, f.type"; + $sql.= " GROUP BY s.nom, s.rowid, s.code_client, f.rowid, f.ref, f.total, f.datef, f.paye, f.fk_statut, f.type"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user"; $sql.= $db->order($sortfield,$sortorder); // TODO: calculate total to display then restore pagination @@ -169,7 +169,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; - print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],"f.facnumber","","&id=".$object->id,'',$sortfield,$sortorder); + print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],"f.ref","","&id=".$object->id,'',$sortfield,$sortorder); print_liste_field_titre("Company",$_SERVER["PHP_SELF"],"s.nom","","&id=".$object->id,'',$sortfield,$sortorder); print_liste_field_titre("CustomerCode",$_SERVER["PHP_SELF"],"s.code_client","","&id=".$object->id,'',$sortfield,$sortorder); print_liste_field_titre("DateInvoice",$_SERVER["PHP_SELF"],"f.datef","","&id=".$object->id,'align="center"',$sortfield,$sortorder); @@ -199,7 +199,7 @@ if ($id > 0 || ! empty($ref)) print ''; print '\n"; print ''; diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 55362ac4218..2856ebb8397 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -144,7 +144,7 @@ if ($socid > 0) print '
'; $sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client,"; - $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht,"; + $sql.= " f.rowid as facid, f.ref, f.total as total_ht,"; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.type,"; $sql.= " sum(d.total_ht) as selling_price,"; // may be negative or positive $sql.= " sum(d.qty * d.buy_price_ht) as buying_price,"; // always positive @@ -159,7 +159,7 @@ if ($socid > 0) $sql.= " AND f.fk_soc = $socid"; $sql.= " AND d.buy_price_ht IS NOT NULL"; if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; - $sql.= " GROUP BY s.nom, s.rowid, s.code_client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut, f.type"; + $sql.= " GROUP BY s.nom, s.rowid, s.code_client, f.rowid, f.ref, f.total, f.datef, f.paye, f.fk_statut, f.type"; $sql.= $db->order($sortfield,$sortorder); // TODO: calculate total to display then restore pagination //$sql.= $db->plimit($conf->liste_limit +1, $offset); @@ -177,7 +177,7 @@ if ($socid > 0) print "
'; $invoicestatic->id=$objp->facid; - $invoicestatic->ref=$objp->facnumber; + $invoicestatic->ref=$objp->ref; print $invoicestatic->getNomUrl(1); print "'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->name,44).'
"; print ''; - print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],"f.facnumber","","&socid=".$_REQUEST["socid"],'',$sortfield,$sortorder); + print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],"f.ref","","&socid=".$_REQUEST["socid"],'',$sortfield,$sortorder); print_liste_field_titre("DateInvoice",$_SERVER["PHP_SELF"],"f.datef","","&socid=".$_REQUEST["socid"],'align="center"',$sortfield,$sortorder); print_liste_field_titre("SoldAmount",$_SERVER["PHP_SELF"],"selling_price","","&socid=".$_REQUEST["socid"],'align="right"',$sortfield,$sortorder); print_liste_field_titre("PurchasedAmount",$_SERVER["PHP_SELF"],"buying_price","","&socid=".$_REQUEST["socid"],'align="right"',$sortfield,$sortorder); @@ -211,7 +211,7 @@ if ($socid > 0) print ''; print '\n"; print "'; + switch($objp->type_mouvement){ + case "0": + print ''; + break; + case "1": + print ''; + break; + case "2": + print ''; + break; + case "3": + print ''; + break; + } } if (! empty($arrayfields['origin']['checked'])) { diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 04605c33065..fb2399175c2 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -450,108 +450,118 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print load_fiche_titre($langs->trans("NewTask"), '', 'title_project'); - print ''; - print ''; - print ''; - print ''; - if (! empty($object->id)) print ''; - - dol_fiche_head(''); - - print '
'; $invoicestatic->id=$objp->facid; - $invoicestatic->ref=$objp->facnumber; + $invoicestatic->ref=$objp->ref; print $invoicestatic->getNomUrl(1); print ""; diff --git a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php index 545e53d350a..460df7e96bf 100644 --- a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php @@ -97,14 +97,12 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets * This is the main function that returns the array of emails * * @param int $mailing_id Id of emailing - * @param array $filtersarray Requete sql de selection des destinataires * @return int <0 if error, number of emails added if ok */ - function add_to_target($mailing_id,$filtersarray=array()) + function add_to_target($mailing_id) { // phpcs:enable $target = array(); - $cibles = array(); $j = 0; @@ -114,7 +112,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets if (! empty($_POST['filter']) && $_POST['filter'] != 'none') $sql.= " AND status = '".$this->db->escape($_POST['filter'])."'"; $sql.= " ORDER BY email"; - // Stocke destinataires dans cibles + // Stocke destinataires dans target $result=$this->db->query($sql); if ($result) { @@ -129,7 +127,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets $obj = $this->db->fetch_object($result); if ($old <> $obj->email) { - $cibles[$j] = array( + $target[$j] = array( 'email' => $obj->email, 'name' => $obj->lastname, 'id' => $obj->id, @@ -162,7 +160,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets // ----- Your code end here ----- - return parent::add_to_target($mailing_id, $cibles); + return parent::add_to_target($mailing_id, $target); } diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index f3fd135f16d..34945504943 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -1050,18 +1050,20 @@ $toutsujet = explode(",", $object->sujet); // With old versions, this field was $compteursujet = 0; $meilleursujet = ''; -for ($i = 0; $i < $nbcolonnes; $i++) { - if (isset($sumfor[$i]) === true && isset($meilleurecolonne) === true && $sumfor[$i] == $meilleurecolonne) { +for ($i = 0; $i < $nbcolonnes; $i++) +{ + if (isset($sumfor[$i]) === true && isset($meilleurecolonne) === true && $sumfor[$i] == $meilleurecolonne) + { $meilleursujet.=", "; if ($object->format == "D") { $meilleursujetexport = $toutsujet[$i]; - + //var_dump($toutsujet); if (strpos($toutsujet[$i], '@') !== false) { $toutsujetdate = explode("@", $toutsujet[$i]); - $meilleursujet .= dol_print_date($toutsujetdate[0],'daytext'). ' ('.dol_print_date($toutsujetdate[0],'%A').')' . ' - ' . $toutsujetdate[1]; + $meilleursujet .= dol_print_date($toutsujetdate[0],'daytext'). ($toutsujetdate[0] ? ' ('.dol_print_date($toutsujetdate[0],'%A').')' : '') . ' - ' . $toutsujetdate[1]; } else { - $meilleursujet .= dol_print_date($toutsujet[$i],'daytext'). ' ('.dol_print_date($toutsujet[$i],'%A').')'; + $meilleursujet .= dol_print_date($toutsujet[$i],'daytext'). ($toutsujet[$i] ? ' ('.dol_print_date($toutsujet[$i],'%A').')' : ''); } } else @@ -1083,9 +1085,9 @@ if ($nbofcheckbox >= 2) print '

'."\n"; if (isset($meilleurecolonne) && $compteursujet == "1") { - print " " . $langs->trans('TheBestChoice') . ": ".$meilleursujet." " . $langs->trans("with") . " ".$meilleurecolonne."" . $vote_str . ".\n"; + print " " . $langs->trans('TheBestChoice') . ": ".$meilleursujet." " . $langs->trans("with") . " ".$meilleurecolonne." " . $vote_str . ".\n"; } elseif (isset($meilleurecolonne)) { - print " " . $langs->trans('TheBestChoices') . ": ".$meilleursujet." " . $langs->trans("with") . " ".$meilleurecolonne."" . $vote_str . ".\n"; + print " " . $langs->trans('TheBestChoices') . ": ".$meilleursujet." " . $langs->trans("with") . " ".$meilleurecolonne." " . $vote_str . ".\n"; } print '


'."\n"; } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 6d3a0724006..ae6d193b80f 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -310,6 +310,7 @@ class Product extends CommonObject public $oldcopy; + public $fk_default_warehouse; /** * @var int ID */ diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index cd2dc221bb9..32efac120b7 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -147,7 +147,7 @@ if ($id > 0 || ! empty($ref)) elseif ($user->rights->facture->lire) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,"; - $sql.= " f.facnumber, f.datef, f.paye, f.type, f.fk_statut as statut, f.rowid as facid,"; + $sql.= " f.ref, f.datef, f.paye, f.type, f.fk_statut as statut, f.rowid as facid,"; $sql.= " d.rowid, d.total_ht as total_ht, d.qty"; // We must keep the d.rowid here to not loose record because of the distinct used to ignore duplicate line when link on societe_commerciaux is used if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -239,7 +239,7 @@ if ($id > 0 || ! empty($ref)) $total_qty+=$objp->qty; $invoicestatic->id=$objp->facid; - $invoicestatic->ref=$objp->facnumber; + $invoicestatic->ref=$objp->ref; $societestatic->fetch($objp->socid); $paiement = $invoicestatic->getSommePaiement(); diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index bd5ac4a4345..f6a694c57fa 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -1048,7 +1048,20 @@ if ($resql) if (! empty($arrayfields['m.type_mouvement']['checked'])) { // Type of movement - print '
'.$objp->type_mouvement.''.$langs->trans('StockIncreaseAfterCorrectTransfer').''.$langs->trans('StockDecreaseAfterCorrectTransfer').''.$langs->trans('StockDecrease').''.$langs->trans('StockIncrease').'
'; - - $defaultref=''; - $obj = empty($conf->global->PROJECT_TASK_ADDON)?'mod_task_simple':$conf->global->PROJECT_TASK_ADDON; - if (! empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.".php")) + if ($object->statut == Project::STATUS_CLOSED) { - require_once DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.'.php'; - $modTask = new $obj; - $defaultref = $modTask->getNextValue($object->thirdparty,null); - } - - if (is_numeric($defaultref) && $defaultref <= 0) $defaultref=''; - - // Ref - print ''; - - print ''; - - // List of projects - print ''; - - print ''; - - // Date start - print ''; - - // Date end - print ''; - - // Planned workload - print ''; - - // Progress - print ''; - - // Description - print ''; - print ''; - - // Other options - $parameters=array(); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$taskstatic,$action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - if (empty($reshook) && ! empty($extrafields_task->attribute_label)) - { - print $taskstatic->showOptionals($extrafields_task,'edit'); // Do not use $object here that is object of project - } - - print '
'.$langs->trans("Ref").''; - if (empty($duplicate_code_error)) - { - print (GETPOSTISSET("ref")?GETPOST("ref",'alpha'):$defaultref); + print '
'; + $langs->load("errors"); + print $langs->trans("WarningProjectClosed"); + print '
'; } else { - print $defaultref; + print ''; + print ''; + print ''; + print ''; + if (! empty($object->id)) print ''; + + dol_fiche_head(''); + + print ''; + + $defaultref=''; + $obj = empty($conf->global->PROJECT_TASK_ADDON)?'mod_task_simple':$conf->global->PROJECT_TASK_ADDON; + if (! empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.".php")) + { + require_once DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.'.php'; + $modTask = new $obj; + $defaultref = $modTask->getNextValue($object->thirdparty,null); + } + + if (is_numeric($defaultref) && $defaultref <= 0) $defaultref=''; + + // Ref + print ''; + + print ''; + + // List of projects + print ''; + + print ''; + + // Date start + print ''; + + // Date end + print ''; + + // Planned workload + print ''; + + // Progress + print ''; + + // Description + print ''; + print ''; + + // Other options + $parameters=array(); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$taskstatic,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + + if (empty($reshook) && ! empty($extrafields_task->attribute_label)) + { + print $taskstatic->showOptionals($extrafields_task,'edit'); // Do not use $object here that is object of project + } + + print '
'.$langs->trans("Ref").''; + if (empty($duplicate_code_error)) + { + print (GETPOSTISSET("ref")?GETPOST("ref",'alpha'):$defaultref); + } + else + { + print $defaultref; + } + print ''; + print '
'.$langs->trans("Label").''; + print ''; + print '
'.$langs->trans("ChildOfProjectTask").''; + print $formother->selectProjectTasks(GETPOST('task_parent'), $projectid?$projectid:$object->id, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500'); + print '
'.$langs->trans("AffectedTo").''; + $contactsofproject=(! empty($object->id)?$object->getListContactId('internal'):''); + if (is_array($contactsofproject) && count($contactsofproject)) + { + print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth300'); + } + else + { + print $langs->trans("NoUserAssignedToTheProject"); + } + print '
'.$langs->trans("DateStart").''; + print $form->selectDate(($date_start?$date_start:''), 'dateo', 1, 1, 0, '', 1, 1); + print '
'.$langs->trans("DateEnd").''; + print $form->selectDate(($date_end?$date_end:-1),'datee', -1, 1, 0, '', 1, 1); + print '
'.$langs->trans("PlannedWorkload").''; + print $form->select_duration('planned_workload', $planned_workload?$planned_workload : 0, 0, 'text'); + print '
'.$langs->trans("ProgressDeclared").''; + print $formother->select_percent($progress,'progress',0,5,0,100,1); + print '
'.$langs->trans("Description").''; + print ''; + print '
'; + + dol_fiche_end(); + + print '
'; + print ''; + print '     '; + print ''; + print '
'; + + print ''; } - print ''; - print '
'.$langs->trans("Label").''; - print ''; - print '
'.$langs->trans("ChildOfProjectTask").''; - print $formother->selectProjectTasks(GETPOST('task_parent'), $projectid?$projectid:$object->id, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500'); - print '
'.$langs->trans("AffectedTo").''; - $contactsofproject=(! empty($object->id)?$object->getListContactId('internal'):''); - if (is_array($contactsofproject) && count($contactsofproject)) - { - print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth300'); - } - else - { - print $langs->trans("NoUserAssignedToTheProject"); - } - print '
'.$langs->trans("DateStart").''; - print $form->selectDate(($date_start?$date_start:''), 'dateo', 1, 1, 0, '', 1, 1); - print '
'.$langs->trans("DateEnd").''; - print $form->selectDate(($date_end?$date_end:-1),'datee', -1, 1, 0, '', 1, 1); - print '
'.$langs->trans("PlannedWorkload").''; - print $form->select_duration('planned_workload', $planned_workload?$planned_workload : 0, 0, 'text'); - print '
'.$langs->trans("ProgressDeclared").''; - print $formother->select_percent($progress,'progress',0,5,0,100,1); - print '
'.$langs->trans("Description").''; - print ''; - print '
'; - - dol_fiche_end(); - - print '
'; - print ''; - print '     '; - print ''; - print '
'; - - print ''; } else if ($id > 0 || ! empty($ref)) { diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 82c722f2485..e6de0743d66 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -326,7 +326,7 @@ if ($id > 0 || ! empty($ref)) dol_fiche_end(); /* - * Lignes de contacts + * Lines of contacts */ /* // Contacts lines (modules that overwrite templates must declare this into descriptor) @@ -340,16 +340,15 @@ if ($id > 0 || ! empty($ref)) /* * Add a new contact line - * Non affiche en mode modification de ligne */ print ''; if ($action != 'editline' && $user->rights->projet->creer) { print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print ''; print "\n"; @@ -507,7 +506,7 @@ if ($id > 0 || ! empty($ref)) { print ' '; print ''; - print img_delete(); + print img_picto($langs->trans('Unlink'), 'unlink'); print ''; } print ''; diff --git a/htdocs/public/emailing/mailing-unsubscribe.php b/htdocs/public/emailing/mailing-unsubscribe.php index 67672f19e7c..d04d6eb8020 100644 --- a/htdocs/public/emailing/mailing-unsubscribe.php +++ b/htdocs/public/emailing/mailing-unsubscribe.php @@ -100,19 +100,21 @@ if (! empty($tag) && ($unsuscrib=='1')) $resql=$db->query($sql); if (! $resql) dol_print_error($db); - // Update status communication of thirdparty prospect (old data) + /* + // Update status communication of thirdparty prospect (old usage) $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=-1 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE tag = '".$db->escape($tag)."' AND source_type='thirdparty' AND source_id is not null)"; $resql=$db->query($sql); if (! $resql) dol_print_error($db); - // Update status communication of contact prospect (old data) + // Update status communication of contact prospect (old usage) $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET no_email=1 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE tag = '".$db->escape($tag)."' AND source_type='contact' AND source_id is not null)"; $resql=$db->query($sql); if (! $resql) dol_print_error($db); + */ - // Update status communication of contact prospect (old data) + // Update status communication of email (new usage) $sql = "INSERT INTO ".MAIN_DB_PREFIX."mailing_unsubscribe (date_creat, entity, email) VALUES ('".$db->idate(dol_now())."', ".$obj->entity.", '".$obj->email."')"; $resql=$db->query($sql); diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index a9bd8a0fb70..acf986bb226 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -95,7 +95,7 @@ if (GETPOST('ajoutcomment','alpha')) } // Add vote -if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // boutonp for chrom, boutonp_x for firefox +if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // boutonp for chrome, boutonp_x for firefox { if (!$canbemodified) accessforbidden(); @@ -160,9 +160,12 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout if ($email) { include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $body = $langs->trans('EmailSomeoneVoted', $nom, getUrlSondage($numsondage, true)); + $application = ($conf->global->MAIN_APPLICATION_TITLE ? $conf->global->MAIN_APPLICATION_TITLE : 'Dolibarr ERP/CRM'); - $cmailfile=new CMailFile("[".MAIN_APPLICATION_TITLE."] ".$langs->trans("Poll").': '.$object->titre, $email, $conf->global->MAIN_MAIL_EMAIL_FROM, $body); + $body = str_replace('\n', '
', $langs->transnoentities('EmailSomeoneVoted', $nom, getUrlSondage($numsondage, true))); + //var_dump($body);exit; + + $cmailfile=new CMailFile("[".$application."] ".$langs->trans("Poll").': '.$object->titre, $email, $conf->global->MAIN_MAIL_EMAIL_FROM, $body, null, null, null, '', '', 0, -1); $result=$cmailfile->sendfile(); } } diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 42d1d616852..50d9710be40 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -894,7 +894,7 @@ class Thirdparties extends DolibarrApi } - $sql = "SELECT f.facnumber, f.type as factype, re.fk_facture_source, re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc, re.description, re.fk_facture, re.fk_facture_line"; + $sql = "SELECT f.ref, f.type as factype, re.fk_facture_source, re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc, re.description, re.fk_facture, re.fk_facture_line"; $sql .= " FROM ".MAIN_DB_PREFIX."societe_remise_except as re, ".MAIN_DB_PREFIX."facture as f"; $sql .= " WHERE f.rowid = re.fk_facture_source AND re.fk_soc = ".$id; if ($filter == "available") $sql .= " AND re.fk_facture IS NULL AND re.fk_facture_line IS NULL"; diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 3a3fb8507c9..c1a0605b2e1 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -200,13 +200,13 @@ if ($type_element == 'invoice') { // Customer : show products from invoices require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $documentstatic=new Facture($db); - $sql_select = 'SELECT f.rowid as doc_id, f.facnumber as doc_number, f.type as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, '; + $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, f.type as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, '; $tables_from = MAIN_DB_PREFIX."facture as f,".MAIN_DB_PREFIX."facturedet as d"; $where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid; $where.= " AND d.fk_facture = f.rowid"; $where.= " AND f.entity = ".$conf->entity; $dateprint = 'f.datef'; - $doc_number='f.facnumber'; + $doc_number='f.ref'; $thirdTypeSelect='customer'; } if ($type_element == 'propal') diff --git a/htdocs/stripe/payment.php b/htdocs/stripe/payment.php index 7a06da294ab..a99104409ef 100644 --- a/htdocs/stripe/payment.php +++ b/htdocs/stripe/payment.php @@ -762,7 +762,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie * List of unpaid invoices */ - $sql = 'SELECT f.rowid as facid, f.facnumber, f.total_ttc, f.multicurrency_code, f.multicurrency_total_ttc, f.type, '; + $sql = 'SELECT f.rowid as facid, f.ref, f.total_ttc, f.multicurrency_code, f.multicurrency_total_ttc, f.type, '; $sql.= ' f.datef as df, f.fk_soc as socid'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f'; @@ -789,7 +789,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } // Sort invoices by date and serial number: the older one comes first - $sql.=' ORDER BY f.datef ASC, f.facnumber ASC'; + $sql.=' ORDER BY f.datef ASC, f.ref ASC'; $resql = $db->query($sql); if ($resql) @@ -1073,7 +1073,7 @@ if (! GETPOST('action')) if (! $sortorder) $sortorder='DESC'; if (! $sortfield) $sortfield='p.datep'; - $sql = 'SELECT p.datep as dp, p.amount, f.amount as fa_amount, f.facnumber'; + $sql = 'SELECT p.datep as dp, p.amount, f.amount as fa_amount, f.ref'; $sql.=', f.rowid as facid, c.libelle as paiement_type, p.num_paiement'; $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p, '.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'c_paiement as c'; $sql.= ' WHERE p.fk_facture = f.rowid AND p.fk_paiement = c.id'; @@ -1095,7 +1095,7 @@ if (! GETPOST('action')) print_barre_liste($langs->trans('Payments'), $page, $_SERVER["PHP_SELF"],'',$sortfield,$sortorder,'',$num); print '
'.$langs->trans("Source").''.$langs->trans("Nature").''.$langs->trans("ThirdParty").''.$langs->trans("TaskContact").''.$langs->trans("Users").''.$langs->trans("ContactType").' 
'; print ''; - print_liste_field_titre('Invoice',$_SERVER["PHP_SELF"],'facnumber','','','',$sortfield,$sortorder); + print_liste_field_titre('Invoice',$_SERVER["PHP_SELF"],'ref','','','',$sortfield,$sortorder); print_liste_field_titre('Date',$_SERVER["PHP_SELF"],'dp','','','',$sortfield,$sortorder); print_liste_field_titre('Type',$_SERVER["PHP_SELF"],'libelle','','','',$sortfield,$sortorder); print_liste_field_titre('Amount',$_SERVER["PHP_SELF"],'fa_amount','','','align="right"',$sortfield,$sortorder); @@ -1106,7 +1106,7 @@ if (! GETPOST('action')) { $objp = $db->fetch_object($resql); print ''; - print '\n"; + print '\n"; print '\n"; print '\n"; print ''; diff --git a/htdocs/takepos/customers.php b/htdocs/takepos/customers.php index 5a67998f180..41738861702 100644 --- a/htdocs/takepos/customers.php +++ b/htdocs/takepos/customers.php @@ -55,7 +55,7 @@ $_GET['optioncss'] = 'print'; */ if ($action=="change") { - $sql="UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$idcustomer." where facnumber='(PROV-POS-".$place.")'"; + $sql="UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$idcustomer." where ref='(PROV-POS-".$place.")'"; $resql = $db->query($sql); ?>
'.$objp->facnumber."'.$objp->ref."'.dol_print_date($db->jdate($objp->dp))."'.$objp->paiement_type.' '.$objp->num_paiement."'.price($objp->amount).'