Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop
This commit is contained in:
commit
5e5cb1da92
@ -547,7 +547,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
/*
|
||||
* Local Taxes
|
||||
*/
|
||||
if ($mysoc->country_code=='ES')
|
||||
if ($mysoc->hasLocalTax(1))
|
||||
{
|
||||
// Local Tax 1
|
||||
print '<br>';
|
||||
@ -563,7 +563,8 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
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 "</td></tr>\n";
|
||||
|
||||
@ -572,11 +573,14 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
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 "</td></tr>\n";
|
||||
print "</table>";
|
||||
|
||||
}
|
||||
if ($mysoc->hasLocalTax(2))
|
||||
{
|
||||
// Local Tax 2
|
||||
print '<br>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
@ -591,7 +595,8 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
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 "</td></tr>\n";
|
||||
|
||||
@ -600,7 +605,8 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
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 "</td></tr>\n";
|
||||
print "</table>";
|
||||
@ -921,7 +927,7 @@ else
|
||||
/*
|
||||
* Local Taxes
|
||||
*/
|
||||
if ($mysoc->country_code=='ES')
|
||||
if ($mysoc->hasLocalTax(1))
|
||||
{
|
||||
// Local Tax 1
|
||||
print '<br>';
|
||||
@ -937,7 +943,8 @@ else
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
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 "</td></tr>\n";
|
||||
|
||||
@ -946,12 +953,15 @@ else
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
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 "</td></tr>\n";
|
||||
|
||||
print "</table>";
|
||||
|
||||
}
|
||||
if ($mysoc->hasLocalTax(2))
|
||||
{
|
||||
// Local Tax 2
|
||||
print '<br>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
@ -966,7 +976,8 @@ else
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
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 "</td></tr>\n";
|
||||
|
||||
@ -975,7 +986,8 @@ else
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
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 "</td></tr>\n";
|
||||
|
||||
|
||||
@ -1066,16 +1066,21 @@ if ($id)
|
||||
}
|
||||
}
|
||||
|
||||
print '<td align="center" nowrap="nowrap">';
|
||||
// Est-ce une entree du dictionnaire qui peut etre desactivee ?
|
||||
$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 == 'RECEP') $iserasable=0;
|
||||
if (isset($obj->code) && $obj->code == 'EF0') $iserasable=0;
|
||||
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0;
|
||||
// Est-ce une entree du dictionnaire qui peut etre desactivee ?
|
||||
$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 == 'RECEP') $iserasable=0;
|
||||
if (isset($obj->code) && $obj->code == 'EF0') $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:'')).'&code='.(! empty($obj->code)?$obj->code:'').'&id='.$id.'&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>";
|
||||
|
||||
// Modify link
|
||||
|
||||
@ -726,7 +726,10 @@ class ActionComm extends CommonObject
|
||||
|
||||
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;
|
||||
}
|
||||
if ($withpicto==1) $result.=' ';
|
||||
|
||||
@ -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 string $idorcode 'id' or 'code'
|
||||
* @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
|
||||
*/
|
||||
function liste_array($active='',$idorcode='id',$excludetype='')
|
||||
function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0)
|
||||
{
|
||||
global $langs,$conf;
|
||||
$langs->load("commercial");
|
||||
@ -110,7 +111,7 @@ class CActionComm
|
||||
$repid = array();
|
||||
$repcode = array();
|
||||
|
||||
$sql = "SELECT id, code, libelle, module";
|
||||
$sql = "SELECT id, code, libelle, module, type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm";
|
||||
if ($active != '') $sql.=" WHERE active=".$active;
|
||||
if (! empty($excludetype)) $sql.=($active != ''?" AND":" WHERE")." type <> '".$excludetype."'";
|
||||
@ -127,20 +128,31 @@ class CActionComm
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$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 == 'order' && ! $conf->commande->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 == 'order_supplier' && ! $conf->fournisseur->enabled) $qualified=0;
|
||||
if ($obj->module == 'shipping' && ! $conf->expedition->enabled) $qualified=0;
|
||||
}
|
||||
|
||||
if ($qualified)
|
||||
{
|
||||
$transcode=$langs->trans("Action".$obj->code);
|
||||
$repid[$obj->id] = ($transcode!="Action".$obj->code?$transcode:$langs->trans($obj->libelle));
|
||||
$repcode[$obj->code] = ($transcode!="Action".$obj->code?$transcode:$langs->trans($obj->libelle));
|
||||
$code=$obj->code;
|
||||
if ($onlyautoornot && $code == 'AC_OTH') $code='AC_MANUAL';
|
||||
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++;
|
||||
}
|
||||
|
||||
@ -127,7 +127,10 @@ if ($objectid > 0)
|
||||
print '</td></tr>';
|
||||
|
||||
// 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
|
||||
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$act->label.'</td></tr>';
|
||||
|
||||
@ -107,6 +107,13 @@ if ($action == 'add_action')
|
||||
$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
|
||||
if (! GETPOST('actioncode'))
|
||||
{
|
||||
@ -122,13 +129,13 @@ if ($action == 'add_action')
|
||||
// Initialisation objet actioncomm
|
||||
$actioncomm->type_id = $cactioncomm->id;
|
||||
$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->location = isset($_POST["location"])?$_POST["location"]:'';
|
||||
$actioncomm->label = trim($_POST["label"]);
|
||||
if (! $_POST["label"])
|
||||
$actioncomm->location = GETPOST("location");
|
||||
$actioncomm->label = trim(GETPOST('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));
|
||||
}
|
||||
@ -390,11 +397,13 @@ if ($action == 'create')
|
||||
$(".fulldaystartmin").removeAttr("disabled");
|
||||
$(".fulldayendhour").removeAttr("disabled");
|
||||
$(".fulldayendmin").removeAttr("disabled");
|
||||
$("#p2").removeAttr("disabled");
|
||||
} else {
|
||||
$(".fulldaystarthour").attr("disabled","disabled").val("00");
|
||||
$(".fulldaystartmin").attr("disabled","disabled").val("00");
|
||||
$(".fulldayendhour").attr("disabled","disabled").val("23");
|
||||
$(".fulldayendmin").attr("disabled","disabled").val("59");
|
||||
$("#p2").attr("disabled","disabled").val("");
|
||||
}
|
||||
}
|
||||
setdatefields();
|
||||
@ -432,21 +441,25 @@ if ($action == 'create')
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Type d'action actifs
|
||||
print '<tr><td width="30%"><span class="fieldrequired">'.$langs->trans("Type").'</span></b></td><td>';
|
||||
if (GETPOST("actioncode"))
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
print '<input type="hidden" name="actioncode" value="'.GETPOST("actioncode").'">'."\n";
|
||||
$cactioncomm->fetch(GETPOST("actioncode"));
|
||||
print $cactioncomm->getNomUrl();
|
||||
print '<tr><td width="30%"><span class="fieldrequired">'.$langs->trans("Type").'</span></b></td><td>';
|
||||
if (GETPOST("actioncode"))
|
||||
{
|
||||
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
|
||||
{
|
||||
$htmlactions->select_type_actions($actioncomm->type_code, "actioncode","systemauto");
|
||||
}
|
||||
print '</td></tr>';
|
||||
else print '<input type="hidden" name="actioncode" value="AC_OTH">';
|
||||
|
||||
// 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
|
||||
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>';
|
||||
|
||||
// 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
|
||||
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
|
||||
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>';
|
||||
|
||||
// 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
|
||||
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$act->label.'</td></tr>';
|
||||
|
||||
@ -340,6 +340,7 @@ if ($action == 'create')
|
||||
$langs->load("bills");
|
||||
print '<center>';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("CreateDraft").'">';
|
||||
print ' <input type="button" class="button" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">';
|
||||
print '</center>';
|
||||
|
||||
print "</form>";
|
||||
|
||||
@ -1565,21 +1565,19 @@ print '<td align="right" nowrap>'.price($object->total_tva).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
|
||||
// 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 '<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>';
|
||||
}
|
||||
print '<tr><td height="10">'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td>';
|
||||
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
|
||||
{
|
||||
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
|
||||
print '<tr><td height="10">'.$langs->trans('AmountTTC').'</td>';
|
||||
|
||||
@ -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('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>";
|
||||
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>";
|
||||
}
|
||||
|
||||
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->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>";
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans('TotalTTC').'</td><td colspan="2">'.price($objectsrc->total_ttc)."</td></tr>";
|
||||
}
|
||||
else
|
||||
@ -1814,11 +1812,8 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
|
||||
if (! empty($conf->projet->enabled)) $nbrow++;
|
||||
|
||||
//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%">';
|
||||
|
||||
@ -2075,20 +2070,17 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
|
||||
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
|
||||
|
||||
// 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 '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
}
|
||||
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 '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
}
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td>';
|
||||
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
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td>';
|
||||
print '<td align="right">'.price($object->total_localtax2).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
}
|
||||
|
||||
// Total TTC
|
||||
|
||||
@ -757,6 +757,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
||||
$object->amount = $_POST['amount'];
|
||||
$object->remise_absolue = $_POST['remise_absolue'];
|
||||
$object->remise_percent = $_POST['remise_percent'];
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
// If creation from another object of another module (Example: origin=propal, originid=1)
|
||||
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('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>";
|
||||
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
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->pays_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->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>";
|
||||
}
|
||||
@ -2654,11 +2652,8 @@ else if ($id > 0 || ! empty($ref))
|
||||
if (! empty($conf->banque->enabled)) $nbcols++;
|
||||
|
||||
//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">';
|
||||
|
||||
|
||||
@ -434,7 +434,7 @@ else
|
||||
|
||||
$colspan=3;
|
||||
if ($conf->use_javascript_ajax && $socid > 0) $colspan=2;
|
||||
|
||||
|
||||
// Address
|
||||
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->address)) == 0) $object->address = $objsoc->address; // Predefined with third party
|
||||
print '<tr><td>'.$langs->trans("Address");
|
||||
@ -442,9 +442,9 @@ else
|
||||
|
||||
if ($conf->use_javascript_ajax && $socid > 0)
|
||||
{
|
||||
$rowspan=3;
|
||||
$rowspan=3;
|
||||
if (empty($conf->global->SOCIETE_DISABLE_STATE)) $rowspan++;
|
||||
|
||||
|
||||
print '<td valign="middle" align="center" rowspan="'.$rowspan.'">';
|
||||
print '<a href="#" id="copyaddressfromsoc">'.$langs->trans('CopyAddressFromSoc').'</a>';
|
||||
print '</td>';
|
||||
@ -460,7 +460,7 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
// Country
|
||||
if (dol_strlen(trim($object->fk_pays)) == 0) $object->fk_pays = $objsoc->country_id; // Predefined with third party
|
||||
if (dol_strlen(trim($object->country_id)) == 0) $object->country_id = $objsoc->country_id; // Predefined with third party
|
||||
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="'.$colspan.'">';
|
||||
print $form->select_country((isset($_POST["country_id"])?$_POST["country_id"]:$object->fk_pays),'country_id');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||
|
||||
@ -1518,27 +1518,49 @@ abstract class CommonObject
|
||||
$this->total_localtax2 += $obj->total_localtax2;
|
||||
$this->total_ttc += $obj->total_ttc;
|
||||
|
||||
// Define vatrates with totals for each line and for all lines
|
||||
// TODO $vatrates and $vatrates_alllines not used ?
|
||||
if (! empty($this->vatrate))
|
||||
// Check if global invoice tax for this vat rate
|
||||
if (! empty($obj->vatrate))
|
||||
{
|
||||
$vatrates[$this->vatrate][]=array(
|
||||
'total_ht' =>$obj->total_ht,
|
||||
'total_tva' =>$obj->total_tva,
|
||||
'total_ttc' =>$obj->total_ttc,
|
||||
'total_localtax1'=>$obj->total_localtax1,
|
||||
'total_localtax2'=>$obj->total_localtax2
|
||||
);
|
||||
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;
|
||||
if (! isset($vatrates_alllines[$this->vatrate]['total_localtax1'])) $vatrates_alllines[$this->vatrate]['total_localtax1']=0;
|
||||
if (! isset($vatrates_alllines[$this->vatrate]['total_localtax2'])) $vatrates_alllines[$this->vatrate]['total_localtax2']=0;
|
||||
if (! isset($vatrates_alllines[$this->vatrate]['total_ttc'])) $vatrates_alllines[$this->vatrate]['total_ttc']=0;
|
||||
$vatrates_alllines[$this->vatrate]['total_ht'] +=$obj->total_ht;
|
||||
$vatrates_alllines[$this->vatrate]['total_tva'] +=$obj->total_tva;
|
||||
$vatrates_alllines[$this->vatrate]['total_localtax1']+=$obj->total_localtax1;
|
||||
$vatrates_alllines[$this->vatrate]['total_localtax2']+=$obj->total_localtax2;
|
||||
$vatrates_alllines[$this->vatrate]['total_ttc'] +=$obj->total_ttc;
|
||||
if ($this->total_localtax1 == 0)
|
||||
{
|
||||
// Search local taxes
|
||||
$sql = "SELECT t.localtax1, t.localtax1_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->localtax1_type == '7')
|
||||
{
|
||||
$this->total_localtax1 += $objt->localtax1;
|
||||
$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++;
|
||||
@ -1546,21 +1568,6 @@ abstract class CommonObject
|
||||
|
||||
$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
|
||||
$fieldht='total_ht';
|
||||
$fieldtva='tva';
|
||||
@ -3037,4 +3044,4 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@ -194,9 +194,10 @@ class FormActions
|
||||
* @param string $selected Type pre-selectionne
|
||||
* @param string $htmlname Nom champ formulaire
|
||||
* @param string $excludetype Type to exclude
|
||||
* @param string $onlyautoornot Group list by auto events or not
|
||||
* @return void
|
||||
*/
|
||||
function select_type_actions($selected='',$htmlname='actioncode',$excludetype='')
|
||||
function select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0)
|
||||
{
|
||||
global $langs,$user;
|
||||
|
||||
@ -205,12 +206,13 @@ class FormActions
|
||||
$caction=new CActionComm($this->db);
|
||||
$form=new Form($this->db);
|
||||
|
||||
$arraylist=$caction->liste_array(1, 'code', $excludetype);
|
||||
array_unshift($arraylist,' '); // Add empty line at start
|
||||
//asort($arraylist);
|
||||
// Suggest a list with manual event or all auto events
|
||||
$arraylist=$caction->liste_array(1, 'code', $excludetype, $onlyautoornot);
|
||||
array_unshift($arraylist,' '); // Add empty line at start
|
||||
//asort($arraylist);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -93,7 +93,10 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt
|
||||
print '<td nowrap="nowrap">';
|
||||
print $langs->trans("Type");
|
||||
print ' </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>';
|
||||
}
|
||||
|
||||
|
||||
@ -2721,7 +2721,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
|
||||
}
|
||||
|
||||
// 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 .= " WHERE t.fk_pays = p.rowid AND p.code = '".$code_country."'";
|
||||
$sql .= " AND t.taux = ".$tva." AND t.active = 1";
|
||||
@ -2731,9 +2731,8 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($local==1) return $obj->localtax1;
|
||||
elseif ($local==2) return $obj->localtax2;
|
||||
//else return array($obj->localtax1,$obj->localtax2);
|
||||
if ($local==1 && $obj->localtax1_type != '7') return $obj->localtax1;
|
||||
elseif ($local==2 && $obj->localtax2_type != '7') return $obj->localtax2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
* 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
|
||||
* 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->localtax1=array();
|
||||
$this->localtax2=array();
|
||||
$this->localtax1_type=array();
|
||||
$this->localtax2_type=array();
|
||||
$this->atleastoneratenotnull=0;
|
||||
$this->atleastonediscount=0;
|
||||
}
|
||||
@ -368,16 +371,24 @@ class pdf_azur extends ModelePDFPropales
|
||||
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
|
||||
|
||||
$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 (! 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->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
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
@ -735,6 +746,84 @@ class pdf_azur extends ModelePDFPropales
|
||||
}
|
||||
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)
|
||||
{
|
||||
if ($tvakey > 0) // On affiche pas taux 0
|
||||
@ -759,48 +848,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++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1);
|
||||
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1);
|
||||
|
||||
// Total LocalTax1
|
||||
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on' && $object->total_localtax1>0)
|
||||
{
|
||||
$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)
|
||||
foreach( $this->localtax1 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++;
|
||||
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
|
||||
|
||||
$tvacompl='';
|
||||
if (preg_match('/\*/',$tvakey))
|
||||
@ -808,27 +874,43 @@ class pdf_azur extends ModelePDFPropales
|
||||
$tvakey=str_replace('*','',$tvakey);
|
||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||
}
|
||||
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' ';
|
||||
$totalvat.=vatrate($tvakey,1).$tvacompl;
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' ';
|
||||
if ($localtax_type == '7') { // amount on order
|
||||
$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);
|
||||
$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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
|
||||
{
|
||||
//Local tax 2
|
||||
foreach($this->localtax2 as $tvakey => $tvaval)
|
||||
}
|
||||
//Local tax 2 after 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 '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++;
|
||||
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
|
||||
|
||||
$tvacompl='';
|
||||
if (preg_match('/\*/',$tvakey))
|
||||
@ -836,13 +918,21 @@ class pdf_azur extends ModelePDFPropales
|
||||
$tvakey=str_replace('*','',$tvakey);
|
||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||
}
|
||||
$totalvat =$outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' ';
|
||||
$totalvat.=vatrate($tvakey,1).$tvacompl;
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' ';
|
||||
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
|
||||
if ($localtax_type == '7') { // amount on order
|
||||
$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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("other");
|
||||
$langs->load("agenda");
|
||||
|
||||
$object->actiontypecode='AC_OTH';
|
||||
$object->actiontypecode='AC_OTH_AUTO';
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("NewCompanyToDolibarr",$object->nom);
|
||||
$object->actionmsg=$langs->transnoentities("NewCompanyToDolibarr",$object->nom);
|
||||
if ($object->prefix) $object->actionmsg.=" (".$object->prefix.")";
|
||||
@ -146,7 +146,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("contracts");
|
||||
$langs->load("agenda");
|
||||
|
||||
$object->actiontypecode='AC_OTH';
|
||||
$object->actiontypecode='AC_OTH_AUTO';
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ContractValidatedInDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("ContractValidatedInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||
@ -160,7 +160,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("propal");
|
||||
$langs->load("agenda");
|
||||
|
||||
$object->actiontypecode='AC_OTH';
|
||||
$object->actiontypecode='AC_OTH_AUTO';
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalValidatedInDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("PropalValidatedInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||
@ -174,7 +174,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("propal");
|
||||
$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->actionmsg))
|
||||
{
|
||||
@ -192,7 +192,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("propal");
|
||||
$langs->load("agenda");
|
||||
|
||||
$object->actiontypecode='AC_OTH';
|
||||
$object->actiontypecode='AC_OTH_AUTO';
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||
@ -206,7 +206,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("propal");
|
||||
$langs->load("agenda");
|
||||
|
||||
$object->actiontypecode='AC_OTH';
|
||||
$object->actiontypecode='AC_OTH_AUTO';
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||
@ -220,7 +220,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("orders");
|
||||
$langs->load("agenda");
|
||||
|
||||
$object->actiontypecode='AC_OTH';
|
||||
$object->actiontypecode='AC_OTH_AUTO';
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||
@ -234,7 +234,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("orders");
|
||||
$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->actionmsg))
|
||||
{
|
||||
@ -253,7 +253,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("bills");
|
||||
$langs->load("agenda");
|
||||
|
||||
$object->actiontypecode='AC_OTH';
|
||||
$object->actiontypecode='AC_OTH_AUTO';
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||
@ -268,7 +268,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("bills");
|
||||
$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->actionmsg))
|
||||
{
|
||||
@ -288,7 +288,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("agenda");
|
||||
|
||||
// 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->actionmsg=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||
@ -303,7 +303,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("bills");
|
||||
$langs->load("agenda");
|
||||
|
||||
$object->actiontypecode='AC_OTH';
|
||||
$object->actiontypecode='AC_OTH_AUTO';
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||
@ -318,7 +318,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("interventions");
|
||||
$langs->load("agenda");
|
||||
|
||||
$object->actiontypecode='AC_OTH';
|
||||
$object->actiontypecode='AC_OTH_AUTO';
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionValidatedInDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("InterventionValidatedInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||
@ -335,7 +335,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("interventions");
|
||||
$langs->load("agenda");
|
||||
|
||||
$object->actiontypecode='AC_EMAIL';
|
||||
$object->actiontypecode='AC_OTH_AUTO';
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionSentByEMail",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("InterventionSentByEMail",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||
@ -351,7 +351,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("sendings");
|
||||
$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->actionmsg))
|
||||
{
|
||||
@ -369,7 +369,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("orders");
|
||||
$langs->load("agenda");
|
||||
|
||||
$object->actiontypecode='AC_OTH';
|
||||
$object->actiontypecode='AC_OTH_AUTO';
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||
@ -385,7 +385,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("agenda");
|
||||
$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->actionmsg))
|
||||
{
|
||||
@ -404,7 +404,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("bills");
|
||||
$langs->load("agenda");
|
||||
|
||||
$object->actiontypecode='AC_OTH';
|
||||
$object->actiontypecode='AC_OTH_AUTO';
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||
@ -420,7 +420,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("agenda");
|
||||
$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->actionmsg))
|
||||
{
|
||||
@ -439,7 +439,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("bills");
|
||||
$langs->load("agenda");
|
||||
|
||||
$object->actiontypecode='AC_OTH';
|
||||
$object->actiontypecode='AC_OTH_AUTO';
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||
@ -454,7 +454,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("bills");
|
||||
$langs->load("agenda");
|
||||
|
||||
$object->actiontypecode='AC_OTH';
|
||||
$object->actiontypecode='AC_OTH_AUTO';
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||
@ -471,7 +471,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("members");
|
||||
$langs->load("agenda");
|
||||
|
||||
$object->actiontypecode='AC_OTH';
|
||||
$object->actiontypecode='AC_OTH_AUTO';
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
|
||||
@ -488,7 +488,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("members");
|
||||
$langs->load("agenda");
|
||||
|
||||
$object->actiontypecode='AC_OTH';
|
||||
$object->actiontypecode='AC_OTH_AUTO';
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
|
||||
@ -511,7 +511,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("members");
|
||||
$langs->load("agenda");
|
||||
|
||||
$object->actiontypecode='AC_OTH';
|
||||
$object->actiontypecode='AC_OTH_AUTO';
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
|
||||
@ -528,7 +528,7 @@ class InterfaceActionsAuto
|
||||
$langs->load("members");
|
||||
$langs->load("agenda");
|
||||
|
||||
$object->actiontypecode='AC_OTH';
|
||||
$object->actiontypecode='AC_OTH_AUTO';
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
|
||||
|
||||
@ -30,15 +30,16 @@
|
||||
-- Types action comm
|
||||
--
|
||||
|
||||
delete from llx_c_actioncomm where id in (1,2,3,4,5,8,9,10,30,31,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, position) values ( 2, 'AC_FAX', 'system', 'Send Fax' ,NULL, 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, position) values ( 4, 'AC_EMAIL', 'system', 'Send Email' ,NULL, 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, position) values ( 8, 'AC_COM', 'systemauto', 'Send customer order by email' ,'order', 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, position) values ( 10, 'AC_SHIP', 'systemauto', 'Send shipping by email' ,'shipping', 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, 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, position) values ( 50, 'AC_OTH', 'system', 'Other' ,NULL, 5);
|
||||
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, active, position) values ( 1, 'AC_TEL', 'system', 'Phone call' ,NULL, 1, 2);
|
||||
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, 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, active, position) values ( 4, 'AC_EMAIL', 'system', 'Send Email' ,NULL, 1, 4);
|
||||
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, 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, 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, active, position) values ( 10, 'AC_SHIP', 'systemauto', 'Send shipping by email' ,'shipping',0, 11);
|
||||
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, 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, 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);
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
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
|
||||
DELETE FROM llx_c_paper_format;
|
||||
|
||||
|
||||
@ -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.
|
||||
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 #####
|
||||
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
|
||||
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.
|
||||
|
||||
@ -81,6 +81,8 @@ ActionAC_SHIP=Send shipping by mail
|
||||
ActionAC_SUP_ORD=Send supplier order by mail
|
||||
ActionAC_SUP_INV=Send supplier invoice by mail
|
||||
ActionAC_OTH=Other
|
||||
ActionAC_MANUAL=Manually inserted events
|
||||
ActionAC_AUTO=Automatically inserted events
|
||||
Stats=Sales statistics
|
||||
CAOrder=Sales volume (validated orders)
|
||||
FromTo=from %s to %s
|
||||
|
||||
@ -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.
|
||||
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 #####
|
||||
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
|
||||
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.
|
||||
|
||||
@ -81,6 +81,8 @@ ActionAC_SHIP=Envoi bon d'expédition par mail
|
||||
ActionAC_SUP_ORD=Envoi commande fournisseur par mail
|
||||
ActionAC_SUP_INV=Envoi facture fournisseur par mail
|
||||
ActionAC_OTH=Autre
|
||||
ActionAC_MANUAL=Evênements insérés manuellement
|
||||
ActionAC_AUTO=Evênements insérés automatiquement
|
||||
Stats=Statistiques de vente
|
||||
CAOrder=Chiffre d'affaires (Commandes validées)
|
||||
FromTo=du %s au %s
|
||||
|
||||
@ -2569,6 +2569,43 @@ class Societe extends CommonObject
|
||||
$this->idprof5='idprof5';
|
||||
$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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -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>';
|
||||
|
||||
// Local Taxes
|
||||
// TODO add specific function by country
|
||||
if($mysoc->country_code=='ES')
|
||||
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
|
||||
{
|
||||
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td>';
|
||||
print $form->selectyesno('localtax1assuj_value',0,1);
|
||||
print '</td><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td>';
|
||||
print $form->selectyesno('localtax2assuj_value',0,1);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("LocalTax1IsUsed").'</td><td>';
|
||||
print $form->selectyesno('localtax1assuj_value',0,1);
|
||||
print '</td><td>'.$langs->trans("LocalTax2IsUsed").'</td><td>';
|
||||
print $form->selectyesno('localtax2assuj_value',0,1);
|
||||
print '</td></tr>';
|
||||
|
||||
}
|
||||
elseif($mysoc->localtax1_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td colspan="3">';
|
||||
print $form->selectyesno('localtax1assuj_value',0,1);
|
||||
print '</td><tr>';
|
||||
}
|
||||
elseif($mysoc->localtax2_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td colspan="3">';
|
||||
print $form->selectyesno('localtax2assuj_value',0,1);
|
||||
print '</td><tr>';
|
||||
}
|
||||
}
|
||||
elseif($mysoc->localtax1_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LocalTax1IsUsed").'</td><td colspan="3">';
|
||||
print $form->selectyesno('localtax1assuj_value',0,1);
|
||||
print '</td><tr>';
|
||||
}
|
||||
elseif($mysoc->localtax2_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LocalTax2IsUsed").'</td><td colspan="3">';
|
||||
print $form->selectyesno('localtax2assuj_value',0,1);
|
||||
print '</td><tr>';
|
||||
}
|
||||
|
||||
if (! empty($conf->global->MAIN_MULTILANGS))
|
||||
@ -1322,31 +1318,27 @@ else
|
||||
print '</tr>';
|
||||
|
||||
// Local Taxes
|
||||
// TODO add specific function by country
|
||||
if($mysoc->country_code=='ES')
|
||||
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
|
||||
{
|
||||
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 '</td><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td>';
|
||||
print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td>';
|
||||
print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
|
||||
print '</td><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td>';
|
||||
print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
|
||||
print '</td></tr>';
|
||||
|
||||
}
|
||||
elseif($mysoc->localtax1_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td colspan="3">';
|
||||
print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
elseif($mysoc->localtax1_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td colspan="3">';
|
||||
print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
|
||||
print '</td></tr>';
|
||||
|
||||
}
|
||||
elseif($mysoc->localtax2_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td colspan="3">';
|
||||
print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
elseif($mysoc->localtax2_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td colspan="3">';
|
||||
print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Type - Size
|
||||
@ -1642,30 +1634,26 @@ else
|
||||
print '</tr>';
|
||||
|
||||
// Local Taxes
|
||||
// TODO add specific function by country
|
||||
if($mysoc->country_code=='ES')
|
||||
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
|
||||
{
|
||||
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td>';
|
||||
print yn($object->localtax1_assuj);
|
||||
print '</td><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td>';
|
||||
print yn($object->localtax2_assuj);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td>';
|
||||
print yn($object->localtax1_assuj);
|
||||
print '</td><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td>';
|
||||
print yn($object->localtax2_assuj);
|
||||
print '</td></tr>';
|
||||
|
||||
}
|
||||
elseif($mysoc->localtax1_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td colspan="3">';
|
||||
print yn($object->localtax1_assuj);
|
||||
print '</td><tr>';
|
||||
}
|
||||
elseif($mysoc->localtax2_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td colspan="3">';
|
||||
print yn($object->localtax2_assuj);
|
||||
print '</td><tr>';
|
||||
}
|
||||
}
|
||||
elseif($mysoc->localtax1_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td colspan="3">';
|
||||
print yn($object->localtax1_assuj);
|
||||
print '</td><tr>';
|
||||
}
|
||||
elseif($mysoc->localtax2_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td colspan="3">';
|
||||
print yn($object->localtax2_assuj);
|
||||
print '</td><tr>';
|
||||
}
|
||||
|
||||
// Type + Staff
|
||||
|
||||
Loading…
Reference in New Issue
Block a user