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

This commit is contained in:
Laurent Destailleur 2012-11-29 13:20:53 +01:00
commit 17e0aedebb
76 changed files with 1265 additions and 701 deletions

View File

@ -547,7 +547,7 @@ if ($action == 'edit' || $action == 'updateedit')
/* /*
* Local Taxes * Local Taxes
*/ */
if ($mysoc->country_code=='ES') if ($mysoc->hasLocalTax(1))
{ {
// Local Tax 1 // Local Tax 1
print '<br>'; print '<br>';
@ -563,7 +563,8 @@ if ($action == 'edit' || $action == 'updateedit')
print '<td colspan="2">'; print '<td colspan="2">';
print "<table>"; print "<table>";
print "<tr><td>".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."</td></tr>"; print "<tr><td>".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."</td></tr>";
print "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."</i></td></tr>\n"; $example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code);
print ($example!="LocalTax1IsUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
print "</table>"; print "</table>";
print "</td></tr>\n"; print "</td></tr>\n";
@ -572,11 +573,14 @@ if ($action == 'edit' || $action == 'updateedit')
print '<td colspan="2">'; print '<td colspan="2">';
print "<table>"; print "<table>";
print "<tr><td>".$langs->transcountry("LocalTax1IsNotUsedDesc",$mysoc->country_code)."</td></tr>"; print "<tr><td>".$langs->transcountry("LocalTax1IsNotUsedDesc",$mysoc->country_code)."</td></tr>";
print "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."</i></td></tr>\n"; $example=$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code);
print ($example!="LocalTax1IsNotUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
print "</table>"; print "</table>";
print "</td></tr>\n"; print "</td></tr>\n";
print "</table>"; print "</table>";
}
if ($mysoc->hasLocalTax(2))
{
// Local Tax 2 // Local Tax 2
print '<br>'; print '<br>';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
@ -591,7 +595,8 @@ if ($action == 'edit' || $action == 'updateedit')
print '<td colspan="2">'; print '<td colspan="2">';
print "<table>"; print "<table>";
print "<tr><td>".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code)."</td></tr>"; print "<tr><td>".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code)."</td></tr>";
print "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."</i></td></tr>\n"; $example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code);
print ($example!="LocalTax2IsUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
print "</table>"; print "</table>";
print "</td></tr>\n"; print "</td></tr>\n";
@ -600,7 +605,8 @@ if ($action == 'edit' || $action == 'updateedit')
print '<td colspan="2">'; print '<td colspan="2">';
print "<table>"; print "<table>";
print "<tr><td>".$langs->transcountry("LocalTax2IsNotUsedDesc",$mysoc->country_code)."</td></tr>"; print "<tr><td>".$langs->transcountry("LocalTax2IsNotUsedDesc",$mysoc->country_code)."</td></tr>";
print "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."</i></td></tr>\n"; $example=$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code);
print ($example!="LocalTax2IsNotUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
print "</table>"; print "</table>";
print "</td></tr>\n"; print "</td></tr>\n";
print "</table>"; print "</table>";
@ -921,7 +927,7 @@ else
/* /*
* Local Taxes * Local Taxes
*/ */
if ($mysoc->country_code=='ES') if ($mysoc->hasLocalTax(1))
{ {
// Local Tax 1 // Local Tax 1
print '<br>'; print '<br>';
@ -937,7 +943,8 @@ else
print '<td colspan="2">'; print '<td colspan="2">';
print "<table>"; print "<table>";
print "<tr><td>".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."</td></tr>"; print "<tr><td>".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."</td></tr>";
print "<tr><td><i>".$langs->trans("Example",$mysoc->country_code).': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."</i></td></tr>\n"; $example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code);
print ($example!="LocalTax1IsUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
print "</table>"; print "</table>";
print "</td></tr>\n"; print "</td></tr>\n";
@ -946,12 +953,15 @@ else
print '<td colspan="2">'; print '<td colspan="2">';
print "<table>"; print "<table>";
print "<tr><td>".$langs->transcountry("LocalTax1IsNotUsedDesc",$mysoc->country_code)."</td></tr>"; print "<tr><td>".$langs->transcountry("LocalTax1IsNotUsedDesc",$mysoc->country_code)."</td></tr>";
print "<tr><td><i>".$langs->trans("Example",$mysoc->country_code).': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."</i></td></tr>\n"; $example=$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code);
print ($example!="LocalTax1IsNotUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
print "</table>"; print "</table>";
print "</td></tr>\n"; print "</td></tr>\n";
print "</table>"; print "</table>";
}
if ($mysoc->hasLocalTax(2))
{
// Local Tax 2 // Local Tax 2
print '<br>'; print '<br>';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
@ -966,7 +976,8 @@ else
print '<td colspan="2">'; print '<td colspan="2">';
print "<table>"; print "<table>";
print "<tr><td>".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code)."</td></tr>"; print "<tr><td>".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code)."</td></tr>";
print "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."</i></td></tr>\n"; $example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code);
print ($example!="LocalTax2IsUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
print "</table>"; print "</table>";
print "</td></tr>\n"; print "</td></tr>\n";
@ -975,7 +986,8 @@ else
print '<td colspan="2">'; print '<td colspan="2">';
print "<table>"; print "<table>";
print "<tr><td>".$langs->transcountry("LocalTax2IsNotUsedDesc",$mysoc->country_code)."</td></tr>"; print "<tr><td>".$langs->transcountry("LocalTax2IsNotUsedDesc",$mysoc->country_code)."</td></tr>";
print "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."</i></td></tr>\n"; $example=$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code);
print ($example!="LocalTax2IsNotUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
print "</table>"; print "</table>";
print "</td></tr>\n"; print "</td></tr>\n";

View File

@ -1066,7 +1066,6 @@ if ($id)
} }
} }
print '<td align="center" nowrap="nowrap">';
// Est-ce une entree du dictionnaire qui peut etre desactivee ? // Est-ce une entree du dictionnaire qui peut etre desactivee ?
$iserasable=1; // Oui par defaut $iserasable=1; // Oui par defaut
if (isset($obj->code) && ($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable=0; if (isset($obj->code) && ($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable=0;
@ -1074,8 +1073,14 @@ if ($id)
if (isset($obj->code) && $obj->code == 'EF0') $iserasable=0; if (isset($obj->code) && $obj->code == 'EF0') $iserasable=0;
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0; if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0;
// Active
print '<td align="center" nowrap="nowrap">';
if ($iserasable) print '<a href="'.$_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&amp;code='.(! empty($obj->code)?$obj->code:'').'&amp;id='.$id.'&amp;action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>'; if ($iserasable) print '<a href="'.$_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&amp;code='.(! empty($obj->code)?$obj->code:'').'&amp;id='.$id.'&amp;action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
else print $langs->trans("AlwaysActive"); else
{
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto')) && empty($obj->active)) print $langs->trans("Deprecated");
else print $langs->trans("AlwaysActive");
}
print "</td>"; print "</td>";
// Modify link // Modify link

View File

@ -477,12 +477,14 @@ class ActionComm extends CommonObject
* @param int $fk_element Id of element action is linked to * @param int $fk_element Id of element action is linked to
* @param string $elementtype Type of element action is linked to * @param string $elementtype Type of element action is linked to
* @param string $filter Other filter * @param string $filter Other filter
* @return int <0 if KO, >0 if OK * @return array <0 if KO, array with actions
*/ */
function getActions($socid=0, $fk_element=0, $elementtype='', $filter='') static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='')
{ {
global $conf, $langs; global $conf, $langs;
$resarray=array();
$sql = "SELECT a.id"; $sql = "SELECT a.id";
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a"; $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " WHERE a.entity = ".$conf->entity; $sql.= " WHERE a.entity = ".$conf->entity;
@ -495,27 +497,27 @@ class ActionComm extends CommonObject
if (! empty($filter)) $sql.= $filter; if (! empty($filter)) $sql.= $filter;
dol_syslog(get_class($this)."::getActions sql=".$sql); dol_syslog(get_class($this)."::getActions sql=".$sql);
$resql=$this->db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {
$num = $this->db->num_rows($resql); $num = $db->num_rows($resql);
if ($num) if ($num)
{ {
for($i=0;$i<$num;$i++) for($i=0;$i<$num;$i++)
{ {
$obj = $this->db->fetch_object($resql); $obj = $db->fetch_object($resql);
$actioncommstatic = new ActionComm($this->db); $actioncommstatic = new ActionComm($db);
$actioncommstatic->fetch($obj->id); $actioncommstatic->fetch($obj->id);
$this->actions[$i] = $actioncommstatic; $resarray[$i] = $actioncommstatic;
} }
} }
$this->db->free($resql); $db->free($resql);
return 1; return $resarray;
} }
else else
{ {
$this->error=$this->db->lasterror(); $this->error=$db->lasterror();
return -1; return -1;
} }
} }
@ -707,26 +709,34 @@ class ActionComm extends CommonObject
if ($option=='birthday') $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/contact/perso.php?id='.$this->id.'">'; if ($option=='birthday') $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/contact/perso.php?id='.$this->id.'">';
else $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$this->id.'">'; else $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$this->id.'">';
$lienfin='</a>'; $lienfin='</a>';
//print $this->libelle; $label=$this->label;
if (empty($label)) $label=$this->libelle; // Fro backward compatibility
//print 'rrr'.$this->libelle;
if ($withpicto == 2) if ($withpicto == 2)
{ {
$libelle=$langs->trans("Action".$this->type_code); $libelle=$label;
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $libelle=$langs->trans("Action".$this->type_code);
$libelleshort=''; $libelleshort='';
} }
else if (empty($this->libelle)) else if (empty($this->libelle))
{ {
$libelle=$langs->trans("Action".$this->type_code); $libelle=$label;
$libelleshort=$langs->trans("Action".$this->type_code,'','','','',$maxlength); if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $libelle=$langs->trans("Action".$this->type_code);
$libelleshort=dol_trunc($label, $maxlength);
} }
else else
{ {
$libelle=$this->libelle; $libelle=$label;
$libelleshort=dol_trunc($this->libelle,$maxlength); $libelleshort=dol_trunc($label,$maxlength);
} }
if ($withpicto) if ($withpicto)
{ {
$libelle.=(($this->type_code && $libelle!=$langs->trans("Action".$this->type_code) && $langs->trans("Action".$this->type_code)!="Action".$this->type_code)?' ('.$langs->trans("Action".$this->type_code).')':''); if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
$libelle.=(($this->type_code && $libelle!=$langs->trans("Action".$this->type_code) && $langs->trans("Action".$this->type_code)!="Action".$this->type_code)?' ('.$langs->trans("Action".$this->type_code).')':'');
}
$result.=$lien.img_object($langs->trans("ShowAction").': '.$libelle,($overwritepicto?$overwritepicto:'action')).$lienfin; $result.=$lien.img_object($langs->trans("ShowAction").': '.$libelle,($overwritepicto?$overwritepicto:'action')).$lienfin;
} }
if ($withpicto==1) $result.=' '; if ($withpicto==1) $result.=' ';

View File

@ -100,9 +100,10 @@ class CActionComm
* @param int $active 1 or 0 to filter on event state active or not ('' by default = no filter) * @param int $active 1 or 0 to filter on event state active or not ('' by default = no filter)
* @param string $idorcode 'id' or 'code' * @param string $idorcode 'id' or 'code'
* @param string $excludetype Type to exclude * @param string $excludetype Type to exclude
* @param string $onlyautoornot Group list by auto events or not
* @return array Array of all event types if OK, <0 if KO * @return array Array of all event types if OK, <0 if KO
*/ */
function liste_array($active='',$idorcode='id',$excludetype='') function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0)
{ {
global $langs,$conf; global $langs,$conf;
$langs->load("commercial"); $langs->load("commercial");
@ -110,7 +111,7 @@ class CActionComm
$repid = array(); $repid = array();
$repcode = array(); $repcode = array();
$sql = "SELECT id, code, libelle, module"; $sql = "SELECT id, code, libelle, module, type";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm"; $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm";
if ($active != '') $sql.=" WHERE active=".$active; if ($active != '') $sql.=" WHERE active=".$active;
if (! empty($excludetype)) $sql.=($active != ''?" AND":" WHERE")." type <> '".$excludetype."'"; if (! empty($excludetype)) $sql.=($active != ''?" AND":" WHERE")." type <> '".$excludetype."'";
@ -127,20 +128,31 @@ class CActionComm
while ($i < $nump) while ($i < $nump)
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$qualified=1; $qualified=1;
if ($obj->module)
// $obj->type can be system, systemauto, module, moduleauto, xxx, xxxauto
if ($qualified && $onlyautoornot && preg_match('/^system/',$obj->type) && ! preg_match('/^AC_OTH/',$obj->code)) $qualified=0; // We discard detailed system events. We keep only the 2 generic lines (AC_OTH and AC_OTHER)
if ($qualified && $obj->module)
{ {
if ($obj->module == 'invoice' && ! $conf->facture->enabled) $qualified=0; if ($obj->module == 'invoice' && ! $conf->facture->enabled) $qualified=0;
if ($obj->module == 'order' && ! $conf->commande->enabled) $qualified=0; if ($obj->module == 'order' && ! $conf->commande->enabled) $qualified=0;
if ($obj->module == 'propal' && ! $conf->propal->enabled) $qualified=0; if ($obj->module == 'propal' && ! $conf->propal->enabled) $qualified=0;
if ($obj->module == 'invoice_supplier' && ! $conf->fournisseur->enabled) $qualified=0; if ($obj->module == 'invoice_supplier' && ! $conf->fournisseur->enabled) $qualified=0;
if ($obj->module == 'order_supplier' && ! $conf->fournisseur->enabled) $qualified=0; if ($obj->module == 'order_supplier' && ! $conf->fournisseur->enabled) $qualified=0;
if ($obj->module == 'shipping' && ! $conf->expedition->enabled) $qualified=0;
} }
if ($qualified) if ($qualified)
{ {
$transcode=$langs->trans("Action".$obj->code); $code=$obj->code;
$repid[$obj->id] = ($transcode!="Action".$obj->code?$transcode:$langs->trans($obj->libelle)); if ($onlyautoornot && $code == 'AC_OTH') $code='AC_MANUAL';
$repcode[$obj->code] = ($transcode!="Action".$obj->code?$transcode:$langs->trans($obj->libelle)); if ($onlyautoornot && $code == 'AC_OTH_AUTO') $code='AC_AUTO';
$transcode=$langs->trans("Action".$code);
$repid[$obj->id] = ($transcode!="Action".$code?$transcode:$langs->trans($obj->libelle));
$repcode[$obj->code] = ($transcode!="Action".$code?$transcode:$langs->trans($obj->libelle));
if ($onlyautoornot && preg_match('/^module/',$obj->type) && $obj->module) $repcode[$obj->code].=' ('.$langs->trans("Module").': '.$obj->module.')';
} }
$i++; $i++;
} }

View File

@ -127,7 +127,10 @@ if ($objectid > 0)
print '</td></tr>'; print '</td></tr>';
// Type // Type
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>'; if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
}
// Title // Title
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$act->label.'</td></tr>'; print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$act->label.'</td></tr>';

View File

@ -107,6 +107,13 @@ if ($action == 'add_action')
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd")).'</div>'; $mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd")).'</div>';
} }
if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && ! GETPOST('label'))
{
$error++;
$action = 'create';
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("Title")).'</div>';
}
// Initialisation objet cactioncomm // Initialisation objet cactioncomm
if (! GETPOST('actioncode')) if (! GETPOST('actioncode'))
{ {
@ -122,13 +129,13 @@ if ($action == 'add_action')
// Initialisation objet actioncomm // Initialisation objet actioncomm
$actioncomm->type_id = $cactioncomm->id; $actioncomm->type_id = $cactioncomm->id;
$actioncomm->type_code = $cactioncomm->code; $actioncomm->type_code = $cactioncomm->code;
$actioncomm->priority = isset($_POST["priority"])?$_POST["priority"]:0; $actioncomm->priority = GETPOST("priority")?GETPOST("priority"):0;
$actioncomm->fulldayevent = (! empty($fulldayevent)?1:0); $actioncomm->fulldayevent = (! empty($fulldayevent)?1:0);
$actioncomm->location = isset($_POST["location"])?$_POST["location"]:''; $actioncomm->location = GETPOST("location");
$actioncomm->label = trim($_POST["label"]); $actioncomm->label = trim(GETPOST('label'));
if (! $_POST["label"]) if (! GETPOST('label'))
{ {
if ($_POST["actioncode"] == 'AC_RDV' && $contact->getFullName($langs)) if (GETPOST('actioncode') == 'AC_RDV' && $contact->getFullName($langs))
{ {
$actioncomm->label = $langs->transnoentitiesnoconv("TaskRDVWith",$contact->getFullName($langs)); $actioncomm->label = $langs->transnoentitiesnoconv("TaskRDVWith",$contact->getFullName($langs));
} }
@ -390,11 +397,13 @@ if ($action == 'create')
$(".fulldaystartmin").removeAttr("disabled"); $(".fulldaystartmin").removeAttr("disabled");
$(".fulldayendhour").removeAttr("disabled"); $(".fulldayendhour").removeAttr("disabled");
$(".fulldayendmin").removeAttr("disabled"); $(".fulldayendmin").removeAttr("disabled");
$("#p2").removeAttr("disabled");
} else { } else {
$(".fulldaystarthour").attr("disabled","disabled").val("00"); $(".fulldaystarthour").attr("disabled","disabled").val("00");
$(".fulldaystartmin").attr("disabled","disabled").val("00"); $(".fulldaystartmin").attr("disabled","disabled").val("00");
$(".fulldayendhour").attr("disabled","disabled").val("23"); $(".fulldayendhour").attr("disabled","disabled").val("23");
$(".fulldayendmin").attr("disabled","disabled").val("59"); $(".fulldayendmin").attr("disabled","disabled").val("59");
$("#p2").attr("disabled","disabled").val("");
} }
} }
setdatefields(); setdatefields();
@ -432,21 +441,25 @@ if ($action == 'create')
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Type d'action actifs // Type d'action actifs
print '<tr><td width="30%"><span class="fieldrequired">'.$langs->trans("Type").'</span></b></td><td>'; if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
if (GETPOST("actioncode"))
{ {
print '<input type="hidden" name="actioncode" value="'.GETPOST("actioncode").'">'."\n"; print '<tr><td width="30%"><span class="fieldrequired">'.$langs->trans("Type").'</span></b></td><td>';
$cactioncomm->fetch(GETPOST("actioncode")); if (GETPOST("actioncode"))
print $cactioncomm->getNomUrl(); {
print '<input type="hidden" name="actioncode" value="'.GETPOST("actioncode").'">'."\n";
$cactioncomm->fetch(GETPOST("actioncode"));
print $cactioncomm->getNomUrl();
}
else
{
$htmlactions->select_type_actions($actioncomm->type_code, "actioncode","systemauto");
}
print '</td></tr>';
} }
else else print '<input type="hidden" name="actioncode" value="AC_OTH">';
{
$htmlactions->select_type_actions($actioncomm->type_code, "actioncode","systemauto");
}
print '</td></tr>';
// Title // Title
print '<tr><td>'.$langs->trans("Title").'</td><td><input type="text" name="label" size="60" value="'.GETPOST('label').'"></td></tr>'; print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").'</td><td><input type="text" name="label" size="60" value="'.GETPOST('label').'"></td></tr>';
// Full day // Full day
print '<tr><td class="fieldrequired">'.$langs->trans("EventOnFullDay").'</td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday')?' checked="checked"':'').'></td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans("EventOnFullDay").'</td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday')?' checked="checked"':'').'></td></tr>';
@ -678,10 +691,13 @@ if ($id)
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">'.$act->id.'</td></tr>'; print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">'.$act->id.'</td></tr>';
// Type // Type
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>'; if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
}
// Title // Title
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" size="50" value="'.$act->label.'"></td></tr>'; print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" size="50" value="'.$act->label.'"></td></tr>';
// Full day event // Full day event
print '<tr><td class="fieldrequired">'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($act->fulldayevent?' checked="checked"':'').'></td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($act->fulldayevent?' checked="checked"':'').'></td></tr>';
@ -797,7 +813,10 @@ if ($id)
print '</td></tr>'; print '</td></tr>';
// Type // Type
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>'; if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
}
// Title // Title
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$act->label.'</td></tr>'; print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$act->label.'</td></tr>';

View File

@ -340,6 +340,7 @@ if ($action == 'create')
$langs->load("bills"); $langs->load("bills");
print '<center>'; print '<center>';
print '<input type="submit" class="button" value="'.$langs->trans("CreateDraft").'">'; print '<input type="submit" class="button" value="'.$langs->trans("CreateDraft").'">';
print '&nbsp;<input type="button" class="button" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">';
print '</center>'; print '</center>';
print "</form>"; print "</form>";

View File

@ -1565,21 +1565,19 @@ print '<td align="right" nowrap>'.price($object->total_tva).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>'; print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
// Amount Local Taxes // Amount Local Taxes
if ($mysoc->country_code=='ES') if ($mysoc->localtax1_assuj=="1") //Localtax1
{ {
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE print '<tr><td height="10">'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td>';
{ print '<td align="right" nowrap>'.price($object->total_localtax1).'</td>';
print '<tr><td height="10">'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td>'; print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
print '<td align="right" nowrap>'.price($object->total_localtax1).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
}
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{
print '<tr><td height="10">'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td>';
print '<td align="right" nowrap>'.price($object->total_localtax2).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
}
} }
if ($mysoc->localtax2_assuj=="1") //Localtax2
{
print '<tr><td height="10">'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td>';
print '<td align="right" nowrap>'.price($object->total_localtax2).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
}
// Amount TTC // Amount TTC
print '<tr><td height="10">'.$langs->trans('AmountTTC').'</td>'; print '<tr><td height="10">'.$langs->trans('AmountTTC').'</td>';

View File

@ -1581,18 +1581,16 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
print '<tr><td>'.$langs->trans($newclassname).'</td><td colspan="2">'.$objectsrc->getNomUrl(1).'</td></tr>'; print '<tr><td>'.$langs->trans($newclassname).'</td><td colspan="2">'.$objectsrc->getNomUrl(1).'</td></tr>';
print '<tr><td>'.$langs->trans('TotalHT').'</td><td colspan="2">'.price($objectsrc->total_ht).'</td></tr>'; print '<tr><td>'.$langs->trans('TotalHT').'</td><td colspan="2">'.price($objectsrc->total_ht).'</td></tr>';
print '<tr><td>'.$langs->trans('TotalVAT').'</td><td colspan="2">'.price($objectsrc->total_tva)."</td></tr>"; print '<tr><td>'.$langs->trans('TotalVAT').'</td><td colspan="2">'.price($objectsrc->total_tva)."</td></tr>";
if ($mysoc->country_code=='ES') if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
{ {
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td><td colspan="2">'.price($objectsrc->total_localtax1)."</td></tr>";
{
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td><td colspan="2">'.price($objectsrc->total_localtax1)."</td></tr>";
}
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td><td colspan="2">'.price($objectsrc->total_localtax2)."</td></tr>";
}
} }
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td><td colspan="2">'.price($objectsrc->total_localtax2)."</td></tr>";
}
print '<tr><td>'.$langs->trans('TotalTTC').'</td><td colspan="2">'.price($objectsrc->total_ttc)."</td></tr>"; print '<tr><td>'.$langs->trans('TotalTTC').'</td><td colspan="2">'.price($objectsrc->total_ttc)."</td></tr>";
} }
else else
@ -1814,11 +1812,8 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
if (! empty($conf->projet->enabled)) $nbrow++; if (! empty($conf->projet->enabled)) $nbrow++;
//Local taxes //Local taxes
if ($mysoc->country_code=='ES') if($mysoc->localtax1_assuj=="1") $nbrow++;
{ if($mysoc->localtax2_assuj=="1") $nbrow++;
if($mysoc->localtax1_assuj=="1") $nbrow++;
if($mysoc->localtax2_assuj=="1") $nbrow++;
}
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -2075,20 +2070,17 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>'; print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
// Amount Local Taxes // Amount Local Taxes
if ($mysoc->country_code=='ES') if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
{ {
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td>';
{ print '<td align="right">'.price($object->total_localtax1).'</td>';
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td>'; print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
print '<td align="right">'.price($object->total_localtax1).'</td>'; }
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>'; if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
} {
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td>';
{ print '<td align="right">'.price($object->total_localtax2).'</td>';
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td>'; print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
print '<td align="right">'.price($object->total_localtax2).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
}
} }
// Total TTC // Total TTC

View File

@ -757,6 +757,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
$object->amount = $_POST['amount']; $object->amount = $_POST['amount'];
$object->remise_absolue = $_POST['remise_absolue']; $object->remise_absolue = $_POST['remise_absolue'];
$object->remise_percent = $_POST['remise_percent']; $object->remise_percent = $_POST['remise_percent'];
$object->fetch_thirdparty();
// If creation from another object of another module (Example: origin=propal, originid=1) // If creation from another object of another module (Example: origin=propal, originid=1)
if ($_POST['origin'] && $_POST['originid']) if ($_POST['origin'] && $_POST['originid'])
@ -2078,17 +2079,14 @@ if ($action == 'create')
print '<tr><td>'.$langs->trans($newclassname).'</td><td colspan="2">'.$objectsrc->getNomUrl(1).'</td></tr>'; print '<tr><td>'.$langs->trans($newclassname).'</td><td colspan="2">'.$objectsrc->getNomUrl(1).'</td></tr>';
print '<tr><td>'.$langs->trans('TotalHT').'</td><td colspan="2">'.price($objectsrc->total_ht).'</td></tr>'; print '<tr><td>'.$langs->trans('TotalHT').'</td><td colspan="2">'.price($objectsrc->total_ht).'</td></tr>';
print '<tr><td>'.$langs->trans('TotalVAT').'</td><td colspan="2">'.price($objectsrc->total_tva)."</td></tr>"; print '<tr><td>'.$langs->trans('TotalVAT').'</td><td colspan="2">'.price($objectsrc->total_tva)."</td></tr>";
if ($mysoc->pays_code=='ES') if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
{ {
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->pays_code).'</td><td colspan="2">'.price($objectsrc->total_localtax1)."</td></tr>";
{ }
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->pays_code).'</td><td colspan="2">'.price($objectsrc->total_localtax1)."</td></tr>";
}
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{ {
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->pays_code).'</td><td colspan="2">'.price($objectsrc->total_localtax2)."</td></tr>"; print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->pays_code).'</td><td colspan="2">'.price($objectsrc->total_localtax2)."</td></tr>";
}
} }
print '<tr><td>'.$langs->trans('TotalTTC').'</td><td colspan="2">'.price($objectsrc->total_ttc)."</td></tr>"; print '<tr><td>'.$langs->trans('TotalTTC').'</td><td colspan="2">'.price($objectsrc->total_ttc)."</td></tr>";
} }
@ -2654,11 +2652,8 @@ else if ($id > 0 || ! empty($ref))
if (! empty($conf->banque->enabled)) $nbcols++; if (! empty($conf->banque->enabled)) $nbcols++;
//Local taxes //Local taxes
if ($mysoc->pays_code=='ES') if($mysoc->localtax1_assuj=="1") $nbrows++;
{ if($mysoc->localtax2_assuj=="1") $nbrows++;
if($mysoc->localtax1_assuj=="1") $nbrows++;
if($mysoc->localtax2_assuj=="1") $nbrows++;
}
print '<td rowspan="'.$nbrows.'" colspan="2" valign="top">'; print '<td rowspan="'.$nbrows.'" colspan="2" valign="top">';

View File

@ -546,17 +546,12 @@ class BonPrelevement extends CommonObject
// TODO Call trigger to create a notification using notification module // TODO Call trigger to create a notification using notification module
} }
else else
{ {
dol_syslog(get_class($this)."::set_infotrans Erreur 1", LOG_ERR); dol_syslog(get_class($this)."::set_infotrans Erreur 1", LOG_ERR);
dol_syslog($this->db->error()); dol_syslog($this->db->error());
$error++; $error++;
} }
/*
* End of procedure
*
*/
if ($error == 0) if ($error == 0)
{ {
$this->db->commit(); $this->db->commit();
@ -1047,6 +1042,44 @@ class BonPrelevement extends CommonObject
} }
/**
* Get object and lines from database
*
* @return int >0 if OK, <0 if KO
*/
function delete()
{
$this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_facture WHERE fk_prelevement_lignes IN (SELECT rowid FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = '".$this->id."')";
$resql1=$this->db->query($sql);
if (! $resql1) dol_print_error($this->db);
$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = '".$this->id."'";
$resql2=$this->db->query($sql);
if (! $resql2) dol_print_error($this->db);
$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_bons WHERE rowid = '".$this->id."'";
$resql3=$this->db->query($sql);
if (! $resql3) dol_print_error($this->db);
$sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_facture_demande SET fk_prelevement_bons = NULL, traite = 0 WHERE fk_prelevement_bons = '".$this->id."'";
$resql4=$this->db->query($sql);
if (! $resql4) dol_print_error($this->db);
if ($resql1 && $resql2 && $resql3)
{
$this->db->commit();
return 1;
}
else
{
$this->db->rollback();
return -1;
}
}
/** /**
* Returns clickable name (with picto) * Returns clickable name (with picto)
* *
@ -1595,20 +1628,20 @@ class BonPrelevement extends CommonObject
{ {
if ($statut==0) return img_picto($langs->trans($this->labelstatut[$statut]),'statut0').' '.$langs->trans($this->labelstatut[$statut]); if ($statut==0) return img_picto($langs->trans($this->labelstatut[$statut]),'statut0').' '.$langs->trans($this->labelstatut[$statut]);
if ($statut==1) return img_picto($langs->trans($this->labelstatut[$statut]),'statut1').' '.$langs->trans($this->labelstatut[$statut]); if ($statut==1) return img_picto($langs->trans($this->labelstatut[$statut]),'statut1').' '.$langs->trans($this->labelstatut[$statut]);
if ($statut==2) return img_picto($langs->trans($this->labelstatut[$statut]),'statut4').' '.$langs->trans($this->labelstatut[$statut]); if ($statut==2) return img_picto($langs->trans($this->labelstatut[$statut]),'statut6').' '.$langs->trans($this->labelstatut[$statut]);
} }
if ($mode == 2) if ($mode == 2)
{ {
if ($statut==0) return img_picto($langs->trans($this->labelstatut[$statut]),'statut0'); if ($statut==0) return img_picto($langs->trans($this->labelstatut[$statut]),'statut0');
if ($statut==1) return img_picto($langs->trans($this->labelstatut[$statut]),'statut1'); if ($statut==1) return img_picto($langs->trans($this->labelstatut[$statut]),'statut1');
if ($statut==2) return img_picto($langs->trans($this->labelstatut[$statut]),'statut4'); if ($statut==2) return img_picto($langs->trans($this->labelstatut[$statut]),'statut6');
} }
if ($mode == 3) if ($mode == 3)
{ {
if ($statut==0) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut0'); if ($statut==0) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut0');
if ($statut==1) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut1'); if ($statut==1) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut1');
if ($statut==2) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut4'); if ($statut==2) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut6');
} }
} }

View File

@ -103,8 +103,6 @@ $rej = new RejetPrelevement($db, $user);
/* /*
* Liste des factures * Liste des factures
*
*
*/ */
$sql = "SELECT pl.rowid, pl.amount, pl.statut"; $sql = "SELECT pl.rowid, pl.amount, pl.statut";
$sql.= " , s.rowid as socid, s.nom"; $sql.= " , s.rowid as socid, s.nom";
@ -141,10 +139,10 @@ if ($resql)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print "<tr $bc[$var]><td>"; print "<tr ".$bc[$var]."><td>";
print '<img border="0" src="./img/statut'.$obj->statut.'.png"></a>&nbsp;';
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid.'">';
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid.'">';
print img_picto('', 'statut'.$obj->statut).' ';
print substr('000000'.$obj->rowid, -6); print substr('000000'.$obj->rowid, -6);
print '</a></td>'; print '</a></td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n"; print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
@ -164,7 +162,7 @@ if ($resql)
print '<tr class="liste_total"><td>&nbsp;</td>'; print '<tr class="liste_total"><td>&nbsp;</td>';
print '<td class="liste_total">'.$langs->trans("Total").'</td>'; print '<td class="liste_total">'.$langs->trans("Total").'</td>';
print '<td align="right">'.price($total)."</td>\n"; print '<td align="right">'.price($total)."</td>\n";
print '<td>&nbsp;</td>'; print '<td colspan="3">&nbsp;</td>';
print "</tr>\n</table>\n"; print "</tr>\n</table>\n";
$db->free($resql); $db->free($resql);
} }

View File

@ -42,14 +42,28 @@ if ($user->societe_id > 0) accessforbidden();
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$id = GETPOST('id','int'); $id = GETPOST('id','int');
/* /*
* Actions * Actions
*/ */
if ( $action == 'confirm_delete' )
{
$bon = new BonPrelevement($db,"");
$bon->fetch($id);
$res=$bon->delete();
if ($res > 0)
{
header("Location: index.php");
exit;
}
}
if ( $action == 'confirm_credite' && GETPOST('confirm','alpha') == 'yes') if ( $action == 'confirm_credite' && GETPOST('confirm','alpha') == 'yes')
{ {
$bon = new BonPrelevement($db,""); $bon = new BonPrelevement($db,"");
$bon->id = $id; $bon->fetch($id);
$bon->set_credite(); $bon->set_credite();
header("Location: fiche.php?id=".$id); header("Location: fiche.php?id=".$id);
@ -63,14 +77,15 @@ if ($action == 'infotrans' && $user->rights->prelevement->bons->send)
$bon = new BonPrelevement($db,""); $bon = new BonPrelevement($db,"");
$bon->fetch($id); $bon->fetch($id);
$dt = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
/*
if ($_FILES['userfile']['name'] && basename($_FILES['userfile']['name'],".ps") == $bon->ref) if ($_FILES['userfile']['name'] && basename($_FILES['userfile']['name'],".ps") == $bon->ref)
{ {
$dir = $conf->prelevement->dir_output.'/receipts'; $dir = $conf->prelevement->dir_output.'/receipts';
if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $dir . "/" . dol_unescapefile($_FILES['userfile']['name']),1) > 0) if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $dir . "/" . dol_unescapefile($_FILES['userfile']['name']),1) > 0)
{ {
$dt = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
$bon->set_infotrans($user, $dt, GETPOST('methode','alpha')); $bon->set_infotrans($user, $dt, GETPOST('methode','alpha'));
} }
@ -81,6 +96,14 @@ if ($action == 'infotrans' && $user->rights->prelevement->bons->send)
{ {
dol_syslog("Fichier invalide",LOG_WARNING); dol_syslog("Fichier invalide",LOG_WARNING);
$mesg='BadFile'; $mesg='BadFile';
}*/
$error = $bon->set_infotrans($user, $dt, GETPOST('methode','alpha'));
if ($error)
{
header("Location: fiche.php?id=".$id."&error=$error");
exit;
} }
} }
@ -92,15 +115,11 @@ if ($action == 'infocredit' && $user->rights->prelevement->bons->credit)
$error = $bon->set_infocredit($user, $dt); $error = $bon->set_infocredit($user, $dt);
if ($error == 0) if ($error)
{
header("Location: fiche.php?id=".$id);
}
else
{ {
header("Location: fiche.php?id=".$id."&error=$error"); header("Location: fiche.php?id=".$id."&error=$error");
exit;
} }
exit;
} }
@ -108,132 +127,139 @@ if ($action == 'infocredit' && $user->rights->prelevement->bons->credit)
* View * View
*/ */
llxHeader('',$langs->trans("WithdrawalReceipt")); $bon = new BonPrelevement($db,"");
$form = new Form($db); $form = new Form($db);
if ($id) llxHeader('',$langs->trans("WithdrawalReceipt"));
if ($id > 0)
{ {
$bon = new BonPrelevement($db,""); $bon->fetch($id);
if ($bon->fetch($id) == 0) $head = prelevement_prepare_head($bon);
dol_fiche_head($head, 'prelevement', $langs->trans("WithdrawalReceipt"), '', 'payment');
if (GETPOST('error','alpha')!='')
{ {
$head = prelevement_prepare_head($bon); print '<div class="error">'.$bon->ReadError(GETPOST('error','alpha')).'</div>';
dol_fiche_head($head, 'prelevement', $langs->trans("WithdrawalReceipt"), '', 'payment'); }
if (GETPOST('error','alpha')!='') /*if ($action == 'credite')
{ {
print '<div class="error">'.$bon->ReadError(GETPOST('error','alpha')).'</div>'; $ret=$form->form_confirm("fiche.php?id=".$bon->id,$langs->trans("ClassCredited"),$langs->trans("ClassCreditedConfirm"),"confirm_credite",'',1,1);
} if ($ret == 'html') print '<br>';
}*/
if ($action == 'credite') print '<table class="border" width="100%">';
{
$ret=$form->form_confirm("fiche.php?id=".$bon->id,$langs->trans("ClassCredited"),$langs->trans("ClassCreditedConfirm"),"confirm_credite",'',1,1);
if ($ret == 'html') print '<br>';
}
print '<table class="border" width="100%">'; print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>'; // Status
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>'; print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>'; print '<td>'.$bon->getLibStatut(1).'</td>';
print '<tr><td width="20%">'.$langs->trans("File").'</td><td>'; print '</tr>';
$relativepath = 'receipts/'.$bon->ref; if($bon->date_trans <> 0)
{
print '<a href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>'; $muser = new User($db);
$muser->fetch($bon->user_trans);
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
print dol_print_date($bon->date_trans,'day');
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("TransMetod").'</td><td>';
print $bon->methodes_trans[$bon->method_trans];
print '</td></tr>'; print '</td></tr>';
// Status
print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
print '<td>'.$bon->getLibStatut(1).'</td>';
print '</tr>';
if($bon->date_trans <> 0)
{
$muser = new User($db);
$muser->fetch($bon->user_trans);
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
print dol_print_date($bon->date_trans,'day');
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("TransMetod").'</td><td>';
print $bon->methodes_trans[$bon->method_trans];
print '</td></tr>';
}
if($bon->date_credit <> 0)
{
print '<tr><td width="20%">'.$langs->trans('CreditDate').'</td><td>';
print dol_print_date($bon->date_credit,'day');
print '</td></tr>';
}
print '</table>';
dol_fiche_end();
if($bon->date_trans == 0 && $user->rights->prelevement->bons->send)
{
print '<form method="post" name="userfile" action="fiche.php?id='.$bon->id.'" enctype="multipart/form-data">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="infotrans">';
print '<table class="border" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("NotifyTransmision").'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
print $form->select_date('','','','','',"userfile");
print '</td></tr>';
print '<tr><td width="20%">'.$langs->trans("TransMetod").'</td><td>';
print $form->selectarray("methode",$bon->methodes_trans);
print '</td></tr>';
print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
print '<input type="hidden" name="max_file_size" value="'.$conf->maxfilesize.'">';
print '<input class="flat" type="file" name="userfile"><br>';
print '</td></tr>';
print '</table><br>';
print '<center><input type="submit" class="button" value="'.$langs->trans("Send").'">';
print '</form>';
}
if($bon->date_trans <> 0 && $bon->date_credit == 0 && $user->rights->prelevement->bons->credit)
{
print '<form name="infocredit" method="post" action="fiche.php?id='.$bon->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="infocredit">';
print '<table class="border" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("NotifyCredit").'</td></tr>';
print '<tr><td width="20%">'.$langs->trans('CreditDate').'</td><td>';
print $form->select_date('','','','','',"infocredit");
print '</td></tr>';
print '</table><br>';
print '<center><input type="submit" class="button" value="'.$langs->trans("ClassCredited").'">';
print '</form>';
}
} }
else if($bon->date_credit <> 0)
{ {
dol_print_error($db); print '<tr><td width="20%">'.$langs->trans('CreditDate').'</td><td>';
print dol_print_date($bon->date_credit,'day');
print '</td></tr>';
}
print '</table>';
print '<br>';
print '<table class="border" width="100%"><tr><td width="20%">';
print $langs->trans("WithdrawalFile").'</td><td>';
$relativepath = 'receipts/'.$bon->ref;
print '<a href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
print '</td></tr></table>';
dol_fiche_end();
if (empty($bon->date_trans) && $user->rights->prelevement->bons->send && $action=='settransmitted')
{
print '<form method="post" name="userfile" action="fiche.php?id='.$bon->id.'" enctype="multipart/form-data">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="infotrans">';
print '<table class="border" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("NotifyTransmision").'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
print $form->select_date('','','','','',"userfile",1,1);
print '</td></tr>';
print '<tr><td width="20%">'.$langs->trans("TransMetod").'</td><td>';
print $form->selectarray("methode",$bon->methodes_trans);
print '</td></tr>';
/* print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
print '<input type="hidden" name="max_file_size" value="'.$conf->maxfilesize.'">';
print '<input class="flat" type="file" name="userfile"><br>';
print '</td></tr>';*/
print '</table><br>';
print '<center><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("SetToStatusSent")).'">';
print '</form>';
}
if (! empty($bon->date_trans) && $bon->date_credit == 0 && $user->rights->prelevement->bons->credit && $action=='setcredited')
{
print '<form name="infocredit" method="post" action="fiche.php?id='.$bon->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="infocredit">';
print '<table class="border" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("NotifyCredit").'</td></tr>';
print '<tr><td width="20%">'.$langs->trans('CreditDate').'</td><td>';
print $form->select_date('','','','','',"infocredit",1,1);
print '</td></tr>';
print '</table>';
print '<br>'.$langs->trans("ThisWillAlsoAddPaymentOnInvoice");
print '<center><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("ClassCredited")).'">';
print '</form>';
}
// Actions
if ($action != 'settransmitted' && $action != 'setcredited')
{
print "\n<div class=\"tabsAction\">\n";
if (empty($bon->date_trans) && $user->rights->prelevement->bons->send)
{
print "<a class=\"butAction\" href=\"fiche.php?action=settransmitted&id=".$bon->id."\">".$langs->trans("SetToStatusSent")."</a>";
}
if (! empty($bon->date_trans) && $bon->date_credit == 0)
{
print "<a class=\"butAction\" href=\"fiche.php?action=setcredited&id=".$bon->id."\">".$langs->trans("ClassCredited")."</a>";
}
print "<a class=\"butActionDelete\" href=\"fiche.php?action=confirm_delete&id=".$bon->id."\">".$langs->trans("Delete")."</a>";
print "</div>";
} }
} }
/* ************************************************************************** */
/* */
/* Barre d'action */
/* */
/* ************************************************************************** */
/*
print "\n</div>\n<div class=\"tabsAction\">\n";
if ($bon->statut == 0)
{
print "<a class=\"butAction\" href=\"fiche.php?action=credite&amp;id=$bon->id\">".$langs->trans("ClassCredited")."</a>";
}
*/
print "</div>";
$db->close();
llxFooter(); llxFooter();
$db->close();
?> ?>

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* *
@ -93,10 +93,10 @@ print '</td><td valign="top" width="70%">';
* Withdraw receipts * Withdraw receipts
*/ */
$limit=5; $limit=5;
$sql = "SELECT p.rowid, p.ref, p.amount, p.datec"; $sql = "SELECT p.rowid, p.ref, p.amount, p.datec, p.statut";
$sql .= " ,p.statut "; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql.= " ORDER BY datec DESC";
$sql .= " ORDER BY datec DESC LIMIT ".$limit; $sql.= $db->plimit($limit);
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
@ -110,6 +110,7 @@ if ($result)
print '<tr class="liste_titre"><td>'.$langs->trans("LastWithdrawalReceipt",$limit).'</td>'; print '<tr class="liste_titre"><td>'.$langs->trans("LastWithdrawalReceipt",$limit).'</td>';
print '<td>'.$langs->trans("Date").'</td>'; print '<td>'.$langs->trans("Date").'</td>';
print '<td align="right">'.$langs->trans("Amount").'</td>'; print '<td align="right">'.$langs->trans("Amount").'</td>';
print '<td align="right">'.$langs->trans("Status").'</td>';
print '</tr>'; print '</tr>';
while ($i < min($num,$limit)) while ($i < min($num,$limit))
@ -117,15 +118,17 @@ if ($result)
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
$var=!$var; $var=!$var;
print "<tr $bc[$var]><td>"; print "<tr ".$bc[$var].">";
print '<img border="0" src="./img/statut'.$obj->statut.'.png"></a>&nbsp;';
print '<a href="fiche.php?id='.$obj->rowid.'">'.$obj->ref."</a></td>\n";
print "<td>";
$bprev->id=$obj->rowid;
$bprev->ref=$obj->ref;
$bprev->statut=$obj->statut;
print $bprev->getNomUrl(1);
print "</td>\n";
print '<td>'.dol_print_date($db->jdate($obj->datec),"dayhour")."</td>\n"; print '<td>'.dol_print_date($db->jdate($obj->datec),"dayhour")."</td>\n";
print '<td align="right">'.price($obj->amount)."</td>\n"; print '<td align="right">'.price($obj->amount)."</td>\n";
print '<td align="right">'.$bprev->getLibStatut(3)."</td>\n";
print "</tr>\n"; print "</tr>\n";
$i++; $i++;

View File

@ -361,7 +361,7 @@ else
$object->state_id = $_POST["state_id"]; $object->state_id = $_POST["state_id"];
// We set country_id, country_code and label for the selected country // We set country_id, country_code and label for the selected country
$object->country_id=$_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id; $object->country_id=$_POST["country_id"]?$_POST["country_id"]:(empty($objsoc->country_id)?$mysoc->country_id:$objsoc->country_id);
if ($object->country_id) if ($object->country_id)
{ {
$tmparray=getCountry($object->country_id,'all'); $tmparray=getCountry($object->country_id,'all');
@ -460,7 +460,6 @@ else
print '</td></tr>'; print '</td></tr>';
// Country // Country
if (dol_strlen(trim($object->fk_pays)) == 0) $object->fk_pays = $objsoc->country_id; // Predefined with third party
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="'.$colspan.'">'; print '<tr><td>'.$langs->trans("Country").'</td><td colspan="'.$colspan.'">';
print $form->select_country((isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id),'country_id'); print $form->select_country((isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id),'country_id');
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);

View File

@ -221,14 +221,16 @@ abstract class CommonObject
* @param int $rowid Id of line contact-element * @param int $rowid Id of line contact-element
* @param int $statut New status of link * @param int $statut New status of link
* @param int $type_contact_id Id of contact type (not modified if 0) * @param int $type_contact_id Id of contact type (not modified if 0)
* @param int $fk_socpeople Id of soc_people to update (not modified if 0)
* @return int <0 if KO, >= 0 if OK * @return int <0 if KO, >= 0 if OK
*/ */
function update_contact($rowid, $statut, $type_contact_id=0) function update_contact($rowid, $statut, $type_contact_id=0, $fk_socpeople=0)
{ {
// Insertion dans la base // Insertion dans la base
$sql = "UPDATE ".MAIN_DB_PREFIX."element_contact set"; $sql = "UPDATE ".MAIN_DB_PREFIX."element_contact set";
$sql.= " statut = ".$statut; $sql.= " statut = ".$statut;
if ($type_contact_id) $sql.= ", fk_c_type_contact = '".$type_contact_id ."'"; if ($type_contact_id) $sql.= ", fk_c_type_contact = '".$type_contact_id ."'";
if ($fk_socpeople) $sql.= ", fk_socpeople = '".$fk_socpeople ."'";
$sql.= " where rowid = ".$rowid; $sql.= " where rowid = ".$rowid;
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
@ -1516,27 +1518,49 @@ abstract class CommonObject
$this->total_localtax2 += $obj->total_localtax2; $this->total_localtax2 += $obj->total_localtax2;
$this->total_ttc += $obj->total_ttc; $this->total_ttc += $obj->total_ttc;
// Define vatrates with totals for each line and for all lines // Check if global invoice tax for this vat rate
// TODO $vatrates and $vatrates_alllines not used ? if (! empty($obj->vatrate))
if (! empty($this->vatrate))
{ {
$vatrates[$this->vatrate][]=array( if ($this->total_localtax1 == 0)
'total_ht' =>$obj->total_ht, {
'total_tva' =>$obj->total_tva, // Search local taxes
'total_ttc' =>$obj->total_ttc, $sql = "SELECT t.localtax1, t.localtax1_type";
'total_localtax1'=>$obj->total_localtax1, $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
'total_localtax2'=>$obj->total_localtax2 $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$this->client->country_code."'";
); $sql .= " AND t.taux = ".$obj->vatrate." AND t.active = 1";
if (! isset($vatrates_alllines[$this->vatrate]['total_ht'])) $vatrates_alllines[$this->vatrate]['total_ht']=0;
if (! isset($vatrates_alllines[$this->vatrate]['total_tva'])) $vatrates_alllines[$this->vatrate]['total_tva']=0; dol_syslog("get_localtax sql=".$sql);
if (! isset($vatrates_alllines[$this->vatrate]['total_localtax1'])) $vatrates_alllines[$this->vatrate]['total_localtax1']=0; $resqlt=$this->db->query($sql);
if (! isset($vatrates_alllines[$this->vatrate]['total_localtax2'])) $vatrates_alllines[$this->vatrate]['total_localtax2']=0; if ($resqlt)
if (! isset($vatrates_alllines[$this->vatrate]['total_ttc'])) $vatrates_alllines[$this->vatrate]['total_ttc']=0; {
$vatrates_alllines[$this->vatrate]['total_ht'] +=$obj->total_ht; $objt = $this->db->fetch_object($resqlt);
$vatrates_alllines[$this->vatrate]['total_tva'] +=$obj->total_tva; if ($objt->localtax1_type == '7')
$vatrates_alllines[$this->vatrate]['total_localtax1']+=$obj->total_localtax1; {
$vatrates_alllines[$this->vatrate]['total_localtax2']+=$obj->total_localtax2; $this->total_localtax1 += $objt->localtax1;
$vatrates_alllines[$this->vatrate]['total_ttc'] +=$obj->total_ttc; $this->total_ttc += $objt->localtax1;
}
}
}
if ($this->total_localtax2 == 0)
{
// Search local taxes
$sql = "SELECT t.localtax2, t.localtax2_type";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
$sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$this->client->country_code."'";
$sql .= " AND t.taux = ".$obj->vatrate." AND t.active = 1";
dol_syslog("get_localtax sql=".$sql);
$resqlt=$this->db->query($sql);
if ($resqlt)
{
$objt = $this->db->fetch_object($resqlt);
if ($objt->localtax2_type == '7')
{
$this->total_localtax2 += $objt->localtax2;
$this->total_ttc += $objt->localtax2;
}
}
}
} }
$i++; $i++;
@ -1544,21 +1568,6 @@ abstract class CommonObject
$this->db->free($resql); $this->db->free($resql);
// TODO
if ($roundingadjust)
{
// For each vatrate, calculate if two method of calculation differs
// If it differs
if (1==2)
{
// Adjust a line and update it
}
}
// Now update global field total_ht, total_ttc and tva // Now update global field total_ht, total_ttc and tva
$fieldht='total_ht'; $fieldht='total_ht';
$fieldtva='tva'; $fieldtva='tva';

View File

@ -165,6 +165,10 @@ class Form
{ {
$ret.=$this->form_date($_SERVER['PHP_SELF'].'?id='.$object->id,$value,$htmlname); $ret.=$this->form_date($_SERVER['PHP_SELF'].'?id='.$object->id,$value,$htmlname);
} }
else if ($typeofdata == 'datehourpicker')
{
$ret.=$this->form_date($_SERVER['PHP_SELF'].'?id='.$object->id,$value,$htmlname,1,1);
}
else if (preg_match('/^select;/',$typeofdata)) else if (preg_match('/^select;/',$typeofdata))
{ {
$arraydata=explode(',',preg_replace('/^select;/','',$typeofdata)); $arraydata=explode(',',preg_replace('/^select;/','',$typeofdata));
@ -183,7 +187,7 @@ class Form
$ret.=$doleditor->Create(1); $ret.=$doleditor->Create(1);
} }
$ret.='</td>'; $ret.='</td>';
if ($typeofdata != 'day' && $typeofdata != 'datepicker') $ret.='<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>'; if ($typeofdata != 'day' && $typeofdata != 'datepicker' && $typeofdata != 'datehourpicker') $ret.='<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
$ret.='</tr></table>'."\n"; $ret.='</tr></table>'."\n";
$ret.='</form>'."\n"; $ret.='</form>'."\n";
} }
@ -192,6 +196,7 @@ class Form
if ($typeofdata == 'email') $ret.=dol_print_email($value,0,0,0,0,1); if ($typeofdata == 'email') $ret.=dol_print_email($value,0,0,0,0,1);
elseif (preg_match('/^text/',$typeofdata) || preg_match('/^note/',$typeofdata)) $ret.=dol_htmlentitiesbr($value); elseif (preg_match('/^text/',$typeofdata) || preg_match('/^note/',$typeofdata)) $ret.=dol_htmlentitiesbr($value);
elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') $ret.=dol_print_date($value,'day'); elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') $ret.=dol_print_date($value,'day');
elseif ($typeofdata == 'datehourpicker') $ret.=dol_print_date($value,'dayhour');
else if (preg_match('/^select;/',$typeofdata)) else if (preg_match('/^select;/',$typeofdata))
{ {
$arraydata=explode(',',preg_replace('/^select;/','',$typeofdata)); $arraydata=explode(',',preg_replace('/^select;/','',$typeofdata));
@ -272,7 +277,7 @@ class Form
if (! empty($tmp[1])) $inputOption=$tmp[1]; if (! empty($tmp[1])) $inputOption=$tmp[1];
if (! empty($tmp[2])) $savemethod=$tmp[2]; if (! empty($tmp[2])) $savemethod=$tmp[2];
} }
else if (preg_match('/^datepicker/',$inputType)) else if ((preg_match('/^datepicker/',$inputType)) || (preg_match('/^datehourpicker/',$inputType)))
{ {
$tmp=explode(':',$inputType); $tmp=explode(':',$inputType);
$inputType=$tmp[0]; $inputType=$tmp[0];
@ -2613,9 +2618,11 @@ class Form
* @param string $page Page * @param string $page Page
* @param string $selected Date preselected * @param string $selected Date preselected
* @param string $htmlname Name of input html field * @param string $htmlname Name of input html field
* @param int $displayhour Display hour selector
* @param int $displaymin Display minutes selector
* @return void * @return void
*/ */
function form_date($page, $selected, $htmlname) function form_date($page, $selected, $htmlname,$displayhour=0,$displaymin=0)
{ {
global $langs; global $langs;
@ -2626,7 +2633,7 @@ class Form
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">'; print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>'; print '<tr><td>';
print $this->select_date($selected,$htmlname,0,0,1,'form'.$htmlname); print $this->select_date($selected,$htmlname,$displayhour,$displaymin,1,'form'.$htmlname);
print '</td>'; print '</td>';
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>'; print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print '</tr></table></form>'; print '</tr></table></form>';

View File

@ -144,10 +144,10 @@ class FormActions
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$actioncomm = new ActionComm($this->db); $listofactions=ActionComm::getActions($this->db, $socid, $object->id, $typeelement);
$actioncomm->getActions($socid, $object->id, $typeelement); if (is_numeric($listofactions) && $listofactions < 0) dol_print_error($this->db,'FailedToGetActions');
$num = count($actioncomm->actions); $num = count($listofactions);
if ($num) if ($num)
{ {
if ($typeelement == 'invoice') $title=$langs->trans('ActionsOnBill'); if ($typeelement == 'invoice') $title=$langs->trans('ActionsOnBill');
@ -164,17 +164,29 @@ class FormActions
$total = 0; $var=true; $total = 0; $var=true;
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><th class="liste_titre">'.$langs->trans('Ref').'</th><th class="liste_titre">'.$langs->trans('Date').'</th><th class="liste_titre">'.$langs->trans('Action').'</th><th class="liste_titre">'.$langs->trans('By').'</th></tr>'; print '<tr class="liste_titre">';
print '<th class="liste_titre">'.$langs->trans('Ref').'</th>';
print '<th class="liste_titre">'.$langs->trans('Action').'</th>';
print '<th class="liste_titre">'.$langs->trans('Date').'</th>';
print '<th class="liste_titre">'.$langs->trans('By').'</th>';
print '</tr>';
print "\n"; print "\n";
foreach($actioncomm->actions as $action) $userstatic = new User($this->db);
foreach($listofactions as $action)
{ {
$savlabel=$action->label;
$action->label=$action->ref;
$ref=$action->getNomUrl(1);
$action->label=$savlabel;
$label=$action->getNomUrl(0,38);
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'.$action->getNomUrl(1).'</td>'; print '<td>'.$ref.'</td>';
print '<td>'.$label.'</td>';
print '<td>'.dol_print_date($action->datep,'day').'</td>'; print '<td>'.dol_print_date($action->datep,'day').'</td>';
print '<td title="'.dol_escape_htmltag($action->label).'">'.dol_trunc($action->label,32).'</td>';
$userstatic = new User($this->db);
$userstatic->id = $action->author->id; $userstatic->id = $action->author->id;
$userstatic->firstname = $action->author->firstname; $userstatic->firstname = $action->author->firstname;
$userstatic->lastname = $action->author->lastname; $userstatic->lastname = $action->author->lastname;
@ -194,9 +206,10 @@ class FormActions
* @param string $selected Type pre-selectionne * @param string $selected Type pre-selectionne
* @param string $htmlname Nom champ formulaire * @param string $htmlname Nom champ formulaire
* @param string $excludetype Type to exclude * @param string $excludetype Type to exclude
* @param string $onlyautoornot Group list by auto events or not
* @return void * @return void
*/ */
function select_type_actions($selected='',$htmlname='actioncode',$excludetype='') function select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0)
{ {
global $langs,$user; global $langs,$user;
@ -205,12 +218,13 @@ class FormActions
$caction=new CActionComm($this->db); $caction=new CActionComm($this->db);
$form=new Form($this->db); $form=new Form($this->db);
$arraylist=$caction->liste_array(1, 'code', $excludetype); // Suggest a list with manual event or all auto events
array_unshift($arraylist,'&nbsp;'); // Add empty line at start $arraylist=$caction->liste_array(1, 'code', $excludetype, $onlyautoornot);
//asort($arraylist); array_unshift($arraylist,'&nbsp;'); // Add empty line at start
//asort($arraylist);
print $form->selectarray($htmlname, $arraylist, $selected); print $form->selectarray($htmlname, $arraylist, $selected);
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); if ($user->admin && empty($onlyautoornot)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
} }
} }

View File

@ -93,7 +93,10 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt
print '<td nowrap="nowrap">'; print '<td nowrap="nowrap">';
print $langs->trans("Type"); print $langs->trans("Type");
print ' &nbsp;</td><td nowrap="nowrap">'; print ' &nbsp;</td><td nowrap="nowrap">';
print $formactions->select_type_actions(GETPOST('actioncode'), "actioncode");
// print $formactions->select_type_actions(GETPOST('actioncode'), "actioncode");
print $formactions->select_type_actions(GETPOST('actioncode')?GETPOST('actioncode'):'manual', "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0));
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -777,7 +777,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
if (get_class($object) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m"; if (get_class($object) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
if (get_class($object) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; if (get_class($object) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql.= " WHERE u.rowid = a.fk_user_author"; $sql.= " WHERE u.rowid = a.fk_user_author";
$sql.= " AND a.entity IN (".getEntity('actioncomm').")"; $sql.= " AND a.entity IN (".getEntity('agenda', 1).")";
if (get_class($object) == 'Adherent') { if (get_class($object) == 'Adherent') {
$sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'"; $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
if (! empty($object->id)) if (! empty($object->id))
@ -916,7 +916,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
if (get_class($object) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m"; if (get_class($object) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
if (get_class($object) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; if (get_class($object) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql.= " WHERE u.rowid = a.fk_user_author"; $sql.= " WHERE u.rowid = a.fk_user_author";
$sql.= " AND a.entity IN (".getEntity('actioncomm').")"; $sql.= " AND a.entity IN (".getEntity('agenda', 1).")";
if (get_class($object) == 'Adherent') $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'"; if (get_class($object) == 'Adherent') $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
if (get_class($object) == 'Adherent' && $object->id) $sql.= " AND a.fk_element = ".$object->id; if (get_class($object) == 'Adherent' && $object->id) $sql.= " AND a.fk_element = ".$object->id;
if (get_class($object) == 'Societe' && $object->id) $sql.= " AND a.fk_soc = ".$object->id; if (get_class($object) == 'Societe' && $object->id) $sql.= " AND a.fk_soc = ".$object->id;

View File

@ -2703,9 +2703,8 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
// Some test to guess with no need to make database access // Some test to guess with no need to make database access
if ($mysoc->country_code == 'ES') // For spain, localtaxes are qualified if both supplier and seller use local taxe if ($mysoc->country_code == 'ES') // For spain, localtaxes are qualified if both supplier and seller use local taxe
{ {
if ($local == 1 && (! $thirdparty_seller->localtax1_assuj || ! $thirdparty_buyer->localtax1_assuj)) return 0; if ($local == 1 && ! $thirdparty_buyer->localtax1_assuj) return 0;
if ($local == 2 && (! $thirdparty_seller->localtax2_assuj || ! $thirdparty_buyer->localtax2_assuj)) return 0; if ($local == 2 && ! $thirdparty_seller->localtax2_assuj) return 0;
} }
else else
{ {
@ -2722,7 +2721,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
} }
// Search local taxes // Search local taxes
$sql = "SELECT t.localtax1, t.localtax2"; $sql = "SELECT t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
$sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$code_country."'"; $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$code_country."'";
$sql .= " AND t.taux = ".$tva." AND t.active = 1"; $sql .= " AND t.taux = ".$tva." AND t.active = 1";
@ -2732,9 +2731,8 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
if ($resql) if ($resql)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
if ($local==1) return $obj->localtax1; if ($local==1 && $obj->localtax1_type != '7') return $obj->localtax1;
elseif ($local==2) return $obj->localtax2; elseif ($local==2 && $obj->localtax2_type != '7') return $obj->localtax2;
//else return array($obj->localtax1,$obj->localtax2);
} }
return 0; return 0;
@ -2995,18 +2993,27 @@ function get_default_npr($thirdparty_seller, $thirdparty_buyer, $idprod)
*/ */
function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $idprod=0) function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $idprod=0)
{ {
global $mysoc;
if (!is_object($thirdparty_seller)) return -1; if (!is_object($thirdparty_seller)) return -1;
if (!is_object($thirdparty_buyer)) return -1; if (!is_object($thirdparty_buyer)) return -1;
if ($local==1) //RE if ($local==1) // Localtax 1
{ {
// Si vendeur non assujeti a RE, localtax1 par default=0 if ($mysoc->country_code == 'ES')
if (is_numeric($thirdparty_seller->localtax1_assuj) && ! $thirdparty_seller->localtax1_assuj) return 0; {
if (! is_numeric($thirdparty_seller->localtax1_assuj) && $thirdparty_seller->localtax1_assuj=='localtax1off') return 0; if (is_numeric($thirdparty_buyer->localtax1_assuj) && ! $thirdparty_buyer->localtax1_assuj) return 0;
}
else
{
// Si vendeur non assujeti a Localtax1, localtax1 par default=0
if (is_numeric($thirdparty_seller->localtax1_assuj) && ! $thirdparty_seller->localtax1_assuj) return 0;
if (! is_numeric($thirdparty_seller->localtax1_assuj) && $thirdparty_seller->localtax1_assuj=='localtax1off') return 0;
}
} }
elseif ($local==2) //IRPF elseif ($local==2) //I Localtax 2
{ {
// Si vendeur non assujeti a IRPF, localtax2 par default=0 // Si vendeur non assujeti a Localtax2, localtax2 par default=0
if (is_numeric($thirdparty_seller->localtax2_assuj) && ! $thirdparty_seller->localtax2_assuj) return 0; if (is_numeric($thirdparty_seller->localtax2_assuj) && ! $thirdparty_seller->localtax2_assuj) return 0;
if (! is_numeric($thirdparty_seller->localtax2_assuj) && $thirdparty_seller->localtax2_assuj=='localtax2off') return 0; if (! is_numeric($thirdparty_seller->localtax2_assuj) && $thirdparty_seller->localtax2_assuj=='localtax2off') return 0;
} }

View File

@ -119,6 +119,8 @@ class pdf_einstein extends ModelePDFCommandes
$this->tva=array(); $this->tva=array();
$this->localtax1=array(); $this->localtax1=array();
$this->localtax2=array(); $this->localtax2=array();
$this->localtax1_type=array();
$this->localtax2_type=array();
$this->atleastoneratenotnull=0; $this->atleastoneratenotnull=0;
$this->atleastonediscount=0; $this->atleastonediscount=0;
} }
@ -150,8 +152,6 @@ class pdf_einstein extends ModelePDFCommandes
$outputlangs->load("products"); $outputlangs->load("products");
$outputlangs->load("orders"); $outputlangs->load("orders");
$default_font_size = pdf_getPDFFontSize($outputlangs);
if ($conf->commande->dir_output) if ($conf->commande->dir_output)
{ {
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -186,7 +186,8 @@ class pdf_einstein extends ModelePDFCommandes
// Create pdf instance // Create pdf instance
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$heightforinfotot = 50; // Height reserved to output the info and total part $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0); $pdf->SetAutoPageBreak(1,0);
@ -370,16 +371,24 @@ class pdf_einstein extends ModelePDFCommandes
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100; if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
$vatrate=(string) $object->lines[$i]->tva_tx; $vatrate=(string) $object->lines[$i]->tva_tx;
$localtax1rate=(string) $object->lines[$i]->localtax1_tx;
$localtax2rate=(string) $object->lines[$i]->localtax2_tx;
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*'; if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=''; if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
if (! isset($this->localtax1[$localtax1rate])) $this->localtax1[$localtax1rate]='';
if (! isset($this->localtax2[$localtax2rate])) $this->localtax2[$localtax2rate]='';
$this->tva[$vatrate] += $tvaligne; $this->tva[$vatrate] += $tvaligne;
$this->localtax1[$localtax1rate]+=$localtax1ligne;
$this->localtax2[$localtax2rate]+=$localtax2ligne; // Search local taxes
$sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
$sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$object->client->country_code."'";
$sql .= " AND t.taux = ".$vatrate." AND t.active = 1";
$resqlt=$this->db->query($sql);
if ($resqlt)
{
$objt = $this->db->fetch_object($resqlt);
$this->localtax1[$objt->localtax1_type][$objt->localtax1]+=$localtax1ligne;
$this->localtax2[$objt->localtax2_type][$objt->localtax2]+=$localtax2ligne;
}
// Add line // Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
@ -701,6 +710,84 @@ class pdf_einstein extends ModelePDFCommandes
} }
else else
{ {
//Local tax 1 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) {
switch ($localtax_type) {
case '1':
case '3':
case '5':
case '7':
continue 2;
break;
}
foreach( $localtax_rate as $tvakey => $tvaval )
{
if ($tvakey>0) // On affiche pas taux 0
{
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
}
}
}
//Local tax 2 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) {
switch ($localtax_type) {
case '1':
case '3':
case '5':
case '7':
continue 2;
break;
}
foreach( $localtax_rate as $tvakey => $tvaval )
{
if ($tvakey>0) // On affiche pas taux 0
{
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
}
}
}
// VAT
foreach($this->tva as $tvakey => $tvaval) foreach($this->tva as $tvakey => $tvaval)
{ {
if ($tvakey > 0) // On affiche pas taux 0 if ($tvakey > 0) // On affiche pas taux 0
@ -724,48 +811,26 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }
if (! $this->atleastoneratenotnull) // If no vat at all
//Local tax 1 after VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{ {
$index++; foreach( $this->localtax1 as $localtax_type => $localtax_rate ) {
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); switch ($localtax_type) {
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1); case '2':
case '4':
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); case '6':
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); continue 2;
break;
// Total LocalTax1 }
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on' && $object->total_localtax1>0) foreach( $localtax_rate as $tvakey => $tvaval )
{
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->country_code), $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1);
}
// Total LocalTax2
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on' && $object->total_localtax2>0)
{
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->country_code), $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1);
}
}
else
{
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{
//Local tax 1
foreach($this->localtax1 as $tvakey => $tvaval)
{ {
if ($tvakey!=0) // On affiche pas taux 0 if ($tvakey>0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (preg_match('/\*/',$tvakey)) if (preg_match('/\*/',$tvakey))
@ -773,27 +838,43 @@ class pdf_einstein extends ModelePDFCommandes
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat =$outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' '; $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1);
}
else
{
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
} }
} }
} }
}
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //Local tax 2 after VAT
{ if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
//Local tax 2 {
foreach($this->localtax2 as $tvakey => $tvaval) foreach( $this->localtax2 as $localtax_type => $localtax_rate ) {
switch ($localtax_type) {
case '2':
case '4':
case '6':
continue 2;
break;
}
foreach( $localtax_rate as $tvakey => $tvaval )
{ {
if ($tvakey!=0) // On affiche pas taux 0 if ($tvakey>0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (preg_match('/\*/',$tvakey)) if (preg_match('/\*/',$tvakey))
@ -801,12 +882,21 @@ class pdf_einstein extends ModelePDFCommandes
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat =$outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' '; $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1);
}
else
{
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
} }
} }
} }

View File

@ -84,7 +84,6 @@ class pdf_expedition_merou extends ModelePdfExpedition
function write_file(&$object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false) function write_file(&$object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false)
{ {
global $user,$conf,$langs,$mysoc; global $user,$conf,$langs,$mysoc;
$default_font_size = pdf_getPDFFontSize($outputlangs);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -147,6 +146,7 @@ class pdf_expedition_merou extends ModelePdfExpedition
$nblignes = count($object->lines); $nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format,'mm','l'); $pdf=pdf_getInstance($this->format,'mm','l');
$default_font_size = pdf_getPDFFontSize($outputlangs);
$heightforinfotot = 0; // Height reserved to output the info and total part $heightforinfotot = 0; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)

View File

@ -87,7 +87,6 @@ class pdf_expedition_rouget extends ModelePdfExpedition
function write_file(&$object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false) function write_file(&$object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false)
{ {
global $user,$conf,$langs; global $user,$conf,$langs;
$default_font_size = pdf_getPDFFontSize($outputlangs);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -133,7 +132,8 @@ class pdf_expedition_rouget extends ModelePdfExpedition
$nblignes = count($object->lines); $nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$heightforinfotot = 0; // Height reserved to output the info and total part $default_font_size = pdf_getPDFFontSize($outputlangs);
$heightforinfotot = 0; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0); $pdf->SetAutoPageBreak(1,0);

View File

@ -150,8 +150,6 @@ class pdf_crabe extends ModelePDFFactures
$outputlangs->load("bills"); $outputlangs->load("bills");
$outputlangs->load("products"); $outputlangs->load("products");
$default_font_size = pdf_getPDFFontSize($outputlangs);
if ($conf->facture->dir_output) if ($conf->facture->dir_output)
{ {
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -186,6 +184,7 @@ class pdf_crabe extends ModelePDFFactures
$nblignes = count($object->lines); $nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part $heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
@ -197,6 +196,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->setPrintFooter(false); $pdf->setPrintFooter(false);
} }
$pdf->SetFont(pdf_getPDFFont($outputlangs)); $pdf->SetFont(pdf_getPDFFont($outputlangs));
// Set path to the background PDF File // Set path to the background PDF File
if (empty($conf->global->MAIN_DISABLE_FPDI) && ! empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) if (empty($conf->global->MAIN_DISABLE_FPDI) && ! empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
{ {

View File

@ -117,8 +117,6 @@ class pdf_soleil extends ModelePDFFicheinter
$outputlangs->load("companies"); $outputlangs->load("companies");
$outputlangs->load("interventions"); $outputlangs->load("interventions");
$default_font_size = pdf_getPDFFontSize($outputlangs);
if ($conf->ficheinter->dir_output) if ($conf->ficheinter->dir_output)
{ {
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -140,6 +138,7 @@ class pdf_soleil extends ModelePDFFicheinter
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part $heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)

View File

@ -113,7 +113,6 @@ class pdf_typhon extends ModelePDFDeliveryOrder
function write_file($object,$outputlangs) function write_file($object,$outputlangs)
{ {
global $user,$langs,$conf; global $user,$langs,$conf;
$default_font_size = pdf_getPDFFontSize($outputlangs);
if (! is_object($outputlangs)) $outputlangs=$langs; if (! is_object($outputlangs)) $outputlangs=$langs;
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
@ -150,6 +149,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part $heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)

View File

@ -108,8 +108,6 @@ class pdf_baleine extends ModelePDFProjects
{ {
$nblignes = count($object->lines); $nblignes = count($object->lines);
$default_font_size = pdf_getPDFFontsize($outputlangs);
$objectref = dol_sanitizeFileName($object->ref); $objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->projet->dir_output; $dir = $conf->projet->dir_output;
if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref; if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
@ -127,6 +125,7 @@ class pdf_baleine extends ModelePDFProjects
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part $heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)

View File

@ -3,6 +3,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* *
* 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
@ -118,6 +119,8 @@ class pdf_azur extends ModelePDFPropales
$this->tva=array(); $this->tva=array();
$this->localtax1=array(); $this->localtax1=array();
$this->localtax2=array(); $this->localtax2=array();
$this->localtax1_type=array();
$this->localtax2_type=array();
$this->atleastoneratenotnull=0; $this->atleastoneratenotnull=0;
$this->atleastonediscount=0; $this->atleastonediscount=0;
} }
@ -149,8 +152,6 @@ class pdf_azur extends ModelePDFPropales
$outputlangs->load("propal"); $outputlangs->load("propal");
$outputlangs->load("products"); $outputlangs->load("products");
$default_font_size = pdf_getPDFFontSize($outputlangs);
if ($conf->propal->dir_output) if ($conf->propal->dir_output)
{ {
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -185,6 +186,7 @@ class pdf_azur extends ModelePDFPropales
// Create pdf instance // Create pdf instance
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part $heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
@ -368,16 +370,24 @@ class pdf_azur extends ModelePDFPropales
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100; if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
$vatrate=(string) $object->lines[$i]->tva_tx; $vatrate=(string) $object->lines[$i]->tva_tx;
$localtax1rate=(string) $object->lines[$i]->localtax1_tx;
$localtax2rate=(string) $object->lines[$i]->localtax2_tx;
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*'; if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=''; if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
if (! isset($this->localtax1[$localtax1rate])) $this->localtax1[$localtax1rate]='';
if (! isset($this->localtax2[$localtax2rate])) $this->localtax2[$localtax2rate]='';
$this->tva[$vatrate] += $tvaligne; $this->tva[$vatrate] += $tvaligne;
$this->localtax1[$localtax1rate]+=$localtax1ligne;
$this->localtax2[$localtax2rate]+=$localtax2ligne; // Search local taxes
$sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
$sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$object->client->country_code."'";
$sql .= " AND t.taux = ".$vatrate." AND t.active = 1";
$resqlt=$this->db->query($sql);
if ($resqlt)
{
$objt = $this->db->fetch_object($resqlt);
$this->localtax1[$objt->localtax1_type][$objt->localtax1]+=$localtax1ligne;
$this->localtax2[$objt->localtax2_type][$objt->localtax2]+=$localtax2ligne;
}
// Add line // Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
@ -735,6 +745,84 @@ class pdf_azur extends ModelePDFPropales
} }
else else
{ {
//Local tax 1 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) {
switch ($localtax_type) {
case '1':
case '3':
case '5':
case '7':
continue 2;
break;
}
foreach( $localtax_rate as $tvakey => $tvaval )
{
if ($tvakey>0) // On affiche pas taux 0
{
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
}
}
}
//Local tax 2 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) {
switch ($localtax_type) {
case '1':
case '3':
case '5':
case '7':
continue 2;
break;
}
foreach( $localtax_rate as $tvakey => $tvaval )
{
if ($tvakey>0) // On affiche pas taux 0
{
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
}
}
}
// VAT
foreach($this->tva as $tvakey => $tvaval) foreach($this->tva as $tvakey => $tvaval)
{ {
if ($tvakey > 0) // On affiche pas taux 0 if ($tvakey > 0) // On affiche pas taux 0
@ -759,48 +847,25 @@ class pdf_azur extends ModelePDFPropales
} }
} }
if (! $this->atleastoneratenotnull) // If no vat at all //Local tax 1 after VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{ {
$index++; foreach( $this->localtax1 as $localtax_type => $localtax_rate ) {
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); switch ($localtax_type) {
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1); case '2':
case '4':
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); case '6':
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); continue 2;
break;
// Total LocalTax1 }
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on' && $object->total_localtax1>0) foreach( $localtax_rate as $tvakey => $tvaval )
{
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->country_code), $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1);
}
// Total LocalTax2
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on' && $object->total_localtax2>0)
{
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->country_code), $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1);
}
}
else
{
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{
//Local tax 1
foreach($this->localtax1 as $tvakey => $tvaval)
{ {
if ($tvakey!=0) // On affiche pas taux 0 if ($tvakey>0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (preg_match('/\*/',$tvakey)) if (preg_match('/\*/',$tvakey))
@ -808,27 +873,43 @@ class pdf_azur extends ModelePDFPropales
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' '; $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1);
}
else
{
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
} }
} }
} }
}
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //Local tax 2 after VAT
{ if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
//Local tax 2 {
foreach($this->localtax2 as $tvakey => $tvaval) foreach( $this->localtax2 as $localtax_type => $localtax_rate ) {
switch ($localtax_type) {
case '2':
case '4':
case '6':
continue 2;
break;
}
foreach( $localtax_rate as $tvakey => $tvaval )
{ {
if ($tvakey!=0) // On affiche pas taux 0 if ($tvakey>0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (preg_match('/\*/',$tvakey)) if (preg_match('/\*/',$tvakey))
@ -836,13 +917,21 @@ class pdf_azur extends ModelePDFPropales
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat =$outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' '; $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1);
}
else
{
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
} }
} }
} }

View File

@ -146,8 +146,6 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$outputlangs->load("bills"); $outputlangs->load("bills");
$outputlangs->load("products"); $outputlangs->load("products");
$default_font_size = pdf_getPDFFontSize($outputlangs);
if ($conf->fournisseur->dir_output.'/facture') if ($conf->fournisseur->dir_output.'/facture')
{ {
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -184,6 +182,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$nblignes = count($object->lines); $nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part $heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)

View File

@ -156,8 +156,6 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$outputlangs->load("products"); $outputlangs->load("products");
$outputlangs->load("orders"); $outputlangs->load("orders");
$default_font_size = pdf_getPDFFontSize($outputlangs);
if ($conf->fournisseur->dir_output.'/commande') if ($conf->fournisseur->dir_output.'/commande')
{ {
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -196,6 +194,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$nblignes = count($object->lines); $nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part $heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)

View File

@ -127,7 +127,7 @@ class InterfaceActionsAuto
$langs->load("other"); $langs->load("other");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_OTH'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("NewCompanyToDolibarr",$object->nom); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("NewCompanyToDolibarr",$object->nom);
$object->actionmsg=$langs->transnoentities("NewCompanyToDolibarr",$object->nom); $object->actionmsg=$langs->transnoentities("NewCompanyToDolibarr",$object->nom);
if ($object->prefix) $object->actionmsg.=" (".$object->prefix.")"; if ($object->prefix) $object->actionmsg.=" (".$object->prefix.")";
@ -146,7 +146,7 @@ class InterfaceActionsAuto
$langs->load("contracts"); $langs->load("contracts");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_OTH'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ContractValidatedInDolibarr",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ContractValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("ContractValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("ContractValidatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -160,7 +160,7 @@ class InterfaceActionsAuto
$langs->load("propal"); $langs->load("propal");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_OTH'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalValidatedInDolibarr",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("PropalValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("PropalValidatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -174,7 +174,7 @@ class InterfaceActionsAuto
$langs->load("propal"); $langs->load("propal");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_EMAIL'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProposalSentByEMail",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProposalSentByEMail",$object->ref);
if (empty($object->actionmsg)) if (empty($object->actionmsg))
{ {
@ -192,7 +192,7 @@ class InterfaceActionsAuto
$langs->load("propal"); $langs->load("propal");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_OTH'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -206,7 +206,7 @@ class InterfaceActionsAuto
$langs->load("propal"); $langs->load("propal");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_OTH'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -220,7 +220,7 @@ class InterfaceActionsAuto
$langs->load("orders"); $langs->load("orders");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_OTH'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -234,7 +234,7 @@ class InterfaceActionsAuto
$langs->load("orders"); $langs->load("orders");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_EMAIL'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderSentByEMail",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderSentByEMail",$object->ref);
if (empty($object->actionmsg)) if (empty($object->actionmsg))
{ {
@ -253,7 +253,7 @@ class InterfaceActionsAuto
$langs->load("bills"); $langs->load("bills");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_OTH'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -268,7 +268,7 @@ class InterfaceActionsAuto
$langs->load("bills"); $langs->load("bills");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_EMAIL'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceSentByEMail",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceSentByEMail",$object->ref);
if (empty($object->actionmsg)) if (empty($object->actionmsg))
{ {
@ -288,7 +288,7 @@ class InterfaceActionsAuto
$langs->load("agenda"); $langs->load("agenda");
// Values for this action can't be defined by caller. // Values for this action can't be defined by caller.
$object->actiontypecode='AC_OTH'; $object->actiontypecode='AC_OTH_AUTO';
$object->actionmsg2=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref); $object->actionmsg2=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -303,7 +303,7 @@ class InterfaceActionsAuto
$langs->load("bills"); $langs->load("bills");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_OTH'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -318,7 +318,7 @@ class InterfaceActionsAuto
$langs->load("interventions"); $langs->load("interventions");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_OTH'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionValidatedInDolibarr",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InterventionValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("InterventionValidatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -335,7 +335,7 @@ class InterfaceActionsAuto
$langs->load("interventions"); $langs->load("interventions");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_EMAIL'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionSentByEMail",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionSentByEMail",$object->ref);
$object->actionmsg=$langs->transnoentities("InterventionSentByEMail",$object->ref); $object->actionmsg=$langs->transnoentities("InterventionSentByEMail",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -351,7 +351,7 @@ class InterfaceActionsAuto
$langs->load("sendings"); $langs->load("sendings");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_SHIP'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ShippingSentByEMail",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ShippingSentByEMail",$object->ref);
if (empty($object->actionmsg)) if (empty($object->actionmsg))
{ {
@ -369,7 +369,7 @@ class InterfaceActionsAuto
$langs->load("orders"); $langs->load("orders");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_OTH'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -385,7 +385,7 @@ class InterfaceActionsAuto
$langs->load("agenda"); $langs->load("agenda");
$langs->load("orders"); $langs->load("orders");
$object->actiontypecode='AC_EMAIL'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("SupplierOrderSentByEMail",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("SupplierOrderSentByEMail",$object->ref);
if (empty($object->actionmsg)) if (empty($object->actionmsg))
{ {
@ -404,7 +404,7 @@ class InterfaceActionsAuto
$langs->load("bills"); $langs->load("bills");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_OTH'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -420,7 +420,7 @@ class InterfaceActionsAuto
$langs->load("agenda"); $langs->load("agenda");
$langs->load("orders"); $langs->load("orders");
$object->actiontypecode='AC_EMAIL'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("SupplierInvoiceSentByEMail",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("SupplierInvoiceSentByEMail",$object->ref);
if (empty($object->actionmsg)) if (empty($object->actionmsg))
{ {
@ -439,7 +439,7 @@ class InterfaceActionsAuto
$langs->load("bills"); $langs->load("bills");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_OTH'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -454,7 +454,7 @@ class InterfaceActionsAuto
$langs->load("bills"); $langs->load("bills");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_OTH'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -471,7 +471,7 @@ class InterfaceActionsAuto
$langs->load("members"); $langs->load("members");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_OTH'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
@ -488,7 +488,7 @@ class InterfaceActionsAuto
$langs->load("members"); $langs->load("members");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_OTH'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
@ -511,7 +511,7 @@ class InterfaceActionsAuto
$langs->load("members"); $langs->load("members");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_OTH'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
@ -528,7 +528,7 @@ class InterfaceActionsAuto
$langs->load("members"); $langs->load("members");
$langs->load("agenda"); $langs->load("agenda");
$object->actiontypecode='AC_OTH'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);

View File

@ -954,34 +954,67 @@ class CommandeFournisseur extends CommonOrder
{ {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."commande_fournisseur"); $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."commande_fournisseur");
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur"; if ($this->id) {
$sql.= " SET ref='(PROV".$this->id.")'"; $num=count($this->lines);
$sql.= " WHERE rowid=".$this->id;
dol_syslog(get_class($this)."::create sql=".$sql);
if ($this->db->query($sql))
{
// On logue creation pour historique
$this->log($user, 0, time());
if (! $notrigger) /*
{ * Insertion du detail des produits dans la base
// Appel des triggers */
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; for ($i=0;$i<$num;$i++)
$interface=new Interfaces($this->db); {
$result=$interface->run_triggers('ORDER_SUPPLIER_CREATE',$this,$user,$langs,$conf); $result = $this->addline(
if ($result < 0) { $error++; $this->errors=$interface->errors; } $this->lines[$i]->desc,
// Fin appel triggers $this->lines[$i]->subprice,
} $this->lines[$i]->qty,
$this->lines[$i]->tva_tx,
$this->lines[$i]->localtax1_tx,
$this->lines[$i]->localtax2_tx,
$this->lines[$i]->fk_product,
0,
$this->lines[$i]->ref_fourn,
$this->lines[$i]->remise_percent,
'HT',
0,
$this->lines[$i]->info_bits
);
if ($result < 0)
{
$this->error=$this->db->lasterror();
dol_print_error($this->db);
$this->db->rollback();
return -1;
}
}
$this->db->commit(); $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur";
return $this->id; $sql.= " SET ref='(PROV".$this->id.")'";
} $sql.= " WHERE rowid=".$this->id;
else dol_syslog(get_class($this)."::create sql=".$sql);
{ if ($this->db->query($sql))
$this->error=$this->db->error(); {
dol_syslog(get_class($this)."::create: Failed -2 - ".$this->error, LOG_ERR); // On logue creation pour historique
$this->db->rollback(); $this->log($user, 0, time());
return -2;
if (! $notrigger)
{
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('ORDER_SUPPLIER_CREATE',$this,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers
}
$this->db->commit();
return $this->id;
}
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::create: Failed -2 - ".$this->error, LOG_ERR);
$this->db->rollback();
return -2;
}
} }
} }
else else
@ -993,6 +1026,69 @@ class CommandeFournisseur extends CommonOrder
} }
} }
/**
* Load an object from its id and create a new one in database
*
* @param HookManager $hookmanager Hook manager instance
* @return int New id of clone
*/
function createFromClone($hookmanager=false)
{
global $conf,$user,$langs;
$error=0;
$this->db->begin();
// Load source object
$objFrom = dol_clone($this);
$this->id=0;
$this->statut=0;
// Clear fields
$this->user_author_id = $user->id;
$this->user_valid = '';
$this->date_creation = '';
$this->date_validation = '';
$this->ref_supplier = '';
// Create clone
$result=$this->create($user);
if ($result < 0) $error++;
if (! $error)
{
// Hook of thirdparty module
if (is_object($hookmanager))
{
$parameters=array('objFrom'=>$objFrom);
$action='';
$reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) $error++;
}
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('ORDER_SUPPLIER_CLONE',$this,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers
}
// End
if (! $error)
{
$this->db->commit();
return $this->id;
}
else
{
$this->db->rollback();
return -1;
}
}
/** /**
* Add order line * Add order line
* *
@ -1044,7 +1140,6 @@ class CommandeFournisseur extends CommonOrder
} }
$desc=trim($desc); $desc=trim($desc);
// Check parameters // Check parameters
if ($qty < 1 && ! $fk_product) if ($qty < 1 && ! $fk_product)
{ {
@ -1053,7 +1148,6 @@ class CommandeFournisseur extends CommonOrder
} }
if ($type < 0) return -1; if ($type < 0) return -1;
if ($this->statut == 0) if ($this->statut == 0)
{ {
$this->db->begin(); $this->db->begin();
@ -1076,7 +1170,7 @@ class CommandeFournisseur extends CommonOrder
$this->error="No price found for this quantity. Quantity may be too low ?"; $this->error="No price found for this quantity. Quantity may be too low ?";
$this->db->rollback(); $this->db->rollback();
dol_syslog(get_class($this)."::addline result=".$result." - ".$this->error, LOG_DEBUG); dol_syslog(get_class($this)."::addline result=".$result." - ".$this->error, LOG_DEBUG);
return -1; return -1; // FIXME this return create an error in jenkins
} }
if ($result < -1) if ($result < -1)
{ {

View File

@ -78,13 +78,18 @@ $errors=array();
$object = new CommandeFournisseur($db); $object = new CommandeFournisseur($db);
// Load object
if ($id > 0 || ! empty($ref))
{
$object->fetch($id, $ref);
$object->fetch_thirdparty();
}
/* /*
* Actions * Actions
*/ */
if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer) if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer)
{ {
$object->fetch($id);
$result=$object->setValueFrom('ref_supplier',GETPOST('ref_supplier','alpha')); $result=$object->setValueFrom('ref_supplier',GETPOST('ref_supplier','alpha'));
if ($result < 0) dol_print_error($db, $object->error); if ($result < 0) dol_print_error($db, $object->error);
} }
@ -92,14 +97,12 @@ if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer)
// conditions de reglement // conditions de reglement
if ($action == 'setconditions' && $user->rights->fournisseur->commande->creer) if ($action == 'setconditions' && $user->rights->fournisseur->commande->creer)
{ {
$object->fetch($id);
$result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int')); $result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int'));
} }
// mode de reglement // mode de reglement
else if ($action == 'setmode' && $user->rights->fournisseur->commande->creer) else if ($action == 'setmode' && $user->rights->fournisseur->commande->creer)
{ {
$object->fetch($id);
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int')); $result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int'));
} }
@ -119,13 +122,11 @@ if ($action == 'setdate_livraison' && $user->rights->fournisseur->commande->cree
// Set project // Set project
else if ($action == 'classin' && $user->rights->fournisseur->commande->creer) else if ($action == 'classin' && $user->rights->fournisseur->commande->creer)
{ {
$object->fetch($id);
$object->setProject($projectid); $object->setProject($projectid);
} }
else if ($action == 'setremisepercent' && $user->rights->fournisseur->commande->creer) else if ($action == 'setremisepercent' && $user->rights->fournisseur->commande->creer)
{ {
$object->fetch($id);
$result = $object->set_remise($user, $_POST['remise_percent']); $result = $object->set_remise($user, $_POST['remise_percent']);
} }
@ -173,36 +174,36 @@ else if ($action == 'reopen' && $user->rights->fournisseur->commande->approuver)
else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
{ {
$langs->load('errors'); $langs->load('errors');
$error = false; $error = 0;
if ($_POST['pu'] < 0 && $_POST['qty'] < 0) if (GETPOST('pu') < 0 && GETPOST('qty') < 0)
{ {
setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPrice'), $langs->transnoentitiesnoconv('Qty')), 'errors'); setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPrice'), $langs->transnoentitiesnoconv('Qty')), 'errors');
$error = true; $error++;
} }
if (empty($_POST['idprodfournprice']) && $_POST['type'] < 0) if (! GETPOST('idprodfournprice') && GETPOST('type') < 0)
{ {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors'); setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors');
$error = true; $error++;
} }
if (empty($_POST['idprodfournprice']) && (! isset($_POST['pu']) || $_POST['pu']=='')) // Unit price can be 0 but not '' if (! GETPOST('idprodfournprice') && (! GETPOST('pu') || GETPOST('pu')=='')) // Unit price can be 0 but not ''
{ {
setEventMessage($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), 'errors'); setEventMessage($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), 'errors');
$error = true; $error++;
} }
if (empty($_POST['idprodfournprice']) && empty($_POST['np_desc']) && empty($_POST['dp_desc'])) if (! GETPOST('idprodfournprice') && ! GETPOST('np_desc') && ! GETPOST('dp_desc'))
{ {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors'); setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors');
$error = true; $error++;
} }
if (empty($_POST['idprodfournprice']) && (! isset($_POST['qty']) || $_POST['qty'] == '') if (! GETPOST('idprodfournprice') && (! GETPOST('qty') || GETPOST('qty') == '')
|| ! empty($_POST['idprodfournprice']) && (! isset($_POST['pqty']) || $_POST['pqty'] == '')) || GETPOST('idprodfournprice') && (! GETPOST('pqty') || GETPOST('pqty') == ''))
{ {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors'); setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors');
$error = true; $error++;
} }
if (! $error && (($_POST['qty'] || $_POST['pqty']) && (($_POST['pu'] && ($_POST['np_desc'] || $_POST['dp_desc'])) || $_POST['idprodfournprice']))) if (! $error && ((GETPOST('qty') || GETPOST('pqty')) && ((GETPOST('pu') && (GETPOST('np_desc') || GETPOST('dp_desc'))) || GETPOST('idprodfournprice'))))
{ {
if ($object->fetch($id) < 0) dol_print_error($db,$object->error); if ($object->fetch($id) < 0) dol_print_error($db,$object->error);
if ($object->fetch_thirdparty() < 0) dol_print_error($db,$object->error); if ($object->fetch_thirdparty() < 0) dol_print_error($db,$object->error);
@ -210,9 +211,9 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
// Ecrase $pu par celui du produit // Ecrase $pu par celui du produit
// Ecrase $desc par celui du produit // Ecrase $desc par celui du produit
// Ecrase $txtva par celui du produit // Ecrase $txtva par celui du produit
if ($_POST["idprodfournprice"]) // >0 or -1 if (GETPOST('idprodfournprice')) // >0 or -1
{ {
$qty = $_POST['qty'] ? $_POST['qty'] : $_POST['pqty']; $qty = GETPOST('qty') ? GETPOST('qty') : GETPOST('pqty');
$productsupplier = new ProductFournisseur($db); $productsupplier = new ProductFournisseur($db);
$idprod=$productsupplier->get_buyprice($_POST['idprodfournprice'], $qty); // Just to see if a price exists for the quantity. Not used to found vat $idprod=$productsupplier->get_buyprice($_POST['idprodfournprice'], $qty); // Just to see if a price exists for the quantity. Not used to found vat
@ -229,9 +230,9 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
$desc.= $productsupplier->description && $_POST['np_desc'] ? "\n" : ""; $desc.= $productsupplier->description && $_POST['np_desc'] ? "\n" : "";
$desc.= $_POST['np_desc']; $desc.= $_POST['np_desc'];
$remise_percent = $_POST["remise_percent"] ? $_POST["remise_percent"] : $_POST["p_remise_percent"]; $remise_percent = GETPOST('remise_percent') ? GETPOST('remise_percent') : GETPOST('p_remise_percent');
$tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, $_POST['idprodfournprice']); $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice'));
$type = $productsupplier->type; $type = $productsupplier->type;
// Local Taxes // Local Taxes
@ -240,13 +241,13 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
$result=$object->addline( $result=$object->addline(
$desc, $desc,
$pu, $pu, // FIXME $pu is not defined
$qty, $qty,
$tva_tx, $tva_tx,
$localtax1_tx, $localtax1_tx,
$localtax2_tx, $localtax2_tx,
$productsupplier->id, $productsupplier->id,
$_POST['idprodfournprice'], GETPOST('idprodfournprice'),
$productsupplier->fourn_ref, $productsupplier->fourn_ref,
$remise_percent, $remise_percent,
'HT', 'HT',
@ -256,7 +257,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
if ($idprod == -1) if ($idprod == -1)
{ {
// Quantity too low // Quantity too low
$mesg='<div class="error">'.$langs->trans("ErrorQtyTooLowForThisSupplier").'</div>'; setEventMessage($langs->trans("ErrorQtyTooLowForThisSupplier"), 'errors');
} }
} }
else else
@ -271,7 +272,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
if (! $_POST['dp_desc']) if (! $_POST['dp_desc'])
{ {
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")).'</div>'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors');
} }
else else
{ {
@ -381,7 +382,6 @@ else if ($action == 'updateligne' && $user->rights->fournisseur->commande->creer
else if ($action == 'confirm_deleteproductline' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer) else if ($action == 'confirm_deleteproductline' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer)
{ {
$object->fetch($id);
$result = $object->deleteline(GETPOST('lineid')); $result = $object->deleteline(GETPOST('lineid'));
if ($result >= 0) if ($result >= 0)
@ -413,7 +413,6 @@ else if ($action == 'confirm_deleteproductline' && $confirm == 'yes' && $user->r
else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fournisseur->commande->valider) else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fournisseur->commande->valider)
{ {
$object->fetch($id);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
$object->date_commande=dol_now(); $object->date_commande=dol_now();
@ -448,7 +447,6 @@ else if ($action == 'confirm_approve' && $confirm == 'yes' && $user->rights->fou
{ {
$idwarehouse=GETPOST('idwarehouse', 'int'); $idwarehouse=GETPOST('idwarehouse', 'int');
$object->fetch($id);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
// Check parameters // Check parameters
@ -479,7 +477,6 @@ else if ($action == 'confirm_approve' && $confirm == 'yes' && $user->rights->fou
else if ($action == 'confirm_refuse' && $confirm == 'yes' && $user->rights->fournisseur->commande->approuver) else if ($action == 'confirm_refuse' && $confirm == 'yes' && $user->rights->fournisseur->commande->approuver)
{ {
$object->fetch($id);
$result = $object->refuse($user); $result = $object->refuse($user);
if ($result > 0) if ($result > 0)
{ {
@ -494,7 +491,6 @@ else if ($action == 'confirm_refuse' && $confirm == 'yes' && $user->rights->four
else if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander) else if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander)
{ {
$object->fetch($id);
$result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']); $result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']);
if ($result > 0) if ($result > 0)
{ {
@ -510,7 +506,6 @@ else if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fo
else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisseur->commande->supprimer) else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisseur->commande->supprimer)
{ {
$object->fetch($id);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
$result=$object->delete($user); $result=$object->delete($user);
if ($result > 0) if ($result > 0)
@ -524,10 +519,35 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->four
} }
} }
// Action clone object
else if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer)
{
if (1==0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers'))
{
$mesg='<div class="error">'.$langs->trans("NoCloneOptionsSpecified").'</div>';
}
else
{
if ($object->id > 0)
{
$result=$object->createFromClone($hookmanager);
if ($result > 0)
{
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
exit;
}
else
{
$mesg='<div class="error">'.$object->error.'</div>';
$action='';
}
}
}
}
// Receive // Receive
else if ($action == 'livraison' && $user->rights->fournisseur->commande->receptionner) else if ($action == 'livraison' && $user->rights->fournisseur->commande->receptionner)
{ {
$object->fetch($id);
if ($_POST["type"]) if ($_POST["type"])
{ {
@ -557,7 +577,6 @@ else if ($action == 'livraison' && $user->rights->fournisseur->commande->recepti
else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander) else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander)
{ {
$object->fetch($id);
$result = $object->cancel($user); $result = $object->cancel($user);
if ($result > 0) if ($result > 0)
{ {
@ -573,7 +592,6 @@ else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->four
// Line ordering // Line ordering
else if ($action == 'up' && $user->rights->fournisseur->commande->creer) else if ($action == 'up' && $user->rights->fournisseur->commande->creer)
{ {
$object->fetch($id);
$object->line_up($_GET['rowid']); $object->line_up($_GET['rowid']);
$outputlangs = $langs; $outputlangs = $langs;
@ -588,7 +606,6 @@ else if ($action == 'up' && $user->rights->fournisseur->commande->creer)
} }
else if ($action == 'down' && $user->rights->fournisseur->commande->creer) else if ($action == 'down' && $user->rights->fournisseur->commande->creer)
{ {
$object->fetch($id);
$object->line_down($_GET['rowid']); $object->line_down($_GET['rowid']);
$outputlangs = $langs; $outputlangs = $langs;
@ -607,7 +624,6 @@ else if ($action == 'builddoc' && $user->rights->fournisseur->commande->creer) /
// Build document // Build document
// Sauvegarde le dernier module choisi pour generer un document // Sauvegarde le dernier module choisi pour generer un document
$object->fetch($id);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
if ($_REQUEST['model']) if ($_REQUEST['model'])
@ -985,6 +1001,18 @@ if ($id > 0 || ! empty($ref))
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
} }
// Clone confirmation
if ($action == 'clone')
{
// Create an array for form
$formquestion=array(
//array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1)
);
// Paiement incomplet. On demande si motif = escompte ou autre
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneOrder'),$langs->trans('ConfirmCloneOrder',$object->ref),'confirm_clone',$formquestion,'yes',1);
if ($ret == 'html') print '<br>';
}
/* /*
* Confirmation de la validation * Confirmation de la validation
*/ */
@ -1037,6 +1065,7 @@ if ($id > 0 || ! empty($ref))
$ret=$form->form_confirm("fiche.php?id=$object->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder",$object->ref),"confirm_refuse", '', 0, 1); $ret=$form->form_confirm("fiche.php?id=$object->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder",$object->ref),"confirm_refuse", '', 0, 1);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
* Confirmation de l'annulation * Confirmation de l'annulation
*/ */
@ -1656,6 +1685,12 @@ if ($id > 0 || ! empty($ref))
} }
} }
// Clone
if ($user->rights->fournisseur->commande->creer)
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;socid='.$object->socid.'&amp;action=clone&amp;object=order">'.$langs->trans("ToClone").'</a>';
}
// Delete // Delete
if ($user->rights->fournisseur->commande->supprimer) if ($user->rights->fournisseur->commande->supprimer)
{ {

View File

@ -122,7 +122,7 @@ if ($resql)
print_barre_liste($title, $page, "liste.php", "", $sortfield, $sortorder, '', $num); print_barre_liste($title, $page, "liste.php", "", $sortfield, $sortorder, '', $num);
print '<form action="liste.php" method="GET">'; print '<form action="liste.php" method="GET">';
print '<table class="liste">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cf.ref","","",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cf.ref","","",'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","",'',$sortfield,$sortorder);

View File

@ -82,7 +82,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
$result=$object->createFromClone($id); $result=$object->createFromClone($id);
if ($result > 0) if ($result > 0)
{ {
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result); header("Location: ".$_SERVER['PHP_SELF'].'?action=editfacnumber&id='.$result);
exit; exit;
} }
else else

View File

@ -30,15 +30,16 @@
-- Types action comm -- Types action comm
-- --
delete from llx_c_actioncomm where id in (1,2,3,4,5,8,9,10,30,31,50); delete from llx_c_actioncomm where id in (1,2,3,4,5,8,9,10,30,31,40,50);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 1, 'AC_TEL', 'system', 'Phone call' ,NULL, 2); insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 1, 'AC_TEL', 'system', 'Phone call' ,NULL, 1, 2);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 2, 'AC_FAX', 'system', 'Send Fax' ,NULL, 3); insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 2, 'AC_FAX', 'system', 'Send Fax' ,NULL, 1, 3);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 3, 'AC_PROP', 'systemauto', 'Send commercial proposal by email' ,'propal', 10); insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 3, 'AC_PROP', 'systemauto', 'Send commercial proposal by email' ,'propal',0, 10);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 4, 'AC_EMAIL', 'system', 'Send Email' ,NULL, 4); insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 4, 'AC_EMAIL', 'system', 'Send Email' ,NULL, 1, 4);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 5, 'AC_RDV', 'system', 'Rendez-vous' ,NULL, 1); insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 5, 'AC_RDV', 'system', 'Rendez-vous' ,NULL, ,1 1);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 8, 'AC_COM', 'systemauto', 'Send customer order by email' ,'order', 8); insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 8, 'AC_COM', 'systemauto', 'Send customer order by email' ,'order', 0, 8);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 9, 'AC_FAC', 'systemauto', 'Send customer invoice by email' ,'invoice', 6); insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 9, 'AC_FAC', 'systemauto', 'Send customer invoice by email' ,'invoice',0, 6);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 10, 'AC_SHIP', 'systemauto', 'Send shipping by email' ,'shipping', 11); insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 10, 'AC_SHIP', 'systemauto', 'Send shipping by email' ,'shipping',0, 11);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 30, 'AC_SUP_ORD', 'systemauto', 'Send supplier order by email' ,'order_supplier', 9); insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 30, 'AC_SUP_ORD', 'systemauto', 'Send supplier order by email' ,'order_supplier',0, 9);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values (31, 'AC_SUP_INV', 'systemauto', 'Send supplier invoice by email' ,'invoice_supplier', 7); insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 31, 'AC_SUP_INV', 'systemauto', 'Send supplier invoice by email' ,'invoice_supplier',0, 7);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 50, 'AC_OTH', 'system', 'Other' ,NULL, 5); insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 40, 'AC_OTH_AUTO','systemauto', 'Other (automatically inserted events)' ,NULL, 1, 20);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 50, 'AC_OTH', 'system', 'Other (manually inserted events)' ,NULL, 1, 5);

View File

@ -805,6 +805,12 @@ ALTER TABLE llx_c_effectif DROP INDEX code, ADD UNIQUE uk_c_effectif (code);
ALTER TABLE llx_c_paiement DROP INDEX code, ADD UNIQUE uk_c_paiement (code); ALTER TABLE llx_c_paiement DROP INDEX code, ADD UNIQUE uk_c_paiement (code);
delete from llx_c_actioncomm where id = 40;
INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, position) values ( 40, 'AC_OTH_AUTO','systemauto', 'Other (automatically inserted events)' ,NULL, 20);
UPDATE llx_c_actioncomm SET libelle = 'Other (manually inserted events)' WHERE code = 'AC_OTH';
UPDATE llx_c_actioncomm SET active = 0 WHERE code in ('AC_PROP', 'AC_COM', 'AC_FAC', 'AC_SHIP', 'AC_SUP_ORD', 'AC_SUP_INV');
-- Update dictionnary of table llx_c_paper_format -- Update dictionnary of table llx_c_paper_format
DELETE FROM llx_c_paper_format; DELETE FROM llx_c_paper_format;

View File

@ -718,6 +718,20 @@ VATIsNotUsedDesc=El tipus d'IVA proposat per defecte és 0. Aquest és el cas d'
VATIsUsedExampleFR=A França, es tracta de les societats o organismes que trien un règim fiscal general (General simplificat o General normal), règim en el qual es declara l'IVA. VATIsUsedExampleFR=A França, es tracta de les societats o organismes que trien un règim fiscal general (General simplificat o General normal), règim en el qual es declara l'IVA.
VATIsNotUsedExampleFR=A França, es tracta d'associacions exemptes d'IVA o societats, organismes o professions liberals que han eligedo el règim fiscal de mòduls (IVA en franquícia), pagant un IVA en franquícia sense fer declaració d'IVA. Aquesta elecció fa aparèixer l'anotació "IVA no aplicable - art-293B del CGI" en les factures. VATIsNotUsedExampleFR=A França, es tracta d'associacions exemptes d'IVA o societats, organismes o professions liberals que han eligedo el règim fiscal de mòduls (IVA en franquícia), pagant un IVA en franquícia sense fer declaració d'IVA. Aquesta elecció fa aparèixer l'anotació "IVA no aplicable - art-293B del CGI" en les factures.
##### Local Taxes ##### ##### Local Taxes #####
LocalTax1IsUsed=Subjecte
LocalTax1IsNotUsed=No subjecte
LocalTax1IsUsedDesc=Ús d'un 2on. tipus d'impost (Diferent de l'IVA)
LocalTax1IsNotUsedDesc=No utilitzar un 2on. tipus d'impost (Diferent de l'IVA)
LocalTax1Management=Gestió 2on. tipus d'impost
LocalTax1IsUsedExample=
LocalTax1IsNotUsedExample=
LocalTax2IsUsed=Subjecte
LocalTax2IsNotUsed=No subjecte
LocalTax2IsUsedDesc=Ús d'un 3er. tipus d'impost (Diferent de l'IVA)
LocalTax2IsNotUsedDesc=No utilitzar un 3er. tipus d'impost (Diferent de l'IVA)
LocalTax2Management=Gestió 2on. tipus d'impost
LocalTax2IsUsedExample=
LocalTax2IsNotUsedExample=
LocalTax1ManagementES=Gestió Recàrrec d'Equivalència LocalTax1ManagementES=Gestió Recàrrec d'Equivalència
LocalTax1IsUsedDescES=El tipus de RE proposat per defecte en les creacions de pressupostos, factures, comandes, etc. Respon a la següent regla:<br>Si el comprador no està subjecte a RE, RE per defecte= 0. Final de regla.<br>Si el comprador està subjecte a RE aleshores s'aplica valor de RE per defecte. Final de regla.<br> LocalTax1IsUsedDescES=El tipus de RE proposat per defecte en les creacions de pressupostos, factures, comandes, etc. Respon a la següent regla:<br>Si el comprador no està subjecte a RE, RE per defecte= 0. Final de regla.<br>Si el comprador està subjecte a RE aleshores s'aplica valor de RE per defecte. Final de regla.<br>
LocalTax1IsNotUsedDescES=El tipus de RE proposat per defecte es 0. Final de regla. LocalTax1IsNotUsedDescES=El tipus de RE proposat per defecte es 0. Final de regla.

View File

@ -20,7 +20,6 @@ AddThisArticle=Afegeix aquest article
RestartSelling=Reprendre la venda RestartSelling=Reprendre la venda
SellFinished=Venda acabada SellFinished=Venda acabada
PrintTicket=Imprimir tiquet PrintTicket=Imprimir tiquet
NoResults=Cap resultat
NoProductFound=Cap article trobat NoProductFound=Cap article trobat
ProductFound=Producte trobat ProductFound=Producte trobat
ProductsFound=Productes trobats ProductsFound=Productes trobats

View File

@ -81,6 +81,8 @@ ActionAC_SHIP=Enviament expedició per correu
ActionAC_SUP_ORD=Enviament comanda a proveïdor per correu ActionAC_SUP_ORD=Enviament comanda a proveïdor per correu
ActionAC_SUP_INV=Enviament factura de proveïdor per correu ActionAC_SUP_INV=Enviament factura de proveïdor per correu
ActionAC_OTH=Altra ActionAC_OTH=Altra
ActionAC_MANUAL=Esdeveniments creats manualment
ActionAC_AUTO=Esdeveniments creats automàticament
Stats=Estadístiques de venda Stats=Estadístiques de venda
CAOrder=Volum de vendes (Comandes validades) CAOrder=Volum de vendes (Comandes validades)
FromTo=de %s a %s FromTo=de %s a %s

View File

@ -12,6 +12,7 @@ Language_en_AU=Anglès (Australia)
Language_en_GB=Anglès (Regne Unit) Language_en_GB=Anglès (Regne Unit)
Language_en_IN=Anglès (Índia) Language_en_IN=Anglès (Índia)
Language_en_NZ=Anglais (Nova Zelanda) Language_en_NZ=Anglais (Nova Zelanda)
Language_en_SA=Inglés (Aràbia Saudita)
Language_en_US=Anglès (Estats Units) Language_en_US=Anglès (Estats Units)
Language_es_ES=Espanyol Language_es_ES=Espanyol
Language_es_AR=Espanyol (Argentina) Language_es_AR=Espanyol (Argentina)

View File

@ -77,6 +77,8 @@ YourMailUnsubcribeOK=El correu electrònic <b>%s</b> és correcta desuscribe.
MailtoEMail=mailto email (hyperlink) MailtoEMail=mailto email (hyperlink)
ActivateCheckRead=Activar confirmació de lectura i opció de Desubscripció ActivateCheckRead=Activar confirmació de lectura i opció de Desubscripció
ActivateCheckReadKey=Clau usada per xifrar la URL de la confirmació de lectura i la funció de desubscripció ActivateCheckReadKey=Clau usada per xifrar la URL de la confirmació de lectura i la funció de desubscripció
EMailSentToNRecipients=E-Mail enviat a %s destinataris.
# Libelle des modules de liste de destinataires mailing== # Libelle des modules de liste de destinataires mailing==
MailingModuleDescContactCompanies=Contactes de tercers (clients potencials, clients, proveïdors ...) MailingModuleDescContactCompanies=Contactes de tercers (clients potencials, clients, proveïdors ...)
MailingModuleDescDolibarrUsers=Usuaris de Dolibarr MailingModuleDescDolibarrUsers=Usuaris de Dolibarr

View File

@ -627,7 +627,8 @@ ByDay=Per dia
BySalesRepresentative=Per comercial BySalesRepresentative=Per comercial
LinkedToSpecificUsers=Enllaçat a un contacte d'usuari particular LinkedToSpecificUsers=Enllaçat a un contacte d'usuari particular
DeleteAFile=Eliminació d'arxiu DeleteAFile=Eliminació d'arxiu
ConfirmDeleteAFile=Confirma l'eliminació de l'arxiu ConfirmDeleteAFile=Confirme l'eliminació de l'arxiu
NoResults=Cap resultat
# Week day # Week day
Monday=Dilluns Monday=Dilluns
Tuesday=Dimarts Tuesday=Dimarts

View File

@ -199,3 +199,6 @@ Collectivités=Col.lectivitats
Particuliers=Particulars Particuliers=Particulars
Entreprises=Empreses Entreprises=Empreses
DOLIBARRFOUNDATION_PAYMENT_FORM=Per realitzar el pagament de la seva cotització per transferència bancària, visiteu la pàgina <a target="_blank" href="http://wiki.dolibarr.org/index.php/Subscribirse#Para_una_adhesi.C3.B3n_por_transferencia">http://wiki.dolibarr.org/index.php/Subscribirse</a>.<br>Per pagar amb targeta de crèdit o PayPal, feu clic al botó a la part inferior d'aquesta pàgina.<br><br> DOLIBARRFOUNDATION_PAYMENT_FORM=Per realitzar el pagament de la seva cotització per transferència bancària, visiteu la pàgina <a target="_blank" href="http://wiki.dolibarr.org/index.php/Subscribirse#Para_una_adhesi.C3.B3n_por_transferencia">http://wiki.dolibarr.org/index.php/Subscribirse</a>.<br>Per pagar amb targeta de crèdit o PayPal, feu clic al botó a la part inferior d'aquesta pàgina.<br><br>
ByProperties=Per característiques
MembersStatisticsByProperties=Estadístiques dels membres per característiques
MembersByNature=Membres per naturalesa

View File

@ -93,6 +93,8 @@ CloneFiles=Clonar els arxius adjunts
ConfirmCloneProject=Esteu segur que voleu clonar aquest projecte? ConfirmCloneProject=Esteu segur que voleu clonar aquest projecte?
ProjectReportDate=Canviar les dates de les tasques en funció de la data d'inici del projecte ProjectReportDate=Canviar les dates de les tasques en funció de la data d'inici del projecte
ErrorShiftTaskDate=S'ha produït un error en el canvi de les dates de les tasques ErrorShiftTaskDate=S'ha produït un error en el canvi de les dates de les tasques
ProjectsAndTasksLines=Projectes i tasques
##### Types de contacts ##### ##### Types de contacts #####
TypeContact_project_internal_PROJECTLEADER=Cap de projecte TypeContact_project_internal_PROJECTLEADER=Cap de projecte
TypeContact_project_external_PROJECTLEADER=Cap de projecte TypeContact_project_external_PROJECTLEADER=Cap de projecte

View File

@ -58,6 +58,7 @@ ActionsOnShipping=Events sobre l'expedició
LinkToTrackYourPackage=Enllaç per al seguiment del seu paquet LinkToTrackYourPackage=Enllaç per al seguiment del seu paquet
ShipmentCreationIsDoneFromOrder=De moment, la creació d'una nova expedició es realitza des de la fitxa de comanda. ShipmentCreationIsDoneFromOrder=De moment, la creació d'una nova expedició es realitza des de la fitxa de comanda.
RelatedShippings=Expedició(ns) associades RelatedShippings=Expedició(ns) associades
ShipmentLine=Línia d'expedició
# Sending methods # Sending methods
SendingMethodCATCH=Recollit pel client SendingMethodCATCH=Recollit pel client

View File

@ -707,6 +707,20 @@ VATIsNotUsedDesc=By default the proposed VAT is 0 which can be used for cases li
VATIsUsedExampleFR=In France, it means companies or organisations having a real fiscal system (Simplified real or normal real). A system in which VAT is declared. VATIsUsedExampleFR=In France, it means companies or organisations having a real fiscal system (Simplified real or normal real). A system in which VAT is declared.
VATIsNotUsedExampleFR=In France, it means associations that are non VAT declared or companies, organisations or liberal professions that have chosen the micro enterprise fiscal system (VAT in franchise) and paid a franchise VAT without any VAT declaration. This choice will display the reference "Non applicable VAT - art-293B of CGI" on invoices. VATIsNotUsedExampleFR=In France, it means associations that are non VAT declared or companies, organisations or liberal professions that have chosen the micro enterprise fiscal system (VAT in franchise) and paid a franchise VAT without any VAT declaration. This choice will display the reference "Non applicable VAT - art-293B of CGI" on invoices.
##### Local Taxes ##### ##### Local Taxes #####
LocalTax1IsUsed=Use second tax
LocalTax1IsNotUsed=Do not use second tax
LocalTax1IsUsedDesc=Use a second type of tax (other than VAT)
LocalTax1IsNotUsedDesc=Do not use other type of tax (other than VAT)
LocalTax1Management=Second type of tax
LocalTax1IsUsedExample=
LocalTax1IsNotUsedExample=
LocalTax2IsUsed=Use third tax
LocalTax2IsNotUsed=Do not use third tax
LocalTax2IsUsedDesc=Use a third type of tax (other than VAT)
LocalTax2IsNotUsedDesc=Do not use other type of tax (other than VAT)
LocalTax2Management=Third type of tax
LocalTax2IsUsedExample=
LocalTax2IsNotUsedExample=
LocalTax1ManagementES= RE Management LocalTax1ManagementES= RE Management
LocalTax1IsUsedDescES= The RE rate by default when creating prospects, invoices, orders etc follow the active standard rule:<br>If te buyer is not subjected to RE, RE by default=0. End of rule.<br>If the buyer is subjected to RE then the RE by default. End of rule.<br> LocalTax1IsUsedDescES= The RE rate by default when creating prospects, invoices, orders etc follow the active standard rule:<br>If te buyer is not subjected to RE, RE by default=0. End of rule.<br>If the buyer is subjected to RE then the RE by default. End of rule.<br>
LocalTax1IsNotUsedDescES= By default the proposed RE is 0. End of rule. LocalTax1IsNotUsedDescES= By default the proposed RE is 0. End of rule.

View File

@ -7,7 +7,7 @@ Agendas= Agendas
Calendar= Calendar Calendar= Calendar
Calendars= Calendars Calendars= Calendars
LocalAgenda=Local calendar LocalAgenda=Local calendar
AffectedTo= Affected to AffectedTo= Assigned to
DoneBy= Done by DoneBy= Done by
Events= Events Events= Events
MyEvents=My events MyEvents=My events
@ -22,7 +22,7 @@ MenuToDoMyActions= My incomplete events
MenuDoneMyActions= My terminated events MenuDoneMyActions= My terminated events
ListOfEvents= List of Dolibarr events ListOfEvents= List of Dolibarr events
ActionsAskedBy=Events reported by ActionsAskedBy=Events reported by
ActionsToDoBy=Events affected to ActionsToDoBy=Events assigned to
ActionsDoneBy=Events done by ActionsDoneBy=Events done by
AllMyActions= All my events/tasks AllMyActions= All my events/tasks
AllActions= All events/tasks AllActions= All events/tasks
@ -59,9 +59,9 @@ DateActionDoneEnd= Real end date
DateActionStart= Start date DateActionStart= Start date
DateActionEnd= End date DateActionEnd= End date
AgendaUrlOptions1=You can also add following parameters to filter output: AgendaUrlOptions1=You can also add following parameters to filter output:
AgendaUrlOptions2=<b>login=%s</b> to restrict output to actions created by, affected to or done by user <b>%s</b>. AgendaUrlOptions2=<b>login=%s</b> to restrict output to actions created by, assigned to or done by user <b>%s</b>.
AgendaUrlOptions3=<b>logina=%s</b> to restrict output to actions created by user <b>%s</b>. AgendaUrlOptions3=<b>logina=%s</b> to restrict output to actions created by user <b>%s</b>.
AgendaUrlOptions4=<b>logint=%s</b> to restrict output to actions affected to user <b>%s</b>. AgendaUrlOptions4=<b>logint=%s</b> to restrict output to actions assigned to user <b>%s</b>.
AgendaUrlOptions5=<b>logind=%s</b> to restrict output to actions done by user <b>%s</b>. AgendaUrlOptions5=<b>logind=%s</b> to restrict output to actions done by user <b>%s</b>.
AgendaShowBirthdayEvents=Show birthday's contacts AgendaShowBirthdayEvents=Show birthday's contacts
AgendaHideBirthdayEvents=Hide birthday's contacts AgendaHideBirthdayEvents=Hide birthday's contacts

View File

@ -31,7 +31,7 @@ SalesRepresentativeFollowUp=Sales representative (follow-up)
SalesRepresentativeSignature=Sales representative (signature) SalesRepresentativeSignature=Sales representative (signature)
CommercialInterlocutor=Commercial interlocutor CommercialInterlocutor=Commercial interlocutor
ErrorWrongCode=Wrong code ErrorWrongCode=Wrong code
NoSalesRepresentativeAffected=No particular sales representative affected NoSalesRepresentativeAffected=No particular sales representative assigned
ShowCustomer=Show customer ShowCustomer=Show customer
ShowProspect=Show prospect ShowProspect=Show prospect
ListOfProspects=List of prospects ListOfProspects=List of prospects
@ -52,7 +52,7 @@ StatusActionToDo=To do
StatusActionDone=Complete StatusActionDone=Complete
MyActionsAsked=Events I have recorded MyActionsAsked=Events I have recorded
MyActionsToDo=Events I have to do MyActionsToDo=Events I have to do
MyActionsDone=Events affected to me MyActionsDone=Events assigned to me
StatusActionInProcess=In process StatusActionInProcess=In process
TasksHistoryForThisContact=Events for this contact TasksHistoryForThisContact=Events for this contact
LastProspectDoNotContact=Do not contact LastProspectDoNotContact=Do not contact
@ -63,7 +63,7 @@ LastProspectContactDone=Contact done
DateActionPlanned=Date event planned for DateActionPlanned=Date event planned for
DateActionDone=Date event done DateActionDone=Date event done
ActionAskedBy=Event reported by ActionAskedBy=Event reported by
ActionAffectedTo=Event affected to ActionAffectedTo=Event assigned to
ActionDoneBy=Event done by ActionDoneBy=Event done by
ActionUserAsk=Reported by ActionUserAsk=Reported by
ErrorStatusCantBeZeroIfStarted=If field '<b>Date done</b>' is filled, action is started (or finished), so field '<b>Status</b>' can't be 0%%. ErrorStatusCantBeZeroIfStarted=If field '<b>Date done</b>' is filled, action is started (or finished), so field '<b>Status</b>' can't be 0%%.
@ -81,6 +81,8 @@ ActionAC_SHIP=Send shipping by mail
ActionAC_SUP_ORD=Send supplier order by mail ActionAC_SUP_ORD=Send supplier order by mail
ActionAC_SUP_INV=Send supplier invoice by mail ActionAC_SUP_INV=Send supplier invoice by mail
ActionAC_OTH=Other ActionAC_OTH=Other
ActionAC_MANUAL=Manually inserted events
ActionAC_AUTO=Automatically inserted events
Stats=Sales statistics Stats=Sales statistics
CAOrder=Sales volume (validated orders) CAOrder=Sales volume (validated orders)
FromTo=from %s to %s FromTo=from %s to %s

View File

@ -61,7 +61,7 @@ LastGroupsCreated=Last %s created groups
LastUsersCreated=Last %s users created LastUsersCreated=Last %s users created
ShowGroup=Show group ShowGroup=Show group
ShowUser=Show user ShowUser=Show user
NonAffectedUsers=Non affected users NonAffectedUsers=Non assigned users
UserModified=User modified successfully UserModified=User modified successfully
GroupModified=Group modified successfully GroupModified=Group modified successfully
PhotoFile=Photo file PhotoFile=Photo file

View File

@ -81,6 +81,9 @@ WithdrawalFileNotCapable=Unable to generate withdrawal receipt file for your cou
ShowWithdraw=Show Withdraw ShowWithdraw=Show Withdraw
IfInvoiceNeedOnWithdrawPaymentWontBeClosed=However, if invoice has at least one withdrawal payment not yet processed, it won't be set as payed to allow to manage withdrawal before. IfInvoiceNeedOnWithdrawPaymentWontBeClosed=However, if invoice has at least one withdrawal payment not yet processed, it won't be set as payed to allow to manage withdrawal before.
DoStandingOrdersBeforePayments=This tabs allows you to request for a standing order. Once it will be finished, you can type the payment to close the invoice. DoStandingOrdersBeforePayments=This tabs allows you to request for a standing order. Once it will be finished, you can type the payment to close the invoice.
WithdrawalFile=Withdrawal file
SetToStatusSent=Set to status "File Sent"
ThisWillAlsoAddPaymentOnInvoice=This will also create payments onto invoices and will classify them to paid
### Notifications ### Notifications
InfoCreditSubject=Payment of standing order %s by the bank InfoCreditSubject=Payment of standing order %s by the bank

View File

@ -720,6 +720,20 @@ VATIsNotUsedDesc=El tipo de IVA propuesto por defecto es 0. Este es el caso de a
VATIsUsedExampleFR=En Francia, se trata de las sociedades u organismos que eligen un régimen fiscal general (General simplificado o General normal), régimen en el cual se declara el IVA. VATIsUsedExampleFR=En Francia, se trata de las sociedades u organismos que eligen un régimen fiscal general (General simplificado o General normal), régimen en el cual se declara el IVA.
VATIsNotUsedExampleFR=En Francia, se trata de asociaciones exentas de IVA o sociedades, organismos o profesiones liberales que han elegido el régimen fiscal de módulos (IVA en franquicia), pagando un IVA en franquicia sin hacer declaración de IVA. Esta elección hace aparecer la anotación "IVA no aplicable - art-293B del CGI" en las facturas. VATIsNotUsedExampleFR=En Francia, se trata de asociaciones exentas de IVA o sociedades, organismos o profesiones liberales que han elegido el régimen fiscal de módulos (IVA en franquicia), pagando un IVA en franquicia sin hacer declaración de IVA. Esta elección hace aparecer la anotación "IVA no aplicable - art-293B del CGI" en las facturas.
##### Local Taxes ##### ##### Local Taxes #####
LocalTax1IsUsed=Sujeto
LocalTax1IsNotUsed=No sujeto
LocalTax1IsUsedDesc=Uso de un 2º tipo de impuesto (Distinto del IVA)
LocalTax1IsNotUsedDesc=No usar un 2º tipo de impuesto (Distinto del IVA)
LocalTax1Management=Gestión 2º tipo de impuesto
LocalTax1IsUsedExample=
LocalTax1IsNotUsedExample=
LocalTax2IsUsed=Sujeto
LocalTax2IsNotUsed=No sujeto
LocalTax2IsUsedDesc=Uso de un 3er. tipo de impuesto (Distinto del IVA)
LocalTax2IsNotUsedDesc=No usar un 3er. tipo de impuesto (Distinto del IVA)
LocalTax2Management=Gestión 3er. tipo de impuesto
LocalTax2IsUsedExample=
LocalTax2IsNotUsedExample=
LocalTax1ManagementES=Gestión RE LocalTax1ManagementES=Gestión RE
LocalTax1IsUsedDescES=El tipo de RE propuesto por defecto en las creaciones de presupuestos, facturas, pedidos, etc. Responde a la siguiente regla:<br>Si el comprador no está sujeto a RE, RE por defecto=0. Final de regla.<br>Si el comprador está sujeto a RE entonces se aplica valor de RE por defecto. Final de regla.<br> LocalTax1IsUsedDescES=El tipo de RE propuesto por defecto en las creaciones de presupuestos, facturas, pedidos, etc. Responde a la siguiente regla:<br>Si el comprador no está sujeto a RE, RE por defecto=0. Final de regla.<br>Si el comprador está sujeto a RE entonces se aplica valor de RE por defecto. Final de regla.<br>
LocalTax1IsNotUsedDescES=El tipo de RE propuesto por defecto es 0. Final de regla. LocalTax1IsNotUsedDescES=El tipo de RE propuesto por defecto es 0. Final de regla.

View File

@ -20,7 +20,6 @@ AddThisArticle=Añadir este artículo
RestartSelling=Retomar la venta RestartSelling=Retomar la venta
SellFinished=Venta terminada SellFinished=Venta terminada
PrintTicket=Imprimir ticket PrintTicket=Imprimir ticket
NoResults=Ningún resultado
NoProductFound=Ningún artículo encontrado NoProductFound=Ningún artículo encontrado
ProductFound=Producto encontrado ProductFound=Producto encontrado
ProductsFound=Productos encontrados ProductsFound=Productos encontrados

View File

@ -81,6 +81,8 @@ ActionAC_SHIP=Envío expedición por correo
ActionAC_SUP_ORD=Envío pedido a proveedor por correo ActionAC_SUP_ORD=Envío pedido a proveedor por correo
ActionAC_SUP_INV=Envío factura de proveedor por correo ActionAC_SUP_INV=Envío factura de proveedor por correo
ActionAC_OTH=Otra ActionAC_OTH=Otra
ActionAC_MANUAL=Eventos creados manualmente
ActionAC_AUTO=Eventos creados automáticamente
Stats=Estadísticas de venta Stats=Estadísticas de venta
CAOrder=Volumen de ventas (Pedidos validados) CAOrder=Volumen de ventas (Pedidos validados)
FromTo=de %s a %s FromTo=de %s a %s

View File

@ -14,6 +14,7 @@ Language_en_AU=Inglés (Australia)
Language_en_GB=Inglés (Reino Unido) Language_en_GB=Inglés (Reino Unido)
Language_en_IN=Inglés (India) Language_en_IN=Inglés (India)
Language_en_NZ=Inglés (Nueva Zelanda) Language_en_NZ=Inglés (Nueva Zelanda)
Language_en_SA=Inglés (Arabia Saudita)
Language_en_US=Inglés (Estados Unidos) Language_en_US=Inglés (Estados Unidos)
Language_es_ES=Español Language_es_ES=Español
Language_es_AR=Español (Argentina) Language_es_AR=Español (Argentina)

View File

@ -78,6 +78,7 @@ YourMailUnsubcribeOK=El correo electrónico <b>%s</b> es correcta desuscribe.
MailtoEMail=mailto email (hyperlink) MailtoEMail=mailto email (hyperlink)
ActivateCheckRead=Activar confirmación de lectura y opción de desuscripción ActivateCheckRead=Activar confirmación de lectura y opción de desuscripción
ActivateCheckReadKey=Clave usada para encriptar la URL de la confirmación de lectura y la función de desuscripción ActivateCheckReadKey=Clave usada para encriptar la URL de la confirmación de lectura y la función de desuscripción
EMailSentToNRecipients=E-Mail enviado a %s destinatarios.
# Libelle des modules de liste de destinataires mailing= # Libelle des modules de liste de destinataires mailing=
MailingModuleDescContactCompanies=Contactos de terceros (clientes potenciales, clientes, proveedores...) MailingModuleDescContactCompanies=Contactos de terceros (clientes potenciales, clientes, proveedores...)

View File

@ -627,8 +627,8 @@ ByDay=Por día
BySalesRepresentative=Por comercial BySalesRepresentative=Por comercial
LinkedToSpecificUsers=Enlazado a un contacto de usuario particular LinkedToSpecificUsers=Enlazado a un contacto de usuario particular
DeleteAFile=Eliminación de archivo DeleteAFile=Eliminación de archivo
ConfirmDeleteAFile=Confirma la eliminación del archivo ConfirmDeleteAFile=Confirme la eliminación del archivo
NoResults=Ningún resultado
# Week day # Week day
Monday=Lunes Monday=Lunes
Tuesday=Martes Tuesday=Martes

View File

@ -199,3 +199,6 @@ Collectivités=Colectividades
Particuliers=Particulares Particuliers=Particulares
Entreprises=Empresas Entreprises=Empresas
DOLIBARRFOUNDATION_PAYMENT_FORM=Para realizar el pago de su cotización por transferencia bancaria, visite la página <a target="_blank" href="http://wiki.dolibarr.org/index.php/Subscribirse#Para_una_adhesi.C3.B3n_por_transferencia">http://wiki.dolibarr.org/index.php/Subscribirse</a>.<br>Para pagar con tarjeta de crédito o PayPal, haga clic en el botón en la parte inferior de esta página.<br><br> DOLIBARRFOUNDATION_PAYMENT_FORM=Para realizar el pago de su cotización por transferencia bancaria, visite la página <a target="_blank" href="http://wiki.dolibarr.org/index.php/Subscribirse#Para_una_adhesi.C3.B3n_por_transferencia">http://wiki.dolibarr.org/index.php/Subscribirse</a>.<br>Para pagar con tarjeta de crédito o PayPal, haga clic en el botón en la parte inferior de esta página.<br><br>
ByProperties=Por características
MembersStatisticsByProperties=Estadísticas de los miembros por características
MembersByNature=Miembros por naturaleza

View File

@ -93,6 +93,7 @@ CloneFiles=Clonar los archivos adjuntos
ConfirmCloneProject=¿Está seguro de querer clonar este proyecto? ConfirmCloneProject=¿Está seguro de querer clonar este proyecto?
ProjectReportDate=Cambiar las fechas de las tareas en función de la fecha de inicio del proyecto ProjectReportDate=Cambiar las fechas de las tareas en función de la fecha de inicio del proyecto
ErrorShiftTaskDate=Se ha producido un error en el cambio de las fechas de las tareas ErrorShiftTaskDate=Se ha producido un error en el cambio de las fechas de las tareas
ProjectsAndTasksLines=Proyectos y tareas
##### Types de contacts ##### ##### Types de contacts #####
TypeContact_project_internal_PROJECTLEADER=Jefe de proyecto TypeContact_project_internal_PROJECTLEADER=Jefe de proyecto
TypeContact_project_external_PROJECTLEADER=Jefe de proyecto TypeContact_project_external_PROJECTLEADER=Jefe de proyecto

View File

@ -58,6 +58,7 @@ ActionsOnShipping=Eventos sobre la expedición
LinkToTrackYourPackage=Enlace para el seguimento de su paquete LinkToTrackYourPackage=Enlace para el seguimento de su paquete
ShipmentCreationIsDoneFromOrder=De momento, la creación de una nueva expedición se realiza desde la ficha de pedido. ShipmentCreationIsDoneFromOrder=De momento, la creación de una nueva expedición se realiza desde la ficha de pedido.
RelatedShippings=Expedición(es) asociada(s) RelatedShippings=Expedición(es) asociada(s)
ShipmentLine=Línea de expedición
# Sending methods # Sending methods
SendingMethodCATCH=Recogido por el cliente SendingMethodCATCH=Recogido por el cliente

View File

@ -715,6 +715,20 @@ VATIsNotUsedDesc= Le taux de TVA proposé par défaut est 0. C'est le cas d'asso
VATIsUsedExampleFR= En France, il s'agit des sociétés ou organismes ayant choisi un régime fiscale réel (Réel simplifié ou Réel normal), régime dans lequel la TVA est déclarée. VATIsUsedExampleFR= En France, il s'agit des sociétés ou organismes ayant choisi un régime fiscale réel (Réel simplifié ou Réel normal), régime dans lequel la TVA est déclarée.
VATIsNotUsedExampleFR= En France, il s'agit des associations ne déclarant pas de TVA ou sociétés, organismes ou professions libérales ayant choisi le régime fiscal micro entreprise (TVA en franchise) et payant une TVA en franchise sans faire de déclaration de TVA. Ce choix fait de plus apparaitre la mention "TVA non applicable - art-293B du CGI" sur les factures. VATIsNotUsedExampleFR= En France, il s'agit des associations ne déclarant pas de TVA ou sociétés, organismes ou professions libérales ayant choisi le régime fiscal micro entreprise (TVA en franchise) et payant une TVA en franchise sans faire de déclaration de TVA. Ce choix fait de plus apparaitre la mention "TVA non applicable - art-293B du CGI" sur les factures.
##### Local Taxes ##### ##### Local Taxes #####
LocalTax1IsUsed=Assujeti
LocalTax1IsNotUsed=Non assujeti
LocalTax1IsUsedDesc=Utilisation d'une 2eme type taxe (autre que TVA)
LocalTax1IsNotUsedDesc=Pas d'utilisation de 2eme type taxe (autre que TVA)
LocalTax1Management=Gestion 2eme type de tax
LocalTax1IsUsedExample=
LocalTax1IsNotUsedExample=
LocalTax2IsUsed=Assujeti
LocalTax2IsNotUsed=Non assujeti
LocalTax2IsUsedDesc=Utilisation d'une 3eme type taxe (autre que TVA)
LocalTax2IsNotUsedDesc=Pas d'utilisation de 3eme type taxe (autre que TVA)
LocalTax2Management=Gestion 3eme type de tax
LocalTax2IsUsedExample=
LocalTax2IsNotUsedExample=
LocalTax1ManagementES= Gestion RE LocalTax1ManagementES= Gestion RE
LocalTax1IsUsedDescES= Le taux de RE proposé par défaut lors de la création de propale, facture, commande, etc... répond à la règle standard suivante:<br>Si acheteur non assujetti à RE, RE par défaut=0. Fin de règle.<br>Si acheteur assujetti à RE alors RE par défaut. Fin de règle.<br> LocalTax1IsUsedDescES= Le taux de RE proposé par défaut lors de la création de propale, facture, commande, etc... répond à la règle standard suivante:<br>Si acheteur non assujetti à RE, RE par défaut=0. Fin de règle.<br>Si acheteur assujetti à RE alors RE par défaut. Fin de règle.<br>
LocalTax1IsNotUsedDescES= Le taux de RE proposé par défaut est 0. Fin de règle. LocalTax1IsNotUsedDescES= Le taux de RE proposé par défaut est 0. Fin de règle.

View File

@ -81,6 +81,8 @@ ActionAC_SHIP=Envoi bon d'expédition par mail
ActionAC_SUP_ORD=Envoi commande fournisseur par mail ActionAC_SUP_ORD=Envoi commande fournisseur par mail
ActionAC_SUP_INV=Envoi facture fournisseur par mail ActionAC_SUP_INV=Envoi facture fournisseur par mail
ActionAC_OTH=Autre ActionAC_OTH=Autre
ActionAC_MANUAL=Evênements insérés manuellement
ActionAC_AUTO=Evênements insérés automatiquement
Stats=Statistiques de vente Stats=Statistiques de vente
CAOrder=Chiffre d'affaires (Commandes validées) CAOrder=Chiffre d'affaires (Commandes validées)
FromTo=du %s au %s FromTo=du %s au %s

View File

@ -81,6 +81,9 @@ WithdrawalFileNotCapable=Impossible de générer un fichier de bons de prélève
ShowWithdraw=Voir prélèvement ShowWithdraw=Voir prélèvement
IfInvoiceNeedOnWithdrawPaymentWontBeClosed=Toutefois, si la facture a au moins un paiement par prélèvement non traité, elle ne le sera pas afin de permettre la gestion du prélèvement d'abord. IfInvoiceNeedOnWithdrawPaymentWontBeClosed=Toutefois, si la facture a au moins un paiement par prélèvement non traité, elle ne le sera pas afin de permettre la gestion du prélèvement d'abord.
DoStandingOrdersBeforePayments=Cet onglet permet de faire une demande de prélèvement bancaire. Une fois réalisé, vous pourrez saisir le paiement sur la facture pour la clore. DoStandingOrdersBeforePayments=Cet onglet permet de faire une demande de prélèvement bancaire. Une fois réalisé, vous pourrez saisir le paiement sur la facture pour la clore.
WithdrawalFile=Fichier de prélèvement
SetToStatusSent=Mettre status "Fichier envoyé"
ThisWillAlsoAddPaymentOnInvoice=Ceci créera également les paiements sur les factures et les classera payées
### Notifications ### Notifications
InfoCreditSubject=Crédit prélèvement %s à la banque InfoCreditSubject=Crédit prélèvement %s à la banque

View File

@ -349,11 +349,8 @@ if ($id || $ref)
//print $form->load_tva('tva_tx',$product->tva_tx,$supplier,$mysoc); // Do not use list here as it may be any vat rates for any country //print $form->load_tva('tva_tx',$product->tva_tx,$supplier,$mysoc); // Do not use list here as it may be any vat rates for any country
if (! empty($socid)) // When update if (! empty($socid)) // When update
{ {
$supplierselected=new Societe($db);
$supplierselected->fetch($socid);
$default_vat=get_default_tva($supplier, $mysoc, $product->id); $default_vat=get_default_tva($supplier, $mysoc, $product->id);
} }
if ($action == 'add_price' && $socid) $default_vat=$product->tva_tx; // If editing product-fourn
print '<input type="text" class="flat" size="5" name="tva_tx" value="'.(GETPOST("tva_tx")?vatrate(GETPOST("tva_tx")):($default_vat!=''?vatrate($default_vat):'')).'">'; print '<input type="text" class="flat" size="5" name="tva_tx" value="'.(GETPOST("tva_tx")?vatrate(GETPOST("tva_tx")):($default_vat!=''?vatrate($default_vat):'')).'">';
print '</td></tr>'; print '</td></tr>';

View File

@ -2570,6 +2570,43 @@ class Societe extends CommonObject
$this->idprof6='idprof6'; $this->idprof6='idprof6';
} }
/**
* Check if localtax define for company
* Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @param localTaxNum $localTaxNum 1 or 2
* @return boolean true / false
*/
function hasLocalTax($localTaxNum) {
global $user,$langs,$conf;
// check parameter
if ($localTaxNum != 1 && $localTaxNum != 2)
return false;
// Search local taxes
$sql = "SELECT t.localtax1, t.localtax2";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
$sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$this->country_code."'";
$sql .= " AND t.active = 1";
if ($localTaxNum == 1)
$sql .= " AND t.localtax1 <> 0";
elseif ($localTaxNum == 2)
$sql .= " AND t.localtax2 <> 0";
dol_syslog("get_localtax sql=".$sql);
$resql=$this->db->query($sql);
if ($resql)
{
return ($this->db->num_rows($resql) > 0);
}
else
return false;
}
} }
?> ?>

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2012 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
@ -232,7 +232,7 @@ if ($result > 0)
foreach($listofnotifiedevents as $notifiedevent) foreach($listofnotifiedevents as $notifiedevent)
{ {
$label=$langs->trans("Notify_".$notifiedevent['code'])!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label']; $label=($langs->trans("Notify_".$notifiedevent['code'])!="Notify_".$notifiedevent['code']?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label']);
$actions[$notifiedevent['rowid']]=$label; $actions[$notifiedevent['rowid']]=$label;
} }
print '<tr '.$bc[$var].'><td>'; print '<tr '.$bc[$var].'><td>';

View File

@ -907,30 +907,26 @@ else
print '<tr><td>'.$langs->trans('Capital').'</td><td colspan="3"><input type="text" name="capital" size="10" value="'.$object->capital.'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>'; print '<tr><td>'.$langs->trans('Capital').'</td><td colspan="3"><input type="text" name="capital" size="10" value="'.$object->capital.'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
// Local Taxes // Local Taxes
// TODO add specific function by country if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
if($mysoc->country_code=='ES')
{ {
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") print '<tr><td>'.$langs->trans("LocalTax1IsUsed").'</td><td>';
{ print $form->selectyesno('localtax1assuj_value',0,1);
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td>'; print '</td><td>'.$langs->trans("LocalTax2IsUsed").'</td><td>';
print $form->selectyesno('localtax1assuj_value',0,1); print $form->selectyesno('localtax2assuj_value',0,1);
print '</td><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td>'; print '</td></tr>';
print $form->selectyesno('localtax2assuj_value',0,1);
print '</td></tr>';
} }
elseif($mysoc->localtax1_assuj=="1") elseif($mysoc->localtax1_assuj=="1")
{ {
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("LocalTax1IsUsed").'</td><td colspan="3">';
print $form->selectyesno('localtax1assuj_value',0,1); print $form->selectyesno('localtax1assuj_value',0,1);
print '</td><tr>'; print '</td><tr>';
} }
elseif($mysoc->localtax2_assuj=="1") elseif($mysoc->localtax2_assuj=="1")
{ {
print '<tr><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("LocalTax2IsUsed").'</td><td colspan="3">';
print $form->selectyesno('localtax2assuj_value',0,1); print $form->selectyesno('localtax2assuj_value',0,1);
print '</td><tr>'; print '</td><tr>';
}
} }
if (! empty($conf->global->MAIN_MULTILANGS)) if (! empty($conf->global->MAIN_MULTILANGS))
@ -1322,31 +1318,27 @@ else
print '</tr>'; print '</tr>';
// Local Taxes // Local Taxes
// TODO add specific function by country if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
if($mysoc->country_code=='ES')
{ {
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td>';
{ print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td>'; print '</td><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td>';
print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
print '</td><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td>'; print '</td></tr>';
print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
print '</td></tr>';
} }
elseif($mysoc->localtax1_assuj=="1") elseif($mysoc->localtax1_assuj=="1")
{ {
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td colspan="3">';
print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
print '</td></tr>'; print '</td></tr>';
} }
elseif($mysoc->localtax2_assuj=="1") elseif($mysoc->localtax2_assuj=="1")
{ {
print '<tr><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td colspan="3">';
print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
print '</td></tr>'; print '</td></tr>';
}
} }
// Type - Size // Type - Size
@ -1642,30 +1634,26 @@ else
print '</tr>'; print '</tr>';
// Local Taxes // Local Taxes
// TODO add specific function by country if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
if($mysoc->country_code=='ES')
{ {
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td>';
{ print yn($object->localtax1_assuj);
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td>'; print '</td><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td>';
print yn($object->localtax1_assuj); print yn($object->localtax2_assuj);
print '</td><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td>'; print '</td></tr>';
print yn($object->localtax2_assuj);
print '</td></tr>';
} }
elseif($mysoc->localtax1_assuj=="1") elseif($mysoc->localtax1_assuj=="1")
{ {
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td colspan="3">';
print yn($object->localtax1_assuj); print yn($object->localtax1_assuj);
print '</td><tr>'; print '</td><tr>';
} }
elseif($mysoc->localtax2_assuj=="1") elseif($mysoc->localtax2_assuj=="1")
{ {
print '<tr><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td colspan="3">';
print yn($object->localtax2_assuj); print yn($object->localtax2_assuj);
print '</td><tr>'; print '</td><tr>';
}
} }
// Type + Staff // Type + Staff