Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.8' into develop
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/compta/facture.php
  • Loading branch information
eldy committed Oct 18, 2015
2 parents ccce974 + bf6b48f commit 81580f7
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 45 deletions.
15 changes: 9 additions & 6 deletions htdocs/comm/propal/apercu.php
Expand Up @@ -47,8 +47,9 @@
* View Mode
*/

llxHeader();
$form = new Form($db);

llxHeader();

if ($id > 0 || ! empty($ref))
{
Expand All @@ -68,10 +69,12 @@
*/
print '<table class="border" width="100%">';

// Ref
print '<tr><td width="25%">'.$langs->trans('Ref').'</td>';
print '<td colspan="5">'.$object->ref.'</td>';
print '</tr>';
$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';

// Ref
print '<tr><td>' . $langs->trans('Ref') . '</td><td colspan="5">';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
print '</td></tr>';

// Ref client
print '<tr><td>'.$langs->trans('RefCustomer').'</td>';
Expand Down Expand Up @@ -144,7 +147,7 @@
print "</table>\n";

// Conversion du PDF en image png si fichier png non existant
if (! file_exists($fileimage) && ! file_exists($fileimagebis))
if ((! file_exists($fileimage) && ! file_exists($fileimagebis)) || (filemtime($fileimage) < filemtime($file)))
{
if (class_exists("Imagick"))
{
Expand Down
14 changes: 7 additions & 7 deletions htdocs/comm/propal/class/propal.class.php
Expand Up @@ -2099,26 +2099,26 @@ function InvoiceArrayList($id)
$this->fetchObjectLinked($id,$this->element);
foreach($this->linkedObjectsIds as $objecttype => $objectid)
{
$numi=count($objectid);
for ($i=0;$i<$numi;$i++)
// Nouveau système du comon object renvoi des rowid et non un id linéaire de 1 à n
// On parcourt donc une liste d'objets en tant qu'objet unique
foreach($objectid as $key => $object)
{
// Cas des factures liees directement
if ($objecttype == 'facture')
{
$linkedInvoices[] = $objectid[$i];
$linkedInvoices[] = $object;
}
// Cas des factures liees par un autre objet (ex: commande)
else
{
$this->fetchObjectLinked($objectid[$i],$objecttype);
$this->fetchObjectLinked($object,$objecttype);
foreach($this->linkedObjectsIds as $subobjecttype => $subobjectid)
{
$numj=count($subobjectid);
for ($j=0;$j<$numj;$j++)
foreach($subobjectid as $subkey => $subobject)
{
if ($subobjecttype == 'facture')
{
$linkedInvoices[] = $subobjectid[$j];
$linkedInvoices[] = $subobject;
}
}
}
Expand Down
13 changes: 9 additions & 4 deletions htdocs/commande/apercu.php
Expand Up @@ -47,6 +47,8 @@
* View Mode
*/

$form = new Form($db);

llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes');

if ($id > 0 || ! empty($ref))
Expand All @@ -64,9 +66,12 @@

print '<table class="border" width="100%">';

// Ref
print '<tr><td width="25%">'.$langs->trans("Ref")."</td>";
print '<td colspan="5">'.$object->ref.'</td></tr>';
//$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';

// Ref
print '<tr><td>' . $langs->trans('Ref') . '</td><td colspan="5">';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
print '</td></tr>';

// Ref cde client
print '<tr><td>'.$langs->trans('RefCustomer').'</td>';
Expand Down Expand Up @@ -142,7 +147,7 @@
print "</table>\n";

// Conversion du PDF en image png si fichier png non existant
if (! file_exists($fileimage) && ! file_exists($fileimagebis))
if ((! file_exists($fileimage) && ! file_exists($fileimagebis)) || (filemtime($fileimage) < filemtime($file)))
{
if (class_exists("Imagick"))
{
Expand Down
3 changes: 3 additions & 0 deletions htdocs/compta/facture.php
Expand Up @@ -1790,6 +1790,9 @@
dol_print_error($db);
}
}

if ($error)
$action = 'edit_extras';
}
}

Expand Down
22 changes: 17 additions & 5 deletions htdocs/compta/facture/apercu.php
Expand Up @@ -29,6 +29,7 @@

require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
Expand Down Expand Up @@ -79,10 +80,21 @@
*/
print '<table class="border" width="100%">';

// Ref
print '<tr><td width="25%">'.$langs->trans('Ref').'</td>';
print '<td colspan="5">'.$object->ref.'</td>';
print '</tr>';
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';

// Ref
print '<tr><td>' . $langs->trans('Ref') . '</td><td colspan="5">';
$morehtmlref = '';
$discount = new DiscountAbsolute($db);
$result = $discount->fetch(0, $object->id);
if ($result > 0) {
$morehtmlref = ' (' . $langs->trans("CreditNoteConvertedIntoDiscount", $discount->getNomUrl(1, 'discount')) . ')';
}
if ($result < 0) {
dol_print_error('', $discount->error);
}
print $form->showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref);
print '</td></tr>';

// Ref customer
print '<tr><td>'.$langs->trans('RefCustomer').'</td>';
Expand Down Expand Up @@ -280,7 +292,7 @@
print "</table>\n";

// Conversion du PDF en image png si fichier png non existant
if (! file_exists($fileimage) && ! file_exists($fileimagebis))
if ((! file_exists($fileimage) && ! file_exists($fileimagebis)) || (filemtime($fileimage) < filemtime($file)))
{
if (class_exists("Imagick"))
{
Expand Down
13 changes: 9 additions & 4 deletions htdocs/compta/sociales/charges.php
Expand Up @@ -79,7 +79,7 @@
{
$dateech=@dol_mktime(GETPOST('echhour'),GETPOST('echmin'),GETPOST('echsec'),GETPOST('echmonth'),GETPOST('echday'),GETPOST('echyear'));
$dateperiod=@dol_mktime(GETPOST('periodhour'),GETPOST('periodmin'),GETPOST('periodsec'),GETPOST('periodmonth'),GETPOST('periodday'),GETPOST('periodyear'));
$amount=GETPOST('amount');
$amount=price2num(GETPOST('amount'));
$actioncode=GETPOST('actioncode');
if (! $dateech)
{
Expand Down Expand Up @@ -114,7 +114,7 @@
$chargesociales->lib=GETPOST('label');
$chargesociales->date_ech=$dateech;
$chargesociales->periode=$dateperiod;
$chargesociales->amount=price2num($amount);
$chargesociales->amount=$amount;

$id=$chargesociales->create($user);
if ($id <= 0)
Expand All @@ -130,7 +130,7 @@
{
$dateech=dol_mktime(GETPOST('echhour'),GETPOST('echmin'),GETPOST('echsec'),GETPOST('echmonth'),GETPOST('echday'),GETPOST('echyear'));
$dateperiod=dol_mktime(GETPOST('periodhour'),GETPOST('periodmin'),GETPOST('periodsec'),GETPOST('periodmonth'),GETPOST('periodday'),GETPOST('periodyear'));
$amount=GETPOST('amount');
$amount=price2num(GETPOST('amount'));
if (! $dateech)
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("DateDue")), null, 'errors');
Expand All @@ -146,7 +146,12 @@
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors');
$action = 'edit';
}
else
elseif (! is_numeric($amount))
{
setEventMessage($langs->trans("ErrorFieldMustBeANumeric",$langs->transnoentities("Amount")), 'errors');
$action = 'create';
}
else
{
$chargesociales=new ChargeSociales($db);
$result=$chargesociales->fetch($id);
Expand Down
33 changes: 17 additions & 16 deletions htdocs/fichinter/apercu.php
Expand Up @@ -72,13 +72,21 @@
*/
print '<table class="border" width="100%">';

// Ref
print '<tr><td width="18%">'.$langs->trans("Ref")."</td>";
print '<td colspan="2">'.$object->ref.'</td>';

$nbrow=4;
$linkback = '<a href="'.DOL_URL_ROOT.'/fichinter/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';

// Ref
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
print '</td></tr>';

$nbrow=3;
// Client
print "<tr><td>".$langs->trans("Customer")."</td>";
print '<td>';
print '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$soc->id.'">'.$soc->name.'</a>';
print '</td>';
print '<td rowspan="'.$nbrow.'" valign="top" width="50%">';

/*
* Documents
*/
Expand Down Expand Up @@ -124,7 +132,7 @@
print "</table>\n";

// Conversion du PDF en image png si fichier png non existant
if (! file_exists($fileimage) && ! file_exists($fileimagebis))
if ((! file_exists($fileimage) && ! file_exists($fileimagebis)) || (filemtime($fileimage) < filemtime($file)))
{
if (class_exists("Imagick"))
{
Expand All @@ -141,21 +149,14 @@

print "</td></tr>";

// Client
print "<tr><td>".$langs->trans("Customer")."</td>";
print '<td colspan="2">';
print '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$soc->id.'">'.$soc->name.'</a>';
print '</td>';
print '</tr>';

// Statut
print '<tr><td>'.$langs->trans("Status").'</td>';
print "<td colspan=\"2\">".$object->getLibStatut(4)."</td>\n";
print "<td>".$object->getLibStatut(4)."</td>\n";
print '</tr>';

// Date
print '<tr><td>'.$langs->trans("Date").'</td>';
print "<td colspan=\"2\">".dol_print_date($object->datec,"daytext")."</td>\n";
print "<td>".dol_print_date($object->datec,"daytext")."</td>\n";
print '</tr>';

print '</table>';
Expand Down
1 change: 1 addition & 0 deletions htdocs/fourn/class/fournisseur.commande.class.php
Expand Up @@ -464,6 +464,7 @@ function valid($user,$idwarehouse=0,$notrigger=0)
{
$result = 1;
$this->log($user, 1, time()); // Statut 1
$this->statut = 1;
$this->ref = $num;
}

Expand Down
6 changes: 3 additions & 3 deletions htdocs/public/opensurvey/studs.php
@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
/* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* 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
Expand Down Expand Up @@ -46,7 +46,7 @@
$nblignes=$object->fetch_lines();

//If the survey has not yet finished, then it can be modified
$canbemodified = ($object->date_fin > dol_now());
$canbemodified = (empty($object->date_fin) || $object->date_fin > dol_now());


/*
Expand Down
1 change: 1 addition & 0 deletions htdocs/societe/class/societe.class.php
Expand Up @@ -2438,6 +2438,7 @@ function set_parent($id)
$resql=$this->db->query($sql);
if ($resql)
{
$this->parent = $id;
return 1;
}
else
Expand Down
1 change: 1 addition & 0 deletions htdocs/societe/soc.php
Expand Up @@ -680,6 +680,7 @@
// Set parent company
if ($action == 'set_thirdparty' && $user->rights->societe->creer)
{
$object->fetch($socid);
$result = $object->set_parent(GETPOST('editparentcompany','int'));
}

Expand Down

0 comments on commit 81580f7

Please sign in to comment.