Fix: [ bug #1535 ] Supplier invoice Extrafields are not shown
This commit is contained in:
parent
e421741fc4
commit
2f30e769f6
@ -99,6 +99,7 @@ For users:
|
|||||||
- Fix: [ bug #1506, #1507 ] ECM trigger error problem
|
- Fix: [ bug #1506, #1507 ] ECM trigger error problem
|
||||||
- Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message
|
- Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message
|
||||||
- Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe.
|
- Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe.
|
||||||
|
- Fix: [ bug #1535 ] Supplier invoice Extrafields are not shown
|
||||||
|
|
||||||
For users, new experimental module (need to set feature level of instance to experimental to see them):
|
For users, new experimental module (need to set feature level of instance to experimental to see them):
|
||||||
- New: Module Accounting Expert to manage accountancy
|
- New: Module Accounting Expert to manage accountancy
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2014 Maxime Kohlhaas <support@atm-consulting.fr>
|
/* Copyright (C) 2014 Maxime Kohlhaas <support@atm-consulting.fr>
|
||||||
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -48,7 +49,9 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
|
|||||||
print '<table width="100%" class="nobordernopadding"><tr><td';
|
print '<table width="100%" class="nobordernopadding"><tr><td';
|
||||||
if (! empty($extrafields->attribute_required [$key])) print ' class="fieldrequired"';
|
if (! empty($extrafields->attribute_required [$key])) print ' class="fieldrequired"';
|
||||||
print '>' . $label . '</td>';
|
print '>' . $label . '</td>';
|
||||||
if (($object->statut == 0 || $extrafields->attribute_alwayseditable[$key]) && $user->rights->{$object->element}->creer && ($action != 'edit_extras' || GETPOST('attribute') != $key))
|
|
||||||
|
//TODO Improve element and rights detection
|
||||||
|
if (($object->statut == 0 || $extrafields->attribute_alwayseditable[$key]) && ($object->element=='order_supplier'?$user->rights->fournisseur>commande:($object->element=='invoice_supplier'?$user->rights->fournisseur>facture:$user->rights->{$object->element}->creer)) && ($action != 'edit_extras' || GETPOST('attribute') != $key))
|
||||||
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_edit().'</a></td>';
|
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_edit().'</a></td>';
|
||||||
|
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
@ -58,8 +61,9 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
|
|||||||
if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) {
|
if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) {
|
||||||
$value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]);
|
$value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'edit_extras' && $user->rights->{$object->element}->creer && GETPOST('attribute') == $key)
|
//TODO Improve element and rights detection
|
||||||
|
if ($action == 'edit_extras' && ($object->element=='order_supplier'?$user->rights->fournisseur>commande:($object->element=='invoice_supplier'?$user->rights->fournisseur>facture:$user->rights->{$object->element}->creer)) && GETPOST('attribute') == $key)
|
||||||
{
|
{
|
||||||
print '<form enctype="multipart/form-data" action="' . $_SERVER["PHP_SELF"] . '" method="post" name="formextra">';
|
print '<form enctype="multipart/form-data" action="' . $_SERVER["PHP_SELF"] . '" method="post" name="formextra">';
|
||||||
print '<input type="hidden" name="action" value="update_extras">';
|
print '<input type="hidden" name="action" value="update_extras">';
|
||||||
|
|||||||
@ -255,6 +255,16 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$result=$this->update_price();
|
$result=$this->update_price();
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
|
{
|
||||||
|
$result=$this->insertExtraFields();
|
||||||
|
if ($result < 0)
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('BILL_SUPPLIER_CREATE',$user);
|
$result=$this->call_trigger('BILL_SUPPLIER_CREATE',$user);
|
||||||
if ($result < 0) $error++;
|
if ($result < 0) $error++;
|
||||||
|
|||||||
@ -300,10 +300,16 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer)
|
|||||||
$_GET['socid']=$_POST['socid'];
|
$_GET['socid']=$_POST['socid'];
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fill array 'array_options' with data from add form
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
|
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||||
|
if ($ret < 0) $error ++;
|
||||||
|
|
||||||
$tmpproject = GETPOST('projectid', 'int');
|
$tmpproject = GETPOST('projectid', 'int');
|
||||||
|
|
||||||
@ -1179,6 +1185,9 @@ llxHeader('','','');
|
|||||||
// Mode creation
|
// Mode creation
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
|
$facturestatic = new FactureFournisseur($db);
|
||||||
|
$extralabels = $extrafields->fetch_name_optionals_label($facturestatic->table_element);
|
||||||
|
|
||||||
print_fiche_titre($langs->trans('NewBill'));
|
print_fiche_titre($langs->trans('NewBill'));
|
||||||
|
|
||||||
dol_htmloutput_events();
|
dol_htmloutput_events();
|
||||||
@ -1419,6 +1428,11 @@ if ($action == 'create')
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
// print '<td><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea></td>';
|
// print '<td><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||||
|
{
|
||||||
|
print $object->showOptionals($extrafields, 'edit');
|
||||||
|
}
|
||||||
|
|
||||||
if (is_object($objectsrc))
|
if (is_object($objectsrc))
|
||||||
{
|
{
|
||||||
@ -1530,6 +1544,9 @@ else
|
|||||||
$societe = new Fournisseur($db);
|
$societe = new Fournisseur($db);
|
||||||
$result=$societe->fetch($object->socid);
|
$result=$societe->fetch($object->socid);
|
||||||
if ($result < 0) dol_print_error($db);
|
if ($result < 0) dol_print_error($db);
|
||||||
|
|
||||||
|
// fetch optionals attributes and labels
|
||||||
|
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View card
|
* View card
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user