Merge remote branch 'dolibarr/3.1-beta' into 3.1-beta
This commit is contained in:
commit
e0a5f8441c
@ -2,7 +2,6 @@
|
|||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# \file build/makepack-dolibarrtheme.pl
|
# \file build/makepack-dolibarrtheme.pl
|
||||||
# \brief Script to build a theme Package for Dolibarr
|
# \brief Script to build a theme Package for Dolibarr
|
||||||
# \version $Revision: 1.10 $
|
|
||||||
# \author (c)2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
# \author (c)2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -25,7 +24,7 @@ $PROJECT="dolibarr";
|
|||||||
|
|
||||||
|
|
||||||
use vars qw/ $REVISION $VERSION /;
|
use vars qw/ $REVISION $VERSION /;
|
||||||
$REVISION='$Revision: 1.10 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1;
|
$REVISION='1.11';
|
||||||
$VERSION="1.0 (build $REVISION)";
|
$VERSION="1.0 (build $REVISION)";
|
||||||
|
|
||||||
|
|
||||||
@ -75,10 +74,14 @@ my $copyalreadydone=0;
|
|||||||
my $batch=0;
|
my $batch=0;
|
||||||
|
|
||||||
print "Makepack theme version $VERSION\n";
|
print "Makepack theme version $VERSION\n";
|
||||||
print "Enter name of theme to package: ";
|
print "Enter name of theme(s) to package (separated with space): ";
|
||||||
$PROJECT=<STDIN>;
|
$PROJECT=<STDIN>;
|
||||||
chomp($PROJECT);
|
chomp($PROJECT);
|
||||||
|
|
||||||
|
@PROJECTLIST=split(/ /,$PROJECT);
|
||||||
|
$PROJECT=join('',@PROJECTLIST);
|
||||||
|
|
||||||
|
|
||||||
# Ask and set version $MAJOR and $MINOR
|
# Ask and set version $MAJOR and $MINOR
|
||||||
print "Enter value for version: ";
|
print "Enter value for version: ";
|
||||||
$PROJVERSION=<STDIN>;
|
$PROJVERSION=<STDIN>;
|
||||||
@ -94,6 +97,8 @@ if ($MINOR eq '')
|
|||||||
|
|
||||||
$FILENAME="$PROJECT";
|
$FILENAME="$PROJECT";
|
||||||
$FILENAMETGZ="theme_$PROJECT-$MAJOR.$MINOR";
|
$FILENAMETGZ="theme_$PROJECT-$MAJOR.$MINOR";
|
||||||
|
$FILENAMEZIP="theme_$PROJECT-$MAJOR.$MINOR";
|
||||||
|
|
||||||
if (-d "/usr/src/redhat") {
|
if (-d "/usr/src/redhat") {
|
||||||
# redhat
|
# redhat
|
||||||
$RPMDIR="/usr/src/redhat";
|
$RPMDIR="/usr/src/redhat";
|
||||||
@ -202,11 +207,13 @@ if ($nboftargetok) {
|
|||||||
mkdir "$BUILDROOT";
|
mkdir "$BUILDROOT";
|
||||||
mkdir "$BUILDROOT/htdocs";
|
mkdir "$BUILDROOT/htdocs";
|
||||||
mkdir "$BUILDROOT/htdocs/theme";
|
mkdir "$BUILDROOT/htdocs/theme";
|
||||||
mkdir "$BUILDROOT/htdocs/theme/$PROJECT";
|
|
||||||
|
|
||||||
print "Copy $SOURCE into $BUILDROOT\n";
|
print "Copy $SOURCE into $BUILDROOT\n";
|
||||||
mkdir "$BUILDROOT";
|
mkdir "$BUILDROOT";
|
||||||
$ret=`cp -pr "$SOURCE/htdocs/theme/$PROJECT" "$BUILDROOT/htdocs/theme"`;
|
foreach my $tmp (@PROJECTLIST)
|
||||||
|
{
|
||||||
|
$ret=`cp -pr "$SOURCE/htdocs/theme/$tmp" "$BUILDROOT/htdocs/theme"`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print "Clean $BUILDROOT\n";
|
print "Clean $BUILDROOT\n";
|
||||||
$ret=`rm -fr $BUILDROOT/htdocs/theme/$PROJECT/Thumbs.db $BUILDROOT/htdocs/theme/$PROJECT/*/Thumbs.db $BUILDROOT/htdocs/theme/$PROJECT/*/*/Thumbs.db $BUILDROOT/htdocs/theme/$PROJECT/*/*/*/Thumbs.db`;
|
$ret=`rm -fr $BUILDROOT/htdocs/theme/$PROJECT/Thumbs.db $BUILDROOT/htdocs/theme/$PROJECT/*/Thumbs.db $BUILDROOT/htdocs/theme/$PROJECT/*/*/Thumbs.db $BUILDROOT/htdocs/theme/$PROJECT/*/*/*/Thumbs.db`;
|
||||||
@ -222,16 +229,12 @@ if ($nboftargetok) {
|
|||||||
|
|
||||||
if ($target eq 'TGZ') {
|
if ($target eq 'TGZ') {
|
||||||
unlink $FILENAMETGZ.tgz;
|
unlink $FILENAMETGZ.tgz;
|
||||||
# unlink $BUILDROOT/$FILENAMETGZ.tgz;
|
|
||||||
print "Compress $BUILDROOT/htdocs into $FILENAMETGZ.tgz...\n";
|
print "Compress $BUILDROOT/htdocs into $FILENAMETGZ.tgz...\n";
|
||||||
$cmd="tar --exclude-vcs --exclude-from \"$DESTI/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMETGZ.tgz\" htdocs";
|
$cmd="tar --exclude-vcs --exclude-from \"$DESTI/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMETGZ.tgz\" htdocs";
|
||||||
$ret=`$cmd`;
|
$ret=`$cmd`;
|
||||||
# $cmd="tar --exclude-vcs --exclude-from \"$DESTI/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMETGZ.tgz\" htdocs\n";
|
|
||||||
# $ret=`$cmd`;
|
|
||||||
if ($OS =~ /windows/i) {
|
if ($OS =~ /windows/i) {
|
||||||
print "Move $FILENAMETGZ.tgz to $DESTI/$FILENAMETGZ.tgz\n";
|
print "Move $FILENAMETGZ.tgz to $DESTI/$FILENAMETGZ.tgz\n";
|
||||||
$ret=`mv "$FILENAMETGZ.tgz" "$DESTI/$FILENAMETGZ.tgz"`;
|
$ret=`mv "$FILENAMETGZ.tgz" "$DESTI/$FILENAMETGZ.tgz"`;
|
||||||
# $ret=`mv "$BUILDROOT/$FILENAMETGZ.tgz" "$DESTI/$FILENAMETGZ.tgz"`;
|
|
||||||
}
|
}
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
@ -240,56 +243,9 @@ if ($nboftargetok) {
|
|||||||
unlink $FILENAMEZIP.zip;
|
unlink $FILENAMEZIP.zip;
|
||||||
print "Compress $FILENAMETGZ into $FILENAMEZIP.zip...\n";
|
print "Compress $FILENAMETGZ into $FILENAMEZIP.zip...\n";
|
||||||
chdir("$BUILDROOT");
|
chdir("$BUILDROOT");
|
||||||
#print "cd $BUILDROOTNT & 7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMETGZ\\*.*\n";
|
$ret=`7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip htdocs`;
|
||||||
#$ret=`cd $BUILDROOTNT & 7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMETGZ\\*.*`;
|
|
||||||
$ret=`7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMETGZ\\*.*`;
|
|
||||||
print "Move $FILENAMEZIP.zip to $DESTI\n";
|
print "Move $FILENAMEZIP.zip to $DESTI\n";
|
||||||
rename("$BUILDROOT/$FILENAMEZIP.zip","$DESTI/$FILENAMEZIP.zip");
|
$ret=`mv "$FILENAMEZIP.zip" "$DESTI/$FILENAMEZIP.zip"`;
|
||||||
next;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($target eq 'RPM') { # Linux only
|
|
||||||
$BUILDFIC="$FILENAME.spec";
|
|
||||||
unlink $FILENAMETGZ.tgz;
|
|
||||||
print "Compress $FILENAMETGZ into $FILENAMETGZ.tgz...\n";
|
|
||||||
$ret=`tar --exclude-vcs --exclude-from "$SOURCE/build/tgz/tar_exclude.txt" --directory "$BUILDROOT" --group=500 --owner=500 -czvf "$BUILDROOT/$FILENAMETGZ.tgz" $FILENAMETGZ`;
|
|
||||||
|
|
||||||
print "Move $FILENAMETGZ.tgz to $RPMDIR/SOURCES/$FILENAMETGZ.tgz\n";
|
|
||||||
$cmd="mv \"$BUILDROOT/$FILENAMETGZ.tgz\" \"$RPMDIR/SOURCES/$FILENAMETGZ.tgz\"";
|
|
||||||
$ret=`$cmd`;
|
|
||||||
|
|
||||||
print "Copy $SOURCE/make/rpm/${BUILDFIC} to $BUILDROOT\n";
|
|
||||||
# $ret=`cp -p "$SOURCE/make/rpm/${BUILDFIC}" "$BUILDROOT"`;
|
|
||||||
open (SPECFROM,"<$SOURCE/make/rpm/${BUILDFIC}") || die "Error";
|
|
||||||
open (SPECTO,">$BUILDROOT/$BUILDFIC") || die "Error";
|
|
||||||
while (<SPECFROM>) {
|
|
||||||
$_ =~ s/__VERSION__/$MAJOR.$MINOR.$BUILD/;
|
|
||||||
print SPECTO $_;
|
|
||||||
}
|
|
||||||
close SPECFROM;
|
|
||||||
close SPECTO;
|
|
||||||
|
|
||||||
print "Launch RPM build (rpm --clean -ba $BUILDROOT/${BUILDFIC})\n";
|
|
||||||
$ret=`rpm --clean -ba $BUILDROOT/${BUILDFIC}`;
|
|
||||||
|
|
||||||
print "Move $RPMDIR/RPMS/noarch/${FILENAMERPM}.noarch.rpm into $DESTI/${FILENAMERPM}.noarch.rpm\n";
|
|
||||||
$cmd="mv \"$RPMDIR/RPMS/noarch/${FILENAMERPM}.noarch.rpm\" \"$DESTI/${FILENAMERPM}.noarch.rpm\"";
|
|
||||||
$ret=`$cmd`;
|
|
||||||
next;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($target eq 'DEB') {
|
|
||||||
print "Automatic build for DEB is not yet supported.\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($target eq 'EXE') {
|
|
||||||
unlink "$FILENAMEEXE.exe";
|
|
||||||
print "Compress into $FILENAMEEXE.exe by $FILENAMEEXE.nsi...\n";
|
|
||||||
$command="\"$REQUIREMENTTARGET{$target}\" /DMUI_VERSION_DOT=$MAJOR.$MINOR.$BUILD /X\"SetCompressor bzip2\" \"$SOURCE\\build\\exe\\$FILENAME.nsi\"";
|
|
||||||
print "$command\n";
|
|
||||||
$ret=`$command`;
|
|
||||||
print "Move $FILENAMEEXE.exe to $DESTI\n";
|
|
||||||
rename("$SOURCE\\build\\exe\\$FILENAMEEXE.exe","$DESTI/$FILENAMEEXE.exe");
|
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -89,7 +89,7 @@ print "</tr>\n";
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
|
print '<tr '.$bc[$var].'><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print $form->select_societes($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client=1',1,1);
|
print $form->select_societes($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
if ($conf->banque->enabled)
|
if ($conf->banque->enabled)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -87,7 +87,7 @@ print '<td>';
|
|||||||
$disabled=0;
|
$disabled=0;
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
if (! empty($conf->global->CASHDESK_ID_THIRDPARTY)) $disabled=1; // If a particular third party is defined, we disable choice
|
if (! empty($conf->global->CASHDESK_ID_THIRDPARTY)) $disabled=1; // If a particular third party is defined, we disable choice
|
||||||
$form->select_societes(GETPOST('socid')?GETPOST('socid'):$conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client=1',!$disabled,$disabled,1);
|
$form->select_societes(GETPOST('socid')?GETPOST('socid'):$conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',!$disabled,$disabled,1);
|
||||||
//print '<input name="warehouse_id" class="texte_login" type="warehouse_id" value="" />';
|
//print '<input name="warehouse_id" class="texte_login" type="warehouse_id" value="" />';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@ -57,6 +57,7 @@ class Categorie
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
*
|
||||||
* @param DB acces base de donnees
|
* @param DB acces base de donnees
|
||||||
* @param id id de la categorie
|
* @param id id de la categorie
|
||||||
*/
|
*/
|
||||||
@ -70,6 +71,7 @@ class Categorie
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Load category into memory from database
|
* Load category into memory from database
|
||||||
|
|
||||||
* @param id id of category
|
* @param id id of category
|
||||||
*/
|
*/
|
||||||
function fetch($id)
|
function fetch($id)
|
||||||
@ -101,7 +103,7 @@ class Categorie
|
|||||||
|
|
||||||
$sql = "SELECT fk_categorie_mere";
|
$sql = "SELECT fk_categorie_mere";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie_association";
|
$sql.= " FROM ".MAIN_DB_PREFIX."categorie_association";
|
||||||
$sql.= " WHERE fk_categorie_fille = '".$id."'";
|
$sql.= " WHERE fk_categorie_fille = ".$id;
|
||||||
|
|
||||||
dol_syslog("Categorie::fetch sql=".$sql);
|
dol_syslog("Categorie::fetch sql=".$sql);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
@ -121,6 +123,7 @@ class Categorie
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Add category into database
|
* Add category into database
|
||||||
|
*
|
||||||
* @return int -1 : erreur SQL
|
* @return int -1 : erreur SQL
|
||||||
* -2 : nouvel ID inconnu
|
* -2 : nouvel ID inconnu
|
||||||
* -3 : categorie invalide
|
* -3 : categorie invalide
|
||||||
@ -199,6 +202,7 @@ class Categorie
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update category
|
* Update category
|
||||||
|
*
|
||||||
* @return int 1 : OK
|
* @return int 1 : OK
|
||||||
* -1 : SQL error
|
* -1 : SQL error
|
||||||
* -2 : invalid category
|
* -2 : invalid category
|
||||||
@ -211,6 +215,7 @@ class Categorie
|
|||||||
$this->label=trim($this->label);
|
$this->label=trim($this->label);
|
||||||
$this->description=trim($this->description);
|
$this->description=trim($this->description);
|
||||||
$this->parentId = ($this->id_mere) != "" ? intval($this->id_mere) : 0;
|
$this->parentId = ($this->id_mere) != "" ? intval($this->id_mere) : 0;
|
||||||
|
$this->visible = ($this->visible) != "" ? intval($this->visible) : 0;
|
||||||
|
|
||||||
if ($this->already_exists())
|
if ($this->already_exists())
|
||||||
{
|
{
|
||||||
@ -222,7 +227,7 @@ class Categorie
|
|||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'categorie_association';
|
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'categorie_association';
|
||||||
$sql .= ' WHERE fk_categorie_fille = "'.$this->id.'"';
|
$sql.= ' WHERE fk_categorie_fille = '.$this->id;
|
||||||
|
|
||||||
dol_syslog("Categorie::update sql=".$sql);
|
dol_syslog("Categorie::update sql=".$sql);
|
||||||
if (! $this->db->query($sql))
|
if (! $this->db->query($sql))
|
||||||
@ -235,7 +240,7 @@ class Categorie
|
|||||||
if($this->id_mere !="" && $this->id_mere!=$this->id)
|
if($this->id_mere !="" && $this->id_mere!=$this->id)
|
||||||
{
|
{
|
||||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'categorie_association(fk_categorie_mere,fk_categorie_fille)';
|
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'categorie_association(fk_categorie_mere,fk_categorie_fille)';
|
||||||
$sql .= ' VALUES ("'.$this->id_mere.'","'.$this->id.'")';
|
$sql.= ' VALUES ('.$this->id_mere.', '.$this->id.')';
|
||||||
|
|
||||||
dol_syslog("Categorie::update sql=".$sql);
|
dol_syslog("Categorie::update sql=".$sql);
|
||||||
if (! $this->db->query($sql))
|
if (! $this->db->query($sql))
|
||||||
@ -284,6 +289,7 @@ class Categorie
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete a category from database
|
* Delete a category from database
|
||||||
|
*
|
||||||
* @param user Object user that ask to delete
|
* @param user Object user that ask to delete
|
||||||
*/
|
*/
|
||||||
function delete($user)
|
function delete($user)
|
||||||
@ -570,7 +576,7 @@ class Categorie
|
|||||||
function get_desc($cate)
|
function get_desc($cate)
|
||||||
{
|
{
|
||||||
$sql = "SELECT description FROM ".MAIN_DB_PREFIX."categorie ";
|
$sql = "SELECT description FROM ".MAIN_DB_PREFIX."categorie ";
|
||||||
$sql .= "WHERE rowid = '".$cate."'";
|
$sql .= "WHERE rowid = ".$cate;
|
||||||
|
|
||||||
$res = $this->db->query($sql);
|
$res = $this->db->query($sql);
|
||||||
$n = $this->db->fetch_array($res);
|
$n = $this->db->fetch_array($res);
|
||||||
@ -943,7 +949,7 @@ class Categorie
|
|||||||
{
|
{
|
||||||
if(sizeof($way)<$primary_way["taille"] || $primary_way["taille"]<0)
|
if(sizeof($way)<$primary_way["taille"] || $primary_way["taille"]<0)
|
||||||
{
|
{
|
||||||
$primary_way["taille"] = sizeOf($way);
|
$primary_way["taille"] = count($way);
|
||||||
$primary_way["chemin"] = $way;
|
$primary_way["chemin"] = $way;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1021,7 +1027,7 @@ class Categorie
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sizeof ($ways) == 0)
|
if (count($ways) == 0)
|
||||||
$ways[0][0] = $this;
|
$ways[0][0] = $this;
|
||||||
|
|
||||||
return $ways;
|
return $ways;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -19,8 +19,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/comm/remise.php
|
* \file htdocs/comm/remise.php
|
||||||
* \ingroup societe
|
* \ingroup societe
|
||||||
* \brief Onglet remise de la societe
|
* \brief Page to edit relative discount of a customer
|
||||||
* \version $Id: remise.php,v 1.35 2011/08/03 00:46:27 eldy Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
@ -31,25 +30,43 @@ $langs->load("companies");
|
|||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|
||||||
$_socid = $_GET["id"];
|
$socid = GETPOST("id");
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
{
|
{
|
||||||
$_socid = $user->societe_id;
|
$socid = $user->societe_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($_POST["action"] == 'setremise')
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (GETPOST('cancel') && GETPOST('backtopage'))
|
||||||
|
{
|
||||||
|
Header("Location: ".GETPOST("backtopage"));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GETPOST("action") == 'setremise')
|
||||||
{
|
{
|
||||||
$soc = New Societe($db);
|
$soc = New Societe($db);
|
||||||
$soc->fetch($_GET["id"]);
|
$soc->fetch($_GET["id"]);
|
||||||
$result=$soc->set_remise_client($_POST["remise"],$_POST["note"],$user);
|
$result=$soc->set_remise_client($_POST["remise"],$_POST["note"],$user);
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
|
{
|
||||||
|
if (GETPOST('backtopage'))
|
||||||
|
{
|
||||||
|
Header("Location: ".GETPOST('backtopage'));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
Header("Location: remise.php?id=".$_GET["id"]);
|
Header("Location: remise.php?id=".$_GET["id"]);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$errmesg=$soc->error;
|
$errmesg=$soc->error;
|
||||||
@ -71,21 +88,15 @@ llxHeader();
|
|||||||
* Mode fiche
|
* Mode fiche
|
||||||
*
|
*
|
||||||
*********************************************************************************/
|
*********************************************************************************/
|
||||||
if ($_socid > 0)
|
if ($socid > 0)
|
||||||
{
|
{
|
||||||
// On recupere les donnees societes par l'objet
|
// On recupere les donnees societes par l'objet
|
||||||
$objsoc = new Societe($db);
|
$objsoc = new Societe($db);
|
||||||
$objsoc->id=$_socid;
|
$objsoc->id=$socid;
|
||||||
$objsoc->fetch($_socid,$to);
|
$objsoc->fetch($socid);
|
||||||
|
|
||||||
if ($errmesg)
|
dol_htmloutput_errors($errmesg);
|
||||||
{
|
|
||||||
print '<div class="error">'.$errmesg.'</div><br>';
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Affichage onglets
|
|
||||||
*/
|
|
||||||
$head = societe_prepare_head($objsoc);
|
$head = societe_prepare_head($objsoc);
|
||||||
|
|
||||||
dol_fiche_head($head, 'relativediscount', $langs->trans("ThirdParty"),0,'company');
|
dol_fiche_head($head, 'relativediscount', $langs->trans("ThirdParty"),0,'company');
|
||||||
@ -111,6 +122,7 @@ if ($_socid > 0)
|
|||||||
print '<form method="POST" action="remise.php?id='.$objsoc->id.'">';
|
print '<form method="POST" action="remise.php?id='.$objsoc->id.'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="setremise">';
|
print '<input type="hidden" name="action" value="setremise">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.GETPOST('backtopage').'">';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
@ -122,13 +134,21 @@ if ($_socid > 0)
|
|||||||
print '<tr><td colspan="2" width="25%">';
|
print '<tr><td colspan="2" width="25%">';
|
||||||
print $langs->trans("NoteReason").'</td><td colspan="2"><input type="text" size="60" name="note" value="'.$_POST["note"].'"></td></tr>';
|
print $langs->trans("NoteReason").'</td><td colspan="2"><input type="text" size="60" name="note" value="'.$_POST["note"].'"></td></tr>';
|
||||||
|
|
||||||
print '<tr><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
|
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
|
print '<center>';
|
||||||
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
|
if (GETPOST("backtopage"))
|
||||||
|
{
|
||||||
|
print ' ';
|
||||||
|
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
|
}
|
||||||
|
print '</center>';
|
||||||
|
|
||||||
print "</form>";
|
print "</form>";
|
||||||
|
|
||||||
print "</div>\n";
|
dol_fiche_end();
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
@ -180,5 +200,5 @@ if ($_socid > 0)
|
|||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date: 2011/08/03 00:46:27 $ - $Revision: 1.35 $');
|
llxFooter();
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -21,7 +21,6 @@
|
|||||||
* \file htdocs/comm/remx.php
|
* \file htdocs/comm/remx.php
|
||||||
* \ingroup societe
|
* \ingroup societe
|
||||||
* \brief Page to edit absolute discounts for a customer
|
* \brief Page to edit absolute discounts for a customer
|
||||||
* \version $Id: remx.php,v 1.53 2011/08/04 21:46:51 eldy Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
@ -34,10 +33,10 @@ $langs->load("bills");
|
|||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$_socid = $_GET["id"];
|
$socid = GETPOST("id");
|
||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
{
|
{
|
||||||
$_socid = $user->societe_id;
|
$socid = $user->societe_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -205,16 +204,16 @@ if (GETPOST("action") == 'confirm_remove' && GETPOST("confirm")=='yes')
|
|||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
$facturestatic=new Facture($db);
|
$facturestatic=new Facture($db);
|
||||||
|
|
||||||
llxHeader();
|
llxHeader('',$langs->trans("GlobalDiscount"));
|
||||||
|
|
||||||
if ($_socid > 0)
|
if ($socid > 0)
|
||||||
{
|
{
|
||||||
dol_htmloutput_mesg($mesg);
|
dol_htmloutput_mesg($mesg);
|
||||||
|
|
||||||
// On recupere les donnees societes par l'objet
|
// On recupere les donnees societes par l'objet
|
||||||
$objsoc = new Societe($db);
|
$objsoc = new Societe($db);
|
||||||
$objsoc->id=$_socid;
|
$objsoc->id=$socid;
|
||||||
$objsoc->fetch($_socid,$to);
|
$objsoc->fetch($socid);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Affichage onglets
|
* Affichage onglets
|
||||||
@ -257,10 +256,10 @@ if ($_socid > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<tr><td width="38%">'.$langs->trans("CustomerAbsoluteDiscountAllUsers").'</td>';
|
print '<tr><td width="38%">'.$langs->trans("CustomerAbsoluteDiscountAllUsers").'</td>';
|
||||||
print '<td>'.$remise_all.' '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
print '<td>'.$remise_all.' '.$langs->trans("Currency".$conf->monnaie).' '.$langs->trans("HT").'</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("CustomerAbsoluteDiscountMy").'</td>';
|
print '<tr><td>'.$langs->trans("CustomerAbsoluteDiscountMy").'</td>';
|
||||||
print '<td>'.$remise_user.' '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
print '<td>'.$remise_user.' '.$langs->trans("Currency".$conf->monnaie).' '.$langs->trans("HT").'</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
@ -270,23 +269,25 @@ if ($_socid > 0)
|
|||||||
print '<td><input type="text" size="5" name="amount_ht" value="'.$_POST["amount_ht"].'"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
print '<td><input type="text" size="5" name="amount_ht" value="'.$_POST["amount_ht"].'"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||||
print '<tr><td width="38%">'.$langs->trans("VAT").'</td>';
|
print '<tr><td width="38%">'.$langs->trans("VAT").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $form->load_tva('tva_tx','0','',$mysoc,'');
|
print $form->load_tva('tva_tx',GETPOST('tva_tx'),'',$mysoc,'');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("NoteReason").'</td>';
|
print '<tr><td>'.$langs->trans("NoteReason").'</td>';
|
||||||
print '<td><input type="text" size="60" name="desc" value="'.$_POST["desc"].'"></td></tr>';
|
print '<td><input type="text" size="60" name="desc" value="'.$_POST["desc"].'"></td></tr>';
|
||||||
|
|
||||||
print '<tr><td align="center" colspan="2">';
|
print "</table>";
|
||||||
|
|
||||||
|
print '<center>';
|
||||||
print '<input type="submit" class="button" name="submit" value="'.$langs->trans("AddGlobalDiscount").'">';
|
print '<input type="submit" class="button" name="submit" value="'.$langs->trans("AddGlobalDiscount").'">';
|
||||||
if (GETPOST("backtopage"))
|
if (GETPOST("backtopage"))
|
||||||
{
|
{
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</center>';
|
||||||
|
|
||||||
print "</table></form>";
|
print '</form>';
|
||||||
|
|
||||||
print "</div>\n";
|
dol_fiche_end();
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
@ -538,5 +539,5 @@ if ($_socid > 0)
|
|||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date: 2011/08/04 21:46:51 $ - $Revision: 1.53 $');
|
llxFooter();
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -734,14 +734,33 @@ if ($action == 'add' && $user->rights->facture->creer)
|
|||||||
if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines();
|
if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines();
|
||||||
|
|
||||||
$fk_parent_line=0;
|
$fk_parent_line=0;
|
||||||
$num=sizeof($lines);
|
$num=count($lines);
|
||||||
|
|
||||||
for ($i=0;$i<$num;$i++)
|
for ($i=0;$i<$num;$i++)
|
||||||
{
|
{
|
||||||
if ($lines[$i]->subprice < 0)
|
if ($lines[$i]->subprice < 0)
|
||||||
{
|
{
|
||||||
// Negative line, we create a discount line
|
// Negative line, we create a discount line
|
||||||
// TODO
|
$discount = new DiscountAbsolute($db);
|
||||||
|
$discount->fk_soc=$object->socid;
|
||||||
|
$discount->amount_ht=abs($lines[$i]->total_ht);
|
||||||
|
$discount->amount_tva=abs($lines[$i]->total_tva);
|
||||||
|
$discount->amount_ttc=abs($lines[$i]->total_ttc);
|
||||||
|
$discount->tva_tx=$lines[$i]->tva_tx;
|
||||||
|
$discount->fk_user=$user->id;
|
||||||
|
$discount->description=$desc;
|
||||||
|
$discountid=$discount->create($user);
|
||||||
|
if ($discountid > 0)
|
||||||
|
{
|
||||||
|
$result=$object->insert_discount($discountid);
|
||||||
|
//$result=$discount->link_to_invoice($lineid,$id);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$mesg=$discount->error;
|
||||||
|
$error++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -791,8 +810,13 @@ if ($action == 'add' && $user->rights->facture->creer)
|
|||||||
$fk_parent_line
|
$fk_parent_line
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($result < 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
|
$lineid=$result;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$lineid=0;
|
||||||
$error++;
|
$error++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -956,7 +980,7 @@ if (($action == 'addline' || $action == 'addline_predef') && $user->rights->fact
|
|||||||
}
|
}
|
||||||
|
|
||||||
$desc = $prod->description;
|
$desc = $prod->description;
|
||||||
$desc.= ($prod->description && $_POST['np_desc']) ? ((dol_textishtml($prod->description) || dol_textishtml($_POST['np_desc']))?"<br />\n":"\n") : "";
|
$desc.= ($prod->description && $_POST['np_desc']) ? ((dol_textishtml($prod->description) || dol_textishtml($_POST['np_desc']))?"<br>\n":"\n") : "";
|
||||||
$desc.= $_POST['np_desc'];
|
$desc.= $_POST['np_desc'];
|
||||||
if (! empty($prod->customcode) || ! empty($prod->country_code))
|
if (! empty($prod->customcode) || ! empty($prod->country_code))
|
||||||
{
|
{
|
||||||
@ -965,7 +989,7 @@ if (($action == 'addline' || $action == 'addline_predef') && $user->rights->fact
|
|||||||
if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - ';
|
if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - ';
|
||||||
if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0);
|
if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0);
|
||||||
$tmptxt.=')';
|
$tmptxt.=')';
|
||||||
$desc.= (dol_textishtml($desc)?"<br />\n":"\n").$tmptxt;
|
$desc.= (dol_textishtml($desc)?"<br>\n":"\n").$tmptxt;
|
||||||
}
|
}
|
||||||
$type = $prod->type;
|
$type = $prod->type;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -236,7 +236,7 @@ class Facture extends CommonObject
|
|||||||
$sql.= ", ".$conf->entity;
|
$sql.= ", ".$conf->entity;
|
||||||
$sql.= ", '".$this->type."'";
|
$sql.= ", '".$this->type."'";
|
||||||
$sql.= ", '".$socid."'";
|
$sql.= ", '".$socid."'";
|
||||||
$sql.= ", ".$this->db->idate($now);
|
$sql.= ", '".$this->db->idate($now)."'";
|
||||||
$sql.= ", '".$totalht."'";
|
$sql.= ", '".$totalht."'";
|
||||||
$sql.= ",".($this->remise_absolue>0?$this->remise_absolue:'NULL');
|
$sql.= ",".($this->remise_absolue>0?$this->remise_absolue:'NULL');
|
||||||
$sql.= ",".($this->remise_percent>0?$this->remise_percent:'NULL');
|
$sql.= ",".($this->remise_percent>0?$this->remise_percent:'NULL');
|
||||||
|
|||||||
@ -55,7 +55,9 @@ if ($_POST["action"] == "builddoc" && $user->rights->facture->lire)
|
|||||||
require_once(DOL_DOCUMENT_ROOT."/includes/fpdf/fpdfi/fpdi.php");
|
require_once(DOL_DOCUMENT_ROOT."/includes/fpdf/fpdfi/fpdi.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php');
|
require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php');
|
||||||
|
|
||||||
$factures = dol_dir_list($conf->facture->dir_output,'all',1,implode('\.pdf|',$_POST['toGenerate']).'\.pdf','\.meta$|\.png','date',SORT_DESC) ;
|
$arrayofexclusion=array();
|
||||||
|
foreach($_POST['toGenerate'] as $tmppdf) $arrayofexclusion[]=preg_quote($tmppdf.'.pdf','/');
|
||||||
|
$factures = dol_dir_list($conf->facture->dir_output,'all',1,implode('|',$arrayofexclusion),'\.meta$|\.png','date',SORT_DESC);
|
||||||
|
|
||||||
// liste les fichiers
|
// liste les fichiers
|
||||||
$files = array() ;
|
$files = array() ;
|
||||||
|
|||||||
@ -553,7 +553,7 @@ if ($conf->don->enabled && $user->rights->societe->lire)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<tr '.$bc[$var].'><td colspan="2">'.$langs->trans("None").'</td></tr>';
|
print '<tr '.$bc[$var].'><td colspan="4">'.$langs->trans("None").'</td></tr>';
|
||||||
}
|
}
|
||||||
print '</table><br>';
|
print '</table><br>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -361,7 +361,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
print '<td>'.$langs->trans('Comments').'</td></tr>';
|
print '<td>'.$langs->trans('Comments').'</td></tr>';
|
||||||
|
|
||||||
$rowspan=5;
|
$rowspan=5;
|
||||||
if ($conf->use_javascript_ajax) $rowspan++;
|
if ($conf->use_javascript_ajax && !empty($conf->global->MAIN_JS_ON_PAYMENT)) $rowspan++;
|
||||||
|
|
||||||
// Payment mode
|
// Payment mode
|
||||||
print '<tr><td><span class="fieldrequired">'.$langs->trans('PaymentMode').'</span></td><td>';
|
print '<tr><td><span class="fieldrequired">'.$langs->trans('PaymentMode').'</span></td><td>';
|
||||||
|
|||||||
@ -288,9 +288,9 @@ if (sizeof($amount))
|
|||||||
|
|
||||||
// Other stats
|
// Other stats
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if ($conf->propal->enabled && $key>0) print ' <a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("ProposalStats"),"stats").'</a> ';
|
if ($conf->propal->enabled && $key>0) print ' <a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("ProposalStats"),"stats").'</a> ';
|
||||||
if ($conf->commande->enabled && $key>0) print ' <a href="'.DOL_URL_ROOT.'/commande/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("OrderStats"),"stats").'</a> ';
|
if ($conf->commande->enabled && $key>0) print ' <a href="'.DOL_URL_ROOT.'/commande/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("OrderStats"),"stats").'</a> ';
|
||||||
if ($conf->facture->enabled && $key>0) print ' <a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("InvoiceStats"),"stats").'</a> ';
|
if ($conf->facture->enabled && $key>0) print ' <a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("InvoiceStats"),"stats").'</a> ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@ -167,7 +167,7 @@ if ($resql)
|
|||||||
$arrayofoperators=array('<'=>'<','>'=>'>');
|
$arrayofoperators=array('<'=>'<','>'=>'>');
|
||||||
print $form->selectarray('filter_op1',$arrayofoperators,$_REQUEST['filter_op1'],1);
|
print $form->selectarray('filter_op1',$arrayofoperators,$_REQUEST['filter_op1'],1);
|
||||||
print ' ';
|
print ' ';
|
||||||
$filter_date1=dol_mktime(0,0,0,$_REQUEST['op1month'],$_REQUEST['op1day'],$_REQUEST['"op1year']);
|
$filter_date1=dol_mktime(0,0,0,$_REQUEST['op1month'],$_REQUEST['op1day'],$_REQUEST['op1year']);
|
||||||
print $form->select_date($filter_date1,'op1',0,0,1);
|
print $form->select_date($filter_date1,'op1',0,0,1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre" align="center">';
|
print '<td class="liste_titre" align="center">';
|
||||||
|
|||||||
@ -34,6 +34,7 @@ class DiscountAbsolute
|
|||||||
var $error;
|
var $error;
|
||||||
|
|
||||||
var $id; // Id remise
|
var $id; // Id remise
|
||||||
|
var $fk_soc;
|
||||||
var $amount_ht; //
|
var $amount_ht; //
|
||||||
var $amount_tva; //
|
var $amount_tva; //
|
||||||
var $amount_ttc; //
|
var $amount_ttc; //
|
||||||
|
|||||||
@ -255,7 +255,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
|
|||||||
{
|
{
|
||||||
$sql = "SELECT code_client FROM ".MAIN_DB_PREFIX."societe";
|
$sql = "SELECT code_client FROM ".MAIN_DB_PREFIX."societe";
|
||||||
$sql.= " WHERE code_client = '".$code."'";
|
$sql.= " WHERE code_client = '".$code."'";
|
||||||
$sql.= " AND rowid != '".$soc->id."'";
|
if ($soc->id > 0) $sql.= " AND rowid != ".$soc->id;
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
@ -203,7 +203,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
|
|||||||
{
|
{
|
||||||
$sql = "SELECT code_client FROM ".MAIN_DB_PREFIX."societe";
|
$sql = "SELECT code_client FROM ".MAIN_DB_PREFIX."societe";
|
||||||
$sql.= " WHERE code_client = '".$code."'";
|
$sql.= " WHERE code_client = '".$code."'";
|
||||||
$sql.= " AND rowid != '".$soc->id."'";
|
if ($soc->id > 0) $sql.= " AND rowid != ".$soc->id;
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
@ -60,8 +60,6 @@ ALTER TABLE llx_facture_fourn ADD COLUMN ref_ext varchar(30) AFTER entity;
|
|||||||
ALTER TABLE llx_commande_fournisseur ADD COLUMN ref_ext varchar(30) AFTER entity;
|
ALTER TABLE llx_commande_fournisseur ADD COLUMN ref_ext varchar(30) AFTER entity;
|
||||||
ALTER TABLE llx_adherent ADD COLUMN ref_ext varchar(30) after entity;
|
ALTER TABLE llx_adherent ADD COLUMN ref_ext varchar(30) after entity;
|
||||||
|
|
||||||
ALTER TABLE llx_commande ADD COLUMN fk_demand_reason integer AFTER fk_availability;
|
|
||||||
|
|
||||||
ALTER TABLE llx_facturedet DROP INDEX uk_fk_remise_except;
|
ALTER TABLE llx_facturedet DROP INDEX uk_fk_remise_except;
|
||||||
ALTER TABLE llx_facturedet ADD UNIQUE INDEX uk_fk_remise_except (fk_remise_except, fk_facture);
|
ALTER TABLE llx_facturedet ADD UNIQUE INDEX uk_fk_remise_except (fk_remise_except, fk_facture);
|
||||||
|
|
||||||
@ -115,6 +113,8 @@ INSERT INTO llx_c_availability (rowid,code,label,active) VALUES (2, 'AV_1W', '1
|
|||||||
INSERT INTO llx_c_availability (rowid,code,label,active) VALUES (3, 'AV_2W', '2 weeks', 1);
|
INSERT INTO llx_c_availability (rowid,code,label,active) VALUES (3, 'AV_2W', '2 weeks', 1);
|
||||||
INSERT INTO llx_c_availability (rowid,code,label,active) VALUES (4, 'AV_3W', '3 weeks', 1);
|
INSERT INTO llx_c_availability (rowid,code,label,active) VALUES (4, 'AV_3W', '3 weeks', 1);
|
||||||
|
|
||||||
|
ALTER TABLE llx_commande ADD COLUMN fk_demand_reason integer AFTER fk_availability;
|
||||||
|
|
||||||
ALTER TABLE llx_propaldet ADD INDEX idx_propaldet_fk_product (fk_product);
|
ALTER TABLE llx_propaldet ADD INDEX idx_propaldet_fk_product (fk_product);
|
||||||
ALTER TABLE llx_commandedet ADD INDEX idx_commandedet_fk_product (fk_product);
|
ALTER TABLE llx_commandedet ADD INDEX idx_commandedet_fk_product (fk_product);
|
||||||
ALTER TABLE llx_facturedet ADD INDEX idx_facturedet_fk_product (fk_product);
|
ALTER TABLE llx_facturedet ADD INDEX idx_facturedet_fk_product (fk_product);
|
||||||
@ -487,3 +487,6 @@ ALTER TABLE llx_user ADD civilite varchar(6) after entity;
|
|||||||
|
|
||||||
ALTER TABLE llx_element_element MODIFY sourcetype varchar(32) NOT NULL;
|
ALTER TABLE llx_element_element MODIFY sourcetype varchar(32) NOT NULL;
|
||||||
ALTER TABLE llx_element_element MODIFY targettype varchar(32) NOT NULL;
|
ALTER TABLE llx_element_element MODIFY targettype varchar(32) NOT NULL;
|
||||||
|
|
||||||
|
ALTER TABLE llx_societe_prices MODIFY tms timestamp NULL;
|
||||||
|
-- ALTER TABLE llx_societe_prices ALTER COLUMN tms DROP NOT NULL;
|
||||||
|
|||||||
@ -21,7 +21,7 @@ create table llx_societe_prices
|
|||||||
(
|
(
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
fk_soc integer DEFAULT 0,
|
fk_soc integer DEFAULT 0,
|
||||||
tms timestamp NOT NULL,
|
tms timestamp,
|
||||||
datec datetime,
|
datec datetime,
|
||||||
fk_user_author integer,
|
fk_user_author integer,
|
||||||
price_level tinyint DEFAULT 1
|
price_level tinyint DEFAULT 1
|
||||||
|
|||||||
@ -308,7 +308,7 @@ $var=false;
|
|||||||
$valid=true;
|
$valid=true;
|
||||||
if (! empty($conf->global->PAYPAL_SECURITY_TOKEN) )
|
if (! empty($conf->global->PAYPAL_SECURITY_TOKEN) )
|
||||||
{
|
{
|
||||||
$token = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN . $SOURCE . $ref, 2);
|
$token = $conf->global->PAYPAL_SECURITY_TOKEN;
|
||||||
if ($SECUREKEY != $token) $valid=false;
|
if ($SECUREKEY != $token) $valid=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1329,15 +1329,17 @@ class Societe extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($this->id)
|
if ($this->id)
|
||||||
{
|
{
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."societe ";
|
||||||
$sql .= " SET price_level = '".$price_level."'";
|
$sql .= " SET price_level = '".$price_level."'";
|
||||||
$sql .= " WHERE rowid = " . $this->id .";";
|
$sql .= " WHERE rowid = " . $this->id;
|
||||||
|
|
||||||
$this->db->query($sql);
|
$this->db->query($sql);
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_prices ";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_prices ";
|
||||||
$sql .= " ( datec, fk_soc, price_level, fk_user_author )";
|
$sql .= " ( datec, fk_soc, price_level, fk_user_author )";
|
||||||
$sql .= " VALUES (".$this->db->idate(mktime()).",".$this->id.",'".$price_level."',".$user->id.")";
|
$sql .= " VALUES ('".$this->db->idate($now)."',".$this->id.",'".$price_level."',".$user->id.")";
|
||||||
|
|
||||||
if (! $this->db->query($sql) )
|
if (! $this->db->query($sql) )
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user