Merge branch 'develop' of https://github.com/ibuiv/dolibarr into develop
This commit is contained in:
commit
6dafb98707
@ -185,6 +185,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/don
|
||||
%_datadir/dolibarr/htdocs/ecm
|
||||
%_datadir/dolibarr/htdocs/emailcollector
|
||||
%_datadir/dolibarr/htdocs/eventorganization
|
||||
%_datadir/dolibarr/htdocs/expedition
|
||||
%_datadir/dolibarr/htdocs/expensereport
|
||||
%_datadir/dolibarr/htdocs/exports
|
||||
@ -206,6 +207,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/mrp
|
||||
%_datadir/dolibarr/htdocs/multicurrency
|
||||
%_datadir/dolibarr/htdocs/opensurvey
|
||||
%_datadir/dolibarr/htdocs/partnership
|
||||
%_datadir/dolibarr/htdocs/paybox
|
||||
%_datadir/dolibarr/htdocs/paypal
|
||||
%_datadir/dolibarr/htdocs/printing
|
||||
|
||||
@ -67,7 +67,8 @@ Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mbstring
|
||||
Requires: mysql-server, mysql
|
||||
Requires: php-mysqli >= 4.1.0
|
||||
%endif
|
||||
%endif
|
||||
%endif%_datadir/dolibarr/htdocs/eventorganization
|
||||
|
||||
%endif
|
||||
|
||||
# Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse)
|
||||
@ -265,6 +266,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/don
|
||||
%_datadir/dolibarr/htdocs/ecm
|
||||
%_datadir/dolibarr/htdocs/emailcollector
|
||||
%_datadir/dolibarr/htdocs/eventorganization
|
||||
%_datadir/dolibarr/htdocs/expedition
|
||||
%_datadir/dolibarr/htdocs/expensereport
|
||||
%_datadir/dolibarr/htdocs/exports
|
||||
@ -286,6 +288,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/mrp
|
||||
%_datadir/dolibarr/htdocs/multicurrency
|
||||
%_datadir/dolibarr/htdocs/opensurvey
|
||||
%_datadir/dolibarr/htdocs/partnership
|
||||
%_datadir/dolibarr/htdocs/paybox
|
||||
%_datadir/dolibarr/htdocs/paypal
|
||||
%_datadir/dolibarr/htdocs/printing
|
||||
|
||||
@ -182,6 +182,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/don
|
||||
%_datadir/dolibarr/htdocs/ecm
|
||||
%_datadir/dolibarr/htdocs/emailcollector
|
||||
%_datadir/dolibarr/htdocs/eventorganization
|
||||
%_datadir/dolibarr/htdocs/expedition
|
||||
%_datadir/dolibarr/htdocs/expensereport
|
||||
%_datadir/dolibarr/htdocs/exports
|
||||
@ -203,6 +204,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/mrp
|
||||
%_datadir/dolibarr/htdocs/multicurrency
|
||||
%_datadir/dolibarr/htdocs/opensurvey
|
||||
%_datadir/dolibarr/htdocs/partnership
|
||||
%_datadir/dolibarr/htdocs/paybox
|
||||
%_datadir/dolibarr/htdocs/paypal
|
||||
%_datadir/dolibarr/htdocs/printing
|
||||
|
||||
@ -193,6 +193,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/don
|
||||
%_datadir/dolibarr/htdocs/ecm
|
||||
%_datadir/dolibarr/htdocs/emailcollector
|
||||
%_datadir/dolibarr/htdocs/eventorganization
|
||||
%_datadir/dolibarr/htdocs/expedition
|
||||
%_datadir/dolibarr/htdocs/expensereport
|
||||
%_datadir/dolibarr/htdocs/exports
|
||||
@ -214,6 +215,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/mrp
|
||||
%_datadir/dolibarr/htdocs/multicurrency
|
||||
%_datadir/dolibarr/htdocs/opensurvey
|
||||
%_datadir/dolibarr/htdocs/partnership
|
||||
%_datadir/dolibarr/htdocs/paybox
|
||||
%_datadir/dolibarr/htdocs/paypal
|
||||
%_datadir/dolibarr/htdocs/printing
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
<exclude-pattern type="relative">htdocs/conf.php</exclude-pattern>
|
||||
<exclude-pattern type="relative">*/nltechno*</exclude-pattern>
|
||||
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
|
||||
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
|
||||
<exclude-pattern type="relative">source</exclude-pattern>
|
||||
<exclude-pattern type="relative">.git</exclude-pattern>
|
||||
|
||||
<!-- List of all tests -->
|
||||
|
||||
@ -557,7 +557,7 @@ class AccountancyExport
|
||||
$Tab['signe_montant'] = '+';
|
||||
|
||||
// The amount must be in centimes without decimal points.
|
||||
$Tab['montant'] = str_pad(abs(($data->debit - $abs->credit) * 100), 12, '0', STR_PAD_LEFT);
|
||||
$Tab['montant'] = str_pad(abs(($data->debit - $data->credit) * 100), 12, '0', STR_PAD_LEFT);
|
||||
$Tab['contrepartie'] = str_repeat(' ', 8);
|
||||
|
||||
// Force date format : %d%m%y
|
||||
|
||||
@ -937,17 +937,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
document.formsoc.action.value="create";
|
||||
document.formsoc.submit();
|
||||
});
|
||||
function initfieldrequired()
|
||||
{
|
||||
function initfieldrequired() {
|
||||
jQuery("#tdcompany").removeClass("fieldrequired");
|
||||
jQuery("#tdlastname").removeClass("fieldrequired");
|
||||
jQuery("#tdfirstname").removeClass("fieldrequired");
|
||||
if (jQuery("#morphy").val() == \'mor\')
|
||||
{
|
||||
if (jQuery("#morphy").val() == \'mor\') {
|
||||
jQuery("#tdcompany").addClass("fieldrequired");
|
||||
}
|
||||
if (jQuery("#morphy").val() == \'phy\')
|
||||
{
|
||||
if (jQuery("#morphy").val() == \'phy\') {
|
||||
jQuery("#tdlastname").addClass("fieldrequired");
|
||||
jQuery("#tdfirstname").addClass("fieldrequired");
|
||||
}
|
||||
@ -1167,17 +1164,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
document.formsoc.action.value="edit";
|
||||
document.formsoc.submit();
|
||||
});
|
||||
function initfieldrequired()
|
||||
{
|
||||
function initfieldrequired() {
|
||||
jQuery("#tdcompany").removeClass("fieldrequired");
|
||||
jQuery("#tdlastname").removeClass("fieldrequired");
|
||||
jQuery("#tdfirstname").removeClass("fieldrequired");
|
||||
if (jQuery("#morphy").val() == \'mor\')
|
||||
{
|
||||
if (jQuery("#morphy").val() == \'mor\') {
|
||||
jQuery("#tdcompany").addClass("fieldrequired");
|
||||
}
|
||||
if (jQuery("#morphy").val() == \'phy\')
|
||||
{
|
||||
if (jQuery("#morphy").val() == \'phy\') {
|
||||
jQuery("#tdlastname").addClass("fieldrequired");
|
||||
jQuery("#tdfirstname").addClass("fieldrequired");
|
||||
}
|
||||
@ -1747,12 +1741,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print $langs->trans("SubscriptionNotNeeded");
|
||||
} elseif (!$adht->subscription) {
|
||||
print $langs->trans("SubscriptionNotRecorded");
|
||||
if ($object->statut > 0) {
|
||||
if (Adherent::STATUS_VALIDATED == $object->statut) {
|
||||
print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft, not excluded and not resiliated
|
||||
}
|
||||
} else {
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
if ($object->statut > 0) {
|
||||
if (Adherent::STATUS_VALIDATED == $object->statut) {
|
||||
print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft, not excluded and not resiliated
|
||||
}
|
||||
}
|
||||
@ -1862,7 +1856,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
if ($action != 'editlogin' && $action != 'editthirdparty') {
|
||||
// Send
|
||||
if (empty($user->socid)) {
|
||||
if ($object->statut == 1) {
|
||||
if (Adherent::STATUS_VALIDATED == $object->statut) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a></div>'."\n";
|
||||
}
|
||||
}
|
||||
@ -1870,20 +1864,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// Send card by email
|
||||
// TODO Remove this to replace with a template
|
||||
/*
|
||||
if ($user->rights->adherent->creer)
|
||||
{
|
||||
if ($object->statut >= 1)
|
||||
{
|
||||
if ($user->rights->adherent->creer) {
|
||||
if (Adherent::STATUS_VALIDATED == $object->statut) {
|
||||
if ($object->email) print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$object->id.'&action=sendinfo">'.$langs->trans("SendCardByMail")."</a></div>\n";
|
||||
else print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans("SendCardByMail")."</a></div>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("SendCardByMail")."</font></div>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("SendCardByMail")."</font></div>";
|
||||
}*/
|
||||
|
||||
@ -1895,7 +1883,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
// Validate
|
||||
if ($object->statut == -1) {
|
||||
if (Adherent::STATUS_DRAFT == $object->statut) {
|
||||
if ($user->rights->adherent->creer) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Validate").'</a></div>'."\n";
|
||||
} else {
|
||||
@ -1904,7 +1892,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
// Reactivate
|
||||
if ($object->statut == 0 || $object->statut == -2) {
|
||||
if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $Object->statut) {
|
||||
if ($user->rights->adherent->creer) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Reenable")."</a></div>\n";
|
||||
} else {
|
||||
@ -1913,7 +1901,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
// Resiliate
|
||||
if ($object->statut >= 1) {
|
||||
if (Adherent::STATUS_VALIDATED == $object->statut) {
|
||||
if ($user->rights->adherent->supprimer) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$id.'&action=resiliate">'.$langs->trans("Resiliate")."</a></div>\n";
|
||||
} else {
|
||||
@ -1922,7 +1910,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
// Exclude
|
||||
if ($object->statut >= 1) {
|
||||
if (Adherent::STATUS_VALIDATED == $object->statut) {
|
||||
if ($user->rights->adherent->supprimer) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$id.'&action=exclude">'.$langs->trans("Exclude")."</a></div>\n";
|
||||
} else {
|
||||
@ -1933,7 +1921,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// Create third party
|
||||
if (!empty($conf->societe->enabled) && !$object->socid) {
|
||||
if ($user->rights->societe->creer) {
|
||||
if ($object->statut != -1) {
|
||||
if (Adherent::STATUS_DRAFT != $object->statut) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=create_thirdparty">'.$langs->trans("CreateDolibarrThirdParty").'</a></div>'."\n";;
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a></div>'."\n";
|
||||
@ -1946,7 +1934,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// Create user
|
||||
if (!$user->socid && !$object->user_id) {
|
||||
if ($user->rights->user->user->creer) {
|
||||
if ($object->statut != -1) {
|
||||
if (Adherent::STATUS_DRAFT != $object->statut) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a></div>'."\n";
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrLogin").'</a></div>'."\n";
|
||||
@ -2010,7 +1998,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Show links to link elements
|
||||
/*$linktoelem = $form->showLinkToObjectBlock($object,array('order'));
|
||||
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
|
||||
if ($linktoelem) {
|
||||
print ($somethingshown?'':'<br>').$linktoelem;
|
||||
}
|
||||
*/
|
||||
|
||||
// Show online payment link
|
||||
|
||||
@ -44,7 +44,6 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
*/
|
||||
class Adherent extends CommonObject
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string ID to identify managed object
|
||||
*/
|
||||
@ -207,7 +206,7 @@ class Adherent extends CommonObject
|
||||
|
||||
public $public;
|
||||
|
||||
// -2:exclu, -1:brouillon, 0:resilie, >=1:valide,paye
|
||||
// -2:excluded, -1:draft, 0:resiliated, >=1:valided,payed
|
||||
// def in common object
|
||||
//public $status;
|
||||
|
||||
@ -327,11 +326,28 @@ class Adherent extends CommonObject
|
||||
'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 190),
|
||||
'canvas' => array('type' => 'varchar(32)', 'label' => 'Canvas', 'enabled' => 1, 'visible' => -1, 'position' => 195),
|
||||
'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 500,
|
||||
'arrayofkeyval' => array(0 => 'Draft', 1 => 'Validated', -1 => 'MemberStatusResiliatedShort', -2 => 'MemberStatusExcludedShort')),
|
||||
'arrayofkeyval' => array(-1 => 'Draft', 1 => 'Validated', 0 => 'MemberStatusResiliatedShort', -2 => 'MemberStatusExcludedShort')),
|
||||
'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 800),
|
||||
'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 805)
|
||||
);
|
||||
|
||||
/**
|
||||
* Draft status
|
||||
*/
|
||||
const STATUS_DRAFT = -1;
|
||||
/**
|
||||
* Validated status
|
||||
*/
|
||||
const STATUS_VALIDATED = 1;
|
||||
/**
|
||||
* Resiliated
|
||||
*/
|
||||
const STATUS_RESILIATED = 0;
|
||||
/**
|
||||
* Excluded
|
||||
*/
|
||||
const STATUS_EXCLUDED = -2;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -341,7 +357,7 @@ class Adherent extends CommonObject
|
||||
public function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
$this->statut = -1;
|
||||
$this->statut = self::STATUS_DRAFT; // shouldn't this be $status ?
|
||||
// l'adherent n'est pas public par defaut
|
||||
$this->public = 0;
|
||||
// les champs optionnels sont vides
|
||||
@ -1570,9 +1586,11 @@ class Adherent extends CommonObject
|
||||
* @param string $emetteur_nom Name of cheque writer
|
||||
* @param string $emetteur_banque Name of bank of cheque
|
||||
* @param string $autocreatethirdparty Auto create new thirdparty if member not yet linked to a thirdparty and we request an option that generate invoice.
|
||||
* @param string $ext_payment_id External id of payment (for example Stripe charge id)
|
||||
* @param string $ext_payment_site Name of external paymentmode (for example 'stripe')
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function subscriptionComplementaryActions($subscriptionid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom = '', $emetteur_banque = '', $autocreatethirdparty = 0)
|
||||
public function subscriptionComplementaryActions($subscriptionid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom = '', $emetteur_banque = '', $autocreatethirdparty = 0, $ext_payment_id = '', $ext_payment_site = '')
|
||||
{
|
||||
global $conf, $langs, $user, $mysoc;
|
||||
|
||||
@ -1752,6 +1770,8 @@ class Adherent extends CommonObject
|
||||
$paiement->paiementid = dol_getIdFromCode($this->db, $operation, 'c_paiement', 'code', 'id', 1);
|
||||
$paiement->num_payment = $num_chq;
|
||||
$paiement->note_public = $label;
|
||||
$paiement->ext_payment_id = $ext_payment_id;
|
||||
$paiement->ext_payment_site = $ext_payment_site;
|
||||
|
||||
if (!$error) {
|
||||
// Create payment line for invoice
|
||||
@ -1834,7 +1854,7 @@ class Adherent extends CommonObject
|
||||
$now = dol_now();
|
||||
|
||||
// Check parameters
|
||||
if ($this->statut == 1) {
|
||||
if ($this->statut == self::STATUS_VALIDATED) {
|
||||
dol_syslog(get_class($this)."::validate statut of member does not allow this", LOG_WARNING);
|
||||
return 0;
|
||||
}
|
||||
@ -1842,7 +1862,7 @@ class Adherent extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
||||
$sql .= " statut = 1";
|
||||
$sql .= " statut = ".self::STATUS_VALIDATED;
|
||||
$sql .= ", datevalid = '".$this->db->idate($now)."'";
|
||||
$sql .= ", fk_user_valid=".$user->id;
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
@ -1850,7 +1870,7 @@ class Adherent extends CommonObject
|
||||
dol_syslog(get_class($this)."::validate", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$this->statut = 1;
|
||||
$this->statut = self::STATUS_VALIDATED;
|
||||
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('MEMBER_VALIDATE', $user);
|
||||
@ -1886,7 +1906,7 @@ class Adherent extends CommonObject
|
||||
$error = 0;
|
||||
|
||||
// Check parameters
|
||||
if ($this->statut == 0) {
|
||||
if ($this->statut == self::STATUS_RESILIATED) {
|
||||
dol_syslog(get_class($this)."::resiliate statut of member does not allow this", LOG_WARNING);
|
||||
return 0;
|
||||
}
|
||||
@ -1894,13 +1914,13 @@ class Adherent extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
||||
$sql .= " statut = 0";
|
||||
$sql .= " statut = ".self::STATUS_RESILIATED;
|
||||
$sql .= ", fk_user_valid=".$user->id;
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$this->statut = 0;
|
||||
$this->statut = self::STATUS_RESILIATED;
|
||||
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('MEMBER_RESILIATE', $user);
|
||||
@ -1936,7 +1956,7 @@ class Adherent extends CommonObject
|
||||
$error = 0;
|
||||
|
||||
// Check parameters
|
||||
if ($this->statut == 0) {
|
||||
if ($this->statut == self::STATUS_EXCLUDED) {
|
||||
dol_syslog(get_class($this)."::resiliate statut of member does not allow this", LOG_WARNING);
|
||||
return 0;
|
||||
}
|
||||
@ -1944,13 +1964,13 @@ class Adherent extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
||||
$sql .= " statut = -2";
|
||||
$sql .= " statut = ".self::STATUS_EXCLUDED;
|
||||
$sql .= ", fk_user_valid=".$user->id;
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$this->statut = 0;
|
||||
$this->statut = self::STATUS_EXCLUDED;
|
||||
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('MEMBER_EXCLUDE', $user);
|
||||
@ -2255,11 +2275,11 @@ class Adherent extends CommonObject
|
||||
$labelStatus = '';
|
||||
$labelStatusShort = '';
|
||||
|
||||
if ($status == -1) {
|
||||
if ($status == self::STATUS_DRAFT) {
|
||||
$statusType = 'status0';
|
||||
$labelStatus = $langs->trans("MemberStatusDraft");
|
||||
$labelStatusShort = $langs->trans("MemberStatusDraftShort");
|
||||
} elseif ($status >= 1) {
|
||||
} elseif ($status >= self::STATUS_VALIDATED) {
|
||||
if ($need_subscription == 0) {
|
||||
$statusType = 'status4';
|
||||
$labelStatus = $langs->trans("MemberStatusNoSubscription");
|
||||
@ -2277,11 +2297,11 @@ class Adherent extends CommonObject
|
||||
$labelStatus = $langs->trans("MemberStatusPaid");
|
||||
$labelStatusShort = $langs->trans("MemberStatusPaidShort");
|
||||
}
|
||||
} elseif ($status == 0) {
|
||||
} elseif ($status == self::STATUS_RESILIATED) {
|
||||
$statusType = 'status6';
|
||||
$labelStatus = $langs->trans("MemberStatusResiliated");
|
||||
$labelStatusShort = $langs->trans("MemberStatusResiliatedShort");
|
||||
} elseif ($status == -2) {
|
||||
} elseif ($status == self::STATUS_EXCLUDED) {
|
||||
$statusType = 'status10';
|
||||
$labelStatus = $langs->trans("MemberStatusExcluded");
|
||||
$labelStatusShort = $langs->trans("MemberStatusExcludedShort");
|
||||
@ -2347,11 +2367,11 @@ class Adherent extends CommonObject
|
||||
$sql .= ", ".MAIN_DB_PREFIX."adherent_type as t";
|
||||
$sql .= " WHERE a.fk_adherent_type = t.rowid";
|
||||
if ($mode == 'expired') {
|
||||
$sql .= " AND a.statut = 1";
|
||||
$sql .= " AND a.statut = ".self::STATUS_VALIDATED;
|
||||
$sql .= " AND a.entity IN (".getEntity('adherent').")";
|
||||
$sql .= " AND ((a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."') AND t.subscription = '1')";
|
||||
} elseif ($mode == 'shift') {
|
||||
$sql .= " AND a.statut = -1";
|
||||
$sql .= " AND a.statut = ".self::STATUS_DRAFT;
|
||||
$sql .= " AND a.entity IN (".getEntity('adherent').")";
|
||||
}
|
||||
|
||||
@ -2368,10 +2388,10 @@ class Adherent extends CommonObject
|
||||
$warning_delay = $conf->adherent->subscription->warning_delay / 60 / 60 / 24;
|
||||
$label = $langs->trans("MembersWithSubscriptionToReceive");
|
||||
$labelShort = $langs->trans("MembersWithSubscriptionToReceiveShort");
|
||||
$url = DOL_URL_ROOT.'/adherents/list.php?mainmenu=members&statut=1&filter=outofdate';
|
||||
$url = DOL_URL_ROOT.'/adherents/list.php?mainmenu=members&statut='.self::STATUS_VALIDATED.'&filter=outofdate';
|
||||
} elseif ($mode == 'shift') {
|
||||
$warning_delay = $conf->adherent->subscription->warning_delay / 60 / 60 / 24;
|
||||
$url = DOL_URL_ROOT.'/adherents/list.php?mainmenu=members&statut=-1';
|
||||
$url = DOL_URL_ROOT.'/adherents/list.php?mainmenu=members&statut='.self::STATUS_DRAFT;
|
||||
$label = $langs->trans("MembersListToValid");
|
||||
$labelShort = $langs->trans("ToValidate");
|
||||
}
|
||||
@ -2484,7 +2504,7 @@ class Adherent extends CommonObject
|
||||
$this->birth = $now;
|
||||
$this->photo = '';
|
||||
$this->public = 1;
|
||||
$this->statut = 0;
|
||||
$this->statut = self::STATUS_DRAFT;
|
||||
|
||||
$this->datefin = $now;
|
||||
$this->datevalid = $now;
|
||||
@ -2803,7 +2823,7 @@ class Adherent extends CommonObject
|
||||
global $conf;
|
||||
|
||||
//Only valid members
|
||||
if ($this->statut <= 0) {
|
||||
if ($this->statut != self::STATUS_VALIDATED) {
|
||||
return false;
|
||||
}
|
||||
if (!$this->datefin) {
|
||||
|
||||
@ -243,7 +243,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||
$elementLabel = $langs->trans('Intervention');
|
||||
} elseif ($notifiedevent['elementtype'] == 'shipping') {
|
||||
$elementLabel = $langs->trans('Shipping');
|
||||
} elseif ($notifiedevent['elementtype'] == 'expensereport') {
|
||||
} elseif ($notifiedevent['elementtype'] == 'expensereport' || $notifiedevent['elementtype'] == 'expense_report') {
|
||||
$elementLabel = $langs->trans('ExpenseReport');
|
||||
}
|
||||
|
||||
@ -271,6 +271,8 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||
|
||||
$helptext = '';
|
||||
form_constantes($constantes, 3, $helptext);
|
||||
|
||||
print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
|
||||
} else {
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -300,7 +302,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||
$elementLabel = $langs->trans('Intervention');
|
||||
} elseif ($notifiedevent['elementtype'] == 'shipping') {
|
||||
$elementLabel = $langs->trans('Shipping');
|
||||
} elseif ($notifiedevent['elementtype'] == 'expensereport') {
|
||||
} elseif ($notifiedevent['elementtype'] == 'expensereport' || $notifiedevent['elementtype'] == 'expense_report') {
|
||||
$elementLabel = $langs->trans('ExpenseReport');
|
||||
}
|
||||
|
||||
@ -316,7 +318,13 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
|
||||
|
||||
print '<div class="opacitymedium">';
|
||||
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
|
||||
if (!empty($conf->societe->enabled)) {
|
||||
print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
@ -343,28 +351,38 @@ print "</tr>\n";
|
||||
foreach ($listofnotifiedevents as $notifiedevent) {
|
||||
$label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
|
||||
|
||||
$elementPicto = $notifiedevent['elementtype'];
|
||||
$elementLabel = $langs->trans(ucfirst($notifiedevent['elementtype']));
|
||||
// Special cases
|
||||
if ($notifiedevent['elementtype'] == 'order_supplier') {
|
||||
$elementPicto = 'supplier_order';
|
||||
$elementLabel = $langs->trans('SupplierOrder');
|
||||
} elseif ($notifiedevent['elementtype'] == 'propal') {
|
||||
$elementLabel = $langs->trans('Proposal');
|
||||
} elseif ($notifiedevent['elementtype'] == 'facture') {
|
||||
$elementPicto = 'bill';
|
||||
$elementLabel = $langs->trans('Bill');
|
||||
} elseif ($notifiedevent['elementtype'] == 'commande') {
|
||||
$elementPicto = 'order';
|
||||
$elementLabel = $langs->trans('Order');
|
||||
} elseif ($notifiedevent['elementtype'] == 'ficheinter') {
|
||||
$elementPicto = 'intervention';
|
||||
$elementLabel = $langs->trans('Intervention');
|
||||
} elseif ($notifiedevent['elementtype'] == 'shipping') {
|
||||
$elementPicto = 'shipment';
|
||||
$elementLabel = $langs->trans('Shipping');
|
||||
} elseif ($notifiedevent['elementtype'] == 'expensereport') {
|
||||
} elseif ($notifiedevent['elementtype'] == 'expensereport' || $notifiedevent['elementtype'] == 'expense_report') {
|
||||
$elementPicto = 'expensereport';
|
||||
$elementLabel = $langs->trans('ExpenseReport');
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$elementLabel.'</td>';
|
||||
print '<td>';
|
||||
print img_picto('', $elementPicto, 'class="pictofixedwidth"');
|
||||
print $elementLabel;
|
||||
print '</td>';
|
||||
print '<td>'.$notifiedevent['code'].'</td>';
|
||||
print '<td>'.$label.'</td>';
|
||||
print '<td><span class="opacitymedium">'.$label.'</span></td>';
|
||||
print '<td>';
|
||||
// Notification with threshold
|
||||
foreach ($conf->global as $key => $val) {
|
||||
@ -417,14 +435,6 @@ foreach ($listofnotifiedevents as $notifiedevent) {
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
print '<div class="opacitymedium">';
|
||||
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
|
||||
if (!empty($conf->societe->enabled)) {
|
||||
print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
|
||||
|
||||
@ -189,7 +189,7 @@ foreach ($dirmodels as $reldir) {
|
||||
if ($conf->global->PAYMENT_ADDON == $file || $conf->global->PAYMENT_ADDON.'.php' == $file) {
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmo&token='.newToken().'&value='.preg_replace('/\.php$/', '', $file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.preg_replace('/\.php$/', '', $file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -72,23 +72,27 @@ class DolibarrApi
|
||||
//$this->r->setSupportedFormats('jsonFormat');
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Executed method when API is called without parameter
|
||||
* Check and convert a string depending on its type/name.
|
||||
*
|
||||
* Display a short message an return a http code 200
|
||||
*
|
||||
* @return array
|
||||
* @param string $field Field name
|
||||
* @param string $value Value to check/clean
|
||||
* @param stdClass $object Object
|
||||
* @return string Value cleaned
|
||||
*/
|
||||
/* Disabled, most APIs does not share same signature for method index
|
||||
function index()
|
||||
protected function _checkValForAPI($field, $value, $object)
|
||||
{
|
||||
return array(
|
||||
'success' => array(
|
||||
'code' => 200,
|
||||
'message' => __class__.' is up and running!'
|
||||
)
|
||||
);
|
||||
}*/
|
||||
// phpcs:enable
|
||||
// TODO Use type detected in $object->fields
|
||||
if (in_array($field, array('note', 'note_private', 'note_public', 'desc', 'description'))) {
|
||||
return checkVal($value, 'restricthtml');
|
||||
} else {
|
||||
return checkVal($value, 'alphanohtml');
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
|
||||
@ -126,7 +126,7 @@ $form = new Form($db);
|
||||
if ($object->id > 0) {
|
||||
$title = $langs->trans("Agenda");
|
||||
//if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
||||
$help_url = '';
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
|
||||
@ -241,8 +241,8 @@ $formfile = new FormFile($db);
|
||||
|
||||
|
||||
$title = $langs->trans('BOM');
|
||||
|
||||
llxHeader('', $title, '');
|
||||
$help_url ='EN:Module_BOM';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
// Example : Adding jquery code
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
|
||||
@ -100,8 +100,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
|
||||
$form = new Form($db);
|
||||
|
||||
$title = $langs->trans("BillOfMaterials").' - '.$langs->trans("Files");
|
||||
$help_url = '';
|
||||
//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
||||
|
||||
$help_url = 'EN:Module_BOM';
|
||||
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if ($object->id) {
|
||||
|
||||
@ -278,10 +278,12 @@ $form = new Form($db);
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
//$help_url="EN:Module_BillOfMaterials|FR:Module_BillOfMaterials_FR|ES:Módulo_BillOfMaterials";
|
||||
$help_url = '';
|
||||
$help_url = 'EN:Module_BOM';
|
||||
|
||||
$title = $langs->trans('ListOfBOMs');
|
||||
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
|
||||
// Build and execute select
|
||||
// --------------------------------------------------------------------
|
||||
@ -393,7 +395,7 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
|
||||
// Output page
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
llxHeader('', $title, $help_url);
|
||||
// llxHeader('', $title, $help_url);
|
||||
|
||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||
|
||||
|
||||
@ -46,6 +46,9 @@ $position = GETPOST("position", "int");
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
|
||||
$object = new Bookmark($db);
|
||||
if ($id > 0) {
|
||||
$object->fetch($id);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@ -133,7 +136,7 @@ $form = new Form($db);
|
||||
$head = array();
|
||||
$h = 1;
|
||||
|
||||
$head[$h][0] = $_SERVER["PHP_SELF"].($object->id ? 'id='.$object->id : '');
|
||||
$head[$h][0] = $_SERVER["PHP_SELF"].($object->id ? '?id='.$object->id : '');
|
||||
$head[$h][1] = $langs->trans("Bookmark");
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
@ -153,25 +156,25 @@ if ($action == 'create') {
|
||||
|
||||
print load_fiche_titre($langs->trans("NewBookmark"));
|
||||
|
||||
print dol_get_fiche_head($head, $hselected, $langs->trans("Bookmark"), 0, 'bookmark');
|
||||
print dol_get_fiche_head($head, $hselected, $langs->trans("Bookmark"), -1, 'bookmark');
|
||||
|
||||
print '<table class="border centpercent tableforfieldcreate">';
|
||||
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input id="titlebookmark" class="flat minwidth300" name="title" value="'.dol_escape_htmltag($title).'"></td><td class="hideonsmartphone">'.$langs->trans("SetHereATitleForLink").'</td></tr>';
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input id="titlebookmark" class="flat minwidth300" name="title" value="'.dol_escape_htmltag($title).'"></td><td class="hideonsmartphone"><span class="opacitymedium">'.$langs->trans("SetHereATitleForLink").'</span></td></tr>';
|
||||
dol_set_focus('#titlebookmark');
|
||||
|
||||
// Url
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("UrlOrLink").'</td><td><input class="flat quatrevingtpercent" name="url" value="'.dol_escape_htmltag($url).'"></td><td class="hideonsmartphone">'.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'</td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("UrlOrLink").'</td><td><input class="flat quatrevingtpercent" name="url" value="'.dol_escape_htmltag($url).'"></td><td class="hideonsmartphone"><span class="opacitymedium">'.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'</span></td></tr>';
|
||||
|
||||
// Target
|
||||
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
|
||||
$liste = array(0=>$langs->trans("ReplaceWindow"), 1=>$langs->trans("OpenANewWindow"));
|
||||
print $form->selectarray('target', $liste, 1);
|
||||
print '</td><td class="hideonsmartphone">'.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'</td></tr>';
|
||||
print '</td><td class="hideonsmartphone"><span class="opacitymedium">'.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'</span></td></tr>';
|
||||
|
||||
// Owner
|
||||
print '<tr><td>'.$langs->trans("Owner").'</td><td>';
|
||||
print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : $user->id, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||
print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : $user->id, 'userid', 0, '', 0, ($user->admin ? '' : array($user->id)), '', 0, 0, 0, '', ($user->admin) ? 1 : 0, '', 'maxwidth300');
|
||||
print '</td><td class="hideonsmartphone"> </td></tr>';
|
||||
|
||||
// Position
|
||||
@ -193,20 +196,6 @@ if ($action == 'create') {
|
||||
|
||||
|
||||
if ($id > 0 && !preg_match('/^add/i', $action)) {
|
||||
/*
|
||||
* Fact bookmark mode or visually edition
|
||||
*/
|
||||
$object->fetch($id);
|
||||
|
||||
$hselected = 'card';
|
||||
$head = array(
|
||||
array(
|
||||
'',
|
||||
$langs->trans('Card'),
|
||||
'card'
|
||||
)
|
||||
);
|
||||
|
||||
if ($action == 'edit') {
|
||||
print '<form name="edit" method="POST" action="'.$_SERVER["PHP_SELF"].'" enctype="multipart/form-data">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
@ -216,7 +205,6 @@ if ($id > 0 && !preg_match('/^add/i', $action)) {
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
}
|
||||
|
||||
|
||||
print dol_get_fiche_head($head, $hselected, $langs->trans("Bookmark"), -1, 'bookmark');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/bookmarks/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
@ -259,7 +247,10 @@ if ($id > 0 && !preg_match('/^add/i', $action)) {
|
||||
if ($action == 'edit') {
|
||||
print '<input class="flat minwidth500 quatrevingtpercent" name="url" value="'.(GETPOSTISSET("url") ? GETPOST("url") : $object->url).'">';
|
||||
} else {
|
||||
print '<a href="'.(preg_match('/^http/i', $object->url) ? $object->url : DOL_URL_ROOT.$object->url).'"'.($object->target ? ' target="_blank"' : '').'>'.$object->url.'</a>';
|
||||
print '<a href="'.(preg_match('/^http/i', $object->url) ? $object->url : DOL_URL_ROOT.$object->url).'"'.($object->target ? ' target="_blank"' : '').'>';
|
||||
print img_picto('', 'globe', 'class="paddingright"');
|
||||
print $object->url;
|
||||
print '</a>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@ -277,7 +268,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) {
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Owner").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($action == 'edit' && $user->admin) {
|
||||
print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
} else {
|
||||
@ -286,7 +277,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) {
|
||||
$fuser->fetch($object->fk_user);
|
||||
print $fuser->getNomUrl(1);
|
||||
} else {
|
||||
print $langs->trans("Public");
|
||||
print '<span class="opacitymedium">'.$langs->trans("Everybody").'</span>';
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@ -181,7 +181,7 @@ print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, 'ali
|
||||
print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, 'align="left"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, 'align="left"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Target", '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre("Owner", $_SERVER["PHP_SELF"], "u.lastname", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Visibility", $_SERVER["PHP_SELF"], "u.lastname", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "b.dateb", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('');
|
||||
@ -204,8 +204,10 @@ while ($i < min($num, $limit)) {
|
||||
print '</td>';
|
||||
|
||||
$linkintern = 0;
|
||||
$title = $obj->title;
|
||||
$link = $obj->url;
|
||||
$title = $obj->title;
|
||||
$link = $obj->url;
|
||||
$canedit = $user->rights->bookmark->supprimer;
|
||||
$candelete = $user->rights->bookmark->creer;
|
||||
|
||||
// Title
|
||||
print "<td>";
|
||||
@ -251,7 +253,11 @@ while ($i < min($num, $limit)) {
|
||||
$tmpuser = $cacheOfUsers[$obj->fk_user];
|
||||
print $tmpuser->getNomUrl(1);
|
||||
} else {
|
||||
print $langs->trans("Public");
|
||||
print '<span class="opacitymedium">'.$langs->trans("Everybody").'</span>';
|
||||
if (!$user->admin) {
|
||||
$candelete = false;
|
||||
$canedit = false;
|
||||
}
|
||||
}
|
||||
print "</td>\n";
|
||||
|
||||
@ -263,10 +269,10 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Actions
|
||||
print '<td class="nowrap right">';
|
||||
if ($user->rights->bookmark->creer) {
|
||||
if ($canedit) {
|
||||
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/bookmarks/card.php?action=edit&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit()."</a>";
|
||||
}
|
||||
if ($user->rights->bookmark->supprimer) {
|
||||
if ($candelete) {
|
||||
print '<a class="marginleftonly" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$obj->rowid.'">'.img_delete().'</a>';
|
||||
} else {
|
||||
print " ";
|
||||
|
||||
@ -217,7 +217,7 @@ class AgendaEvents extends DolibarrApi
|
||||
$result = $this->_validate($request_data);
|
||||
|
||||
foreach ($request_data as $field => $value) {
|
||||
$this->actioncomm->$field = $value;
|
||||
$this->actioncomm->$field = $this->_checkValForAPI($field, $value, $this->actioncomm);
|
||||
}
|
||||
/*if (isset($request_data["lines"])) {
|
||||
$lines = array();
|
||||
@ -226,6 +226,7 @@ class AgendaEvents extends DolibarrApi
|
||||
}
|
||||
$this->expensereport->lines = $lines;
|
||||
}*/
|
||||
|
||||
if ($this->actioncomm->create(DolibarrApiAccess::$user) < 0) {
|
||||
throw new RestException(500, "Error creating event", array_merge(array($this->actioncomm->error), $this->actioncomm->errors));
|
||||
}
|
||||
@ -268,7 +269,8 @@ class AgendaEvents extends DolibarrApi
|
||||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
$this->actioncomm->$field = $value;
|
||||
|
||||
$this->actioncomm->$field = $this->_checkValForAPI($field, $value, $this->actioncomm);
|
||||
}
|
||||
|
||||
if ($this->actioncomm->update(DolibarrApiAccess::$user, 1) > 0) {
|
||||
@ -299,7 +301,7 @@ class AgendaEvents extends DolibarrApi
|
||||
}
|
||||
|
||||
if (!DolibarrApiAccess::$user->rights->agenda->allactions->delete && DolibarrApiAccess::$user->id != $this->actioncomm->userownerid) {
|
||||
throw new RestException(401, "Insufficient rights to delete an Agenda Event of owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id);
|
||||
throw new RestException(401, "Insufficient rights to delete an Agenda Event of owner id ".$this->actioncomm->userownerid.' Your id is '.DolibarrApiAccess::$user->id);
|
||||
}
|
||||
|
||||
if (!$result) {
|
||||
@ -398,9 +400,12 @@ class AgendaEvents extends DolibarrApi
|
||||
unset($object->civility_id);
|
||||
unset($object->contact);
|
||||
unset($object->societe);
|
||||
|
||||
unset($object->demand_reason_id);
|
||||
unset($object->transport_mode_id);
|
||||
unset($object->region_id);
|
||||
unset($object->actions);
|
||||
unset($object->lines);
|
||||
unset($object->modelpdf);
|
||||
|
||||
return $object;
|
||||
}
|
||||
|
||||
@ -616,6 +616,10 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
if ($arrayquery['options_'.$key] != '') {
|
||||
$sqlwhere[] = " (te.".$key." = ".((int) $arrayquery['options_'.$key]).")";
|
||||
}
|
||||
} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'link') {
|
||||
if ($arrayquery['options_'.$key] > 0) {
|
||||
$sqlwhere[]= " (te.".$key." = ".((int) $arrayquery['options_'.$key]).")";
|
||||
}
|
||||
} else {
|
||||
if (is_array($arrayquery['options_'.$key])) {
|
||||
$sqlwhere[] = " (te.".$key." IN (".$this->db->sanitize("'".implode("','", $arrayquery['options_'.$key])."'", 1)."))";
|
||||
@ -642,7 +646,6 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
if ($num) {
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->thirdparty_lines[$i] = $obj->rowid;
|
||||
|
||||
$i++;
|
||||
|
||||
@ -2468,7 +2468,7 @@ if ($action == 'create' && $usercancreate) {
|
||||
if (empty($reshook)) {
|
||||
// Reopen a closed order
|
||||
if (($object->statut == Commande::STATUS_CLOSED || $object->statut == Commande::STATUS_CANCELED) && $usercancreate) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen">'.$langs->trans('ReOpen').'</a></div>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen">'.$langs->trans('ReOpen').'</a>';
|
||||
}
|
||||
|
||||
// Send
|
||||
@ -2551,39 +2551,39 @@ if ($action == 'create' && $usercancreate) {
|
||||
|
||||
// Set to shipped
|
||||
if (($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS) && $usercanclose) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=shipped">'.$langs->trans('ClassifyShipped').'</a></div>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=shipped">'.$langs->trans('ClassifyShipped').'</a>';
|
||||
}
|
||||
// Create bill and Classify billed
|
||||
// Note: Even if module invoice is not enabled, we should be able to use button "Classified billed"
|
||||
if ($object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) {
|
||||
if (!empty($conf->facture->enabled) && $user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a></div>';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
||||
}
|
||||
if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").'</a></div>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>';
|
||||
}
|
||||
}
|
||||
if ($object->statut > Commande::STATUS_DRAFT && $object->billed) {
|
||||
if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifyunbilled">'.$langs->trans("ClassifyUnBilled").'</a></div>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifyunbilled">'.$langs->trans("ClassifyUnBilled").'</a>';
|
||||
}
|
||||
}
|
||||
// Clone
|
||||
if ($usercancreate) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=order">'.$langs->trans("ToClone").'</a></div>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=order">'.$langs->trans("ToClone").'</a>';
|
||||
}
|
||||
|
||||
// Cancel order
|
||||
if ($object->statut == Commande::STATUS_VALIDATED && (!empty($usercanclose) || !empty($usercancancel))) {
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel">'.$langs->trans("Cancel").'</a></div>';
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel">'.$langs->trans("Cancel").'</a>';
|
||||
}
|
||||
|
||||
// Delete order
|
||||
if ($usercandelete) {
|
||||
if ($numshipping == 0) {
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a></div>';
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a>';
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("ShippingExist").'">'.$langs->trans("Delete").'</a></div>';
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("ShippingExist").'">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,7 +29,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
*/
|
||||
class BankAccounts extends DolibarrApi
|
||||
{
|
||||
|
||||
/**
|
||||
* array $FIELDS Mandatory fields, checked when creating an object
|
||||
*/
|
||||
@ -158,7 +157,7 @@ class BankAccounts extends DolibarrApi
|
||||
|
||||
$account = new Account($this->db);
|
||||
foreach ($request_data as $field => $value) {
|
||||
$account->$field = $value;
|
||||
$account->$field = $this->_checkValForAPI($field, $value, $account);
|
||||
}
|
||||
// Date of the initial balance (required to create an account).
|
||||
$account->date_solde = time();
|
||||
@ -333,7 +332,7 @@ class BankAccounts extends DolibarrApi
|
||||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
$account->$field = $value;
|
||||
$account->$field = $this->_checkValForAPI($field, $value, $account);
|
||||
}
|
||||
|
||||
if ($account->update(DolibarrApiAccess::$user) > 0) {
|
||||
|
||||
@ -124,8 +124,11 @@ $usercancreate = $user->rights->facture->creer;
|
||||
$usercanissuepayment = $user->rights->facture->paiement;
|
||||
$usercandelete = $user->rights->facture->supprimer;
|
||||
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->facture->invoice_advance->validate)));
|
||||
$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->facture->invoice_advance->send);
|
||||
$usercanreopen = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->facture->invoice_advance->reopen);
|
||||
$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->facture->invoice_advance->send)));
|
||||
$usercanreopen = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->facture->invoice_advance->reopen)));
|
||||
if (!empty($conf->global->INVOICE_DISALLOW_REOPEN)) {
|
||||
$usercanreopen = false;
|
||||
}
|
||||
$usercanunvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->facture->invoice_advance->unvalidate)));
|
||||
|
||||
$usercanproductignorepricemin = ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS));
|
||||
@ -193,8 +196,7 @@ if (empty($reshook)) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
} elseif ($action == 'reopen' && $usercancreate) {
|
||||
// Change status of invoice
|
||||
} elseif ($action == 'reopen' && $usercanreopen) {
|
||||
$result = $object->fetch($id);
|
||||
|
||||
if ($object->statut == Facture::STATUS_CLOSED || ($object->statut == Facture::STATUS_ABANDONED && ($object->close_code != 'replaced' || $object->getIdReplacingInvoice() == 0)) || ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 1)) { // ($object->statut == 1 && $object->paye == 1) should not happened but can be found when data are corrupted
|
||||
|
||||
@ -4902,7 +4902,7 @@ class Facture extends CommonInvoice
|
||||
* @param int|string $template Name (or id) of email template (Must be a template of type 'facture_send')
|
||||
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
|
||||
*/
|
||||
public function sendEmailsReminderOnDueDate($nbdays = 0, $paymentmode = 'all', $template = '')
|
||||
public function sendEmailsRemindersOnInvoiceDueDate($nbdays = 0, $paymentmode = 'all', $template = '')
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
|
||||
@ -4914,12 +4914,12 @@ class Facture extends CommonInvoice
|
||||
|
||||
if (empty($conf->facture->enabled)) { // Should not happen. If module disabled, cron job should not be visible.
|
||||
$langs->load("bills");
|
||||
$this->output = $langs->trans('ModuleNotEnabled', $langs->transnoentitiesnoconv("Facture"));
|
||||
$this->output .= $langs->trans('ModuleNotEnabled', $langs->transnoentitiesnoconv("Facture"));
|
||||
return 0;
|
||||
}
|
||||
/*if (empty($conf->global->FACTURE_REMINDER_EMAIL)) {
|
||||
$langs->load("bills");
|
||||
$this->output = $langs->trans('EventRemindersByEmailNotEnabled', $langs->transnoentitiesnoconv("Facture"));
|
||||
$this->output .= $langs->trans('EventRemindersByEmailNotEnabled', $langs->transnoentitiesnoconv("Facture"));
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
@ -4941,7 +4941,7 @@ class Facture extends CommonInvoice
|
||||
$sql .= ", ".MAIN_DB_PREFIX."c_paiement as cp";
|
||||
}
|
||||
$sql .= " WHERE f.paye = 0";
|
||||
$sql .= " AND f.date_lim_reglement = '".$this->db->idate(dol_get_first_hour(dol_time_plus_duree(dol_now(), -1 * $nbdays, 'd'), 'gmt'), 'gmt')."'";
|
||||
$sql .= " AND f.date_lim_reglement = '".$this->db->idate(dol_get_first_hour(dol_time_plus_duree($now, -1 * $nbdays, 'd'), 'gmt'), 'gmt')."'";
|
||||
$sql .= " AND f.entity IN (".getEntity('facture').")";
|
||||
if (!empty($paymentmode) && $paymentmode != 'all') {
|
||||
$sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'";
|
||||
@ -4949,6 +4949,8 @@ class Facture extends CommonInvoice
|
||||
// TODO Add filter to check there is no payment started
|
||||
$sql .= $this->db->order("date_lim_reglement", "ASC");
|
||||
$resql = $this->db->query($sql);
|
||||
$tmpidate=$this->db->idate(dol_get_first_hour(dol_time_plus_duree($now, -1 * $nbdays, 'd'), 'gmt'), 'gmt');
|
||||
$this->output .= 'Search unpaid invoices with due date = '.$tmpidate.'<br>';
|
||||
|
||||
if ($resql) {
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
@ -4969,7 +4971,7 @@ class Facture extends CommonInvoice
|
||||
$arraymessage = $formmail->getEMailTemplate($this->db, 'facture_send', $user, $outputlangs, (is_numeric($template) ? $template : 0), 1, (is_numeric($template) ? '' : $template));
|
||||
if (is_numeric($arraymessage) && $arraymessage <= 0) {
|
||||
$langs->load("bills");
|
||||
$this->output = $langs->trans('FailedToFindEmailTemplate', $template);
|
||||
$this->output .= $langs->trans('FailedToFindEmailTemplate', $template);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -5040,7 +5042,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$this->output = 'Nb of emails sent : '.$nbMailSend;
|
||||
$this->output .= 'Nb of emails sent : '.$nbMailSend;
|
||||
$this->db->commit();
|
||||
return 0;
|
||||
} else {
|
||||
|
||||
@ -110,27 +110,66 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->facture
|
||||
$db->commit();
|
||||
|
||||
// Loop on each invoice linked to this payment to rebuild PDF
|
||||
$factures = array();
|
||||
foreach ($factures as $id) {
|
||||
$fac = new Facture($db);
|
||||
$fac->fetch($id);
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
$outputlangs = $langs;
|
||||
if (!empty($_REQUEST['lang_id'])) {
|
||||
if (GETPOST('lang_id', 'aZ09')) {
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
||||
$outputlangs->setDefaultLang(GETPOST('lang_id', 'aZ09'));
|
||||
}
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
$fac->generateDocument($fac->model_pdf, $outputlangs);
|
||||
|
||||
$hidedetails = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0;
|
||||
$hidedesc = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0;
|
||||
$hideref = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0;
|
||||
|
||||
$sql = 'SELECT f.rowid as facid';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf,'.MAIN_DB_PREFIX.'facture as f,'.MAIN_DB_PREFIX.'societe as s';
|
||||
$sql .= ' WHERE pf.fk_facture = f.rowid';
|
||||
$sql .= ' AND f.fk_soc = s.rowid';
|
||||
$sql .= ' AND f.entity IN ('.getEntity('invoice').')';
|
||||
$sql .= ' AND pf.fk_paiement = '.$object->id;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$i = 0;
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
if ($num > 0) {
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$invoice = new Facture($db);
|
||||
|
||||
if ($invoice->fetch($objp->facid) <= 0) {
|
||||
$errors++;
|
||||
setEventMessages($invoice->error, $invoice->errors, 'errors');
|
||||
break;
|
||||
}
|
||||
|
||||
if ($invoice->generateDocument($invoice->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref) < 0) {
|
||||
$errors++;
|
||||
setEventMessages($invoice->error, $invoice->errors, 'errors');
|
||||
break;
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
} else {
|
||||
$errors++;
|
||||
setEventMessages($db->error, $db->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id);
|
||||
exit;
|
||||
if (! $errors) {
|
||||
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$db->rollback();
|
||||
|
||||
$langs->load("errors");
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -413,8 +413,15 @@ class Paiement extends CommonObject
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
|
||||
$hidedetails = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0;
|
||||
$hidedesc = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0;
|
||||
$hideref = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0;
|
||||
|
||||
$ret = $invoice->fetch($facid); // Reload to get new records
|
||||
$result = $invoice->generateDocument($invoice->model_pdf, $outputlangs);
|
||||
|
||||
$result = $invoice->generateDocument($invoice->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
|
||||
if ($result < 0) {
|
||||
setEventMessages($invoice->error, $invoice->errors, 'errors');
|
||||
$error++;
|
||||
|
||||
@ -134,12 +134,17 @@ if ($action == 'setbankaccount' && $user->rights->tax->charges->creer) {
|
||||
// Delete social contribution
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes') {
|
||||
$object->fetch($id);
|
||||
$result = $object->delete($user);
|
||||
if ($result > 0) {
|
||||
header("Location: list.php");
|
||||
exit;
|
||||
$totalpaye = $object->getSommePaiement();
|
||||
if (empty($totalpaye)) {
|
||||
$result = $object->delete($user);
|
||||
if ($result > 0) {
|
||||
header("Location: list.php");
|
||||
exit;
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
setEventMessages($langs->trans('DisabledBecausePayments'), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -771,8 +776,10 @@ if ($id > 0) {
|
||||
}
|
||||
|
||||
// Delete
|
||||
if ($user->rights->tax->charges->supprimer) {
|
||||
if ($user->rights->tax->charges->supprimer && empty($totalpaye)) {
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.DOL_URL_ROOT.'/compta/sociales/card.php?id='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans("Delete").'</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.(dol_escape_htmltag($langs->trans("DisabledBecausePayments"))).'">'.$langs->trans("Delete").'</a></div>';
|
||||
}
|
||||
|
||||
print "</div>";
|
||||
|
||||
@ -144,7 +144,7 @@ class Tva extends CommonObject
|
||||
$sql .= " '".$this->db->escape($this->note)."',";
|
||||
$sql .= " '".$this->db->escape($this->fk_account)."',";
|
||||
$sql .= " '".$this->db->escape($this->type_payment)."',";
|
||||
$sql .= " '".$this->db->escape($this->fk_user_creat)."',";
|
||||
$sql .= " '".($this->fk_user_creat > 0 ? (int) $this->fk_user_creat : (int) $user->id)."',";
|
||||
$sql .= " '".$this->db->escape($this->fk_user_modif)."'";
|
||||
$sql .= ")";
|
||||
|
||||
|
||||
@ -722,7 +722,8 @@ if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
|
||||
$moreforfilter .= $formother->select_categories(Categorie::TYPE_CUSTOMER, $search_categ_thirdparty, 'search_categ_thirdparty', 1, $tmptitle);
|
||||
$moreforfilter .= '</div>';
|
||||
}
|
||||
if (empty($type) || $type == 'f') {
|
||||
|
||||
if (!empty($conf->fournisseur->enabled) && (empty($type) || $type == 'f')) {
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$tmptitle = $langs->trans('SuppliersCategoriesShort');
|
||||
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"');
|
||||
|
||||
@ -180,7 +180,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
|
||||
//print '<br>';
|
||||
|
||||
$cssclass='fieldtitle';
|
||||
$cssclass='titlefield';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
@ -5238,6 +5238,9 @@ abstract class CommonObject
|
||||
if ($this->element == 'contrat' && !empty($conf->global->CONTRACT_ALLOW_EXTERNAL_DOWNLOAD)) {
|
||||
$setsharekey = true;
|
||||
}
|
||||
if ($this->element == 'supplier_proposal' && !empty($conf->global->SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) {
|
||||
$setsharekey = true;
|
||||
}
|
||||
|
||||
if ($setsharekey) {
|
||||
if (empty($ecmfile->share)) { // Because object not found or share not set yet
|
||||
|
||||
@ -141,7 +141,7 @@ class DiscountAbsolute
|
||||
$sql .= " fsup.ref as ref_invoice_supplier_source, fsup.type as type_invoice_supplier_source";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe_remise_except as sr";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON sr.fk_facture_source = f.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fsup ON sr.fk_invoice_supplier_source = fsup.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as fsup ON sr.fk_invoice_supplier_source = fsup.rowid";
|
||||
$sql .= " WHERE sr.entity IN (".getEntity('invoice').")";
|
||||
if ($rowid) {
|
||||
$sql .= " AND sr.rowid=".((int) $rowid);
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2021 Gaëtan MAISON <gm@ilad.org>
|
||||
*
|
||||
* 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
|
||||
@ -154,6 +155,11 @@ class DolEditor
|
||||
} else {
|
||||
$skin = 'moono-lisa'; // default with ckeditor 4.6 : moono-lisa
|
||||
}
|
||||
if (!empty($conf->global->FCKEDITOR_ENABLE_SCAYT_AUTOSTARTUP)) {
|
||||
$scaytautostartup = 'scayt_autoStartup: true,';
|
||||
} else {
|
||||
$scaytautostartup = '/*scayt is disable*/'; // Disable by default
|
||||
}
|
||||
|
||||
$htmlencode_force = preg_match('/_encoded$/', $this->toolbarname) ? 'true' : 'false';
|
||||
|
||||
@ -178,6 +184,8 @@ class DolEditor
|
||||
width: '.($this->width ? '\''.$this->width.'\'' : '\'\'').',
|
||||
height: '.$this->height.',
|
||||
skin: \''.$skin.'\',
|
||||
'.$scaytautostartup.'
|
||||
scayt_sLang: \''.$langs->getDefaultLang().'\',
|
||||
language: \''.$langs->defaultlang.'\',
|
||||
textDirection: \''.$langs->trans("DIRECTION").'\',
|
||||
on :
|
||||
|
||||
@ -1007,6 +1007,9 @@ class FormCompany extends Form
|
||||
{
|
||||
|
||||
global $conf, $langs;
|
||||
if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->fournisseur->enabled)) {
|
||||
return '' ;
|
||||
}
|
||||
|
||||
$out = '<select class="flat '.$morecss.'" name="'.$htmlname.'" id="'.$htmlidname.'">';
|
||||
if ($typeinput == 'form') {
|
||||
@ -1031,7 +1034,9 @@ class FormCompany extends Form
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
|
||||
$out .= '<option value="1,3"'.($selected == '1,3' ? ' selected' : '').'>'.$langs->trans('Customer').'</option>';
|
||||
}
|
||||
$out .= '<option value="4"'.($selected == '4' ? ' selected' : '').'>'.$langs->trans('Supplier').'</option>';
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
$out .= '<option value="4"'.($selected == '4' ? ' selected' : '').'>'.$langs->trans('Supplier').'</option>';
|
||||
}
|
||||
$out .= '<option value="0"'.($selected == '0' ? ' selected' : '').'>'.$langs->trans('Other').'</option>';
|
||||
} elseif ($typeinput == 'admin') {
|
||||
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) {
|
||||
|
||||
@ -297,7 +297,7 @@ class FormFile
|
||||
$out .= "\n</div><!-- End form link new url -->\n";
|
||||
}
|
||||
|
||||
$parameters = array('socid'=>(isset($GLOBALS['socid']) ? $GLOBALS['socid'] : ''), 'id'=>(isset($GLOBALS['id']) ? $GLOBALS['id'] : ''), 'url'=>$url, 'perm'=>$perm);
|
||||
$parameters = array('socid'=>(isset($GLOBALS['socid']) ? $GLOBALS['socid'] : ''), 'id'=>(isset($GLOBALS['id']) ? $GLOBALS['id'] : ''), 'url'=>$url, 'perm'=>$perm, 'options'=>$options);
|
||||
$res = $hookmanager->executeHooks('formattachOptions', $parameters, $object);
|
||||
if (empty($res)) {
|
||||
print '<div class="'.($usewithoutform ? 'inline-block valignmiddle' : 'attacharea attacharea'.$htmlname).'">';
|
||||
|
||||
@ -169,13 +169,15 @@ class FormTicket
|
||||
if ($this->withref) {
|
||||
// Ref
|
||||
$defaultref = $ticketstat->getDefaultRef();
|
||||
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("Ref").'</span></td><td><input size="18" type="text" name="ref" value="'.(GETPOST("ref", 'alpha') ? GETPOST("ref", 'alpha') : $defaultref).'"></td></tr>';
|
||||
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("Ref").'</span></td><td>';
|
||||
print '<input type="text" name="ref" value="'.dol_escape_htmltag(GETPOST("ref", 'alpha') ? GETPOST("ref", 'alpha') : $defaultref).'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// TITLE
|
||||
if ($this->withemail) {
|
||||
print '<tr><td class="titlefield"><label for="email"><span class="fieldrequired">'.$langs->trans("Email").'</span></label></td><td>';
|
||||
print '<input class="text minwidth200" id="email" name="email" value="'.(GETPOST('email', 'alpha') ? GETPOST('email', 'alpha') : $subject).'" />';
|
||||
print '<input class="text minwidth200" id="email" name="email" value="'.(GETPOST('email', 'alpha') ? GETPOST('email', 'alpha') : $subject).'" autofocus>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -313,7 +315,7 @@ class FormTicket
|
||||
if ($this->withfile == 2) { // Can add other files
|
||||
$out .= '<input type="file" class="flat" id="addedfile" name="addedfile" value="'.$langs->trans("Upload").'" />';
|
||||
$out .= ' ';
|
||||
$out .= '<input type="submit" class="button smallpaddingimp" id="addfile" name="addfile" value="'.$langs->trans("MailingAddFile").'" />';
|
||||
$out .= '<input type="submit" class="button smallpaddingimp reposition" id="addfile" name="addfile" value="'.$langs->trans("MailingAddFile").'" />';
|
||||
}
|
||||
$out .= "</td></tr>\n";
|
||||
|
||||
@ -453,6 +455,8 @@ class FormTicket
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
print '<input type="hidden" name="page_y">'."\n";
|
||||
|
||||
print "</form>\n";
|
||||
print "<!-- End form TICKET -->\n";
|
||||
}
|
||||
@ -1083,7 +1087,7 @@ class FormTicket
|
||||
if ($this->withfile == 2) { // Can add other files
|
||||
$out .= '<input type="file" class="flat" id="addedfile" name="addedfile" value="'.$langs->trans("Upload").'" />';
|
||||
$out .= ' ';
|
||||
$out .= '<input type="submit" class="button smallpaddingimp" id="'.$addfileaction.'" name="'.$addfileaction.'" value="'.$langs->trans("MailingAddFile").'" />';
|
||||
$out .= '<input type="submit" class="button smallpaddingimp reposition" id="'.$addfileaction.'" name="'.$addfileaction.'" value="'.$langs->trans("MailingAddFile").'" />';
|
||||
}
|
||||
$out .= "</td></tr>\n";
|
||||
|
||||
@ -1100,6 +1104,8 @@ class FormTicket
|
||||
}
|
||||
print "</center>\n";
|
||||
|
||||
print '<input type="hidden" name="page_y">'."\n";
|
||||
|
||||
print "</form>\n";
|
||||
print "<!-- End form TICKET -->\n";
|
||||
}
|
||||
|
||||
@ -3510,7 +3510,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'angle-double-down', 'angle-double-up', 'asset',
|
||||
'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'building',
|
||||
'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'cron', 'cubes',
|
||||
'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'edit', 'ellipsis-h', 'email', 'eraser', 'establishment', 'external-link-alt', 'external-link-square-alt',
|
||||
'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'edit', 'ellipsis-h', 'email', 'eraser', 'establishment', 'expensereport', 'external-link-alt', 'external-link-square-alt',
|
||||
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'autofill', 'folder', 'folder-open', 'folder-plus',
|
||||
'globe', 'globe-americas', 'graph', 'grip', 'grip_title', 'group',
|
||||
'help', 'holiday',
|
||||
@ -3542,7 +3542,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'recruitmentcandidature', 'recruitmentjobposition', 'resource',
|
||||
'shapes', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
|
||||
'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda',
|
||||
'user-cog', 'website', 'workstation',
|
||||
'uncheck', 'user-cog', 'website', 'workstation',
|
||||
'conferenceorbooth', 'eventorganization'
|
||||
))) {
|
||||
$pictowithouttext = str_replace('object_', '', $pictowithouttext);
|
||||
@ -3572,7 +3572,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'generic'=>'file', 'holiday'=>'umbrella-beach',
|
||||
'info'=>'info-circle', 'inventory'=>'boxes', 'intracommreport'=>'globe-europe', 'label'=>'layer-group', 'loan'=>'money-bill-alt',
|
||||
'member'=>'user-alt', 'meeting'=>'chalkboard-teacher', 'mrp'=>'cubes', 'next'=>'arrow-alt-circle-right',
|
||||
'trip'=>'wallet', 'group'=>'users', 'movement'=>'people-carry',
|
||||
'trip'=>'wallet', 'expensereport'=>'wallet', 'group'=>'users', 'movement'=>'people-carry',
|
||||
'sign-out'=>'sign-out-alt',
|
||||
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star',
|
||||
'bank'=>'university', 'close_title'=>'times', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter',
|
||||
@ -3588,7 +3588,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt',
|
||||
'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach',
|
||||
'title_agenda'=>'calendar-alt',
|
||||
'uparrow'=>'share', 'vcard'=>'address-card',
|
||||
'uncheck'=>'times', 'uparrow'=>'share', 'vcard'=>'address-card',
|
||||
'jabber'=>'comment-o',
|
||||
'website'=>'globe-americas', 'workstation'=>'pallet',
|
||||
'conferenceorbooth'=>'chalkboard-teacher', 'eventorganization'=>'project-diagram'
|
||||
@ -3662,7 +3662,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'resource'=>'infobox-action',
|
||||
'salary'=>'infobox-bank_account', 'supplier_invoice'=>'infobox-order_supplier', 'supplier_invoicea'=>'infobox-order_supplier', 'supplier_invoiced'=>'infobox-order_supplier',
|
||||
'supplier_order'=>'infobox-order_supplier', 'supplier_proposal'=>'infobox-supplier_proposal',
|
||||
'ticket'=>'infobox-contrat', 'title_accountancy'=>'infobox-bank_account', 'title_hrm'=>'infobox-holiday', 'trip'=>'infobox-expensereport', 'title_agenda'=>'infobox-action',
|
||||
'ticket'=>'infobox-contrat', 'title_accountancy'=>'infobox-bank_account', 'title_hrm'=>'infobox-holiday', 'expensereport'=>'infobox-expensereport', 'trip'=>'infobox-expensereport', 'title_agenda'=>'infobox-action',
|
||||
//'title_setup'=>'infobox-action', 'tools'=>'infobox-action',
|
||||
'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode'
|
||||
);
|
||||
@ -3680,7 +3680,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'map-marker-alt'=>'#aaa', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'inventory'=>'#a69944', 'stock'=>'#a69944', 'movement'=>'#a69944',
|
||||
'other'=>'#ddd',
|
||||
'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'reception'=>'#a69944', 'resize'=>'#444', 'rss'=>'#cba',
|
||||
'shipment'=>'#a69944', 'stats'=>'#444', 'switch_off'=>'#999', 'technic'=>'#999', 'timespent'=>'#555', 'uparrow'=>'#555', 'user-cog'=>'#999', 'country'=>'#aaa', 'globe-americas'=>'#aaa',
|
||||
'shipment'=>'#a69944', 'stats'=>'#444', 'switch_off'=>'#999', 'technic'=>'#999', 'timespent'=>'#555',
|
||||
'uncheck'=>'#800', 'uparrow'=>'#555', 'user-cog'=>'#999', 'country'=>'#aaa', 'globe-americas'=>'#aaa',
|
||||
'website'=>'#304', 'workstation'=>'#a69944'
|
||||
);
|
||||
if (isset($arrayconvpictotocolor[$pictowithouttext])) {
|
||||
@ -7102,6 +7103,11 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
||||
} else {
|
||||
$substitutionarray['__DIRECTDOWNLOAD_URL_CONTRACT__'] = '';
|
||||
}
|
||||
if (!empty($conf->global->SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD) && is_object($object) && $object->element == 'supplier_proposal') {
|
||||
$substitutionarray['__DIRECTDOWNLOAD_URL_SUPPLIER_PROPOSAL__'] = $object->getLastMainDocLink($object->element);
|
||||
} else {
|
||||
$substitutionarray['__DIRECTDOWNLOAD_URL_SUPPLIER_PROPOSAL__'] = '';
|
||||
}
|
||||
|
||||
if (is_object($object) && $object->element == 'propal') {
|
||||
$substitutionarray['__URL_PROPOSAL__'] = DOL_MAIN_URL_ROOT."/comm/propal/card.php?id=".$object->id;
|
||||
@ -7115,6 +7121,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
||||
if (is_object($object) && $object->element == 'contrat') {
|
||||
$substitutionarray['__URL_CONTRACT__'] = DOL_MAIN_URL_ROOT."/contrat/card.php?id=".$object->id;
|
||||
}
|
||||
if (is_object($object) && $object->element == 'supplier_proposal') {
|
||||
$substitutionarray['__URL_SUPPLIER_PROPOSAL__'] = DOL_MAIN_URL_ROOT."/supplier_proposal/card.php?id=".$object->id;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_object($object) && $object->element == 'action') {
|
||||
|
||||
@ -121,7 +121,7 @@ class modFacture extends DolibarrModules
|
||||
$datestart = dol_mktime(23, 0, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']);
|
||||
$this->cronjobs = array(
|
||||
0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>1, 'test'=>'$conf->facture->enabled', 'datestart'=>$datestart),
|
||||
1=>array('label'=>'SendEmailsRemindersOnDueDate', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture.class.php', 'objectname'=>'Facture', 'method'=>'sendEmailsReminderOnDueDate', 'parameters'=>"10,all,EmailTemplateCode", 'comment'=>'Send an emails when the unpaid invoices reach a due date + n days (an email template with EmailTemplateCode must exists. the version in the language of the thirdparty will be used in priority)', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>0, 'test'=>'$conf->facture->enabled', 'datestart'=>$datestart),
|
||||
1=>array('label'=>'SendEmailsRemindersOnInvoiceDueDate', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture.class.php', 'objectname'=>'Facture', 'method'=>'sendEmailsRemindersOnInvoiceDueDate', 'parameters'=>"10,all,EmailTemplateCode", 'comment'=>'Send an emails when the unpaid invoices reach a due date + n days. First param is the offset n of days, second parameter is "all" or a payment mode code, last paramater is the code of email template to use (an email template with EmailTemplateCode must exists. the version in the language of the thirdparty will be used in priority).', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>0, 'test'=>'$conf->facture->enabled', 'datestart'=>$datestart),
|
||||
);
|
||||
|
||||
// Permissions
|
||||
|
||||
@ -87,10 +87,29 @@ if ($module == 'ecm') {
|
||||
print '</a>';
|
||||
}
|
||||
if ($permtoadd && GETPOSTISSET('website')) { // If on file manager to manage medias of a web site
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=confirmconvertimgwebp&website='.$website->ref.'" class="inline-block valignmiddle toolbarbutton paddingtop" title="'.dol_escape_htmltag($langs->trans("GenerateImgWebp")).'">';
|
||||
print '<a id="generateimgwebp" href="'.$_SERVER["PHP_SELF"].'?action=confirmconvertimgwebp&website='.$website->ref.'" class="inline-block valignmiddle toolbarbutton paddingtop" title="'.dol_escape_htmltag($langs->trans("GenerateImgWebp")).'">';
|
||||
print img_picto('', 'images', '', false, 0, 0, '', 'size15x flip marginrightonly');
|
||||
print '</a>';
|
||||
}
|
||||
if ($permtoadd && $module == 'ecm') { // If on file manager medias in ecm
|
||||
print '<a id="generateimgwebp" href="'.$_SERVER["PHP_SELF"].'?action=confirmconvertimgwebp" class="inline-block valignmiddle toolbarbutton paddingtop" title="'.dol_escape_htmltag($langs->trans("GenerateImgWebp")).'">';
|
||||
print img_picto('', 'images', '', false, 0, 0, '', 'size15x flip marginrightonly');
|
||||
print '</a>';
|
||||
}
|
||||
print "<script>
|
||||
$(\"#generateimgwebp\").on(\"click\",function(){
|
||||
try{
|
||||
console.log(\"We click to generate webp image, we set current dir into hidden vars\");
|
||||
section_dir = $(\".directory.expanded\")[$(\".directory.expanded\").length-1].children[0].rel
|
||||
section=$(\".directory.expanded\")[$(\".directory.expanded\").length-1].children[0].id.split('_')[2]
|
||||
}catch{
|
||||
section_dir = '/'
|
||||
section=0
|
||||
}
|
||||
console.log(\"We add hiden vars in href of button to create webp \");
|
||||
$(\"#generateimgwebp\").attr(\"href\",$(\"#generateimgwebp\").attr(\"href\")+'§ion_dir='+section_dir+'§ion='+section)
|
||||
})
|
||||
</script>";
|
||||
|
||||
// Start "Add new file" area
|
||||
$nameforformuserfile = 'formuserfileecm';
|
||||
@ -139,22 +158,30 @@ if ($action == 'delete_section') {
|
||||
// End confirm
|
||||
|
||||
if ($action == 'confirmconvertimgwebp') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?website='.$website->ref, $langs->trans('ConfirmImgWebpCreation'), $langs->trans('ConfirmGenerateImgWebp', $object->ref), 'convertimgwebp', '', "yes", 1);
|
||||
$section_dir=GETPOST('section_dir', 'alpha');
|
||||
$section=GETPOST('section', 'alpha');
|
||||
$form = new Form($db);
|
||||
$formquestion['section_dir']=array('type'=>'hidden', 'value'=>$section_dir, 'name'=>'section_dir');
|
||||
$formquestion['section']=array('type'=>'hidden', 'value'=>$section, 'name'=>'section');
|
||||
if ($module == 'medias') {
|
||||
$formquestion['website']=array('type'=>'hidden', 'value'=>$website->ref, 'name'=>'website');
|
||||
}
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('ConfirmImgWebpCreation'), $langs->trans('ConfirmGenerateImgWebp', $object->ref), 'convertimgwebp', $formquestion, "yes", 1);
|
||||
$action = 'file_manager';
|
||||
}
|
||||
|
||||
if ($action == 'convertimgwebp' && $permtoadd) {
|
||||
if ($module == 'medias') {
|
||||
$imagefolder = $conf->website->dir_output.'/'.$websitekey.'/medias/image/'.$websitekey.'/';
|
||||
$imagefolder = $conf->website->dir_output.'/'.$websitekey.'/medias/'.dol_sanitizeFileName(GETPOST('section_dir', 'alpha'));
|
||||
} else {
|
||||
$imagefolder = $conf->ecm->dir_output;
|
||||
$imagefolder = $conf->ecm->dir_output.'/'.dol_sanitizePathName(GETPOST('section_dir', 'alpha'));
|
||||
}
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||
|
||||
$regeximgext = getListOfPossibleImageExt();
|
||||
|
||||
$filelist = dol_dir_list($imagefolder, "all", 1, $regeximgext);
|
||||
$filelist = dol_dir_list($imagefolder, "all", 0, $regeximgext);
|
||||
|
||||
foreach ($filelist as $filename) {
|
||||
$filepath = $filename['fullname'];
|
||||
|
||||
@ -128,7 +128,7 @@ class InterfaceNotification extends DolibarrTriggers
|
||||
}
|
||||
// Check if module for this event is active
|
||||
if ($qualified) {
|
||||
//print 'xx'.$obj->code;
|
||||
//print 'xx'.$obj->code.' '.$obj->elementtype.'<br>';
|
||||
$element = $obj->elementtype;
|
||||
|
||||
// Exclude events if related module is disabled
|
||||
@ -142,7 +142,9 @@ class InterfaceNotification extends DolibarrTriggers
|
||||
$qualified = 0;
|
||||
} elseif ($element == 'member' && empty($conf->adherent->enabled)) {
|
||||
$qualified = 0;
|
||||
} elseif (!in_array($element, array('order_supplier', 'invoice_supplier', 'withdraw', 'shipping', 'member', 'expensereport')) && empty($conf->$element->enabled)) {
|
||||
} elseif (($element == 'expense_report' || $element == 'expensereport') && empty($conf->expensereport->enabled)) {
|
||||
$qualified = 0;
|
||||
} elseif (!in_array($element, array('order_supplier', 'invoice_supplier', 'withdraw', 'shipping', 'member', 'expense_report', 'expensereport')) && empty($conf->$element->enabled)) {
|
||||
$qualified = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -350,9 +350,6 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
|
||||
$stringcurrentdate = $langs->trans("CurrentHour").': '.dol_print_date(dol_now(), 'dayhour');
|
||||
|
||||
if ($action == 'delete') {
|
||||
print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.$param, $langs->trans("CronDelete"), $langs->trans("CronConfirmDelete"), "confirm_delete", '', '', 1);
|
||||
}
|
||||
if ($action == 'execute') {
|
||||
print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&securitykey='.$securitykey.$param, $langs->trans("CronExecute"), $langs->trans("CronConfirmExecute"), "confirm_execute", '', '', 1);
|
||||
}
|
||||
@ -362,12 +359,12 @@ $arrayofmassactions = array(
|
||||
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||
'enable'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("CronStatusActiveBtn"),
|
||||
'disable'=>img_picto('', 'title_close', 'class="pictofixedwidth"').$langs->trans("CronStatusInactiveBtn"),
|
||||
'disable'=>img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans("CronStatusInactiveBtn"),
|
||||
);
|
||||
if ($user->rights->cron->delete) {
|
||||
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||
}
|
||||
if (in_array($massaction, array('presend', 'predelete'))) {
|
||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
||||
$arrayofmassactions = array();
|
||||
}
|
||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||
@ -406,6 +403,12 @@ if ($mode == 'modulesetup') {
|
||||
|
||||
print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, ($mode == 'modulesetup' ? '' : 'title_setup'), 0, $newcardbutton, '', $limit);
|
||||
|
||||
// Add code for pre mass action (confirmation or email presend form)
|
||||
$topicmail = "SendCronRef";
|
||||
$modelmail = "cron";
|
||||
$objecttmp = new Cronjob($db);
|
||||
$trackid = 'cron'.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
|
||||
$text = $langs->trans("HoursOnThisPageAreOnServerTZ").' '.$stringcurrentdate.'<br>';
|
||||
if (!empty($conf->global->CRON_WARNING_DELAY_HOURS)) {
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2019 Thibault FOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2021 Maxime DEMAREST <maxime@indelog.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
|
||||
@ -1098,4 +1099,31 @@ class Don extends CommonObject
|
||||
|
||||
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get reamain to pay for a donation
|
||||
*
|
||||
* @return int <0 if KO, > reamain to pay if OK
|
||||
*/
|
||||
public function getRemainToPay()
|
||||
{
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
if (empty($this->id)) {
|
||||
$this->error = 'Missing object id';
|
||||
$this->errors[] = $this->error;
|
||||
dol_syslog(__METHOD__.' : '.$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
$sql = 'SELECT SUM(amount) as sum_amount FROM '.MAIN_DB_PREFIX.'payment_donation WHERE fk_donation = '.$this->id;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
dol_print_error($this->db);
|
||||
return -2;
|
||||
} else {
|
||||
$sum_amount = (float) $this->db->fetch_object($resql)->sum_amount;
|
||||
return (float) $this->amount - $sum_amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,6 +92,15 @@ class PaymentDonation extends CommonObject
|
||||
public $type_code;
|
||||
public $type_label;
|
||||
|
||||
/**
|
||||
* @var string Id of external payment mode
|
||||
*/
|
||||
public $ext_payment_id;
|
||||
|
||||
/**
|
||||
* @var string Name of external payment mode
|
||||
*/
|
||||
public $ext_payment_site;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -126,6 +135,13 @@ class PaymentDonation extends CommonObject
|
||||
}
|
||||
|
||||
// Clean parameters
|
||||
if (isset($this->chid)) {
|
||||
$this->chid = (int) $this->chid;
|
||||
} elseif (isset($this->fk_donation)) {
|
||||
// NOTE : The property used in INSERT for fk_donation is not fk_donation but chid
|
||||
// (keep priority to chid property)
|
||||
$this->chid = (int) $this->fk_donation;
|
||||
}
|
||||
if (isset($this->fk_donation)) {
|
||||
$this->fk_donation = (int) $this->fk_donation;
|
||||
}
|
||||
@ -169,12 +185,14 @@ class PaymentDonation extends CommonObject
|
||||
|
||||
if ($totalamount != 0) {
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_donation (fk_donation, datec, datep, amount,";
|
||||
$sql .= " fk_typepayment, num_payment, note, fk_user_creat, fk_bank)";
|
||||
$sql .= " fk_typepayment, num_payment, note, ext_payment_id, ext_payment_site,";
|
||||
$sql .= " fk_user_creat, fk_bank)";
|
||||
$sql .= " VALUES ($this->chid, '".$this->db->idate($now)."',";
|
||||
$sql .= " '".$this->db->idate($this->datepaid)."',";
|
||||
$sql .= " ".$totalamount.",";
|
||||
$sql .= " ".$this->paymenttype.", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note_public)."', ".$user->id.",";
|
||||
$sql .= " 0)";
|
||||
$sql .= " ".$this->paymenttype.", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note_public)."', ";
|
||||
$sql .= " ".($this->ext_payment_id ? "'".$this->db->escape($this->ext_payment_id)."'" : "null").", ".($this->ext_payment_site ? "'".$this->db->escape($this->ext_payment_site)."'" : "null").",";
|
||||
$sql .= " ".$user->id.", 0)";
|
||||
|
||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
@ -244,15 +244,21 @@ if (!empty($conf->projet->enabled)) {
|
||||
if (!empty($conf->contrat->enabled)) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."contrat as c on f.fk_contrat = c.rowid";
|
||||
}
|
||||
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (f.rowid = ef.fk_object)";
|
||||
}
|
||||
if (empty($conf->global->FICHINTER_DISABLE_DETAILS) && $atleastonefieldinlines) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid";
|
||||
}
|
||||
// Add table from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
if (!$user->rights->societe->client->voir && empty($socid)) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= " WHERE f.entity IN (".getEntity('intervention').")";
|
||||
$sql .= " AND f.fk_soc = s.rowid";
|
||||
|
||||
@ -36,7 +36,6 @@
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/commoninvoice.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commoninvoice.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
@ -501,8 +500,8 @@ class FactureFournisseur extends CommonInvoice
|
||||
if (count($this->lines) && is_object($this->lines[0])) { // If this->lines is array of InvoiceLines (preferred mode)
|
||||
dol_syslog("There is ".count($this->lines)." lines that are invoice lines objects");
|
||||
foreach ($this->lines as $i => $val) {
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn, special_code)';
|
||||
$sql .= ' VALUES ('.$this->id.','.intval($this->lines[$i]->special_code).')';
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn, special_code, fk_remise_except)';
|
||||
$sql .= ' VALUES ('.$this->id.','.intval($this->lines[$i]->special_code).','.($this->lines[$i]->fk_remise_except > 0 ? $this->lines[$i]->fk_remise_except : 'NULL').')';
|
||||
|
||||
$resql_insert = $this->db->query($sql);
|
||||
if ($resql_insert) {
|
||||
@ -546,8 +545,8 @@ class FactureFournisseur extends CommonInvoice
|
||||
$line = (object) $line;
|
||||
}
|
||||
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn, special_code)';
|
||||
$sql .= ' VALUES ('.$this->id.','.intval($this->lines[$i]->special_code).')';
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn, special_code, fk_remise_except)';
|
||||
$sql .= ' VALUES ('.$this->id.','.intval($this->lines[$i]->special_code).','.($this->lines[$i]->fk_remise_except > 0 ? $this->lines[$i]->fk_remise_except : 'NULL').')';
|
||||
|
||||
$resql_insert = $this->db->query($sql);
|
||||
if ($resql_insert) {
|
||||
@ -797,7 +796,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
$this->lines = array();
|
||||
|
||||
$sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description, f.date_start, f.date_end, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.vat_src_code, f.tva_tx';
|
||||
$sql .= ', f.localtax1_tx, f.localtax2_tx, f.localtax1_type, f.localtax2_type, f.total_localtax1, f.total_localtax2, f.fk_facture_fourn ';
|
||||
$sql .= ', f.localtax1_tx, f.localtax2_tx, f.localtax1_type, f.localtax2_type, f.total_localtax1, f.total_localtax2, f.fk_facture_fourn, f.fk_remise_except';
|
||||
$sql .= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_product, f.product_type, f.info_bits, f.rang, f.special_code, f.fk_parent_line, f.fk_unit';
|
||||
$sql .= ', p.rowid as product_id, p.ref as product_ref, p.label as label, p.description as product_desc';
|
||||
$sql .= ', f.fk_code_ventilation, f.fk_multicurrency, f.multicurrency_code, f.multicurrency_subprice, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc';
|
||||
@ -841,6 +840,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
$line->localtax2_type = $obj->localtax2_type;
|
||||
$line->qty = $obj->qty;
|
||||
$line->remise_percent = $obj->remise_percent;
|
||||
$line->fk_remise_except = $obj->fk_remise_except;
|
||||
$line->tva = $obj->total_tva; // deprecated
|
||||
$line->total_ht = $obj->total_ht;
|
||||
$line->total_ttc = $obj->total_ttc;
|
||||
@ -1772,13 +1772,14 @@ class FactureFournisseur extends CommonInvoice
|
||||
* @param string $ref_supplier Supplier ref
|
||||
* @param string $special_code Special code
|
||||
* @param int $fk_parent_line Parent line id
|
||||
* @param int $fk_remise_except Id discount used
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
public function addline($desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, $fk_product = 0, $remise_percent = 0, $date_start = '', $date_end = '', $ventil = 0, $info_bits = '', $price_base_type = 'HT', $type = 0, $rang = -1, $notrigger = false, $array_options = 0, $fk_unit = null, $origin_id = 0, $pu_ht_devise = 0, $ref_supplier = '', $special_code = '', $fk_parent_line = 0)
|
||||
public function addline($desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, $fk_product = 0, $remise_percent = 0, $date_start = '', $date_end = '', $ventil = 0, $info_bits = '', $price_base_type = 'HT', $type = 0, $rang = -1, $notrigger = false, $array_options = 0, $fk_unit = null, $origin_id = 0, $pu_ht_devise = 0, $ref_supplier = '', $special_code = '', $fk_parent_line = 0, $fk_remise_except = 0)
|
||||
{
|
||||
global $langs, $mysoc, $conf;
|
||||
|
||||
dol_syslog(get_class($this)."::addline $desc,$pu,$qty,$txtva,$fk_product,$remise_percent,$date_start,$date_end,$ventil,$info_bits,$price_base_type,$type,$fk_unit", LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::addline $desc,$pu,$qty,$txtva,$fk_product,$remise_percent,$date_start,$date_end,$ventil,$info_bits,$price_base_type,$type,$fk_unit,fk_remise_except=$fk_remise_except", LOG_DEBUG);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
|
||||
if ($this->statut == self::STATUS_DRAFT) {
|
||||
@ -1957,6 +1958,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
$this->line->ventil = $ventil;
|
||||
$this->line->rang = $rang;
|
||||
$this->line->info_bits = $info_bits;
|
||||
$this->line->fk_remise_except = $fk_remise_except;
|
||||
|
||||
$this->line->special_code = ((string) $special_code != '' ? $special_code : $this->special_code);
|
||||
$this->line->fk_parent_line = $fk_parent_line;
|
||||
@ -2677,10 +2679,10 @@ class FactureFournisseur extends CommonInvoice
|
||||
$this->multicurrency_tx = 1;
|
||||
$this->multicurrency_code = $conf->currency;
|
||||
|
||||
$xnbp = 0;
|
||||
if (empty($option) || $option != 'nolines') {
|
||||
// Lines
|
||||
$nbp = 5;
|
||||
$xnbp = 0;
|
||||
while ($xnbp < $nbp) {
|
||||
$line = new SupplierInvoiceLine($this->db);
|
||||
$line->desc = $langs->trans("Description")." ".$xnbp;
|
||||
@ -2774,7 +2776,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
*/
|
||||
public function createFromClone(User $user, $fromid, $invertdetail = 0)
|
||||
{
|
||||
global $langs;
|
||||
global $conf, $langs;
|
||||
|
||||
$error = 0;
|
||||
|
||||
@ -3133,6 +3135,12 @@ class SupplierInvoiceLine extends CommonObjectLine
|
||||
*/
|
||||
public $info_bits;
|
||||
|
||||
/**
|
||||
* Link to line into llx_remise_except
|
||||
* @var int
|
||||
*/
|
||||
public $fk_remise_except;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
@ -3189,7 +3197,7 @@ class SupplierInvoiceLine extends CommonObjectLine
|
||||
public function fetch($rowid)
|
||||
{
|
||||
$sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description, f.date_start, f.date_end, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.tva_tx';
|
||||
$sql .= ', f.localtax1_type, f.localtax2_type, f.localtax1_tx, f.localtax2_tx, f.total_localtax1, f.total_localtax2 ';
|
||||
$sql .= ', f.localtax1_type, f.localtax2_type, f.localtax1_tx, f.localtax2_tx, f.total_localtax1, f.total_localtax2, f.fk_remise_except';
|
||||
$sql .= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_facture_fourn, f.fk_product, f.product_type, f.info_bits, f.rang, f.special_code, f.fk_parent_line, f.fk_unit';
|
||||
$sql .= ', p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.description as product_desc';
|
||||
$sql .= ', f.multicurrency_subprice, f.multicurrency_total_ht, f.multicurrency_total_tva, multicurrency_total_ttc';
|
||||
@ -3232,6 +3240,7 @@ class SupplierInvoiceLine extends CommonObjectLine
|
||||
|
||||
$this->qty = $obj->qty;
|
||||
$this->remise_percent = $obj->remise_percent;
|
||||
$this->fk_remise_except = $obj->fk_remise_except;
|
||||
$this->tva = $obj->total_tva; // deprecated
|
||||
$this->total_ht = $obj->total_ht;
|
||||
$this->total_tva = $obj->total_tva;
|
||||
@ -3348,6 +3357,22 @@ class SupplierInvoiceLine extends CommonObjectLine
|
||||
$this->localtax2_tx = 0;
|
||||
}
|
||||
|
||||
if (empty($this->pa_ht)) {
|
||||
$this->pa_ht = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_subprice)) {
|
||||
$this->multicurrency_subprice = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_total_ht)) {
|
||||
$this->multicurrency_total_ht = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_total_tva)) {
|
||||
$this->multicurrency_total_tva = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_total_ttc)) {
|
||||
$this->multicurrency_total_ttc = 0;
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if (empty($this->fk_product)) {
|
||||
@ -3371,6 +3396,8 @@ class SupplierInvoiceLine extends CommonObjectLine
|
||||
$sql .= ", pu_ttc = ".price2num($this->pu_ttc);
|
||||
$sql .= ", qty = ".price2num($this->qty);
|
||||
$sql .= ", remise_percent = ".price2num($this->remise_percent);
|
||||
if ($this->fk_remise_except) $sql.= ", fk_remise_except=".$this->fk_remise_except;
|
||||
else $sql.= ", fk_remise_except=null";
|
||||
$sql .= ", vat_src_code = '".$this->db->escape(empty($this->vat_src_code) ? '' : $this->vat_src_code)."'";
|
||||
$sql .= ", tva_tx = ".price2num($this->tva_tx);
|
||||
$sql .= ", localtax1_tx = ".price2num($this->localtax1_tx);
|
||||
@ -3442,7 +3469,7 @@ class SupplierInvoiceLine extends CommonObjectLine
|
||||
*/
|
||||
public function insert($notrigger = 0)
|
||||
{
|
||||
global $user, $conf;
|
||||
global $user, $conf, $langs;
|
||||
|
||||
$error = 0;
|
||||
|
||||
@ -3533,7 +3560,7 @@ class SupplierInvoiceLine extends CommonObjectLine
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql .= ' (fk_facture_fourn, fk_parent_line, label, description, ref, qty,';
|
||||
$sql .= ' vat_src_code, tva_tx, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type,';
|
||||
$sql .= ' fk_product, product_type, remise_percent, pu_ht, pu_ttc,';
|
||||
$sql .= ' fk_product, product_type, remise_percent, fk_remise_except, pu_ht, pu_ttc,';
|
||||
$sql .= ' date_start, date_end, fk_code_ventilation, rang, special_code,';
|
||||
$sql .= ' info_bits, total_ht, tva, total_ttc, total_localtax1, total_localtax2, fk_unit';
|
||||
$sql .= ', fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc';
|
||||
@ -3554,6 +3581,7 @@ class SupplierInvoiceLine extends CommonObjectLine
|
||||
$sql .= ' '.(!empty($this->fk_product) ? $this->fk_product : "null").',';
|
||||
$sql .= " ".$this->product_type.",";
|
||||
$sql .= " ".price2num($this->remise_percent).",";
|
||||
$sql .= ' '.(! empty($this->fk_remise_except)?$this->fk_remise_except:"null").',';
|
||||
$sql .= " ".price2num($this->subprice).",";
|
||||
$sql .= " ".(!empty($this->qty) ?price2num($this->total_ttc / $this->qty) : price2num($this->total_ttc)).",";
|
||||
$sql .= " ".(!empty($this->date_start) ? "'".$this->db->idate($this->date_start)."'" : "null").",";
|
||||
@ -3588,6 +3616,45 @@ class SupplierInvoiceLine extends CommonObjectLine
|
||||
}
|
||||
}
|
||||
|
||||
// Si fk_remise_except defini, on lie la remise a la facture
|
||||
// ce qui la flague comme "consommee".
|
||||
if ($this->fk_remise_except) {
|
||||
$discount = new DiscountAbsolute($this->db);
|
||||
$result = $discount->fetch($this->fk_remise_except);
|
||||
if ($result >= 0) {
|
||||
// Check if discount was found
|
||||
if ($result > 0) {
|
||||
// Check if discount not already affected to another invoice
|
||||
if ($discount->fk_facture_line > 0) {
|
||||
if (empty($noerrorifdiscountalreadylinked)) {
|
||||
$this->error = $langs->trans("ErrorDiscountAlreadyUsed", $discount->id);
|
||||
dol_syslog(get_class($this) . "::insert Error " . $this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
} else {
|
||||
$result = $discount->link_to_invoice($this->rowid, 0);
|
||||
if ($result < 0) {
|
||||
$this->error = $discount->error;
|
||||
dol_syslog(get_class($this) . "::insert Error " . $this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->error = $langs->trans("ErrorADiscountThatHasBeenRemovedIsIncluded");
|
||||
dol_syslog(get_class($this) . "::insert Error " . $this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
} else {
|
||||
$this->error = $discount->error;
|
||||
dol_syslog(get_class($this) . "::insert Error " . $this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && !$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('LINEBILL_SUPPLIER_CREATE', $user);
|
||||
|
||||
@ -230,7 +230,66 @@ class PaiementFourn extends Paiement
|
||||
$alreadypayed = price2num($paiement + $creditnotes + $deposits, 'MT');
|
||||
$remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT');
|
||||
if ($remaintopay == 0) {
|
||||
$result = $invoice->setPaid($user, '', '');
|
||||
// If invoice is a down payment, we also convert down payment to discount
|
||||
if ($invoice->type == FactureFournisseur::TYPE_DEPOSIT) {
|
||||
$amount_ht = $amount_tva = $amount_ttc = array();
|
||||
$multicurrency_amount_ht = $multicurrency_amount_tva = $multicurrency_amount_ttc = array();
|
||||
|
||||
// Insert one discount by VAT rate category
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php';
|
||||
$discount = new DiscountAbsolute($this->db);
|
||||
$discount->fetch('', $invoice->id);
|
||||
if (empty($discount->id)) { // If the invoice was not yet converted into a discount (this may have been done manually before we come here)
|
||||
$discount->discount_type = 1; // Supplier discount
|
||||
$discount->description = '(DEPOSIT)';
|
||||
$discount->fk_soc = $invoice->socid;
|
||||
$discount->fk_invoice_supplier_source = $invoice->id;
|
||||
|
||||
// Loop on each vat rate
|
||||
$i = 0;
|
||||
foreach ($invoice->lines as $line) {
|
||||
if ($line->total_ht != 0) { // no need to create discount if amount is null
|
||||
$amount_ht[$line->tva_tx] += $line->total_ht;
|
||||
$amount_tva[$line->tva_tx] += $line->total_tva;
|
||||
$amount_ttc[$line->tva_tx] += $line->total_ttc;
|
||||
$multicurrency_amount_ht[$line->tva_tx] += $line->multicurrency_total_ht;
|
||||
$multicurrency_amount_tva[$line->tva_tx] += $line->multicurrency_total_tva;
|
||||
$multicurrency_amount_ttc[$line->tva_tx] += $line->multicurrency_total_ttc;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($amount_ht as $tva_tx => $xxx) {
|
||||
$discount->amount_ht = abs($amount_ht[$tva_tx]);
|
||||
$discount->amount_tva = abs($amount_tva[$tva_tx]);
|
||||
$discount->amount_ttc = abs($amount_ttc[$tva_tx]);
|
||||
$discount->multicurrency_amount_ht = abs($multicurrency_amount_ht[$tva_tx]);
|
||||
$discount->multicurrency_amount_tva = abs($multicurrency_amount_tva[$tva_tx]);
|
||||
$discount->multicurrency_amount_ttc = abs($multicurrency_amount_ttc[$tva_tx]);
|
||||
$discount->tva_tx = abs($tva_tx);
|
||||
|
||||
$result = $discount->create($user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($discount->error, $discount->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
// Set invoice to paid
|
||||
if (!$error) {
|
||||
$result = $invoice->setPaid($user, '', '');
|
||||
if ($result < 0) {
|
||||
$this->error = $invoice->error;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing.");
|
||||
}
|
||||
|
||||
@ -986,7 +986,10 @@ if (empty($reshook)) {
|
||||
$result = $srcobject->fetch(GETPOST('originid', 'int'));
|
||||
|
||||
// If deposit invoice - down payment with 1 line (fixed amount or percent)
|
||||
if (GETPOST('type') == Facture::TYPE_DEPOSIT && in_array($typeamount, array('amount', 'variable'))) {
|
||||
$typeamount = GETPOST('typedeposit', 'alpha');
|
||||
if (GETPOST('type') == FactureFournisseur::TYPE_DEPOSIT && in_array($typeamount, array('amount', 'variable'))) {
|
||||
$valuedeposit = price2num(GETPOST('valuedeposit', 'alpha'), 'MU');
|
||||
|
||||
// Define the array $amountdeposit
|
||||
$amountdeposit = array();
|
||||
if (!empty($conf->global->MAIN_DEPOSIT_MULTI_TVA)) {
|
||||
@ -1099,9 +1102,7 @@ if (empty($reshook)) {
|
||||
$subprice_diff = $object->lines[0]->subprice - $diff / (1 + $object->lines[0]->tva_tx / 100);
|
||||
$object->updateline($object->lines[0]->id, $object->lines[0]->desc, $subprice_diff, $object->lines[0]->qty, $object->lines[0]->remise_percent, $object->lines[0]->date_start, $object->lines[0]->date_end, $object->lines[0]->tva_tx, 0, 0, 'HT', $object->lines[0]->info_bits, $object->lines[0]->product_type, 0, 0, 0, $object->lines[0]->pa_ht, $object->lines[0]->label, 0, array(), 100);
|
||||
}
|
||||
}
|
||||
|
||||
if ($result > 0) {
|
||||
} elseif ($result > 0) {
|
||||
$lines = $srcobject->lines;
|
||||
if (empty($lines) && method_exists($srcobject, 'fetch_lines')) {
|
||||
$srcobject->fetch_lines();
|
||||
@ -1222,7 +1223,7 @@ if (empty($reshook)) {
|
||||
// Edit line
|
||||
$db->begin();
|
||||
|
||||
$object->fetch($id);
|
||||
if (! $object->fetch($id) > 0) dol_print_error($db);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);
|
||||
@ -1271,7 +1272,7 @@ if (empty($reshook)) {
|
||||
$localtax2_tx = get_localtax($tva_tx, 2, $mysoc, $object->thirdparty);
|
||||
|
||||
$remise_percent = price2num(GETPOST('remise_percent'), 2);
|
||||
$pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), 'CU');
|
||||
$pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), 'MU');
|
||||
|
||||
// Extrafields Lines
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
@ -1337,7 +1338,7 @@ if (empty($reshook)) {
|
||||
|
||||
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS');
|
||||
$remise_percent = price2num(GETPOST('remise_percent'.$predef), 2);
|
||||
$price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2);
|
||||
$price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'MU', 2);
|
||||
|
||||
// Extrafields
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
@ -1964,7 +1965,7 @@ if ($action == 'create') {
|
||||
print $desc;
|
||||
print '</div></div>';
|
||||
|
||||
if ((empty($origin)) || ((($origin == 'propal') || ($origin == 'commande')) && (! empty($originid)))) {
|
||||
if (empty($origin) || ($origin == 'order_supplier' && !empty($originid))) {
|
||||
// Deposit - Down payment
|
||||
if (empty($conf->global->INVOICE_DISABLE_DEPOSIT)) {
|
||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||
@ -2004,7 +2005,7 @@ if ($action == 'create') {
|
||||
print '<td>';
|
||||
print $desc;
|
||||
print '</td>';
|
||||
if (($origin == 'propal') || ($origin == 'commande')) {
|
||||
if ($origin == 'order_supplier') {
|
||||
print '<td class="nowrap" style="padding-left: 15px">';
|
||||
$arraylist = array(
|
||||
'amount' => $langs->transnoentitiesnoconv('FixAmount', $langs->transnoentitiesnoconv('Deposit')),
|
||||
|
||||
@ -61,12 +61,14 @@
|
||||
-- Brazil -> for Departmements
|
||||
-- Canada -> for Departmements
|
||||
-- Chile
|
||||
-- China
|
||||
-- Colombie -> for Departmements
|
||||
-- Denmark
|
||||
-- France
|
||||
-- Germany -> for Departmements
|
||||
-- Greece
|
||||
-- Honduras -> for Departmements
|
||||
-- Hungary
|
||||
-- India -> for Departmements
|
||||
-- Indonesia -> for Departmements
|
||||
-- Italy
|
||||
@ -76,12 +78,14 @@
|
||||
-- Morocco
|
||||
-- Netherlands -> for Departmements
|
||||
-- Panama -> for Departmements
|
||||
-- Peru
|
||||
-- Portugal
|
||||
-- Romania -> for Departmements
|
||||
-- San Salvador
|
||||
-- Slovenia
|
||||
-- Spain
|
||||
-- Switzerland/Suisse -> for Departmements/Cantons
|
||||
-- Taiwan -> for Departmements
|
||||
-- Tunesia
|
||||
-- United Arab Emirates -> for Departmements
|
||||
-- United Kingdom
|
||||
@ -91,14 +95,14 @@
|
||||
|
||||
|
||||
-- TEMPLATE ------------------------------------------------------------------------------------------
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 0, 0, '0', 0, '-');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 0, 0, '0', 0, '-');
|
||||
|
||||
|
||||
-- Algeria Regions (id country=13)
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 13, 1301, '', 0, 'Algerie');
|
||||
|
||||
|
||||
-- Andorra Regions (id country=18)
|
||||
-- Andorra Regions (id country=34)
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 34, 34000, 'AD', NULL, 'Andorra');
|
||||
|
||||
|
||||
@ -170,6 +174,43 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 6
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 67, 6715, NULL, NULL, 'Arica y Parinacota');
|
||||
|
||||
|
||||
-- China Regions (rowid country=9)
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 901, '京',0,'北京市');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 902, '津',0,'天津市');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 903, '沪',0,'上海市');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 904, '渝',0,'重庆市');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 905, '冀',0,'河北省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 906, '晋',0,'山西省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 907, '辽',0,'辽宁省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 908, '吉',0,'吉林省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 909, '黑',0,'黑龙江省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 910, '苏',0,'江苏省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 911, '浙',0,'浙江省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 912, '皖',0,'安徽省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 913, '闽',0,'福建省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 914, '赣',0,'江西省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 915, '鲁',0,'山东省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 916, '豫',0,'河南省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 917, '鄂',0,'湖北省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 918, '湘',0,'湖南省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 919, '粤',0,'广东省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 920, '琼',0,'海南省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 921, '川',0,'四川省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 922, '贵',0,'贵州省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 923, '云',0,'云南省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 924, '陕',0,'陕西省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 925, '甘',0,'甘肃省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 926, '青',0,'青海省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 927, '台',0,'台湾省');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 928, '蒙',0,'内蒙古自治区');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 929, '桂',0,'广西壮族自治区');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 930, '藏',0,'西藏自治区');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 931, '宁',0,'宁夏回族自治区');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 932, '新',0,'新疆维吾尔自治区');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 933, '港',0,'香港特别行政区');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 9, 934, '澳',0,'澳门特别行政区');
|
||||
|
||||
|
||||
-- Colombie Regions (id country=70)
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 70, 7001, '', 0, 'Colombie');
|
||||
|
||||
@ -228,6 +269,16 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 1
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 114, 11401, '', 0, 'Honduras');
|
||||
|
||||
|
||||
-- Hungary Regions (rowid country=18)
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 18, 183100, 'HU31', NULL, 'Northern Hungary');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 18, 183200, 'HU32', NULL, 'Northern Great Plain');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 18, 183300, 'HU33', NULL, 'Southern Great Plain');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 18, 180100, 'HU1', NULL, 'Central Hungary');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 18, 182100, 'HU21', NULL, 'Central Transdanubia');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 18, 182200, 'HU22', NULL, 'Western Transdanubia');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 18, 182300, 'HU23', NULL, 'Southern Transdanubia');
|
||||
|
||||
|
||||
-- India Regions (id country=117)
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 117, 11701, '', 0, 'India');
|
||||
|
||||
@ -311,6 +362,35 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 1
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 178, 17801, '', 0, 'Panama');
|
||||
|
||||
|
||||
-- Peru Regions (id country=181)
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18101, '', 0, 'Amazonas');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18102, '', 0, 'Ancash');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18103, '', 0, 'Apurimac');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18104, '', 0, 'Arequipa');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18105, '', 0, 'Ayacucho');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18106, '', 0, 'Cajamarca');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18107, '', 0, 'Callao');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18108, '', 0, 'Cuzco');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18109, '', 0, 'Huancavelica');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18110, '', 0, 'Huanuco');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18111, '', 0, 'Ica');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18112, '', 0, 'Junin');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18113, '', 0, 'La Libertad');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18114, '', 0, 'Lambayeque');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18115, '', 0, 'Lima Metropolitana');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18116, '', 0, 'Lima');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18117, '', 0, 'Loreto');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18118, '', 0, 'Madre de Dios');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18119, '', 0, 'Moquegua');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18120, '', 0, 'Pasco');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18121, '', 0, 'Piura');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18122, '', 0, 'Puno');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18123, '', 0, 'San Martín');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18124, '', 0, 'Tacna');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18125, '', 0, 'Tumbes');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 181, 18126, '', 0, 'Ucayali');
|
||||
|
||||
|
||||
-- Portugal Regions (rowid country=25)
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 25, 15001, 'PT', NULL, 'Portugal');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 25, 15002, 'PT9', NULL, 'Azores-Madeira');
|
||||
@ -358,31 +438,35 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 6, 601, '', 1, 'Cantons');
|
||||
|
||||
|
||||
-- Taiwan Regions (rowid country=213)
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 213, 21301, 'TW', NULL, 'Taiwan');
|
||||
|
||||
|
||||
-- Tunisia Regions (id country=10)
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1001, '', 0, 'Ariana');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1002, '', 0, 'Béja');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1003, '', 0, 'Ben Arous');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1004, '', 0, 'Bizerte');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1005, '', 0, 'Gabès');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1006, '', 0, 'Gafsa');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1007, '', 0, 'Jendouba');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1008, '', 0, 'Kairouan');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1009, '', 0, 'Kasserine');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1010, '', 0, 'Kébili');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1011, '', 0, 'La Manouba');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1012, '', 0, 'Le Kef');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1013, '', 0, 'Mahdia');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1014, '', 0, 'Médenine');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1015, '', 0, 'Monastir');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1016, '', 0, 'Nabeul');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1017, '', 0, 'Sfax');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1018, '', 0, 'Sidi Bouzid');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1019, '', 0, 'Siliana');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1020, '', 0, 'Sousse');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1021, '', 0, 'Tataouine');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1022, '', 0, 'Tozeur');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1023, '', 0, 'Tunis');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1024, '', 0, 'Zaghouan');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1001, '', 0, 'Ariana');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1002, '', 0, 'Béja');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1003, '', 0, 'Ben Arous');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1004, '', 0, 'Bizerte');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1005, '', 0, 'Gabès');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1006, '', 0, 'Gafsa');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1007, '', 0, 'Jendouba');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1008, '', 0, 'Kairouan');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1009, '', 0, 'Kasserine');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1010, '', 0, 'Kébili');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1011, '', 0, 'La Manouba');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1012, '', 0, 'Le Kef');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1013, '', 0, 'Mahdia');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1014, '', 0, 'Médenine');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1015, '', 0, 'Monastir');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1016, '', 0, 'Nabeul');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1017, '', 0, 'Sfax');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1018, '', 0, 'Sidi Bouzid');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1019, '', 0, 'Siliana');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1020, '', 0, 'Sousse');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1021, '', 0, 'Tataouine');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1022, '', 0, 'Tozeur');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1023, '', 0, 'Tunis');
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1024, '', 0, 'Zaghouan');
|
||||
|
||||
|
||||
-- United Arab Emirates (UAE) Regions (rowid country=227)
|
||||
@ -411,89 +495,3 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 2
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23208, '', 0, 'Nor-Oriental');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23209, '', 0, 'Zuliana');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- Regions Peru (id country=181)
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18101, '', 0, 'Amazonas', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18102, '', 0, 'Ancash', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18103, '', 0, 'Apurimac', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18104, '', 0, 'Arequipa', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18105, '', 0, 'Ayacucho', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18106, '', 0, 'Cajamarca', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18107, '', 0, 'Callao', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18108, '', 0, 'Cuzco', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18109, '', 0, 'Huancavelica', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18110, '', 0, 'Huanuco', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18111, '', 0, 'Ica', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18112, '', 0, 'Junin', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18113, '', 0, 'La Libertad', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18114, '', 0, 'Lambayeque', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18115, '', 0, 'Lima Metropolitana', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18116, '', 0, 'Lima', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18117, '', 0, 'Loreto', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18118, '', 0, 'Madre de Dios', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18119, '', 0, 'Moquegua', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18120, '', 0, 'Pasco', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18121, '', 0, 'Piura', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18122, '', 0, 'Puno', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18123, '', 0, 'San Martín', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18124, '', 0, 'Tacna', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18125, '', 0, 'Tumbes', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18126, '', 0, 'Ucayali', 1);
|
||||
|
||||
|
||||
|
||||
-- Regions Hungary (rowid country=18)
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES (18, 183100, 'HU31', NULL, 'Northern Hungary');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES (18, 183200, 'HU32', NULL, 'Northern Great Plain');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES (18, 183300, 'HU33', NULL, 'Southern Great Plain');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES (18, 180100, 'HU1', NULL, 'Central Hungary');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES (18, 182100, 'HU21', NULL, 'Central Transdanubia');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES (18, 182200, 'HU22', NULL, 'Western Transdanubia');
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES (18, 182300, 'HU23', NULL, 'Southern Transdanubia');
|
||||
|
||||
|
||||
|
||||
-- Regions China (rowid country=9)
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 901, '京',0,'北京市');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 902, '津',0,'天津市');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 903, '沪',0,'上海市');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 904, '渝',0,'重庆市');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 905, '冀',0,'河北省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 906, '晋',0,'山西省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 907, '辽',0,'辽宁省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 908, '吉',0,'吉林省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 909, '黑',0,'黑龙江省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 910, '苏',0,'江苏省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 911, '浙',0,'浙江省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 912, '皖',0,'安徽省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 913, '闽',0,'福建省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 914, '赣',0,'江西省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 915, '鲁',0,'山东省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 916, '豫',0,'河南省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 917, '鄂',0,'湖北省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 918, '湘',0,'湖南省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 919, '粤',0,'广东省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 920, '琼',0,'海南省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 921, '川',0,'四川省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 922, '贵',0,'贵州省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 923, '云',0,'云南省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 924, '陕',0,'陕西省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 925, '甘',0,'甘肃省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 926, '青',0,'青海省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 927, '台',0,'台湾省');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 928, '蒙',0,'内蒙古自治区');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 929, '桂',0,'广西壮族自治区');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 930, '藏',0,'西藏自治区');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 931, '宁',0,'宁夏回族自治区');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 932, '新',0,'新疆维吾尔自治区');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 933, '港',0,'香港特别行政区');
|
||||
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 934, '澳',0,'澳门特别行政区');
|
||||
|
||||
|
||||
-- Regions Taiwan (rowid country=213)
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES (213, 21301, 'TW', NULL, 'Taiwan');
|
||||
|
||||
|
||||
@ -51,11 +51,14 @@
|
||||
-- Germany
|
||||
-- Honduras
|
||||
-- Hungary
|
||||
-- (Italy)
|
||||
-- Italy
|
||||
-- Luxembourg
|
||||
-- Netherlands
|
||||
-- (Moroco)
|
||||
-- Panama
|
||||
-- Romania
|
||||
-- Slovenia (need to check code SI-Id)
|
||||
-- Taiwan
|
||||
-- Tunisia
|
||||
|
||||
|
||||
@ -531,117 +534,117 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (183300, 'HU-CS', 'HU333', NULL, NULL, 'Csongrád');
|
||||
|
||||
|
||||
-- Provinces Italy (id=3)
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('AG',315,NULL,NULL,NULL,'AGRIGENTO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('AL',312,NULL,NULL,NULL,'ALESSANDRIA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('AN',310,NULL,NULL,NULL,'ANCONA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('AO',319,NULL,NULL,NULL,'AOSTA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('AR',316,NULL,NULL,NULL,'AREZZO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('AP',310,NULL,NULL,NULL,'ASCOLI PICENO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('AT',312,NULL,NULL,NULL,'ASTI');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('AV',304,NULL,NULL,NULL,'AVELLINO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('BA',313,NULL,NULL,NULL,'BARI');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('BT',313,NULL,NULL,NULL,'BARLETTA-ANDRIA-TRANI');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('BL',320,NULL,NULL,NULL,'BELLUNO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('BN',304,NULL,NULL,NULL,'BENEVENTO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('BG',309,NULL,NULL,NULL,'BERGAMO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('BI',312,NULL,NULL,NULL,'BIELLA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('BO',305,NULL,NULL,NULL,'BOLOGNA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('BZ',317,NULL,NULL,NULL,'BOLZANO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('BS',309,NULL,NULL,NULL,'BRESCIA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('BR',313,NULL,NULL,NULL,'BRINDISI');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('CA',314,NULL,NULL,NULL,'CAGLIARI');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('CL',315,NULL,NULL,NULL,'CALTANISSETTA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('CB',311,NULL,NULL,NULL,'CAMPOBASSO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('CI',314,NULL,NULL,NULL,'CARBONIA-IGLESIAS');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('CE',304,NULL,NULL,NULL,'CASERTA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('CT',315,NULL,NULL,NULL,'CATANIA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('CZ',303,NULL,NULL,NULL,'CATANZARO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('CH',301,NULL,NULL,NULL,'CHIETI');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('CO',309,NULL,NULL,NULL,'COMO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('CS',303,NULL,NULL,NULL,'COSENZA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('CR',309,NULL,NULL,NULL,'CREMONA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('KR',303,NULL,NULL,NULL,'CROTONE');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('CN',312,NULL,NULL,NULL,'CUNEO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('EN',315,NULL,NULL,NULL,'ENNA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('FM',310,NULL,NULL,NULL,'FERMO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('FE',305,NULL,NULL,NULL,'FERRARA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('FI',316,NULL,NULL,NULL,'FIRENZE');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('FG',313,NULL,NULL,NULL,'FOGGIA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('FC',305,NULL,NULL,NULL,'FORLI-CESENA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('FR',307,NULL,NULL,NULL,'FROSINONE');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('GE',308,NULL,NULL,NULL,'GENOVA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('GO',306,NULL,NULL,NULL,'GORIZIA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('GR',316,NULL,NULL,NULL,'GROSSETO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('IM',308,NULL,NULL,NULL,'IMPERIA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('IS',311,NULL,NULL,NULL,'ISERNIA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('SP',308,NULL,NULL,NULL,'LA SPEZIA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('AQ',301,NULL,NULL,NULL,'L AQUILA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('LT',307,NULL,NULL,NULL,'LATINA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('LE',313,NULL,NULL,NULL,'LECCE');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('LC',309,NULL,NULL,NULL,'LECCO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('LI',314,NULL,NULL,NULL,'LIVORNO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('LO',309,NULL,NULL,NULL,'LODI');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('LU',316,NULL,NULL,NULL,'LUCCA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('MC',310,NULL,NULL,NULL,'MACERATA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('MN',309,NULL,NULL,NULL,'MANTOVA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('MS',316,NULL,NULL,NULL,'MASSA-CARRARA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('MT',302,NULL,NULL,NULL,'MATERA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('VS',314,NULL,NULL,NULL,'MEDIO CAMPIDANO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('ME',315,NULL,NULL,NULL,'MESSINA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('MI',309,NULL,NULL,NULL,'MILANO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('MB',309,NULL,NULL,NULL,'MONZA e BRIANZA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('MO',305,NULL,NULL,NULL,'MODENA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('NA',304,NULL,NULL,NULL,'NAPOLI');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('NO',312,NULL,NULL,NULL,'NOVARA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('NU',314,NULL,NULL,NULL,'NUORO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('OG',314,NULL,NULL,NULL,'OGLIASTRA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('OT',314,NULL,NULL,NULL,'OLBIA-TEMPIO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('OR',314,NULL,NULL,NULL,'ORISTANO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('PD',320,NULL,NULL,NULL,'PADOVA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('PA',315,NULL,NULL,NULL,'PALERMO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('PR',305,NULL,NULL,NULL,'PARMA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('PV',309,NULL,NULL,NULL,'PAVIA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('PG',318,NULL,NULL,NULL,'PERUGIA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('PU',310,NULL,NULL,NULL,'PESARO e URBINO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('PE',301,NULL,NULL,NULL,'PESCARA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('PC',305,NULL,NULL,NULL,'PIACENZA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('PI',316,NULL,NULL,NULL,'PISA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('PT',316,NULL,NULL,NULL,'PISTOIA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('PN',306,NULL,NULL,NULL,'PORDENONE');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('PZ',302,NULL,NULL,NULL,'POTENZA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('PO',316,NULL,NULL,NULL,'PRATO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('RG',315,NULL,NULL,NULL,'RAGUSA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('RA',305,NULL,NULL,NULL,'RAVENNA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('RC',303,NULL,NULL,NULL,'REGGIO CALABRIA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('RE',305,NULL,NULL,NULL,'REGGIO NELL EMILIA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('RI',307,NULL,NULL,NULL,'RIETI');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('RN',305,NULL,NULL,NULL,'RIMINI');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('RM',307,NULL,NULL,NULL,'ROMA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('RO',320,NULL,NULL,NULL,'ROVIGO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('SA',304,NULL,NULL,NULL,'SALERNO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('SS',314,NULL,NULL,NULL,'SASSARI');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('SV',308,NULL,NULL,NULL,'SAVONA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('SI',316,NULL,NULL,NULL,'SIENA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('SR',315,NULL,NULL,NULL,'SIRACUSA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('SO',309,NULL,NULL,NULL,'SONDRIO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('TA',313,NULL,NULL,NULL,'TARANTO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('TE',301,NULL,NULL,NULL,'TERAMO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('TR',318,NULL,NULL,NULL,'TERNI');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('TO',312,NULL,NULL,NULL,'TORINO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('TP',315,NULL,NULL,NULL,'TRAPANI');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('TN',317,NULL,NULL,NULL,'TRENTO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('TV',320,NULL,NULL,NULL,'TREVISO');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('TS',306,NULL,NULL,NULL,'TRIESTE');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('UD',306,NULL,NULL,NULL,'UDINE');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('VA',309,NULL,NULL,NULL,'VARESE');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('VE',320,NULL,NULL,NULL,'VENEZIA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('VB',312,NULL,NULL,NULL,'VERBANO-CUSIO-OSSOLA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('VC',312,NULL,NULL,NULL,'VERCELLI');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('VR',320,NULL,NULL,NULL,'VERONA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('VV',303,NULL,NULL,NULL,'VIBO VALENTIA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('VI',320,NULL,NULL,NULL,'VICENZA');
|
||||
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('VT',307,NULL,NULL,NULL,'VITERBO');
|
||||
-- Italy Provinces (id=3)
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (315, 'AG', NULL, NULL, NULL, 'AGRIGENTO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (312, 'AL', NULL, NULL, NULL, 'ALESSANDRIA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (310, 'AN', NULL, NULL, NULL, 'ANCONA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (319, 'AO', NULL, NULL, NULL, 'AOSTA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (316, 'AR', NULL, NULL, NULL, 'AREZZO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (310, 'AP', NULL, NULL, NULL, 'ASCOLI PICENO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (312, 'AT', NULL, NULL, NULL, 'ASTI');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (304, 'AV', NULL, NULL, NULL, 'AVELLINO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (313, 'BA', NULL, NULL, NULL, 'BARI');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (313, 'BT', NULL, NULL, NULL, 'BARLETTA-ANDRIA-TRANI');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (320, 'BL', NULL, NULL, NULL, 'BELLUNO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (304, 'BN', NULL, NULL, NULL, 'BENEVENTO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (309, 'BG', NULL, NULL, NULL, 'BERGAMO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (312, 'BI', NULL, NULL, NULL, 'BIELLA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (305, 'BO', NULL, NULL, NULL, 'BOLOGNA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (317, 'BZ', NULL, NULL, NULL, 'BOLZANO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (309, 'BS', NULL, NULL, NULL, 'BRESCIA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (313, 'BR', NULL, NULL, NULL, 'BRINDISI');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (314, 'CA', NULL, NULL, NULL, 'CAGLIARI');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (315, 'CL', NULL, NULL, NULL, 'CALTANISSETTA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (311, 'CB', NULL, NULL, NULL, 'CAMPOBASSO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (314, 'CI', NULL, NULL, NULL, 'CARBONIA-IGLESIAS');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (304, 'CE', NULL, NULL, NULL, 'CASERTA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (315, 'CT', NULL, NULL, NULL, 'CATANIA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (303, 'CZ', NULL, NULL, NULL, 'CATANZARO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (301, 'CH', NULL, NULL, NULL, 'CHIETI');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (309, 'CO', NULL, NULL, NULL, 'COMO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (303, 'CS', NULL, NULL, NULL, 'COSENZA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (309, 'CR', NULL, NULL, NULL, 'CREMONA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (303, 'KR', NULL, NULL, NULL, 'CROTONE');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (312, 'CN', NULL, NULL, NULL, 'CUNEO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (315, 'EN', NULL, NULL, NULL, 'ENNA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (310, 'FM', NULL, NULL, NULL, 'FERMO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (305, 'FE', NULL, NULL, NULL, 'FERRARA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (316, 'FI', NULL, NULL, NULL, 'FIRENZE');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (313, 'FG', NULL, NULL, NULL, 'FOGGIA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (305, 'FC', NULL, NULL, NULL, 'FORLI-CESENA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (307, 'FR', NULL, NULL, NULL, 'FROSINONE');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (308, 'GE', NULL, NULL, NULL, 'GENOVA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (306, 'GO', NULL, NULL, NULL, 'GORIZIA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (316, 'GR', NULL, NULL, NULL, 'GROSSETO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (308, 'IM', NULL, NULL, NULL, 'IMPERIA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (311, 'IS', NULL, NULL, NULL, 'ISERNIA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (308, 'SP', NULL, NULL, NULL, 'LA SPEZIA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (301, 'AQ', NULL, NULL, NULL, 'L AQUILA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (307, 'LT', NULL, NULL, NULL, 'LATINA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (313, 'LE', NULL, NULL, NULL, 'LECCE');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (309, 'LC', NULL, NULL, NULL, 'LECCO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (314, 'LI', NULL, NULL, NULL, 'LIVORNO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (309, 'LO', NULL, NULL, NULL, 'LODI');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (316, 'LU', NULL, NULL, NULL, 'LUCCA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (310, 'MC', NULL, NULL, NULL, 'MACERATA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (309, 'MN', NULL, NULL, NULL, 'MANTOVA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (316, 'MS', NULL, NULL, NULL, 'MASSA-CARRARA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (302, 'MT', NULL, NULL, NULL, 'MATERA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (314, 'VS', NULL, NULL, NULL, 'MEDIO CAMPIDANO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (315, 'ME', NULL, NULL, NULL, 'MESSINA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (309, 'MI', NULL, NULL, NULL, 'MILANO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (309, 'MB', NULL, NULL, NULL, 'MONZA e BRIANZA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (305, 'MO', NULL, NULL, NULL, 'MODENA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (304, 'NA', NULL, NULL, NULL, 'NAPOLI');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (312, 'NO', NULL, NULL, NULL, 'NOVARA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (314, 'NU', NULL, NULL, NULL, 'NUORO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (314, 'OG', NULL, NULL, NULL, 'OGLIASTRA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (314, 'OT', NULL, NULL, NULL, 'OLBIA-TEMPIO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (314, 'OR', NULL, NULL, NULL, 'ORISTANO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (320, 'PD', NULL, NULL, NULL, 'PADOVA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (315, 'PA', NULL, NULL, NULL, 'PALERMO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (305, 'PR', NULL, NULL, NULL, 'PARMA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (309, 'PV', NULL, NULL, NULL, 'PAVIA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (318, 'PG', NULL, NULL, NULL, 'PERUGIA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (310, 'PU', NULL, NULL, NULL, 'PESARO e URBINO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (301, 'PE', NULL, NULL, NULL, 'PESCARA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (305, 'PC', NULL, NULL, NULL, 'PIACENZA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (316, 'PI', NULL, NULL, NULL, 'PISA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (316, 'PT', NULL, NULL, NULL, 'PISTOIA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (306, 'PN', NULL, NULL, NULL, 'PORDENONE');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (302, 'PZ', NULL, NULL, NULL, 'POTENZA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (316, 'PO', NULL, NULL, NULL, 'PRATO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (315, 'RG', NULL, NULL, NULL, 'RAGUSA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (305, 'RA', NULL, NULL, NULL, 'RAVENNA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (303, 'RC', NULL, NULL, NULL, 'REGGIO CALABRIA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (305, 'RE', NULL, NULL, NULL, 'REGGIO NELL EMILIA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (307, 'RI', NULL, NULL, NULL, 'RIETI');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (305, 'RN', NULL, NULL, NULL, 'RIMINI');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (307, 'RM', NULL, NULL, NULL, 'ROMA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (320, 'RO', NULL, NULL, NULL, 'ROVIGO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (304, 'SA', NULL, NULL, NULL, 'SALERNO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (314, 'SS', NULL, NULL, NULL, 'SASSARI');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (308, 'SV', NULL, NULL, NULL, 'SAVONA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (316, 'SI', NULL, NULL, NULL, 'SIENA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (315, 'SR', NULL, NULL, NULL, 'SIRACUSA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (309, 'SO', NULL, NULL, NULL, 'SONDRIO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (313, 'TA', NULL, NULL, NULL, 'TARANTO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (301, 'TE', NULL, NULL, NULL, 'TERAMO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (318, 'TR', NULL, NULL, NULL, 'TERNI');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (312, 'TO', NULL, NULL, NULL, 'TORINO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (315, 'TP', NULL, NULL, NULL, 'TRAPANI');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (317, 'TN', NULL, NULL, NULL, 'TRENTO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (320, 'TV', NULL, NULL, NULL, 'TREVISO');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (306, 'TS', NULL, NULL, NULL, 'TRIESTE');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (306, 'UD', NULL, NULL, NULL, 'UDINE');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (309, 'VA', NULL, NULL, NULL, 'VARESE');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (320, 'VE', NULL, NULL, NULL, 'VENEZIA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (312, 'VB', NULL, NULL, NULL, 'VERBANO-CUSIO-OSSOLA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (312, 'VC', NULL, NULL, NULL, 'VERCELLI');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (320, 'VR', NULL, NULL, NULL, 'VERONA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (303, 'VV', NULL, NULL, NULL, 'VIBO VALENTIA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (320, 'VI', NULL, NULL, NULL, 'VICENZA');
|
||||
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (307, 'VT', NULL, NULL, NULL, 'VITERBO');
|
||||
|
||||
|
||||
-- Luxembourg Cantons (id country=140)
|
||||
@ -759,6 +762,19 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA19B', 1214, '', 0, '', 'Province de Tan-Tan', 1);
|
||||
|
||||
|
||||
-- Panama - 10 Provinces (id country=178)
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-1', '', 0, '', 'Bocas del Toro');
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-2', '', 0, '', 'Coclé');
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-3', '', 0, '', 'Colón');
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-4', '', 0, '', 'Chiriquí');
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-5', '', 0, '', 'Darién');
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-6', '', 0, '', 'Herrera');
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-7', '', 0, '', 'Los Santos');
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-8', '', 0, '', 'Panamá');
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-9', '', 0, '', 'Veraguas');
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-13', '', 0, '', 'Panamá Oeste');
|
||||
|
||||
|
||||
-- Romania Provinces (id country=188)
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'AB', '', 0, '', 'Alba');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'AR', '', 0, '', 'Arad');
|
||||
@ -804,6 +820,55 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'VN', '', 0, '', 'Vrancea');
|
||||
|
||||
|
||||
-- Slovenia Provinces (rowid country=202)
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (20203, 'SI031', NULL, NULL, 'MURA', 'Mura');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (20203, 'SI032', NULL, NULL, 'DRAVA', 'Drava');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (20203, 'SI033', NULL, NULL, 'CARINTHIA', 'Carinthia');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (20203, 'SI034', NULL, NULL, 'SAVINJA', 'Savinja');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (20203, 'SI035', NULL, NULL, 'CENTRAL SAVA', 'Central Sava');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (20203, 'SI036', NULL, NULL, 'LOWER SAVA', 'Lower Sava');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (20203, 'SI037', NULL, NULL, 'SOUTHEAST SLOVENIA', 'Southeast Slovenia');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (20203, 'SI038', NULL, NULL, 'LITTORAL–INNER CARNIOLA', 'Littoral–Inner Carniola');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (20204, 'SI041', NULL, NULL, 'CENTRAL SLOVENIA', 'Central Slovenia');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (20204, 'SI038', NULL, NULL, 'UPPER CARNIOLA', 'Upper Carniola');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (20204, 'SI043', NULL, NULL, 'GORIZIA', 'Gorizia');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (20204, 'SI044', NULL, NULL, 'COASTAL–KARST', 'Coastal–Karst');
|
||||
|
||||
|
||||
-- Taiwan Divisions / Provinces / Counties (rowid country=886)
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-KLU', 'KLU', NULL, '基隆市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TPE', 'TPE', NULL, '臺北市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TPH', 'TPH', NULL, '新北市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TYC', 'TYC', NULL, '桃園市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-HSH', 'HSH', NULL, '新竹縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-HSC', 'HSC', NULL, '新竹市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-MAL', 'MAL', NULL, '苗栗縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-MAC', 'MAC', NULL, '苗栗市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TXG', 'TXG', NULL, '臺中市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-CWH', 'CWH', NULL, '彰化縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-CWS', 'CWS', NULL, '彰化市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-NTC', 'NTC', NULL, '南投市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-NTO', 'NTO', NULL, '南投縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-YLH', 'YLH', NULL, '雲林縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-CHY', 'CHY', NULL, '嘉義縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-CYI', 'CYI', NULL, '嘉義市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TNN', 'TNN', NULL, '臺南市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-KHH', 'KHH', NULL, '高雄市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-IUH', 'IUH', NULL, '屏東縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-PTS', 'PTS', NULL, '屏東市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-ILN', 'ILN', NULL, '宜蘭縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-ILC', 'ILC', NULL, '宜蘭市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-HWA', 'HWA', NULL, '花蓮縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-HWC', 'HWC', NULL, '花蓮市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TTC', 'TTC', NULL, '臺東市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TTT', 'TTT', NULL, '臺東縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-PEH', 'PEH', NULL, '澎湖縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-GNI', 'GNI', NULL, '綠島');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-KYD', 'KYD', NULL, '蘭嶼');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-KMN', 'KMN', NULL, '金門縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-LNN', 'LNN', NULL, '連江縣');
|
||||
|
||||
|
||||
-- Tunisia Governorates / Provinces / Wilaya (id country=10)
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN01', '', 0, '', 'Ariana');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN02', '', 0, '', 'Béja');
|
||||
@ -1628,17 +1693,6 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2503', 18126, '', 0, '', 'Padre Abad', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2504', 18126, '', 0, '', 'Purús', 1);
|
||||
|
||||
-- Provinces Panama (id country=178)
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PA-1', 17801, '', 0, '', 'Bocas del Toro', 1);
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PA-2', 17801, '', 0, '', 'Coclé', 1);
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PA-3', 17801, '', 0, '', 'Colón', 1);
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PA-4', 17801, '', 0, '', 'Chiriquí', 1);
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PA-5', 17801, '', 0, '', 'Darién', 1);
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PA-6', 17801, '', 0, '', 'Herrera', 1);
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PA-7', 17801, '', 0, '', 'Los Santos', 1);
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PA-8', 17801, '', 0, '', 'Panamá', 1);
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PA-9', 17801, '', 0, '', 'Veraguas', 1);
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PA-13', 17801, '', 0, '', 'Panamá Oeste', 1);
|
||||
|
||||
-- Provinces United Arab Emirates (id country=227)
|
||||
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AE-1', 22701, '', 0, '', 'Abu Dhabi', 1);
|
||||
@ -1673,52 +1727,3 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('15001', 'PT-VR', NULL, NULL, 'VILA REAL', 'Vila Real');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('15001', 'PT-VI', NULL, NULL, 'VISEU', 'Viseu');
|
||||
|
||||
-- Provinces Slovenia (rowid country=202)
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20203', 'SI031', NULL, NULL, 'MURA', 'Mura');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20203', 'SI032', NULL, NULL, 'DRAVA', 'Drava');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20203', 'SI033', NULL, NULL, 'CARINTHIA', 'Carinthia');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20203', 'SI034', NULL, NULL, 'SAVINJA', 'Savinja');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20203', 'SI035', NULL, NULL, 'CENTRAL SAVA', 'Central Sava');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20203', 'SI036', NULL, NULL, 'LOWER SAVA', 'Lower Sava');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20203', 'SI037', NULL, NULL, 'SOUTHEAST SLOVENIA', 'Southeast Slovenia');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20203', 'SI038', NULL, NULL, 'LITTORAL–INNER CARNIOLA', 'Littoral–Inner Carniola');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20204', 'SI041', NULL, NULL, 'CENTRAL SLOVENIA', 'Central Slovenia');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20204', 'SI038', NULL, NULL, 'UPPER CARNIOLA', 'Upper Carniola');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20204', 'SI043', NULL, NULL, 'GORIZIA', 'Gorizia');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20204', 'SI044', NULL, NULL, 'COASTAL–KARST', 'Coastal–Karst');
|
||||
|
||||
|
||||
-- Provinces Taiwan (rowid country=886)
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-KLU', 'KLU', NULL, '基隆市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TPE', 'TPE', NULL, '臺北市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TPH', 'TPH', NULL, '新北市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TYC', 'TYC', NULL, '桃園市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-HSH', 'HSH', NULL, '新竹縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-HSC', 'HSC', NULL, '新竹市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-MAL', 'MAL', NULL, '苗栗縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-MAC', 'MAC', NULL, '苗栗市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TXG', 'TXG', NULL, '臺中市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-CWH', 'CWH', NULL, '彰化縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-CWS', 'CWS', NULL, '彰化市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-NTC', 'NTC', NULL, '南投市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-NTO', 'NTO', NULL, '南投縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-YLH', 'YLH', NULL, '雲林縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-CHY', 'CHY', NULL, '嘉義縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-CYI', 'CYI', NULL, '嘉義市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TNN', 'TNN', NULL, '臺南市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-KHH', 'KHH', NULL, '高雄市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-IUH', 'IUH', NULL, '屏東縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-PTS', 'PTS', NULL, '屏東市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-ILN', 'ILN', NULL, '宜蘭縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-ILC', 'ILC', NULL, '宜蘭市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-HWA', 'HWA', NULL, '花蓮縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-HWC', 'HWC', NULL, '花蓮市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TTC', 'TTC', NULL, '臺東市');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TTT', 'TTT', NULL, '臺東縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-PEH', 'PEH', NULL, '澎湖縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-GNI', 'GNI', NULL, '綠島');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-KYD', 'KYD', NULL, '蘭嶼');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-KMN', 'KMN', NULL, '金門縣');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-LNN', 'LNN', NULL, '連江縣');
|
||||
|
||||
|
||||
|
||||
@ -259,7 +259,7 @@ create table llx_salary
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
ref varchar(30) NULL, -- payment reference number (currently NULL because there is no numbering manager yet)
|
||||
label varchar(255),
|
||||
tms timestamp,
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
datec datetime, -- Create date
|
||||
fk_user integer NOT NULL,
|
||||
datep date, -- payment date
|
||||
@ -307,7 +307,7 @@ create table llx_product_perentity
|
||||
accountancy_code_sell_export varchar(32), -- Selling accountancy code for vat export
|
||||
accountancy_code_buy varchar(32), -- Buying accountancy code
|
||||
accountancy_code_buy_intra varchar(32), -- Buying accountancy code for vat intracommunity
|
||||
accountancy_code_buy_export varchar(32), -- Buying accountancy code for vat import
|
||||
accountancy_code_buy_export varchar(32), -- Buying accountancy code for vat import
|
||||
pmp double(24,8)
|
||||
)ENGINE=innodb;
|
||||
|
||||
@ -432,7 +432,15 @@ ALTER TABLE llx_facture_fourn ADD COLUMN fk_user_closing integer DEFAULT NULL af
|
||||
|
||||
ALTER TABLE llx_entrepot ADD COLUMN fk_project INTEGER DEFAULT NULL AFTER entity; -- project associated to warehouse if any
|
||||
|
||||
-- Add external payement suport for donation
|
||||
ALTER TABLE llx_payment_donation ADD COLUMN ext_payment_site varchar(128) AFTER note;
|
||||
ALTER TABLE llx_payment_donation ADD COLUMN ext_payment_id varchar(128) AFTER note;
|
||||
|
||||
-- Rebuild sequence for postgres only after query INSERT INTO llx_salary(rowid, ...
|
||||
-- VPGSQL8.2 SELECT dol_util_rebuild_sequences();
|
||||
|
||||
UPDATE llx_const SET value = 'github' WHERE __DECRYPT('name')__ = 'MAIN_BUGTRACK_ENABLELINK' AND __DECRYPT('value')__ = 1;
|
||||
UPDATE llx_const SET value = 'github' WHERE __DECRYPT('name')__ = 'MAIN_BUGTRACK_ENABLELINK' AND __DECRYPT('value')__ = 1;
|
||||
UPDATE llx_const SET value = 'github' WHERE __DECRYPT('name')__ = 'MAIN_BUGTRACK_ENABLELINK' AND __DECRYPT('value')__ = 1;
|
||||
|
||||
ALTER TABLE llx_facture_fourn_det ADD COLUMN fk_remise_except integer DEFAULT NULL after remise_percent;
|
||||
ALTER TABLE llx_facture_fourn_det ADD UNIQUE INDEX uk_fk_remise_except (fk_remise_except, fk_facture_fourn);
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
ALTER TABLE llx_facture_fourn_det ADD INDEX idx_facture_fourn_det_fk_facture (fk_facture_fourn);
|
||||
ALTER TABLE llx_facture_fourn_det ADD INDEX idx_facture_fourn_det_fk_product (fk_product);
|
||||
ALTER TABLE llx_facture_fourn_det ADD INDEX idx_facture_fourn_det_fk_code_ventilation (fk_code_ventilation);
|
||||
ALTER TABLE llx_facture_fourn_det ADD UNIQUE INDEX uk_fk_remise_except (fk_remise_except, fk_facture_fourn);
|
||||
|
||||
ALTER TABLE llx_facture_fourn_det ADD CONSTRAINT fk_facture_fourn_det_fk_facture FOREIGN KEY (fk_facture_fourn) REFERENCES llx_facture_fourn (rowid);
|
||||
ALTER TABLE llx_facture_fourn_det ADD CONSTRAINT fk_facture_fourn_det_fk_unit FOREIGN KEY (fk_unit) REFERENCES llx_c_units (rowid);
|
||||
|
||||
@ -31,6 +31,7 @@ create table llx_facture_fourn_det
|
||||
pu_ttc double(24,8), -- unit price with tax
|
||||
qty real, -- quantity of product/service
|
||||
remise_percent real DEFAULT 0, -- % de la remise ligne (exemple 20%)
|
||||
fk_remise_except integer NULL, -- Lien vers table des remises fixes
|
||||
vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here.
|
||||
tva_tx double(6,3), -- TVA taux product/service
|
||||
localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate
|
||||
|
||||
@ -20,14 +20,16 @@ create table llx_payment_donation
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
fk_donation integer,
|
||||
datec datetime, -- date de creation
|
||||
datec datetime, -- date de creation
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
datep datetime, -- payment date
|
||||
datep datetime, -- payment date
|
||||
amount double(24,8) DEFAULT 0,
|
||||
fk_typepayment integer NOT NULL,
|
||||
num_payment varchar(50),
|
||||
note text,
|
||||
ext_payment_id varchar(128), -- external id of payment (for example Stripe charge id)
|
||||
ext_payment_site varchar(128), -- name of external paymentmode (for example 'stripe')
|
||||
fk_bank integer NOT NULL,
|
||||
fk_user_creat integer, -- creation user
|
||||
fk_user_modif integer -- last modification user
|
||||
fk_user_creat integer, -- creation user
|
||||
fk_user_modif integer -- last modification user
|
||||
)ENGINE=innodb;
|
||||
|
||||
@ -21,7 +21,7 @@ create table llx_salary
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
ref varchar(30) NULL, -- payment reference number (currently NULL because there is no numbering manager yet)
|
||||
tms timestamp,
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
datec datetime, -- Create date
|
||||
fk_user integer NOT NULL,
|
||||
datep date, -- payment date
|
||||
|
||||
@ -169,6 +169,7 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitm
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitmentjobposition_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitmentcandidature FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitmentcandidature_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_salary FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_address FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
|
||||
@ -58,7 +58,7 @@ BillsCoinsPad=Coins and banknotes Pad
|
||||
DolistorePosCategory=TakePOS modules and other POS solutions for Dolibarr
|
||||
TakeposNeedsCategories=TakePOS needs at least one product categorie to work
|
||||
TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS needs at least 1 product category under the category <b>%s</b> to work
|
||||
OrderNotes=Order Notes
|
||||
OrderNotes=Printing the receipt will set all items to 'Order confirmed'
|
||||
CashDeskBankAccountFor=Default account to use for payments in
|
||||
NoPaimementModesDefined=No paiment mode defined in TakePOS configuration
|
||||
TicketVatGrouped=Group VAT by rate in tickets|receipts
|
||||
|
||||
@ -140,7 +140,7 @@ DefineListOfAltLanguagesInWebsiteProperties=Define list of all available languag
|
||||
GenerateSitemaps=Generate website sitemap file
|
||||
ConfirmGenerateSitemaps=If you confirm, you will erase the existing sitemap file...
|
||||
ConfirmSitemapsCreation=Confirm sitemap generation
|
||||
SitemapGenerated=Sitemap file generated
|
||||
SitemapGenerated=Sitemap file <b>%s</b> generated
|
||||
ImportFavicon=Favicon
|
||||
ErrorFaviconType=Favicon must be png
|
||||
ErrorFaviconSize=Favicon must be sized 16x16, 32x32 or 64x64
|
||||
|
||||
4
htdocs/modulebuilder/template/.gitignore
vendored
4
htdocs/modulebuilder/template/.gitignore
vendored
@ -15,4 +15,6 @@
|
||||
/.buildpath
|
||||
/.project
|
||||
# Other
|
||||
*.back
|
||||
*.back
|
||||
/.editorconfig
|
||||
/.gitattributes
|
||||
|
||||
@ -213,7 +213,7 @@ class MyModuleApi extends DolibarrApi
|
||||
$result = $this->_validate($request_data);
|
||||
|
||||
foreach ($request_data as $field => $value) {
|
||||
$this->myobject->$field = $value;
|
||||
$this->myobject->$field = $this->_checkValForAPI($field, $value, $this->myobject);
|
||||
}
|
||||
|
||||
// Clean data
|
||||
@ -255,7 +255,7 @@ class MyModuleApi extends DolibarrApi
|
||||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
$this->myobject->$field = $value;
|
||||
$this->myobject->$field = $this->_checkValForAPI($field, $value, $this->myobject);
|
||||
}
|
||||
|
||||
// Clean data
|
||||
|
||||
@ -896,7 +896,7 @@ if (empty($reshook)) {
|
||||
$result = $facture->addline(
|
||||
$desc,
|
||||
$pu_ht,
|
||||
price2nm(GETPOST('qty'), 'MS'),
|
||||
price2num(GETPOST('qty'), 'MS'),
|
||||
$tva_tx,
|
||||
$localtax1_tx,
|
||||
$localtax2_tx,
|
||||
|
||||
@ -1793,6 +1793,51 @@ class Products extends DolibarrApi
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get stock data for the product id given.
|
||||
* Optionaly with $selected_warehouse_id parameter user can get stock of specific warehouse
|
||||
*
|
||||
* @param int $id ID of Product
|
||||
* @param int $selected_warehouse_id ID of warehouse
|
||||
* @return int
|
||||
*
|
||||
* @throws RestException 500
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
*
|
||||
* @url GET {id}/stock
|
||||
*/
|
||||
public function getStock($id, $selected_warehouse_id = null)
|
||||
{
|
||||
|
||||
if (!DolibarrApiAccess::$user->rights->produit->lire) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('product', $id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$product_model = new Product($this->db);
|
||||
$product_model->fetch($id);
|
||||
$product_model->load_stock();
|
||||
|
||||
$stockData = $this->_cleanObjectDatas($product_model)->stock_warehouse;
|
||||
if ($selected_warehouse_id) {
|
||||
foreach ($stockData as $warehouse_id => $warehouse) {
|
||||
if ($warehouse_id != $selected_warehouse_id) {
|
||||
unset($stockData[$warehouse_id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($stockData)) {
|
||||
throw new RestException(404, 'No stock found');
|
||||
}
|
||||
|
||||
return ['stock_warehouses'=>$stockData];
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
|
||||
@ -460,8 +460,10 @@ if ($action == 'create') {
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '<tr>';
|
||||
|
||||
// Description
|
||||
print '<tr><td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>'.nl2br($object->description).'</td></tr>';
|
||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>'.dol_htmlentitiesbr($object->description).'</td></tr>';
|
||||
|
||||
$calcproductsunique = $object->nb_different_products();
|
||||
$calcproducts = $object->nb_products();
|
||||
@ -571,6 +573,9 @@ if ($action == 'create') {
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print "<tr class=\"liste_titre\">";
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
print_liste_field_titre("Product", "", "p.ref", "&id=".$id, "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", "", "p.label", "&id=".$id, "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("NumberOfUnit", "", "ps.reel", "&id=".$id, "", '', $sortfield, $sortorder, 'right ');
|
||||
@ -591,6 +596,10 @@ if ($action == 'create') {
|
||||
if ($user->rights->stock->creer) {
|
||||
print_liste_field_titre('');
|
||||
}
|
||||
// Hook fields
|
||||
$parameters = array('sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
print "</tr>\n";
|
||||
|
||||
$totalunit = 0;
|
||||
@ -612,6 +621,13 @@ if ($action == 'create') {
|
||||
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
||||
$sql .= ",fk_unit";
|
||||
}
|
||||
// Add fields from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||
if ($reshook > 0) { //Note that $sql is replaced if reshook > 0
|
||||
$sql = "";
|
||||
}
|
||||
$sql .= $hookmanager->resPrint;
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."product_stock as ps, ".MAIN_DB_PREFIX."product as p";
|
||||
|
||||
if ($separatedPMP) {
|
||||
@ -656,6 +672,9 @@ if ($action == 'create') {
|
||||
|
||||
//print '<td>'.dol_print_date($objp->datem).'</td>';
|
||||
print '<tr class="oddeven">';
|
||||
$parameters = array('obj'=>$objp);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
print "<td>";
|
||||
$productstatic->id = $objp->rowid;
|
||||
$productstatic->ref = $objp->ref;
|
||||
|
||||
@ -57,6 +57,38 @@ $linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/list.php?restore_lastsearch
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
$morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu;
|
||||
|
||||
// Project
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.img_picto('', 'project').' '.$langs->trans('Project').' ';
|
||||
if ($usercancreate) {
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
$projectid = $object->fk_project;
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">';
|
||||
$morehtmlref .= $proj->ref;
|
||||
$morehtmlref .= '</a>';
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
$shownav = 1;
|
||||
|
||||
@ -623,6 +623,38 @@ if ($resql) {
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
$morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu;
|
||||
|
||||
// Project
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.img_picto('', 'project').' '.$langs->trans('Project').' ';
|
||||
if ($usercancreate && 1 == 2) {
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
$projectid = $object->fk_project;
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">';
|
||||
$morehtmlref .= $proj->ref;
|
||||
$morehtmlref .= '</a>';
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
$shownav = 1;
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
* Copyright (C) 2016 ATM Consulting <support@atm-consulting.fr>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2021 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2021 Antonin MARCHAL <antonin@letempledujeu.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
|
||||
@ -64,6 +65,25 @@ $draftorder = GETPOST('draftorder', 'alpha');
|
||||
$fourn_id = GETPOST('fourn_id', 'int');
|
||||
$fk_supplier = GETPOST('fk_supplier', 'int');
|
||||
$fk_entrepot = GETPOST('fk_entrepot', 'int');
|
||||
|
||||
//List all visible warehouses
|
||||
$resWar = $db->query("SELECT rowid FROM " . MAIN_DB_PREFIX . "entrepot WHERE entity IN (" . $db->sanitize(getEntity('stock')) .")");
|
||||
$listofqualifiedwarehousesid = "";
|
||||
$count = 0;
|
||||
while ($tmpobj = $db->fetch_object($resWar)) {
|
||||
if (!empty($listofqualifiedwarehousesid)) {
|
||||
$listofqualifiedwarehousesid .= ",";
|
||||
}
|
||||
$listofqualifiedwarehousesid .= $tmpobj->rowid;
|
||||
$lastWarehouseID = $tmpobj->rowid;
|
||||
$count++;
|
||||
};
|
||||
|
||||
//MultiCompany : If only 1 Warehouse is visible, filter will automatically be set to it.
|
||||
if ($count == 1 && (empty($fk_entrepot) || $fk_entrepot <= 0) && !empty($conf->global->MULTICOMPANY_PRODUCT_SHARING_ENABLED)) {
|
||||
$fk_entrepot = $lastWarehouseID;
|
||||
};
|
||||
|
||||
$texte = '';
|
||||
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
@ -324,8 +344,8 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot AS ent ON s.fk_entrepot = ent.rowid AND ent.entity IN('.getEntity('stock').')';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product AND s.fk_entrepot IN ('.$db->sanitize($listofqualifiedwarehousesid).')';
|
||||
//$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot AS ent ON s.fk_entrepot = ent.rowid AND ent.entity IN('.getEntity('stock').')';
|
||||
if ($fk_supplier > 0) {
|
||||
$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price pfp ON (pfp.fk_product = p.rowid AND pfp.fk_soc = '.$fk_supplier.')';
|
||||
}
|
||||
|
||||
@ -41,8 +41,6 @@ if (!empty($conf->propal->enabled)) {
|
||||
}
|
||||
if (!empty($conf->facture->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
}
|
||||
if (!empty($conf->facture->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
|
||||
}
|
||||
if (!empty($conf->commande->enabled)) {
|
||||
@ -80,8 +78,6 @@ if (!empty($conf->don->enabled)) {
|
||||
}
|
||||
if (!empty($conf->loan->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php';
|
||||
}
|
||||
if (!empty($conf->loan->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/loan/class/loanschedule.class.php';
|
||||
}
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
|
||||
@ -222,10 +222,13 @@ if (empty($reshook) && $action == 'add') {
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."<br>\n";
|
||||
}
|
||||
if (GETPOST('email') && !isValidEmail(GETPOST('email'))) {
|
||||
if (!empty($conf->global->ADHERENT_MAIL_REQUIRED) && empty(GETPOST('email'))) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$errmsg .= $langs->trans("ErrorBadEMail", GETPOST('email'))."<br>\n";
|
||||
$errmsg .= $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Email'))."<br>\n";
|
||||
} elseif (GETPOST("email") && !isValidEmail(GETPOST("email"))) {
|
||||
$langs->load('errors');
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."<br>\n";
|
||||
}
|
||||
$birthday = dol_mktime(GETPOST("birthhour", 'int'), GETPOST("birthmin", 'int'), GETPOST("birthsec", 'int'), GETPOST("birthmonth", 'int'), GETPOST("birthday", 'int'), GETPOST("birthyear", 'int'));
|
||||
if (GETPOST("birthmonth") && empty($birthday)) {
|
||||
@ -630,7 +633,7 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) {
|
||||
print '</td></tr>';
|
||||
}
|
||||
// EMail
|
||||
print '<tr><td>'.$langs->trans("Email").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="email" maxlength="255" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('email')).'"></td></tr>'."\n";
|
||||
print '<tr><td>'.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' <span style="color:red;">*</span>' : '').'</td><td><input type="text" name="email" maxlength="255" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('email')).'"></td></tr>'."\n";
|
||||
// Login
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
||||
print '<tr><td>'.$langs->trans("Login").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="login" maxlength="50" class="minwidth100"value="'.dol_escape_htmltag(GETPOST('login')).'"></td></tr>'."\n";
|
||||
|
||||
@ -1587,9 +1587,10 @@ if ($source == 'donation') {
|
||||
$object = $don;
|
||||
|
||||
if ($action != 'dopayment') { // Do not change amount if we just click on first dopayment
|
||||
$amount = $subscription->total_ttc;
|
||||
if (GETPOST("amount", 'alpha')) {
|
||||
$amount = GETPOST("amount", 'alpha');
|
||||
} else {
|
||||
$amount = $don->getRemainToPay();
|
||||
}
|
||||
$amount = price2num($amount);
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2021 Waël Almoman <info@almoman.com>
|
||||
* Copyright (C) 2021 Maxime Demarest <maxime@indelog.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
|
||||
@ -394,7 +395,7 @@ if ($ispaymentok) {
|
||||
|
||||
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
|
||||
if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) {
|
||||
$result = $object->validate($user);
|
||||
$result = ($object->status == $object::STATUS_EXCLUDED) ? -1 : $object->validate($user); // if membre is excluded (status == -2) the new validation is not possible
|
||||
if ($result < 0 || empty($object->datevalid)) {
|
||||
$error++;
|
||||
$errmsg = $object->error;
|
||||
@ -412,7 +413,13 @@ if ($ispaymentok) {
|
||||
|
||||
$datesubend = null;
|
||||
if ($datesubscription && $defaultdelay && $defaultdelayunit) {
|
||||
$datesubend = dol_time_plus_duree(dol_time_plus_duree($datesubscription, $defaultdelay, $defaultdelayunit), -1, 'd');
|
||||
$datesubend = dol_time_plus_duree($datesubscription, $defaultdelay, $defaultdelayunit);
|
||||
// the new end date of subscription must be in futur
|
||||
while ($datesubend < $now) {
|
||||
$datesubend = dol_time_plus_duree($datesubend, $defaultdelay, $defaultdelayunit);
|
||||
$datesubscription = dol_time_plus_duree($datesubscription, $defaultdelay, $defaultdelayunit);
|
||||
}
|
||||
$datesubend = dol_time_plus_duree($datesubend, -1, 'd');
|
||||
}
|
||||
|
||||
$paymentdate = $now;
|
||||
@ -480,7 +487,7 @@ if ($ispaymentok) {
|
||||
|
||||
$autocreatethirdparty = 1; // will create thirdparty if member not yet linked to a thirdparty
|
||||
|
||||
$result = $object->subscriptionComplementaryActions($crowid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom, $emetteur_banque, $autocreatethirdparty);
|
||||
$result = $object->subscriptionComplementaryActions($crowid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom, $emetteur_banque, $autocreatethirdparty, $TRANSACTIONID, $service);
|
||||
if ($result < 0) {
|
||||
dol_syslog("Error ".$object->error." ".join(',', $object->errors), LOG_DEBUG, 0, '_payment');
|
||||
|
||||
@ -776,6 +783,115 @@ if ($ispaymentok) {
|
||||
$postactionmessages[] = 'Invoice paid '.$tmptag['INV'].' was not found';
|
||||
$ispostactionok = -1;
|
||||
}
|
||||
} elseif (array_key_exists('DON', $tmptag) && $tmptag['DON'] > 0) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
|
||||
$don = new Don($db);
|
||||
$result = $don->fetch($tmptag['DON']);
|
||||
if ($result) {
|
||||
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
|
||||
|
||||
$paymentTypeId = 0;
|
||||
if ($paymentmethod == 'paybox') {
|
||||
$paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS;
|
||||
}
|
||||
if ($paymentmethod == 'paypal') {
|
||||
$paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS;
|
||||
}
|
||||
if ($paymentmethod == 'stripe') {
|
||||
$paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS;
|
||||
}
|
||||
if (empty($paymentTypeId)) {
|
||||
$paymentType = $_SESSION["paymentType"];
|
||||
if (empty($paymentType)) {
|
||||
$paymentType = 'CB';
|
||||
}
|
||||
$paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1);
|
||||
}
|
||||
|
||||
$currencyCodeType = $_SESSION['currencyCodeType'];
|
||||
|
||||
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
|
||||
if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) {
|
||||
$db->begin();
|
||||
|
||||
// Creation of paiement line for donation
|
||||
include_once DOL_DOCUMENT_ROOT.'/don/class/paymentdonation.class.php';
|
||||
$paiement = new PaymentDonation($db);
|
||||
|
||||
if ($currencyCodeType == $conf->currency) {
|
||||
$paiement->amounts = array($object->id => $FinalPaymentAmt); // Array with all payments dispatching with donation
|
||||
} else {
|
||||
// PaymentDonation does not support multi currency
|
||||
$postactionmessages[] = 'Payment donation can\'t be payed with diffent currency than '.$conf->currency;
|
||||
$ispostactionok = -1;
|
||||
$error++; // Not yet supported
|
||||
}
|
||||
|
||||
$paiement->fk_donation = $don->id;
|
||||
$paiement->datepaid = $now;
|
||||
$paiement->paymenttype = $paymentTypeId;
|
||||
$paiement->num_payment = '';
|
||||
$paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress;
|
||||
$paiement->ext_payment_id = $TRANSACTIONID;
|
||||
$paiement->ext_payment_site = $service;
|
||||
|
||||
if (!$error) {
|
||||
$paiement_id = $paiement->create($user, 1);
|
||||
if ($paiement_id < 0) {
|
||||
$postactionmessages[] = $paiement->error.' '.join("<br>\n", $paiement->errors);
|
||||
$ispostactionok = -1;
|
||||
$error++;
|
||||
} else {
|
||||
$postactionmessages[] = 'Payment created';
|
||||
$ispostactionok = 1;
|
||||
|
||||
if ($totalpayed >= $don->getRemainToPay()) $don->setPaid($don->id);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && !empty($conf->banque->enabled)) {
|
||||
$bankaccountid = 0;
|
||||
if ($paymentmethod == 'paybox') {
|
||||
$bankaccountid = $conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS;
|
||||
} elseif ($paymentmethod == 'paypal') {
|
||||
$bankaccountid = $conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS;
|
||||
} elseif ($paymentmethod == 'stripe') {
|
||||
$bankaccountid = $conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS;
|
||||
}
|
||||
|
||||
if ($bankaccountid > 0) {
|
||||
$result = $paiement->addPaymentToBank($user, 'payment_donation', '(DonationPayment)', $bankaccountid, '', '');
|
||||
if ($result < 0) {
|
||||
$postactionmessages[] = $paiement->error.' '.join("<br>\n", $paiement->errors);
|
||||
$ispostactionok = -1;
|
||||
$error++;
|
||||
} else {
|
||||
$postactionmessages[] = 'Bank transaction of payment created';
|
||||
$ispostactionok = 1;
|
||||
}
|
||||
} else {
|
||||
$postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.';
|
||||
$ispostactionok = -1;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
} else {
|
||||
$postactionmessages[] = 'Failed to get a valid value for "amount paid" ('.$FinalPaymentAmt.') or "payment type" ('.$paymentType.') to record the payment of donation '.$tmptag['DON'].'. May be payment was already recorded.';
|
||||
$ispostactionok = -1;
|
||||
}
|
||||
} else {
|
||||
$postactionmessages[] = 'Donation paid '.$tmptag['DON'].' was not found';
|
||||
$ispostactionok = -1;
|
||||
}
|
||||
|
||||
// TODO send email with acknowledgment for the donation
|
||||
// (need that the donation module can gen a pdf document for the cerfa with pre filled content)
|
||||
} else {
|
||||
// Nothing done
|
||||
}
|
||||
@ -903,6 +1019,7 @@ if ($ispaymentok) {
|
||||
$content .= "ErrorSeverityCode = ".$ErrorSeverityCode."<br>\n";
|
||||
}
|
||||
|
||||
|
||||
$ishtml = dol_textishtml($content); // May contain urls
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
|
||||
@ -79,6 +79,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$parameters = array(
|
||||
'id' => $id,
|
||||
);
|
||||
|
||||
@ -784,6 +784,7 @@ if ($action == 'create') {
|
||||
$langs->load("projects");
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Project").'</td><td colspan="2">';
|
||||
print img_picto('', 'project', 'class="paddingright"');
|
||||
$numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0);
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
|
||||
print '</td>';
|
||||
|
||||
@ -146,7 +146,7 @@ class Salary extends CommonObject
|
||||
$sql .= " note='".$this->db->escape($this->note)."',";
|
||||
$sql .= " fk_bank=".($this->fk_bank > 0 ? (int) $this->fk_bank : "null").",";
|
||||
$sql .= " fk_user_author=".((int) $this->fk_user_author).",";
|
||||
$sql .= " fk_user_modif=".($this->fk_user_modif > 0 ? (int) $this->fk_user_modif : 'null');
|
||||
$sql .= " fk_user_modif=".($this->fk_user_modif > 0 ? (int) $this->fk_user_modif : (int) $user->id);
|
||||
|
||||
$sql .= " WHERE rowid=".((int) $this->id);
|
||||
|
||||
@ -589,7 +589,7 @@ class Salary extends CommonObject
|
||||
*/
|
||||
public function info($id)
|
||||
{
|
||||
$sql = 'SELECT ps.rowid, ps.datec, ps.fk_user_author';
|
||||
$sql = 'SELECT ps.rowid, ps.datec, ps.tms, ps.fk_user_author, ps.fk_user_modif';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'salary as ps';
|
||||
$sql .= ' WHERE ps.rowid = '.((int) $id);
|
||||
|
||||
@ -605,7 +605,14 @@ class Salary extends CommonObject
|
||||
$cuser->fetch($obj->fk_user_author);
|
||||
$this->user_creation = $cuser;
|
||||
}
|
||||
|
||||
if ($obj->fk_user_modif) {
|
||||
$muser = new User($this->db);
|
||||
$muser->fetch($obj->fk_user_modif);
|
||||
$this->user_modification = $muser;
|
||||
}
|
||||
$this->date_creation = $this->db->jdate($obj->datec);
|
||||
$this->date_modification = $this->db->jdate($obj->tms);
|
||||
}
|
||||
$this->db->free($result);
|
||||
} else {
|
||||
|
||||
@ -286,9 +286,10 @@ if ($action == 'create') {
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmount' data-rowid='".$namef."' data-value='".($objp->amount - $sumpaid)."'");
|
||||
} */
|
||||
$remaintopay = $objp->amount - $sumpaid;
|
||||
print '<input type=hidden class="sum_remain" name="'.$nameRemain.'" value="'.$remaintopay.'">';
|
||||
print '<input type="text" size="8" name="'.$namef.'" id="'.$namef.'" value="'.$remaintopay.'">';
|
||||
$valuetoshow = GETPOSTISSET($namef) ? GETPOST($namef) : ($objp->amount - $sumpaid);
|
||||
|
||||
print '<input type=hidden class="sum_remain" name="'.$nameRemain.'" value="'.$valuetoshow.'">';
|
||||
print '<input type="text" class="right width75" name="'.$namef.'" id="'.$namef.'" value="'.$valuetoshow.'">';
|
||||
} else {
|
||||
print '-';
|
||||
}
|
||||
|
||||
@ -195,7 +195,6 @@ if ($resql) {
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans('Salary').'</td>';
|
||||
print '<td>'.$langs->trans('Type').'</td>';
|
||||
print '<td>'.$langs->trans('Label').'</td>';
|
||||
print '<td class="right">'.$langs->trans('ExpectedToPay').'</td>';
|
||||
print '<td class="center">'.$langs->trans('Status').'</td>';
|
||||
@ -212,11 +211,6 @@ if ($resql) {
|
||||
$salary->fetch($objp->scid);
|
||||
print $salary->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
// Type
|
||||
print '<td>';
|
||||
print $salary->type_label;
|
||||
/*print $salary->type;*/
|
||||
print "</td>\n";
|
||||
// Label
|
||||
print '<td>'.$objp->label.'</td>';
|
||||
// Expected to pay
|
||||
|
||||
@ -1510,20 +1510,24 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
// Type - Workforce/Staff
|
||||
print '<tr><td>'.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).'</td><td class="maxwidthonsmartphone"'.($conf->browser->layout == 'phone' ? ' colspan="3"' : '').'>'."\n";
|
||||
print '<tr><td>'.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).'</td><td class="maxwidthonsmartphone"'.( ($conf->browser->layout == 'phone' || !empty($conf->global->SOCIETE_DISABLE_WORKFORCE)) ? ' colspan="3"' : '').'>'."\n";
|
||||
$sortparam = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label.
|
||||
print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 1, 0, 0, '', 0, 0, 0, $sortparam, '', 1);
|
||||
if ($user->admin) {
|
||||
print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
}
|
||||
print '</td>';
|
||||
if ($conf->browser->layout == 'phone') {
|
||||
print '</tr><tr>';
|
||||
}
|
||||
print '<td>'.$form->editfieldkey('Workforce', 'effectif_id', '', $object, 0).'</td><td class="maxwidthonsmartphone"'.($conf->browser->layout == 'phone' ? ' colspan="3"' : '').'>';
|
||||
print $form->selectarray("effectif_id", $formcompany->effectif_array(0), $object->effectif_id, 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
if ($user->admin) {
|
||||
print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
if (empty($conf->global->SOCIETE_DISABLE_WORKFORCE)) {
|
||||
print '</td>';
|
||||
if ($conf->browser->layout == 'phone') {
|
||||
print '</tr><tr>';
|
||||
}
|
||||
print '<td>'.$form->editfieldkey('Workforce', 'effectif_id', '', $object, 0).'</td><td class="maxwidthonsmartphone"'.($conf->browser->layout == 'phone' ? ' colspan="3"' : '').'>';
|
||||
print $form->selectarray("effectif_id", $formcompany->effectif_array(0), $object->effectif_id, 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
if ($user->admin) {
|
||||
print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
}
|
||||
} else {
|
||||
print '<input type="hidden" name="effectif_id" id="effectif_id" value="'.$object->effectif_id.'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@ -2196,19 +2200,23 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '</tr>';
|
||||
|
||||
// Type - Workforce/Staff
|
||||
print '<tr><td>'.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).'</td><td class="maxwidthonsmartphone">';
|
||||
print '<tr><td>'.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).'</td><td class="maxwidthonsmartphone"'.( ($conf->browser->layout == 'phone' || !empty($conf->global->SOCIETE_DISABLE_WORKFORCE)) ? ' colspan="3"' : '').'>';
|
||||
print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 1, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1);
|
||||
if ($user->admin) {
|
||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
}
|
||||
print '</td>';
|
||||
if ($conf->browser->layout == 'phone') {
|
||||
print '</tr><tr>';
|
||||
}
|
||||
print '<td>'.$form->editfieldkey('Workforce', 'effectif_id', '', $object, 0).'</td><td class="maxwidthonsmartphone">';
|
||||
print $form->selectarray("effectif_id", $formcompany->effectif_array(0), $object->effectif_id, 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
if ($user->admin) {
|
||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
if (empty($conf->global->SOCIETE_DISABLE_WORKFORCE)) {
|
||||
print '</td>';
|
||||
if ($conf->browser->layout == 'phone') {
|
||||
print '</tr><tr>';
|
||||
}
|
||||
print '<td>'.$form->editfieldkey('Workforce', 'effectif_id', '', $object, 0).'</td><td class="maxwidthonsmartphone">';
|
||||
print $form->selectarray("effectif_id", $formcompany->effectif_array(0), $object->effectif_id, 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
if ($user->admin) {
|
||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
}
|
||||
} else {
|
||||
print '<input type="hidden" name="effectif_id" id="effectif_id" value="'.$object->effectif_id.'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@ -2646,7 +2654,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '</td></tr>';
|
||||
|
||||
// Workforce/Staff
|
||||
print '<tr><td>'.$langs->trans("Workforce").'</td><td>'.$object->effectif.'</td></tr>';
|
||||
if (empty($conf->global->SOCIETE_DISABLE_WORKFORCE)) {
|
||||
print '<tr><td>'.$langs->trans("Workforce").'</td><td>'.$object->effectif.'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
@ -290,7 +290,9 @@ class SupplierProposal extends CommonObject
|
||||
$line->tva_tx = $tva_tx;
|
||||
|
||||
$this->lines[] = $line;
|
||||
return 1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
@ -1401,10 +1403,12 @@ class SupplierProposal extends CommonObject
|
||||
|
||||
// Numbering module definition
|
||||
$soc = new Societe($this->db);
|
||||
$soc->fetch($this->socid);
|
||||
$result = $soc->fetch($this->socid);
|
||||
|
||||
if ($result < 0) return -1;
|
||||
|
||||
// Define new ref
|
||||
if (!$error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) { // empty should not happened, but when it occurs, the test save life
|
||||
if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life
|
||||
$num = $this->getNextNumRef($soc);
|
||||
} else {
|
||||
$num = $this->ref;
|
||||
@ -1525,6 +1529,7 @@ class SupplierProposal extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
@ -1555,6 +1560,7 @@ class SupplierProposal extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -1589,6 +1595,7 @@ class SupplierProposal extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -1663,7 +1670,9 @@ class SupplierProposal extends CommonObject
|
||||
public function cloture($user, $status, $note)
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
$hidedetails = 0;
|
||||
$hidedesc = 0;
|
||||
$hideref = 0;
|
||||
$this->statut = $status;
|
||||
$error = 0;
|
||||
$now = dol_now();
|
||||
@ -1785,6 +1794,7 @@ class SupplierProposal extends CommonObject
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1847,6 +1857,7 @@ class SupplierProposal extends CommonObject
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
@ -2908,8 +2919,10 @@ class SupplierProposalLine extends CommonObjectLine
|
||||
$this->fk_unit = $objp->fk_unit;
|
||||
|
||||
$this->db->free($result);
|
||||
return 1;
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -118,14 +118,14 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="titlefieldcreate">'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
|
||||
print '<td>'.$langs->trans("Parameters").'</td><td class="center">'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
if ($conf->global->TAKEPOS_PRINT_METHOD != "browser") {
|
||||
if ($conf->global->TAKEPOS_PRINT_METHOD != "browser") { // Why this ?
|
||||
print '<tr class="oddeven value"><td>';
|
||||
print $langs->trans("OrderPrinters").' (<a href="'.DOL_URL_ROOT.'/takepos/admin/orderprinters.php?leftmenu=setup">'.$langs->trans("Setup").'</a>)';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<td class="center">';
|
||||
print ajax_constantonoff("TAKEPOS_ORDER_PRINTERS", array(), $conf->entity, 0, 0, 1, 0);
|
||||
//print $form->selectyesno("TAKEPOS_ORDER_PRINTERS", $conf->global->TAKEPOS_ORDER_PRINTERS, 1);
|
||||
print '</td></tr>';
|
||||
@ -133,7 +133,7 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
|
||||
print '<tr class="oddeven value"><td>';
|
||||
print $langs->trans("OrderNotes");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<td class="center">';
|
||||
print ajax_constantonoff("TAKEPOS_ORDER_NOTES", array(), $conf->entity, 0, 0, 1, 0);
|
||||
//print $form->selectyesno("TAKEPOS_ORDER_NOTES", $conf->global->TAKEPOS_ORDER_NOTES, 1);
|
||||
print '</td></tr>';
|
||||
@ -142,7 +142,7 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
|
||||
print '<tr class="oddeven value"><td>';
|
||||
print $langs->trans("BasicPhoneLayout");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<td class="center">';
|
||||
//print $form->selectyesno("TAKEPOS_PHONE_BASIC_LAYOUT", $conf->global->TAKEPOS_PHONE_BASIC_LAYOUT, 1);
|
||||
print ajax_constantonoff("TAKEPOS_PHONE_BASIC_LAYOUT", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print '</td></tr>';
|
||||
@ -150,7 +150,7 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
|
||||
print '<tr class="oddeven value"><td>';
|
||||
print $langs->trans("ProductSupplements");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<td class="center">';
|
||||
//print $form->selectyesno("TAKEPOS_SUPPLEMENTS", $conf->global->TAKEPOS_SUPPLEMENTS, 1);
|
||||
print ajax_constantonoff("TAKEPOS_SUPPLEMENTS", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print '</td></tr>';
|
||||
@ -159,7 +159,7 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("SupplementCategory");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<td class="center">';
|
||||
print $form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_SUPPLEMENTS_CATEGORY, 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0);
|
||||
print ajax_combobox('TAKEPOS_SUPPLEMENTS_CATEGORY');
|
||||
print "</td></tr>\n";
|
||||
@ -168,14 +168,14 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
|
||||
print '<tr class="oddeven value"><td>';
|
||||
print 'QR - '.$langs->trans("CustomerMenu");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<td class="center">';
|
||||
print ajax_constantonoff("TAKEPOS_QR_MENU", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven value"><td>';
|
||||
print 'QR - '.$langs->trans("AutoOrder");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<td class="center">';
|
||||
print ajax_constantonoff("TAKEPOS_AUTO_ORDER", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print '</td></tr>';
|
||||
|
||||
@ -187,7 +187,7 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
|
||||
print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
|
||||
}
|
||||
|
||||
if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
|
||||
if (!empty($conf->global->TAKEPOS_BAR_RESTAURANT)) {
|
||||
if ($conf->global->TAKEPOS_QR_MENU) {
|
||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||
@ -197,10 +197,10 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
|
||||
print '<td>'.$langs->trans("URL").'</td><td class="right">'.$langs->trans("QR").'</td>';
|
||||
print "</tr>\n";
|
||||
print '<tr class="oddeven value"><td>';
|
||||
print "<a target='_blank' href='".$urlwithroot."/takepos/public/menu.php'>".$urlwithroot."/takepos/public/menu.php</a>";
|
||||
print '<a target="_blank" href="'.$urlwithroot.'/takepos/public/menu.php">'.$urlwithroot.'/takepos/public/menu.php</a>';
|
||||
print '</td>';
|
||||
print '<td class="right">';
|
||||
print "<a target='_blank' href='printqr.php'><img src='".DOL_URL_ROOT."/takepos/genimg/qr.php' height='42' width='42'></a>";
|
||||
print '<a target="_blank" href="printqr.php"><img src="'.DOL_URL_ROOT.'/takepos/genimg/qr.php" height="42" width="42"></a>';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
@ -974,12 +974,12 @@ if ($action == "search") {
|
||||
function SendTicket(id)
|
||||
{
|
||||
console.log("Open box to select the Print/Send form");
|
||||
$.colorbox({href:"send.php?facid="+id, width:"70%", height:"30%", transition:"none", iframe:"true", title:"<?php echo $langs->trans("SendTicket"); ?>"});
|
||||
$.colorbox({href:"send.php?facid="+id, width:"70%", height:"30%", transition:"none", iframe:"true", title:'<?php echo dol_escape_js($langs->trans("SendTicket")); ?>'});
|
||||
}
|
||||
|
||||
function Print(id, gift){
|
||||
$.colorbox({href:"receipt.php?facid="+id+"&gift="+gift, width:"40%", height:"90%", transition:"none", iframe:"true", title:"<?php
|
||||
echo $langs->trans("PrintTicket"); ?>"});
|
||||
console.log("Call Print() to generate the receipt.");
|
||||
$.colorbox({href:"receipt.php?facid="+id+"&gift="+gift, width:"40%", height:"90%", transition:"none", iframe:"true", title:'<?php echo dol_escape_js($langs->trans("PrintTicket")); ?>'});
|
||||
}
|
||||
|
||||
function TakeposPrinting(id){
|
||||
|
||||
@ -50,7 +50,7 @@ include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
|
||||
$langs->loadLangs(array("main", "cashdesk", "companies"));
|
||||
|
||||
$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant
|
||||
$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Bar or Restaurant
|
||||
|
||||
$facid = GETPOST('facid', 'int');
|
||||
|
||||
@ -318,5 +318,6 @@ if (!empty($conf->global->TAKEPOS_FOOTER) || !empty($conf->global->{$constFreeTe
|
||||
<script type="text/javascript">
|
||||
window.print();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -143,6 +143,7 @@ input {
|
||||
input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select {
|
||||
background-color: var(--inputbackgroundcolor);
|
||||
color: var(--colortext);
|
||||
border-radius: 2px;
|
||||
}
|
||||
select.vmenusearchselectcombo {
|
||||
background-color: unset;
|
||||
|
||||
@ -203,14 +203,15 @@ div.mainmenu.generic4::before {
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.menu_titre .em092 {
|
||||
|
||||
.em092 {
|
||||
font-size: 0.92em;
|
||||
}
|
||||
|
||||
.menu_titre .em088 {
|
||||
.em088 {
|
||||
font-size: 0.88em;
|
||||
}
|
||||
|
||||
.menu_titre .em080 {
|
||||
.em080 {
|
||||
font-size: 0.80em;
|
||||
}
|
||||
|
||||
@ -536,7 +536,7 @@ class ProductCombination
|
||||
$new_price += $variation_price;
|
||||
}
|
||||
|
||||
$child->updatePrice($new_price, $new_type, $user, $new_vat, $new_min_price, $i, $new_npr, $new_psq);
|
||||
$child->updatePrice($new_price, $new_type, $user, $new_vat, $new_min_price, $i, $new_npr, $new_psq, 0, array(), $parent->default_vat_code);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -2260,7 +2260,7 @@ if ($action == 'generatesitemaps' && $usercanedit) {
|
||||
|
||||
$domtree->formatOutput = true;
|
||||
|
||||
$xmlname = 'sitemap.'.$websitekey.'.xml';
|
||||
$xmlname = 'sitemap.xml';
|
||||
|
||||
$sql = "SELECT wp.rowid, wp.type_container , wp.pageurl, wp.lang, wp.fk_page, wp.tms as tms,";
|
||||
$sql .= " w.virtualhost, w.fk_default_home";
|
||||
@ -2285,7 +2285,7 @@ if ($action == 'generatesitemaps' && $usercanedit) {
|
||||
$shortlangcode = substr($objp->lang, 0, 2); // en_US or en-US -> en
|
||||
}
|
||||
if (empty($shortlangcode)) {
|
||||
$shortlangcode = substr($object->lang, 0, 2); // en_US or en-US -> en
|
||||
$shortlangcode = substr($object->lang, 0, 2); // Use short lang code of website
|
||||
}
|
||||
|
||||
// Forge $pageurl, adding language prefix if it is an alternative language
|
||||
@ -2344,7 +2344,7 @@ if ($action == 'generatesitemaps' && $usercanedit) {
|
||||
$xhtmllink = $domtree->createElement('xhtml:link', '');
|
||||
$xhtmllink->setAttribute("rel", "alternante");
|
||||
$xhtmllink->setAttribute("hreflang", $tmpshortlangcode);
|
||||
$xhtmllink->setAttribute("href", $domainname.($objp->fk_default_home == $tmppage->id ? '/' : (($tmpshortlangcode != substr($objp->lang, 0, 2)) ? '/'.$tmpshortlangcode : '').'/'.$tmppage->pageurl.'.php'));
|
||||
$xhtmllink->setAttribute("href", $domainname.($objp->fk_default_home == $tmppage->id ? '/' : (($tmpshortlangcode != substr($object->lang, 0, 2)) ? '/'.$tmpshortlangcode : '').'/'.$tmppage->pageurl.'.php'));
|
||||
$url->appendChild($xhtmllink);
|
||||
|
||||
$alternatefound++;
|
||||
@ -2353,7 +2353,8 @@ if ($action == 'generatesitemaps' && $usercanedit) {
|
||||
}
|
||||
|
||||
// Add "has translation pages"
|
||||
$sql = 'SELECT rowid as id, lang, pageurl from '.MAIN_DB_PREFIX.'website_page where fk_page IN ('.$db->sanitize($objp->rowid.($translationof ? ', '.$translationof : '')).")";
|
||||
$sql = 'SELECT rowid as id, lang, pageurl from '.MAIN_DB_PREFIX.'website_page';
|
||||
$sql .= ' WHERE status = '.WebsitePage::STATUS_VALIDATED.' AND fk_page IN ('.$db->sanitize($objp->rowid.($translationof ? ', '.$translationof : '')).")";
|
||||
$resqlhastrans = $db->query($sql);
|
||||
if ($resqlhastrans) {
|
||||
$num_rows_hastrans = $db->num_rows($resqlhastrans);
|
||||
@ -2367,7 +2368,7 @@ if ($action == 'generatesitemaps' && $usercanedit) {
|
||||
$xhtmllink = $domtree->createElement('xhtml:link', '');
|
||||
$xhtmllink->setAttribute("rel", "alternate");
|
||||
$xhtmllink->setAttribute("hreflang", $tmpshortlangcode);
|
||||
$xhtmllink->setAttribute("href", $domainname.($objp->fk_default_home == $objhastrans->id ? '/' : (($tmpshortlangcode != substr($objp->lang, 0, 2) ? '/'.$tmpshortlangcode : '')).'/'.$objhastrans->pageurl.'.php'));
|
||||
$xhtmllink->setAttribute("href", $domainname.($objp->fk_default_home == $objhastrans->id ? '/' : (($tmpshortlangcode != substr($object->lang, 0, 2) ? '/'.$tmpshortlangcode : '')).'/'.$objhastrans->pageurl.'.php'));
|
||||
$url->appendChild($xhtmllink);
|
||||
|
||||
$alternatefound++;
|
||||
@ -2396,7 +2397,7 @@ if ($action == 'generatesitemaps' && $usercanedit) {
|
||||
if (!empty($conf->global->MAIN_UMASK)) {
|
||||
@chmod($tempdir.$xmlname, octdec($conf->global->MAIN_UMASK));
|
||||
}
|
||||
setEventMessages($langs->trans("SitemapGenerated"), null, 'mesgs');
|
||||
setEventMessages($langs->trans("SitemapGenerated", $xmlname), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
@ -2414,7 +2415,7 @@ if ($action == 'generatesitemaps' && $usercanedit) {
|
||||
$robotsitemap = "Sitemap: ".$domainname."/".$xmlname;
|
||||
$result = strpos($robotcontent, 'Sitemap: ');
|
||||
if ($result) {
|
||||
$result = preg_replace("/Sitemap.*\n/", $robotsitemap, $robotcontent);
|
||||
$result = preg_replace('/Sitemap:.*/', $robotsitemap, $robotcontent);
|
||||
$robotcontent = $result ? $result : $robotcontent;
|
||||
} else {
|
||||
$robotcontent .= $robotsitemap."\n";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user