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/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/admin/card.php b/htdocs/accountancy/admin/card.php index 33fdb675ac0..c777c36dca0 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -388,13 +388,13 @@ else if ($id > 0 || $ref) { if (! empty($user->rights->accounting->chartofaccount)) { print '' . $langs->trans('Modify') . ''; } else { - print '' . $langs->trans('Modify') . ''; + print '' . $langs->trans('Modify') . ''; } if (! empty($user->rights->accounting->chartofaccount)) { print '' . $langs->trans('Delete') . ''; } else { - print '' . $langs->trans('Delete') . ''; + print '' . $langs->trans('Delete') . ''; } print ''; diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 62eda456fe7..443bbfa4961 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -117,7 +117,7 @@ if ($result) } else { - $addbutton = '' . $langs->trans("NewFiscalYear") . ''; + $addbutton = '' . $langs->trans("NewFiscalYear") . ''; } $title = $langs->trans('AccountingPeriods'); diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 677bc627c80..7d506c6c72c 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"; @@ -102,7 +102,7 @@ if (! empty($id)) { $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON l.fk_code_ventilation = aa.rowid"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = l.fk_facture"; $sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id; - $sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy + $sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")"; // We don't share object for accountancy dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG); $result = $db->query($sql); @@ -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/index.php b/htdocs/accountancy/customer/index.php index 4f4932fe08f..ca75aaac15e 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -180,7 +180,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid $sql .= " WHERE f.datef >= '" . $db->idate($search_date_start) . "'"; $sql .= " AND f.datef <= '" . $db->idate($search_date_end) . "'"; $sql .= " AND f.fk_statut > 0"; -$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy +$sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")"; // We don't share object for accountancy $sql .= " AND aa.account_number IS NULL"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")"; @@ -255,7 +255,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_factu $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation"; $sql .= " WHERE f.datef >= '" . $db->idate($search_date_start) . "'"; $sql .= " AND f.datef <= '" . $db->idate($search_date_end) . "'"; -$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy +$sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")"; // We don't share object for accountancy $sql .= " AND f.fk_statut > 0"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")"; @@ -332,7 +332,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture"; $sql .= " WHERE f.datef >= '" . $db->idate($search_date_start) . "'"; $sql .= " AND f.datef <= '" . $db->idate($search_date_end) . "'"; - $sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy + $sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")"; // We don't share object for accountancy $sql .= " AND f.fk_statut > 0"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")"; @@ -384,7 +384,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture"; $sql .= " WHERE f.datef >= '" . $db->idate($search_date_start) . "'"; $sql .= " AND f.datef <= '" . $db->idate($search_date_end) . "'"; - $sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy + $sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")"; // We don't share object for accountancy $sql .= " AND f.fk_statut > 0"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")"; diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 7d8599b683c..f13344c936b 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/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 5c808051a06..71922b77aa2 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -139,7 +139,7 @@ $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ", ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE f.fk_soc = s.rowid"; -$sql.= ' AND f.entity IN ('.getEntity('facture').')'; +$sql.= ' AND f.entity IN ('.getEntity('invoice').')'; $sql.= " AND sc.fk_soc = f.fk_soc"; $sql.= " AND (d.product_type = 0 OR d.product_type = 1)"; if (! empty($conf->global->AGENT_CONTACT_TYPE)) diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php index 06527f42b91..850b47cee17 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,16 +185,16 @@ $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"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON d.fk_product = p.rowid"; $sql .= " WHERE f.fk_statut > 0"; -$sql .= " AND f.entity IN (" . getEntity('facture') . ") "; +$sql .= " AND f.entity IN (" . getEntity('invoice') . ") "; 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..ae79cc7957f 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,"; @@ -189,7 +189,7 @@ if (! empty($TSelectedCats)) { $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=p.rowid'; } $sql.= " WHERE f.fk_soc = s.rowid"; -$sql.= ' AND f.entity IN ('.getEntity('facture').')'; +$sql.= ' AND f.entity IN ('.getEntity('invoice').')'; $sql.= " AND f.fk_statut > 0"; $sql.= " AND d.fk_facture = f.rowid"; if ($id > 0) @@ -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/product/stock/product.php b/htdocs/product/stock/product.php index 852bf2a4e8d..54a4cd564ab 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -767,12 +767,12 @@ if (empty($reshook)) } else { - print '' . $langs->trans("CorrectStock") . ''; + print '' . $langs->trans("CorrectStock") . ''; } } else { - print '' . $langs->trans("CorrectStock") . ''; + print '' . $langs->trans("CorrectStock") . ''; } //if (($user->rights->stock->mouvement->creer) && ! $object->hasbatch()) @@ -783,12 +783,12 @@ if (empty($reshook)) } else { - print '' . $langs->trans("TransferStock") . ''; + print '' . $langs->trans("TransferStock") . ''; } } else { - print '' . $langs->trans("CorrectStock") . ''; + print '' . $langs->trans("CorrectStock") . ''; } print ''; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 6c9db443487..c9abfd7d4ad 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -552,7 +552,7 @@ if ($action == 'create' && $user->rights->projet->creer) $text=$form->select_company(GETPOST('socid','int'), 'socid', $filteronlist, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300'); if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile)) { - $texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty"); + $texthelp=$langs->trans("IfNeedToUseOtherObjectKeepEmpty"); print $form->textwithtooltip($text.' '.img_help(),$texthelp,1); } else print $text; @@ -789,7 +789,7 @@ elseif ($object->id > 0) $text=$form->select_company($object->thirdparty->id, 'socid', $filteronlist, 'None', 1, 0, array(), 0, 'minwidth300'); if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile)) { - $texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty"); + $texthelp=$langs->trans("IfNeedToUseOtherObjectKeepEmpty"); print $form->textwithtooltip($text.' '.img_help(), $texthelp, 1, 0, '', '', 2); } else print $text; @@ -1118,7 +1118,7 @@ elseif ($object->id > 0) } else { - print '
'.$langs->trans('Modify').'
'; + print '
'.$langs->trans('Modify').'
'; } } @@ -1131,7 +1131,7 @@ elseif ($object->id > 0) } else { - print '
'.$langs->trans('Validate').'
'; + print '
'.$langs->trans('Validate').'
'; } } @@ -1144,7 +1144,7 @@ elseif ($object->id > 0) } else { - print '
'.$langs->trans('Close').'
'; + print '
'.$langs->trans('Close').'
'; } } @@ -1157,7 +1157,7 @@ elseif ($object->id > 0) } else { - print '
'.$langs->trans('ReOpen').'
'; + print '
'.$langs->trans('ReOpen').'
'; } } @@ -1225,7 +1225,7 @@ elseif ($object->id > 0) } else { - print '
'.$langs->trans('ToClone').'
'; + print '
'.$langs->trans('ToClone').'
'; } } @@ -1238,7 +1238,7 @@ elseif ($object->id > 0) } else { - print '
'.$langs->trans('Delete').'
'; + print '
'.$langs->trans('Delete').'
'; } } } diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php index 92c187ce438..d491e55a080 100644 --- a/htdocs/projet/info.php +++ b/htdocs/projet/info.php @@ -169,7 +169,7 @@ if (! empty($conf->agenda->enabled)) } else { - $morehtmlcenter.=''.$langs->trans("AddAction").''; + $morehtmlcenter.=''.$langs->trans("AddAction").''; } } diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index b220af0d96a..e36a000674b 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -438,6 +438,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( + 'generate_doc'=>$langs->trans("Generate"), // 'presend'=>$langs->trans("SendByMail"), // 'builddoc'=>$langs->trans("PDFMerge"), ); diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 73ce4a562e4..7b96d2e2ea1 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -333,12 +333,12 @@ if ($id > 0 || ! empty($ref)) } else { - print ''.$langs->trans('AddTask').''; + print ''.$langs->trans('AddTask').''; } } else { - print ''.$langs->trans('AddTask').''; + print ''.$langs->trans('AddTask').''; } print ''; @@ -580,7 +580,7 @@ if ($id > 0 || ! empty($ref)) } else { - print ''.$langs->trans('Modify').''; + print ''.$langs->trans('Modify').''; } // Delete @@ -592,12 +592,12 @@ if ($id > 0 || ! empty($ref)) } else { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } } else { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } print ''; diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 78b3ceb75db..b78534bf4b0 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -1,10 +1,11 @@ - * Copyright (C) 2001-2002 Jean-Louis Bergamo - * Copyright (C) 2006-2013 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2012 J. Fernando Lagrange +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2001-2002 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 J. Fernando Lagrange * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -232,6 +233,7 @@ if ($action == 'add') $adh->public = $public; $adh->firstname = $_POST["firstname"]; $adh->lastname = $_POST["lastname"]; + $adh->gender = $_POST["gender"]; $adh->civility_id = $_POST["civility_id"]; $adh->societe = $_POST["societe"]; $adh->address = $_POST["address"]; @@ -580,6 +582,12 @@ print $formcompany->select_civility(GETPOST('civility_id'),'civility_id').' print ''."\n"; // Firstname print ''."\n"; +// Gender +print ''; +print ''; // Company print ''."\n"; // Address diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index c7a9fa45b3a..c2df82fb2f2 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -1,8 +1,9 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2007-2012 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin +/* Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2007-2012 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -91,6 +92,7 @@ if ($id > 0) print ''; print ''; print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index cd923ee6dcd..3981731419e 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -12,6 +12,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1148,7 +1149,7 @@ else } else { - print ''.fieldLabel('ThirdPartyName','name').''; + print ''.$form->editfieldkey('ThirdPartyName', 'name', '', $object, 0).''; } print 'global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>'; print ''; @@ -1161,11 +1162,11 @@ else // If javascript on, we show option individual if ($conf->use_javascript_ajax) { - print ''; + print ''; print ''; print ''; // Title - print ''; print ''; } @@ -1175,7 +1176,7 @@ else print ''; // Prospect/Customer - print ''; + print ''; print ''; - print '
'; $invoicestatic->id=$objp->facid; - $invoicestatic->ref=$objp->facnumber; + $invoicestatic->ref=$objp->ref; print $invoicestatic->getNomUrl(1); print ""; diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index 9c6c9265592..b1da52ad4aa 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -232,7 +232,7 @@ if ($object->id > 0) } else { - print ''.$langs->trans("AddAction").''; + print ''.$langs->trans("AddAction").''; } } diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index f9b3db7a99e..75754512c71 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -372,7 +372,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { - print ''.$langs->trans('Modify').''."\n"; + print ''.$langs->trans('Modify').''."\n"; } // Clone @@ -401,7 +401,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } } print ''."\n"; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index f94c34d1804..3e95b3cbb45 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2037,12 +2037,12 @@ if ($action != 'create' && $action != 'edit') } else { - print ''; + print ''; } } else { - print ''; + print ''; } } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 6d3a0724006..b872a6e401e 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 */ @@ -2622,7 +2623,7 @@ class Product extends CommonObject } $sql.= " WHERE f.rowid = fd.fk_facture"; $sql.= " AND f.fk_soc = s.rowid"; - $sql.= " AND f.entity IN (".getEntity('facture').")"; + $sql.= " AND f.entity IN (".getEntity('invoice').")"; $sql.= " AND fd.fk_product = ".$this->id; if (!$user->rights->societe->client->voir && !$socid) { $sql.= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; } @@ -2788,7 +2789,7 @@ class Product extends CommonObject if ($filteronproducttype >= 0) { $sql.= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype; } $sql.= " AND f.fk_soc = s.rowid"; - $sql.= " AND f.entity IN (".getEntity('facture').")"; + $sql.= " AND f.entity IN (".getEntity('invoice').")"; if (!$user->rights->societe->client->voir && !$socid) { $sql.= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; } if ($socid > 0) { $sql.= " AND f.fk_soc = $socid"; diff --git a/htdocs/product/dynamic_price/editor.php b/htdocs/product/dynamic_price/editor.php index baa738c20c5..3e4a87fe9f9 100644 --- a/htdocs/product/dynamic_price/editor.php +++ b/htdocs/product/dynamic_price/editor.php @@ -219,7 +219,7 @@ print ' print ''.$langs->trans("Back").''; if ($eid == 0) { - print '
'.$langs->trans('Delete').'
'."\n"; + print '
'.$langs->trans('Delete').'
'."\n"; } else { diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 24848ad26c5..eaa2f3dffc2 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -336,7 +336,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { - print ''.$langs->trans('Modify').''."\n"; + print ''.$langs->trans('Modify').''."\n"; } if ($permissiontodelete) @@ -345,7 +345,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } } print ''."\n"; diff --git a/htdocs/product/inventory/tpl/inventory.tpl.php b/htdocs/product/inventory/tpl/inventory.tpl.php index 30dc02a17d6..0b89ac8a647 100644 --- a/htdocs/product/inventory/tpl/inventory.tpl.php +++ b/htdocs/product/inventory/tpl/inventory.tpl.php @@ -201,7 +201,7 @@ if (empty($conf) || ! is_object($conf)) - trans('Delete') ?> + trans('Delete') ?> diff --git a/htdocs/product/list.php b/htdocs/product/list.php index dda8cf267c9..323d21e5629 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -417,6 +417,7 @@ if ($resql) // List of mass actions available $arrayofmassactions = array( + 'generate_doc'=>$langs->trans("Generate"), //'presend'=>$langs->trans("SendByMail"), //'builddoc'=>$langs->trans("PDFMerge"), ); diff --git a/htdocs/product/price.php b/htdocs/product/price.php index b610e2a2914..557892da312 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1111,7 +1111,7 @@ if (! $action || $action == 'delete' || $action == 'showlog_customer_price' || $ if ($object->isVariant()) { if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; + print ''; } } else { if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index cd2dc221bb9..6cf8c13208a 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"; @@ -155,7 +155,7 @@ if ($id > 0 || ! empty($ref)) $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.entity IN (".getEntity('facture').")"; + $sql.= " AND f.entity IN (".getEntity('invoice').")"; $sql.= " AND d.fk_facture = f.rowid"; $sql.= " AND d.fk_product =".$product->id; if (! empty($search_month)) @@ -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/card.php b/htdocs/product/stock/card.php index 6977ac28acf..1d9cbd7952f 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -419,12 +419,12 @@ else if ($user->rights->stock->creer) print "id."\">".$langs->trans("Modify").""; else - print "".$langs->trans("Modify").""; + print "".$langs->trans("Modify").""; if ($user->rights->stock->supprimer) print "id."\">".$langs->trans("Delete").""; else - print "".$langs->trans("Delete").""; + print "".$langs->trans("Delete").""; } } diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 7991477e146..98103af8ccf 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -322,8 +322,8 @@ class MouvementStock extends CommonObject if (! $foundforbatch || $qtyisnotenough) { $langs->load("stocks"); - $this->error = $langs->trans('qtyToTranferLotIsNotEnough'); - $this->errors[] = $langs->trans('qtyToTranferLotIsNotEnough'); + $this->error = $langs->trans('qtyToTranferLotIsNotEnough').' : '.$product->ref; + $this->errors[] = $langs->trans('qtyToTranferLotIsNotEnough').' : '.$product->ref; $this->db->rollback(); return -8; } @@ -333,8 +333,8 @@ class MouvementStock extends CommonObject if (empty($product->stock_warehouse[$entrepot_id]->real) || $product->stock_warehouse[$entrepot_id]->real < abs($qty)) { $langs->load("stocks"); - $this->error = $langs->trans('qtyToTranferIsNotEnough'); - $this->errors[] = $langs->trans('qtyToTranferIsNotEnough'); + $this->error = $langs->trans('qtyToTranferIsNotEnough').' : '.$product->ref; + $this->errors[] = $langs->trans('qtyToTranferIsNotEnough').' : '.$product->ref; $this->db->rollback(); return -8; } 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').'
'.$langs->trans("Lastname").' *
'.$langs->trans("Firstname").' *
'.$langs->trans("Gender").''; +$arraygender=array('man'=>$langs->trans("Genderman"),'woman'=>$langs->trans("Genderwoman")); +print $form->selectarray('gender', $arraygender, GETPOST('gender')?GETPOST('gender'):$object->gender, 1); +print '
'.$langs->trans("Company").'
'.$langs->trans("Person").''.$object->morphy.'
'.$langs->trans("Firstname").''.$object->firstname.' 
'.$langs->trans("Lastname").''.$object->lastname.' 
'.$langs->trans("Gender").''.$object->gender.' 
'.$langs->trans("Company").''.$object->societe.' 
'.$langs->trans("Address").''.nl2br($object->address).' 
'.$langs->trans("Zip").' / '.$langs->trans("Town").''.$object->zip.' '.$object->town.' 
'.fieldLabel('FirstName','firstname').'
'.$form->editfieldkey('FirstName', 'firstname', '', $object, 0).'
'.fieldLabel('UserTitle','civility_id').''; + print '
'.$form->editfieldkey('UserTitle', 'civility_id', '', $object, 0).''; print $formcompany->select_civility($object->civility_id, 'civility_id', 'maxwidth100').'
'.fieldLabel('ProspectCustomer','customerprospect',1).'
'.$form->editfieldkey('ProspectCustomer', 'customerprospect', '', $object, 0, 'string', '', 1).''; $selected=GETPOST('client','int')!=''?GETPOST('client','int'):$object->client; print ''.fieldLabel('CustomerCode','customer_code').''; + print ''.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).''; print ''; - print ''; // Barcode if (! empty($conf->barcode->enabled)) { - print ''; + print ''; print ''; } // Address - print ''; + print ''; print ''; // Zip / Town - print ''; // Country - print ''; @@ -1264,11 +1265,11 @@ else { if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) { - print ''; + print ''; print ''; - print ''; + print ''; print ''; if (! empty($conf->socialnetworks->enabled)) @@ -1287,27 +1288,33 @@ else // Skype if (! empty($conf->global->SOCIALNETWORKS_SKYPE)) { - print ''; - print ''; + print ''; + print ''; } // Twitter if (! empty($conf->global->SOCIALNETWORKS_TWITTER)) { - print ''; - print ''; + print ''; + print ''; } // Facebook if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK)) { - print ''; - print ''; + print ''; + print ''; } } // Phone / Fax - print ''; + print ''; print ''; - print ''; + print ''; print ''; // Prof ids @@ -1322,7 +1329,7 @@ else if (($j % 2) == 0) print ''; $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; - print ''; @@ -1334,11 +1341,11 @@ else if ($j % 2 == 1) print ''; // Vat is used - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; // Legal Form - print ''; + print ''; print ''; // Capital - print ''; + print ''; print ''; if (! empty($conf->global->MAIN_MULTILANGS)) { - print ''; print ''; @@ -1431,7 +1438,7 @@ else if (!empty($conf->incoterm->enabled)) { print ''; - print ''; + print ''; print ''; @@ -1444,7 +1451,7 @@ else // Customer //if ($object->prospect || $object->client || (! $object->fournisseur && ! empty($conf->global->THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER))) { - print '"; @@ -1452,7 +1459,7 @@ else // Supplier //if ($object->fournisseur) { - print '"; @@ -1463,7 +1470,7 @@ else if (! empty($conf->multicurrency->enabled)) { print ''; - print ''; + print ''; print ''; @@ -1478,18 +1485,18 @@ else print $object->showOptionals($extrafields,'edit'); } - // Assign a sale representative - print ''; - print ''; - print ''; + // Assign a sale representative + print ''; + print ''; + print ''; // Ajout du logo print ''; - print ''; + print ''; print ''; @@ -1736,7 +1743,7 @@ else } // Name - print ''; + print ''; print ''; // Alias names (commercial, trademark or alias names) @@ -1746,7 +1753,7 @@ else // Prefix if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { - print ''; + print ''; print ''; - print ''; - print ''; + print ''; print ''; @@ -2626,7 +2629,7 @@ else else { $langs->load("mails"); - print ''; + print ''; } if ($user->rights->societe->creer) 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/class/societe.class.php b/htdocs/societe/class/societe.class.php index de792c69189..7559301a913 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3804,7 +3804,7 @@ class Societe extends CommonObject if ($mode == 'supplier') { $sql .= " AND entity IN (".getEntity('facture_fourn').")"; } else { - $sql .= " AND entity IN (".getEntity('facture').")"; + $sql .= " AND entity IN (".getEntity('invoice').")"; } dol_syslog("getOutstandingBills", LOG_DEBUG); 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/societe/project.php b/htdocs/societe/project.php index 97e6817f5d5..5d8936060ac 100644 --- a/htdocs/societe/project.php +++ b/htdocs/societe/project.php @@ -133,7 +133,7 @@ if ($socid) /* } else { - print ''.$langs->trans("AddProject").''; + print ''.$langs->trans("AddProject").''; } } diff --git a/htdocs/stripe/class/actions_stripe.class.php b/htdocs/stripe/class/actions_stripe.class.php index 69dc4e33307..a7a2e56ecff 100644 --- a/htdocs/stripe/class/actions_stripe.class.php +++ b/htdocs/stripe/class/actions_stripe.class.php @@ -215,23 +215,23 @@ class ActionsStripeconnect } else { - print ''.$langs->trans("StripeConnectPay").''; + print ''.$langs->trans("StripeConnectPay").''; } } elseif ($resteapayer == 0) { - print ''.$langs->trans("StripeConnectPay").''; + print ''.$langs->trans("StripeConnectPay").''; } } else { - print ''.$langs->trans("StripeConnectPay").''; + print ''.$langs->trans("StripeConnectPay").''; } } elseif (is_object($object) && $object->element == 'invoice_supplier'){ - print ''.$langs->trans("StripeConnectPay").''; + print ''.$langs->trans("StripeConnectPay").''; } elseif (is_object($object) && $object->element == 'member'){ - print ''.$langs->trans("StripeAutoSubscription").''; + print ''.$langs->trans("StripeAutoSubscription").''; } return 0; } 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 '
'; $tmpcode=$object->code_client; if (empty($tmpcode) && ! empty($modCodeClient->code_auto)) $tmpcode=$modCodeClient->getNextValue($object,0); @@ -1202,7 +1203,7 @@ else { // Supplier print '
'.fieldLabel('Supplier','fournisseur',1).''; + print ''.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).''; $default = -1; if (! empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)) $default=1; print $form->selectyesno("fournisseur", (GETPOST('fournisseur','int')!=''?GETPOST('fournisseur','int'):(GETPOST("type",'alpha') == '' ? $default : $object->fournisseur)), 1, 0, (GETPOST("type",'alpha') == '' ? 1 : 0)); @@ -1210,7 +1211,7 @@ else print ''; if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire)) { - print fieldLabel('SupplierCode','supplier_code'); + print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); } print ''; if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire)) @@ -1228,33 +1229,33 @@ else } // Status - print '
'.fieldLabel('Status','status').''; + print '
'.$form->editfieldkey('Status', 'status', '', $object, 0).''; print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),1); print '
'.fieldLabel('Gencod','barcode').'
'.$form->editfieldkey('Gencod', 'barcode', '', $object, 0).''; print '
'.fieldLabel('Address','address').'
'.$form->editfieldkey('Address', 'address', '', $object, 0).'
'.fieldLabel('Zip','zipcode').''; + print '
'.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).''; print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); - print ''.fieldLabel('Town','town').''; + print ''.$form->editfieldkey('Town', 'town', '', $object, 0).''; print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); print '
'.fieldLabel('Country','selectcountry_id').''; + print '
'.$form->editfieldkey('Country', 'selectcountry_id', '', $object, 0).''; print $form->select_country((GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.fieldLabel('Region-State','state_id').''; + print '
'.$form->editfieldkey('Region-State', 'state_id', '', $object, 0).''; } else { - print '
'.fieldLabel('State','state_id').''; + print '
'.$form->editfieldkey('State', 'state_id', '', $object, 0).''; } if ($object->country_id) print $formcompany->select_state($object->state_id,$object->country_code); @@ -1277,9 +1278,9 @@ else } // Email / Web - print '
'.fieldLabel('EMail','email',$conf->global->SOCIETE_EMAIL_MANDATORY).'
'.$form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '', $conf->global->SOCIETE_EMAIL_MANDATORY).'
'.fieldLabel('Web','url').'
'.$form->editfieldkey('Web', 'url', '', $object, 0).'
'.fieldLabel('Skype','skype').'skype).'">
'.$form->editfieldkey('Skype', 'skype', '', $object, 0).''; + print 'skype).'">'; + print '
'.fieldLabel('Twitter','twitter').'twitter).'">
'.$form->editfieldkey('Twitter', 'twitter', '', $object, 0).''; + print 'twitter).'">'; + print '
'.fieldLabel('Facebook','facebook').'facebook).'">
'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).''; + print 'facebook).'">'; + print '
'.fieldLabel('Phone','phone').'
'.$form->editfieldkey('Phone', 'phone', '', $object, 0).''.fieldLabel('Fax','fax').''.$form->editfieldkey('Fax', 'fax', '', $object, 0).'
'.fieldLabel($idprof,$key, (empty($conf->global->$idprof_mandatory)?0:1)).''; + print ''.$form->editfieldkey($idprof, $key, '', $object, 0, 'string', '', (empty($conf->global->$idprof_mandatory)?0:1)).''; print $formcompany->get_input_id_prof($i, $key, $object->$key, $object->country_code); print '
'.fieldLabel('VATIsUsed','assujtva_value').'
'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).''; print $form->selectyesno('assujtva_value', GETPOSTISSET('assujtva_value')?GETPOST('assujtva_value','int'):1, 1); // Assujeti par defaut en creation print ''.fieldLabel('VATIntra','intra_vat').''.$form->editfieldkey('VATIntra', 'intra_vat', '', $object, 0).''; $s = ''; @@ -1391,18 +1398,18 @@ else } // Type - Size - print '
'.fieldLabel('ThirdPartyType','typent_id').''."\n"; + print '
'.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).''."\n"; $sortparam=(empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam); if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print ''.fieldLabel('Staff','effectif_id').''; + print ''.$form->editfieldkey('Staff', 'effectif_id', '', $object, 0).''; print $form->selectarray("effectif_id", $formcompany->effectif_array(0), $object->effectif_id); if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.fieldLabel('JuridicalStatus','forme_juridique_code').'
'.$form->editfieldkey('JuridicalStatus', 'forme_juridique_code', '', $object, 0).''; if ($object->country_id) { @@ -1415,13 +1422,13 @@ else print '
'.fieldLabel('Capital','capital').'
'.$form->editfieldkey('Capital', 'capital', '', $object, 0).' '; print ''.$langs->trans("Currency".$conf->currency).'
'.fieldLabel('DefaultLang','default_lang').''."\n"; + print '
'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; print $formadmin->select_language(($object->default_lang?$object->default_lang:$conf->global->MAIN_LANG_DEFAULT),'default_lang',0,0,1,0,0,'maxwidth200onsmartphone'); print '
'.fieldLabel('IncotermLabel','incoterm_id').''.$form->editfieldkey('IncotermLabel', 'incoterm_id', '', $object, 0).''; print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:'')); print '
' . fieldLabel('CustomersProspectsCategoriesShort', 'custcats') . ''; + print '
' . $form->editfieldkey('CustomersProspectsCategoriesShort', 'custcats', '', $object, 0) . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1); print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%"); print "
' . fieldLabel('SuppliersCategoriesShort', 'suppcats') . ''; + print '
' . $form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0) . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, 'parent', null, null, 1); print $form->multiselectarray('suppcats', $cate_arbo, GETPOST('suppcats', 'array'), null, null, null, null, "90%"); print "
'.fieldLabel('Currency','multicurrency_code').''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print $form->selectMultiCurrency(($object->multicurrency_code ? $object->multicurrency_code : $conf->currency), 'multicurrency_code', 1); print '
'.fieldLabel('AllocateCommercial','commercial_id').''; - $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1); - // Note: If user has no right to "see all thirdparties", we for selection of sale representative to him, so after creation he can see the record. - print $form->multiselectarray('commercial', $userlist, (count(GETPOST('commercial', 'array')) > 0?GETPOST('commercial', 'array'):(empty($user->rights->societe->client->voir)?array($user->id):array())), null, null, null, null, "90%"); - print '
'.$form->editfieldkey('AllocateCommercial', 'commercial_id', '', $object, 0).''; + $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1); + // Note: If user has no right to "see all thirdparties", we for selection of sale representative to him, so after creation he can see the record. + print $form->multiselectarray('commercial', $userlist, (count(GETPOST('commercial', 'array')) > 0?GETPOST('commercial', 'array'):(empty($user->rights->societe->client->voir)?array($user->id):array())), null, null, null, null, "90%"); + print '
'.fieldLabel('Logo','photoinput').''.$form->editfieldkey('Logo', 'photoinput', '', $object, 0).''; print ''; print '
'.fieldLabel('ThirdPartyName','name',1).'
'.$form->editfieldkey('ThirdPartyName', 'name', '', $object, 0, 'string', '', 1).'
'.fieldLabel('Prefix','prefix').''; + print '
'.$form->editfieldkey('Prefix', 'prefix', '', $object, 0).''; // It does not change the prefix mode using the auto numbering prefix if (($prefixCustomerIsUsed || $prefixSupplierIsUsed) && $object->prefix_comm) { @@ -1761,14 +1768,14 @@ else } // Prospect/Customer - print '
'.fieldLabel('ProspectCustomer','customerprospect',1).'
'.$form->editfieldkey('ProspectCustomer', 'customerprospect', '', $object, 0, 'string', '', 1).''.fieldLabel('CustomerCode','customer_code').''; + print ''.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).''; print ''; - print ''; print ''; + print ''; print ''; } // Status - print ''; // Address - print ''; + print ''; print ''; // Zip / Town - print ''; // Country - print ''; @@ -1872,11 +1879,11 @@ else { if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) { - print ''; + print ''; print ''; - print ''; + print ''; print ''; if (! empty($conf->socialnetworks->enabled)) @@ -1894,27 +1901,27 @@ else // Skype if (! empty($conf->global->SOCIALNETWORKS_SKYPE)) { - print ''; + print ''; print ''; } // Twitter if (! empty($conf->global->SOCIALNETWORKS_TWITTER)) { - print ''; + print ''; print ''; } // Facebook if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK)) { - print ''; + print ''; print ''; } } // Phone / Fax - print ''; + print ''; print ''; - print ''; + print ''; print ''; // Prof ids @@ -1929,12 +1936,8 @@ else if (($j % 2) == 0) print ''; $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; - if (empty($conf->global->$idprof_mandatory) || ! $object->isACompany()) - print ''; if (($j % 2) == 1) print ''; $j++; @@ -1944,7 +1947,7 @@ else if ($j % 2 == 1) print ''; // VAT is used - print ''; @@ -1952,7 +1955,7 @@ else //TODO: Place into a function to control showing by country or study better option if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") { - print ''; - print ''; + print ''; print ''; // Type - Size - print ''; - print ''; // Juridical type - print ''; // Capital - print ''; + print ''; print ''; @@ -2051,7 +2054,7 @@ else // Default language if (! empty($conf->global->MAIN_MULTILANGS)) { - print ''; print ''; @@ -2061,7 +2064,7 @@ else if (!empty($conf->incoterm->enabled)) { print ''; - print ''; + print ''; print ''; @@ -2071,7 +2074,7 @@ else if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { // Customer - print ''; + print ''; print '"; // Supplier - print ''; + print ''; print ''; - print ''; + print ''; print ''; @@ -2118,15 +2121,15 @@ else // Webservices url/key if (!empty($conf->syncsupplierwebservices->enabled)) { - print ''; + print ''; print ''; - print ''; + print ''; print ''; } // Logo print ''; - print ''; + print ''; print ''; - print ''; + print ''; print '
'; if ((!$object->code_client || $object->code_client == -1) && $modCodeClient->code_auto) @@ -1799,13 +1806,13 @@ else || (! empty($conf->supplier_proposal->enabled) && ! empty($user->rights->supplier_proposal->lire))) { print '
'.fieldLabel('Supplier','fournisseur',1).''; + print ''.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).''; print $form->selectyesno("fournisseur",$object->fournisseur,1); print ''; if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire)) { - print fieldLabel('SupplierCode','supplier_code'); + print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); } print ''; if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire)) @@ -1838,31 +1845,31 @@ else // Barcode if (! empty($conf->barcode->enabled)) { - print '
'.fieldLabel('Gencod','barcode').'
'.$form->editfieldkey('Gencod', 'barcode', '', $object, 0).''; print '
'.fieldLabel('Status','status').''; + print '
'.$form->editfieldkey('Status', 'status', '', $object, 0).''; print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$object->status); print '
'.fieldLabel('Address','address').'
'.$form->editfieldkey('Address', 'address', '', $object, 0).'
'.fieldLabel('Zip','zipcode').''; + print '
'.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).''; print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth50onsmartphone'); - print ''.fieldLabel('Town','town').''; + print ''.$form->editfieldkey('Town', 'town', '', $object, 0).''; print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id')); print '
'.fieldLabel('Country','selectcounty_id').''; + print '
'.$form->editfieldkey('Country', 'selectcounty_id', '', $object, 0).''; print $form->select_country((GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id),'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.fieldLabel('Region-State','state_id').''; + print '
'.$form->editfieldkey('Region-State', 'state_id', '', $object, 0).''; } else { - print '
'.fieldLabel('State','state_id').''; + print '
'.$form->editfieldkey('State', 'state_id', '', $object, 0).''; } print $formcompany->select_state($object->state_id,$object->country_code); @@ -1884,9 +1891,9 @@ else } // EMail / Web - print '
'.fieldLabel('EMail','email',(! empty($conf->global->SOCIETE_EMAIL_MANDATORY))).'
'.$form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '', (! empty($conf->global->SOCIETE_EMAIL_MANDATORY))).'
'.fieldLabel('Web','url').'
'.$form->editfieldkey('Web', 'url', '', $object, 0).'
'.fieldLabel('Skype','skype').'
'.$form->editfieldkey('Skype', 'skype', '', $object, 0).'
'.fieldLabel('Twitter','twitter').'
'.$form->editfieldkey('Twitter', 'twitter', '', $object, 0).'
'.fieldLabel('Facebook','facebook').'
'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).'
'.fieldLabel('Phone','phone').'
'.$form->editfieldkey('Phone', 'phone', '', $object, 0).''.fieldLabel('Fax','fax').''.$form->editfieldkey('Fax', 'fax', '', $object, 0).'
'.fieldLabel($idprof,$key).''; - else - print ''.fieldLabel($idprof,$key).''; - - print $formcompany->get_input_id_prof($i,$key,$object->$key,$object->country_code); + print ''.$form->editfieldkey($idprof, $key, '', $object, 0, 'string', '', ! (empty($conf->global->$idprof_mandatory) || ! $object->isACompany())).''; + print $formcompany->get_input_id_prof($i, $key, $object->$key, $object->country_code); print '
'.fieldLabel('VATIsUsed','assujtva_value').''; + print '
'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).''; print $form->selectyesno('assujtva_value',$object->tva_assuj,1); print '
'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').''; + print '
'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code), 'localtax1assuj_value', '', $object, 0).''; print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); if(! isOnlyOneLocalTax(1)) { @@ -1962,7 +1965,7 @@ else } print ''.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').''; + print ''.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code), 'localtax2assuj_value', '', $object, 0).''; print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); if (! isOnlyOneLocalTax(2)) { @@ -1974,7 +1977,7 @@ else } elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1") { - print '
'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').''; + print '
'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code), 'localtax1assuj_value', '', $object, 0).''; print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); if(! isOnlyOneLocalTax(1)) { @@ -1986,7 +1989,7 @@ else } elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1") { - print '
'.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').''; + print '
'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code), 'localtax2assuj_value', '', $object, 0).''; print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); if(! isOnlyOneLocalTax(2)) { @@ -1998,7 +2001,7 @@ else } // VAT Code - print '
'.fieldLabel('VATIntra','intra_vat').'
'.$form->editfieldkey('VATIntra', 'intra_vat', '', $object, 0).''; $s =''; @@ -2028,22 +2031,22 @@ else print '
'.fieldLabel('ThirdPartyType','typent_id').''; + print '
'.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).''; print $form->selectarray("typent_id",$formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print ''.fieldLabel('Staff','effectif_id').''; + print ''.$form->editfieldkey('Staff', 'effectif_id', '', $object, 0).''; print $form->selectarray("effectif_id",$formcompany->effectif_array(0), $object->effectif_id); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.fieldLabel('JuridicalStatus','forme_juridique_code').''; + print '
'.$form->editfieldkey('JuridicalStatus', 'forme_juridique_code', '', $object, 0).''; print $formcompany->select_juridicalstatus($object->forme_juridique_code, $object->country_code, '', 'forme_juridique_code'); print '
'.fieldLabel('Capital','capital').'
'.$form->editfieldkey('Capital', 'capital', '', $object, 0).' '.$langs->trans("Currency".$conf->currency).'
'.fieldLabel('DefaultLang','default_lang').''."\n"; + print '
'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; print $formadmin->select_language($object->default_lang,'default_lang',0,0,1); print '
'.fieldLabel('IncotermLabel','incoterm_id').''.$form->editfieldkey('IncotermLabel', 'incoterm_id', '', $object, 0).''; print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:'')); print '
' . fieldLabel('CustomersCategoriesShort', 'custcats') . '
' . $form->editfieldkey('CustomersCategoriesShort', 'custcats', '', $object, 0) . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, null, null, null, 1); $c = new Categorie($db); @@ -2084,7 +2087,7 @@ else print "
' . fieldLabel('SuppliersCategoriesShort', 'suppcats') . '
' . $form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0) . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, null, null, null, 1); $c = new Categorie($db); @@ -2101,7 +2104,7 @@ else if (! empty($conf->multicurrency->enabled)) { print '
'.fieldLabel('Currency','multicurrency_code').''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print $form->selectMultiCurrency(($object->multicurrency_code ? $object->multicurrency_code : $conf->currency), 'multicurrency_code', 1); print '
'.fieldLabel('WebServiceURL','webservices_url').'
'.$form->editfieldkey('WebServiceURL', 'webservices_url', '', $object, 0).''.fieldLabel('WebServiceKey','webservices_key').''.$form->editfieldkey('WebServiceKey', 'webservices_key', '', $object, 0).'
'.fieldLabel('Logo','photoinput').''.$form->editfieldkey('Logo', 'photoinput', '', $object, 0).''; if ($object->logo) print $form->showphoto('societe',$object); $caneditfield=1; @@ -2144,7 +2147,7 @@ else // Assign sale representative print '
'.fieldLabel('AllocateCommercial','commercial_id').''.$form->editfieldkey('AllocateCommercial', 'commercial_id', '', $object, 0).''; $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1); $arrayselected = GETPOST('commercial', 'array'); @@ -2155,7 +2158,7 @@ else print '
'; print ''; - dol_fiche_end(); + dol_fiche_end(); print '
'; print ''; @@ -2524,7 +2527,7 @@ else if (! empty($conf->multicurrency->enabled)) { print '
'.fieldLabel('Currency','multicurrency_code').''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print !empty($object->multicurrency_code) ? currency_name($object->multicurrency_code,1) : ''; print '
'; 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/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 99e99517f75..b1133616eeb 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1169,10 +1169,9 @@ if ($action == 'create') } // Multicurrency - if (! empty($conf->multicurrency->enabled)) - { + if (! empty($conf->multicurrency->enabled)) { print ''; - print ''; + print ''; print ''; @@ -1524,7 +1523,7 @@ if ($action == 'create') print ''; print '
'.$objp->facnumber."'.$objp->ref."'.dol_print_date($db->jdate($objp->dp))."'.$objp->paiement_type.' '.$objp->num_paiement."'.price($objp->amount).' 
'.fieldLabel('Currency','multicurrency_code').''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); print '
'; print ''; if ($action != 'editmulticurrencycode' && ! empty($object->brouillon)) print ''; @@ -1541,7 +1540,7 @@ if ($action == 'create') print ''; print '
'; - print fieldLabel('Currency','multicurrency_code'); + print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
'; print ''; if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) print ''; @@ -1612,17 +1611,17 @@ if ($action == 'create') if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT - print ''; + print ''; print ''; print ''; // Multicurrency Amount VAT - print ''; + print ''; print ''; print ''; // Multicurrency Amount TTC - print ''; + print ''; print ''; print ''; } @@ -1778,7 +1777,7 @@ if ($action == 'create') ) { if (count($object->lines) > 0) print ''; - // else print ''.$langs->trans('Validate').''; + // else print ''.$langs->trans('Validate').''; } // Edit @@ -1797,7 +1796,7 @@ if ($action == 'create') if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->supplier_proposal->send_advance) { print ''; } else - print ''; + print ''; } // Create an order diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 795564984d4..5986ac65f14 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -396,6 +396,7 @@ if ($resql) // List of mass actions available $arrayofmassactions = array( + 'generate_doc'=>$langs->trans("Generate"), //'presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"), ); 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); ?>
'; - print fieldLabel('CurrencyRate','multicurrency_tx'); + print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '
' . $form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0) . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '
' . $form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0) . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '
' . $form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0) . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '