Fix: Lost button

Conflicts:
	htdocs/compta/facture.php
	htdocs/fourn/facture/fiche.php
This commit is contained in:
Laurent Destailleur 2013-01-06 13:33:09 +01:00
parent a40047d464
commit 567cd00f5c

View File

@ -236,7 +236,7 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer)
$action='create'; $action='create';
$error++; $error++;
} }
if ($datefacture == '') if ($datefacture == '')
{ {
$mesg='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('DateInvoice')).'</div>'; $mesg='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('DateInvoice')).'</div>';
@ -291,7 +291,7 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer)
if ($element == 'project') if ($element == 'project')
{ {
$element = 'projet'; $element = 'projet';
} }
$object->origin = $_POST['origin']; $object->origin = $_POST['origin'];
$object->origin_id = $_POST['originid']; $object->origin_id = $_POST['originid'];
@ -613,6 +613,8 @@ elseif ($action == 'edit' && $user->rights->fournisseur->facture->creer)
$outputlangs->setDefaultLang($_REQUEST['lang_id']); $outputlangs->setDefaultLang($_REQUEST['lang_id']);
} }
//if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_invoice_pdf_create($db, $object->id, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); //if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_invoice_pdf_create($db, $object->id, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager);
$action='';
} }
} }
@ -959,7 +961,7 @@ if ($action == 'create')
if ($element == 'project') if ($element == 'project')
{ {
$projectid=GETPOST('originid'); $projectid=GETPOST('originid');
$element = 'projet'; $element = 'projet';
} }
else if (in_array($element,array('order_supplier'))) else if (in_array($element,array('order_supplier')))
{ {
@ -1382,7 +1384,7 @@ else
// Local taxes // Local taxes
// TODO I use here $societe->localtax1_assuj. Before it was $mysoc->localtax1_assuj, but this is a supplier invoice, so made by supplier, so depends on supplier properties // TODO I use here $societe->localtax1_assuj. Before it was $mysoc->localtax1_assuj, but this is a supplier invoice, so made by supplier, so depends on supplier properties
if ($mysoc->country_code=='ES') if ($mysoc->country_code=='ES')
{ {
if($mysoc->localtax1_assuj=="1") $nbrows++; if($mysoc->localtax1_assuj=="1") $nbrows++;
@ -1517,7 +1519,7 @@ else
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>'; print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
} }
} }
else else
{ {
if ($societe->localtax1_assuj=="1") //Localtax1 RE if ($societe->localtax1_assuj=="1") //Localtax1 RE
{ {
@ -1858,7 +1860,7 @@ else
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="socid" value="'. $object->socid .'">'; print '<input type="hidden" name="socid" value="'. $object->socid .'">';
print '<input type="hidden" name="facid" value="'.$object->id.'">'; print '<input type="hidden" name="facid" value="'.$object->id.'">';
print '<script type="text/javascript"> print '<script type="text/javascript">
jQuery(document).ready(function() { jQuery(document).ready(function() {
jQuery(\'#idprodfournprice\').change(function() { jQuery(\'#idprodfournprice\').change(function() {
@ -1866,7 +1868,7 @@ else
}); });
}); });
</script>'; </script>';
$var=! $var; $var=! $var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td colspan="4">'; print '<td colspan="4">';
@ -1908,14 +1910,19 @@ else
if ($action != 'presend') if ($action != 'presend')
{ {
/* /*
* Boutons actions * Boutons actions
*/ */
print '<div class="tabsAction">'; print '<div class="tabsAction">';
// Reopen a standard paid invoice // Modify a validated invoice with no payments
if ($object->statut == 1 && $action != 'edit' && $object->getSommePaiement() == 0 && $user->rights->fournisseur->facture->creer)
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=edit">'.$langs->trans('Modify').'</a>';
}
// Reopen a standard paid invoice
if (($object->type == 0 || $object->type == 1) && ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely) if (($object->type == 0 || $object->type == 1) && ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely)
{ {
if (! $facidnext && $object->close_code != 'replaced') // Not replaced by another invoice if (! $facidnext && $object->close_code != 'replaced') // Not replaced by another invoice
@ -2107,4 +2114,4 @@ else
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();
?> ?>