Merge remote-tracking branch 'origin/3.9' into develop

Conflicts:
	htdocs/fourn/commande/list.php
	htdocs/fourn/commande/orderstoinvoice.php
	htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/locale/cs/functions
	htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/locale/da/functions
	htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/locale/de/functions
	htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/locale/es/functions
	htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/locale/fi/functions
	htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/locale/fr/functions
	htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/locale/hu/functions
	htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/locale/it/functions
	htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/locale/nl/functions
	htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/locale/no/functions
	htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/locale/pl/functions
	htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/locale/ru/functions
	htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/locale/tr/functions
	htdocs/install/pgsql/functions/functions.sql
This commit is contained in:
Laurent Destailleur
2016-07-06 15:11:29 +02:00
40 changed files with 1712 additions and 1660 deletions

View File

@@ -70,6 +70,11 @@ $date_end = dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endda
$date_starty = dol_mktime(0,0,0,$_REQUEST["date_start_delymonth"],$_REQUEST["date_start_delyday"],$_REQUEST["date_start_delyyear"]); // Date for local PHP server $date_starty = dol_mktime(0,0,0,$_REQUEST["date_start_delymonth"],$_REQUEST["date_start_delyday"],$_REQUEST["date_start_delyyear"]); // Date for local PHP server
$date_endy = dol_mktime(23,59,59,$_REQUEST["date_end_delymonth"],$_REQUEST["date_end_delyday"],$_REQUEST["date_end_delyyear"]); $date_endy = dol_mktime(23,59,59,$_REQUEST["date_end_delymonth"],$_REQUEST["date_end_delyday"],$_REQUEST["date_end_delyyear"]);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label('facture');
if ($action == 'create') if ($action == 'create')
{ {
if (! is_array($selected)) if (! is_array($selected))
@@ -174,6 +179,9 @@ if (($action == 'create' || $action == 'add') && !$error)
$object->remise_absolue = $_POST['remise_absolue']; $object->remise_absolue = $_POST['remise_absolue'];
$object->remise_percent = $_POST['remise_percent']; $object->remise_percent = $_POST['remise_percent'];
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
if ($ret < 0) $error++;
if ($_POST['origin'] && $_POST['originid']) if ($_POST['origin'] && $_POST['originid'])
{ {
$object->origin = $_POST['origin']; $object->origin = $_POST['origin'];
@@ -464,6 +472,12 @@ if ($action == 'create' && !$error)
$parameters=array('objectsrc' => $objectsrc, 'idsrc' => $listoforders, 'colspan' => ' colspan="3"'); $parameters=array('objectsrc' => $objectsrc, 'idsrc' => $listoforders, 'colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
$object=new Facture($db);
print $object->showOptionals($extrafields,'edit');
}
// Modele PDF // Modele PDF
print '<tr><td>'.$langs->trans('Model').'</td>'; print '<tr><td>'.$langs->trans('Model').'</td>';
print '<td>'; print '<td>';

View File

@@ -434,6 +434,7 @@ class doc_generic_task_odt extends ModelePDFTask
} }
$project= new Project($this->db); $project= new Project($this->db);
$project->fetch($object->fk_project); $project->fetch($object->fk_project);
$project->fetch_thirdparty();
$dir = $conf->projet->dir_output. "/" . $project->ref. "/"; $dir = $conf->projet->dir_output. "/" . $project->ref. "/";
$objectref = dol_sanitizeFileName($object->ref); $objectref = dol_sanitizeFileName($object->ref);
@@ -468,7 +469,7 @@ class doc_generic_task_odt extends ModelePDFTask
dol_mkdir($conf->projet->dir_temp); dol_mkdir($conf->projet->dir_temp);
$socobject=$object->thirdparty; $socobject=$project->thirdparty;
// Make substitution // Make substitution
$substitutionarray=array( $substitutionarray=array(

View File

@@ -71,6 +71,11 @@ $date_end = dol_mktime(23, 59, 59, $_REQUEST["date_endmonth"], $_REQUEST["date_e
$date_starty = dol_mktime(0, 0, 0, $_REQUEST["date_start_delymonth"], $_REQUEST["date_start_delyday"], $_REQUEST["date_start_delyyear"]); // Date for local PHP server $date_starty = dol_mktime(0, 0, 0, $_REQUEST["date_start_delymonth"], $_REQUEST["date_start_delyday"], $_REQUEST["date_start_delyyear"]); // Date for local PHP server
$date_endy = dol_mktime(23, 59, 59, $_REQUEST["date_end_delymonth"], $_REQUEST["date_end_delyday"], $_REQUEST["date_end_delyyear"]); $date_endy = dol_mktime(23, 59, 59, $_REQUEST["date_end_delymonth"], $_REQUEST["date_end_delyday"], $_REQUEST["date_end_delyyear"]);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label('facture_fourn');
if ($action == 'create') if ($action == 'create')
{ {
if (! is_array($selected)) if (! is_array($selected))
@@ -162,6 +167,9 @@ if (($action == 'create' || $action == 'add') && ! $error) {
if (empty($object->date_echeance)) if (empty($object->date_echeance))
$object->date_echeance = $object->calculate_date_lim_reglement(); $object->date_echeance = $object->calculate_date_lim_reglement();
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
if ($ret < 0) $error++;
if ($_POST['origin'] && $_POST['originid']) { if ($_POST['origin'] && $_POST['originid']) {
$object->linked_objects = $orders_id; $object->linked_objects = $orders_id;
$id = $object->create($user); $id = $object->create($user);
@@ -362,6 +370,12 @@ if ($action == 'create' && !$error) {
); );
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
$object=new FactureFournisseur($db);
print $object->showOptionals($extrafields,'edit');
}
// Modele PDF // Modele PDF
print '<tr><td>' . $langs->trans('Model') . '</td>'; print '<tr><td>' . $langs->trans('Model') . '</td>';
print '<td>'; print '<td>';

View File

@@ -311,14 +311,17 @@ if (empty($reshook))
} }
// Delete payment // Delete payment
elseif ($action == 'deletepaiement' && $user->rights->fournisseur->facture->creer) elseif ($action == 'confirm_delete_paiement' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer)
{ {
$object->fetch($id); $object->fetch($id);
if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0) if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0)
{ {
$paiementfourn = new PaiementFourn($db); $paiementfourn = new PaiementFourn($db);
$result=$paiementfourn->fetch(GETPOST('paiement_id')); $result=$paiementfourn->fetch(GETPOST('paiement_id'));
if ($result > 0) $result=$paiementfourn->delete(); // If fetch ok and found if ($result > 0) {
$result=$paiementfourn->delete(); // If fetch ok and found
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
}
if ($result < 0) { if ($result < 0) {
setEventMessages($paiementfourn->error, $paiementfourn->errors, 'errors'); setEventMessages($paiementfourn->error, $paiementfourn->errors, 'errors');
} }
@@ -1620,6 +1623,12 @@ else
{ {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1);
}
if ($action == 'deletepaiement')
{
$payment_id = GETPOST('paiement_id');
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&paiement_id='.$payment_id, $langs->trans('DeletePayment'), $langs->trans('ConfirmDeletePayment'), 'confirm_delete_paiement', '', 0, 1);
} }
// Confirmation to delete line // Confirmation to delete line

View File

@@ -148,6 +148,9 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_rib FOR EACH
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_socpeople FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_socpeople FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_socpeople_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_socpeople_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_stock_mouvement FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_stock_mouvement FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_supplier_proposal FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_supplier_proposal_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_supplier_proposaldet_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_tva FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_tva FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_user FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_user FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_user_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_user_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();

View File

@@ -208,28 +208,39 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
} }
} }
$graphfiles=array( if($conf->propal->enabled) {
'propal' =>array('modulepart'=>'productstats_proposals', $graphfiles['propal']=array('modulepart'=>'productstats_proposals',
'file' => $object->id.'/propal12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', 'file' => $object->id.'/propal12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png',
'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsProposals"):$langs->transnoentitiesnoconv("NumberOfProposals"))), 'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsProposals"):$langs->transnoentitiesnoconv("NumberOfProposals")));
'proposalssuppliers'=>array('modulepart'=>'productstats_proposalssuppliers', }
if($conf->supplier_proposal->enabled) {
$graphfiles['proposalssuppliers']=array('modulepart'=>'productstats_proposalssuppliers',
'file' => $object->id.'/proposalssuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', 'file' => $object->id.'/proposalssuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png',
'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsSupplierProposals"):$langs->transnoentitiesnoconv("NumberOfSupplierProposals"))), 'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsSupplierProposals"):$langs->transnoentitiesnoconv("NumberOfSupplierProposals")));
}
'orders' =>array('modulepart'=>'productstats_orders', if($conf->order->enabled) {
$graphfiles['orders']=array('modulepart'=>'productstats_orders',
'file' => $object->id.'/orders12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', 'file' => $object->id.'/orders12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png',
'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsCustomerOrders"):$langs->transnoentitiesnoconv("NumberOfCustomerOrders"))), 'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsCustomerOrders"):$langs->transnoentitiesnoconv("NumberOfCustomerOrders")));
'orderssuppliers'=>array('modulepart'=>'productstats_orderssuppliers', }
'file' => $object->id.'/orderssuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png',
'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsSupplierOrders"):$langs->transnoentitiesnoconv("NumberOfSupplierOrders"))),
'invoices' =>array('modulepart'=>'productstats_invoices', if($conf->fournisseur->enabled) {
$graphfiles['orderssuppliers']=array('modulepart'=>'productstats_orderssuppliers',
'file' => $object->id.'/orderssuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png',
'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsSupplierOrders"):$langs->transnoentitiesnoconv("NumberOfSupplierOrders")));
}
if($conf->facture->enabled) {
$graphfiles['invoices']=array('modulepart'=>'productstats_invoices',
'file' => $object->id.'/invoices12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', 'file' => $object->id.'/invoices12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png',
'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsCustomerInvoices"):$langs->transnoentitiesnoconv("NumberOfCustomerInvoices"))), 'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsCustomerInvoices"):$langs->transnoentitiesnoconv("NumberOfCustomerInvoices")));
'invoicessuppliers'=>array('modulepart'=>'productstats_invoicessuppliers',
$graphfiles['invoicessuppliers']=array('modulepart'=>'productstats_invoicessuppliers',
'file' => $object->id.'/invoicessuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', 'file' => $object->id.'/invoicessuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png',
'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsSupplierInvoices"):$langs->transnoentitiesnoconv("NumberOfSupplierInvoices"))), 'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsSupplierInvoices"):$langs->transnoentitiesnoconv("NumberOfSupplierInvoices")));
); }
$px = new DolGraph(); $px = new DolGraph();