Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2013-03-08 12:09:49 +01:00
commit e5f712fe14
12 changed files with 51 additions and 34 deletions

View File

@ -118,7 +118,7 @@ class Facturation
} }
// Define part of HT, VAT, TTC // Define part of HT, VAT, TTC
$resultarray=calcul_price_total($this->qte,$this->prix(),$this->remisePercent(),$vat_rate,0,0,0,'HT',$product->type); $resultarray=calcul_price_total($this->qte,$this->prix(),$this->remisePercent(),$vat_rate,0,0,0,'HT',$product->type,0);
// Calcul du total ht sans remise // Calcul du total ht sans remise
$total_ht = $resultarray[0]; $total_ht = $resultarray[0];

View File

@ -635,7 +635,7 @@ else if ($action == "addline" && $user->rights->propal->creer)
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors');
$error++; $error++;
} }
if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht != 0) || $price_ht == '')) // Unit price can be 0 but not ''. Also price can be negative for proposal.
{ {
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors');
$error++; $error++;

View File

@ -730,6 +730,8 @@ else if ($action == 'addline' && $user->rights->commande->creer)
if ($result > 0) if ($result > 0)
{ {
$ret=$object->fetch($object->id); // Reload to get new records
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{ {
// Define output language // Define output language
@ -742,7 +744,6 @@ else if ($action == 'addline' && $user->rights->commande->creer)
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret=$object->fetch($object->id); // Reload to get new records
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010 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
@ -47,6 +47,8 @@ $id=GETPOST('account', 'int');
// Conciliation // Conciliation
if ($action == 'rappro' && $user->rights->banque->consolidate) if ($action == 'rappro' && $user->rights->banque->consolidate)
{ {
$error=0;
// Definition, nettoyage parametres // Definition, nettoyage parametres
$num_releve=trim($_POST["num_releve"]); $num_releve=trim($_POST["num_releve"]);
@ -54,25 +56,37 @@ if ($action == 'rappro' && $user->rights->banque->consolidate)
{ {
$bankline=new AccountLine($db); $bankline=new AccountLine($db);
if (isset($_POST["rowid"]) && is_array($_POST["rowid"])) if (isset($_POST['rowid']) && is_array($_POST['rowid']))
{ {
foreach($_POST["rowid"] as $row) foreach($_POST['rowid'] as $row)
{ {
if($row > 0) if($row > 0)
{ {
$result=$bankline->fetch($row); $result=$bankline->fetch($row);
$bankline->num_releve=$num_releve; //$_POST["num_releve"]; $bankline->num_releve=$num_releve; //$_POST["num_releve"];
$result=$bankline->update_conciliation($user,$_POST["cat"]); $result=$bankline->update_conciliation($user,$_POST["cat"]);
if ($result < 0) $mesg.=$bankline->error; if ($result < 0)
{
$mesg.=$bankline->error;
$error++;
break;
}
} }
} }
} }
} }
else else
{ {
$error++;
$langs->load("errors"); $langs->load("errors");
$mesg='<div class="error">'.$langs->trans("ErrorPleaseTypeBankTransactionReportName").'</div>'; $mesg='<div class="error">'.$langs->trans("ErrorPleaseTypeBankTransactionReportName").'</div>';
} }
if (! $error)
{
header('Location: '.DOL_URL_ROOT.'/compta/bank/rappro?account='.$id); // To avoid to submit twice and allow back
exit;
}
} }
/* /*
@ -80,12 +94,12 @@ if ($action == 'rappro' && $user->rights->banque->consolidate)
*/ */
if ($action == 'del') if ($action == 'del')
{ {
$accline=new AccountLine($db); $bankline=new AccountLine($db);
$accline->fetch($_GET["rowid"]); $bankline->fetch($_GET["rowid"]);
$result=$accline->delete(); $result=$bankline->delete($user);
if ($result < 0) if ($result < 0)
{ {
dol_print_error($db,$accline->error); dol_print_error($db,$bankline->error);
} }
} }
@ -200,7 +214,7 @@ if ($resql)
} }
print '<form method="post" action="rappro.php?account='.$acct->id.'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?account='.$acct->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"rappro\">"; print "<input type=\"hidden\" name=\"action\" value=\"rappro\">";
print "<input type=\"hidden\" name=\"account\" value=\"".$acct->id."\">"; print "<input type=\"hidden\" name=\"account\" value=\"".$acct->id."\">";
@ -212,8 +226,7 @@ if ($resql)
{ {
print $langs->trans("EventualyAddCategory").': <select class="flat" name="cat">'.$options.'</select><br>'; print $langs->trans("EventualyAddCategory").': <select class="flat" name="cat">'.$options.'</select><br>';
} }
print $langs->trans("ThenCheckLinesAndConciliate").' '; print '<br>'.$langs->trans("ThenCheckLinesAndConciliate").' "'.$langs->trans("Conciliate").'"<br>';
print "<input class=\"button\" type=\"submit\" value=\"".$langs->trans("Conciliate")."\"><br>";
print '<br>'; print '<br>';
@ -230,7 +243,6 @@ if ($resql)
print "</tr>\n"; print "</tr>\n";
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)
{ {
@ -265,7 +277,7 @@ if ($resql)
print '</td>'; print '</td>';
} }
// Number // Type + Number
$label=($langs->trans("PaymentType".$objp->type)!="PaymentType".$objp->type)?$langs->trans("PaymentType".$objp->type):$objp->type; // $objp->type is a code $label=($langs->trans("PaymentType".$objp->type)!="PaymentType".$objp->type)?$langs->trans("PaymentType".$objp->type):$objp->type; // $objp->type is a code
if ($label=='SOLD') $label=''; if ($label=='SOLD') $label='';
print '<td nowrap="nowrap">'.$label.($objp->num_chq?' '.$objp->num_chq:'').'</td>'; print '<td nowrap="nowrap">'.$label.($objp->num_chq?' '.$objp->num_chq:'').'</td>';
@ -400,12 +412,12 @@ if ($resql)
} }
// Affiche zone saisie releve + bouton "Rapprocher" // Show checkbox for conciliation
if ($db->jdate($objp->do) <= $now) if ($db->jdate($objp->do) <= $now)
{ {
print '<td align="center" nowrap="nowrap">'; print '<td align="center" nowrap="nowrap">';
print '<input class="flat" name="rowid[]" type="checkbox" value="'.$objp->rowid.'" size="1">'; print '<input class="flat" name="rowid['.$objp->rowid.']" type="checkbox" value="'.$objp->rowid.'" size="1"'.(! empty($_POST['rowid'][$objp->rowid])?' checked="checked"':'').'>';
// print '<input class="flat" name="num_releve" type="text" value="'.$objp->num_releve.'" size="8">'; // print '<input class="flat" name="num_releve" type="text" value="'.$objp->num_releve.'" size="8">';
// print ' &nbsp; '; // print ' &nbsp; ';
// print "<input class=\"button\" type=\"submit\" value=\"".$langs->trans("Conciliate")."\">"; // print "<input class=\"button\" type=\"submit\" value=\"".$langs->trans("Conciliate")."\">";
@ -429,13 +441,12 @@ if ($resql)
} }
$db->free($resql); $db->free($resql);
print "</table><br>\n";
print '<div align="right"><input class="button" type="submit" value="'.$langs->trans("Conciliate").'"></div><br>';
print "</form>\n"; print "</form>\n";
if ($num != 0)
{
print "</table><br>\n";
}
} }
else else
{ {

View File

@ -372,7 +372,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu
{ {
$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_INVOICE_MANDATORY'; $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_INVOICE_MANDATORY';
if (! $object->thirdparty->idprof.$i && ! empty($conf->global->$idprof_mandatory)) $idprof='idprof'.$i;
if (! $object->thirdparty->$idprof && ! empty($conf->global->$idprof_mandatory))
{ {
if (! $error) $langs->load("errors"); if (! $error) $langs->load("errors");
$error++; $error++;

View File

@ -140,7 +140,7 @@ if (empty($reshook))
$object->zip = $_POST["zipcode"]; $object->zip = $_POST["zipcode"];
$object->town = $_POST["town"]; $object->town = $_POST["town"];
$object->country_id = $_POST["country_id"]; $object->country_id = $_POST["country_id"];
$object->state_id = $_POST["departement_id"]; $object->state_id = $_POST["state_id"];
$object->email = $_POST["email"]; $object->email = $_POST["email"];
$object->phone_pro = $_POST["phone_pro"]; $object->phone_pro = $_POST["phone_pro"];
$object->phone_perso = $_POST["phone_perso"]; $object->phone_perso = $_POST["phone_perso"];
@ -239,7 +239,7 @@ if (empty($reshook))
$object->address = $_POST["address"]; $object->address = $_POST["address"];
$object->zip = $_POST["zipcode"]; $object->zip = $_POST["zipcode"];
$object->town = $_POST["town"]; $object->town = $_POST["town"];
$object->state_id = $_POST["departement_id"]; $object->state_id = $_POST["state_id"];
$object->country_id = $_POST["country_id"]; $object->country_id = $_POST["country_id"];
$object->email = $_POST["email"]; $object->email = $_POST["email"];
@ -889,7 +889,7 @@ else
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
$img=picto_from_langcode($object->country_code); $img=picto_from_langcode($object->country_code);
if ($img) print $img.' '; if ($img) print $img.' ';
print $object->country_id; print $object->country;
print '</td></tr>'; print '</td></tr>';
// State // State

View File

@ -87,7 +87,7 @@ class box_contacts extends ModeleBoxes
$datec=$db->jdate($objp->datec); $datec=$db->jdate($objp->datec);
$datem=$db->jdate($objp->tms); $datem=$db->jdate($objp->tms);
$contactstatic->name=$objp->name; $contactstatic->lastname=$objp->lastname;
$contactstatic->firstname=$objp->firstname; $contactstatic->firstname=$objp->firstname;
$contactstatic->civilite_id=$objp->civilite; $contactstatic->civilite_id=$objp->civilite;

View File

@ -622,7 +622,7 @@ class Translate
$newdir=dol_osencode($dir); $newdir=dol_osencode($dir);
// Check if directory exists // Check if directory exists
if (! dol_is_dir($dir)) continue; if (! is_dir($newdir)) continue; // We must not use dol_is_dir here, function may not be loaded
$fonc='numberwords'; $fonc='numberwords';
if (file_exists($newdir.'/functions_'.$fonc.'.lib.php')) if (file_exists($newdir.'/functions_'.$fonc.'.lib.php'))

View File

@ -301,6 +301,8 @@ TotalHT=Total (net of tax)
TotalTTC=Total (inc. tax) TotalTTC=Total (inc. tax)
TotalTTCToYourCredit=Total (inc. tax) to your credit TotalTTCToYourCredit=Total (inc. tax) to your credit
TotalVAT=Total tax TotalVAT=Total tax
TotalLT1=Total tax 2
TotalLT2=Total tax 3
TotalLT1ES=Total RE TotalLT1ES=Total RE
TotalLT2ES=Total IRPF TotalLT2ES=Total IRPF
IncludedVAT=Included tax IncludedVAT=Included tax

View File

@ -303,6 +303,8 @@ TotalHT=Total HT
TotalTTC=Total TTC TotalTTC=Total TTC
TotalTTCToYourCredit=Total TTC à votre crédit TotalTTCToYourCredit=Total TTC à votre crédit
TotalVAT=Total TVA TotalVAT=Total TVA
TotalLT1=Total Taxe 2
TotalLT2=Total Taxe 3
TotalLT1ES=Total RE TotalLT1ES=Total RE
TotalLT2ES=Total IRPF TotalLT2ES=Total IRPF
IncludedVAT=Dont TVA IncludedVAT=Dont TVA

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2001-2002 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2001-2002 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org> * Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
* *
@ -182,7 +182,7 @@ if ($action == 'add')
$error+=1; $error+=1;
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv('Nature'))."<br>\n"; $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv('Nature'))."<br>\n";
} }
if (empty($_POST["nom"])) if (empty($_POST["lastname"]))
{ {
$error+=1; $error+=1;
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Lastname"))."<br>\n"; $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Lastname"))."<br>\n";