Some debug with pgsql

This commit is contained in:
eldy 2013-03-17 14:28:57 +01:00
parent ca96bd6467
commit 1d09e122c0
7 changed files with 28 additions and 12 deletions

View File

@ -1,5 +1,7 @@
<?php
/*
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
@ -17,7 +19,7 @@
/**
* \file htdocs/admin/carrier.php
* \ingroup expedition
* \brief Page d'administration des Transporteurs
* \brief Page to setup carriers. TODO Delete this page. We mut use dictionnary instead.
*/
require '../main.inc.php';

View File

@ -81,7 +81,9 @@ class Expedition extends CommonObject
var $total_localtax1; // Total Local tax 1
var $total_localtax2; // Total Local tax 2
var $listmeths; // List of carriers
/**
* Constructor
*
@ -1175,12 +1177,14 @@ class Expedition extends CommonObject
/**
* Fetch all deliveries method and return an array. Load array this->listmeths.
*
* @param id $id only this carrier, all if none
* @return void
*/
function list_delivery_methods($id='')
{
global $langs;
$listmeths = array();
$i=0;
@ -1220,6 +1224,7 @@ class Expedition extends CommonObject
$i++;
}
}
else dol_print_error($this->db,'');
}
/**
@ -1231,8 +1236,8 @@ class Expedition extends CommonObject
{
if ($id=='')
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."c_shipment_mode (rowid, code, libelle, description, tracking)";
$sql.=" VALUES ('','".$this->update[code]."','".$this->update[libelle]."','".$this->update[description]."','".$this->update[tracking]."')";
$sql = "INSERT INTO ".MAIN_DB_PREFIX."c_shipment_mode (code, libelle, description, tracking)";
$sql.=" VALUES ('".$this->update[code]."','".$this->update[libelle]."','".$this->update[description]."','".$this->update[tracking]."')";
$resql = $this->db->query($sql);
}
else
@ -1245,7 +1250,7 @@ class Expedition extends CommonObject
$sql.= " WHERE rowid=".$id;
$resql = $this->db->query($sql);
}
if ($resql < 0) dol_print_error($this->db,'');
}
/**

View File

@ -12,8 +12,7 @@
-- To restrict request to Mysql version x.y use -- VMYSQLx.y
-- To restrict request to Pgsql version x.y use -- VPGSQLx.y
-- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
-- To make pk to be auto increment (postgres) VPGSQL8.2 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid INTEGER SERIAL PRIMARY KEY;
-- To make pk to be auto increment (postgres) VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE
-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user);
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
@ -38,6 +37,7 @@ UPDATE llx_const set name='MAIN_INFO_SOCIETE_TOWN' where name='MAIN_INFO_SOCIETE
UPDATE llx_const set name='MAIN_INFO_SOCIETE_ZIP' where name='MAIN_INFO_SOCIETE_CP';
UPDATE llx_const set name='MAIN_INFO_SOCIETE_COUNTRY' where name='MAIN_INFO_SOCIETE_PAYS';
UPDATE llx_const set name='MAIN_INFO_SOCIETE_STATE' where name='MAIN_INFO_SOCIETE_DEPARTEMENT';
UPDATE llx_const set name='LIVRAISON_ADDON_NUMBER' where name='LIVRAISON_ADDON';
ALTER TABLE llx_user add COLUMN fk_user integer;
@ -84,9 +84,16 @@ alter table llx_societe_address CHANGE COLUMN cp zip varchar(10);
ALTER TABLE llx_c_shipment_mode ADD COLUMN tracking VARCHAR(256) NOT NULL DEFAULT '' AFTER description;
ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL;
--ALTER TABLE llx_c_shipment_mode DROP COLUMN CASCADE;
--ALTER TABLE llx_c_shipment_mode ADD COLUMN rowid INTEGER AUTO_INCREMENT PRIMARY KEY;
--ALTER TABLE llc_c_shipment_mode ADD COLUMN rowid SERIAL PRIMARY KEY;
--ALTER TABLE llx_c_shipment_mode ADD COLUMN rowid INTEGER AUTO_INCREMENT PRIMARY KEY;
-- VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
-- VPGSQL8.2 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid INTEGER SERIAL PRIMARY KEY;
-- VPGSQL8.2 DROP table llx_c_shipment_mode;
-- VPGSQL8.2 CREATE TABLE llx_c_shipment_mode (rowid SERIAL PRIMARY KEY, tms timestamp, code varchar(30) NOT NULL, libelle varchar(50) NOT NULL, description text, tracking varchar(256) NOT NULL, active integer DEFAULT 0, module varchar(32) NULL);
ALTER TABLE llx_stock_mouvement MODIFY COLUMN value real;

View File

@ -52,7 +52,7 @@ CREATE OR REPLACE FUNCTION dol_util_rebuild_sequences() RETURNS integer as $body
CREATE OR REPLACE FUNCTION dol_util_triggerall(DoEnable boolean) RETURNS integer AS $BODY$ DECLARE mytables RECORD; BEGIN FOR mytables IN SELECT relname FROM pg_class WHERE relhastriggers IS TRUE AND relkind = 'r' AND NOT relname LIKE 'pg_%' LOOP IF DoEnable THEN EXECUTE 'ALTER TABLE ' || mytables.relname || ' ENABLE TRIGGER ALL'; ELSE EXECUTE 'ALTER TABLE ' || mytables.relname || ' DISABLE TRIGGER ALL'; END IF; END LOOP; RETURN 1; END; $BODY$ LANGUAGE 'PLPGSQL';
-- Add triggers
-- Add triggers for timestamp fields
CREATE OR REPLACE FUNCTION update_modified_column_tms() RETURNS TRIGGER AS $$ BEGIN NEW.tms = now(); RETURN NEW; END; $$ LANGUAGE 'PLPGSQL';
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_accountingtransaction FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_actioncomm FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();

View File

@ -59,6 +59,7 @@ LinkToTrackYourPackage=Link to track your package
ShipmentCreationIsDoneFromOrder=For the moment, creation of a new shipment is done from the order card.
RelatedShippings=Related shippings
ShipmentLine=Shipment line
CarrierList=List of transporters
# Sending methods
SendingMethodCATCH=Catch by customer

View File

@ -59,6 +59,7 @@ LinkToTrackYourPackage=Lien pour suivi de votre colis
ShipmentCreationIsDoneFromOrder=Pour le moment, la création d'une nouvelle expédition se fait depuis la fiche commande.
RelatedShippings=Expédition(s) associée(s)
ShipmentLine=Ligne d'expédition
CarrierList=Liste des transporteurs
# Sending methods
SendingMethodCATCH=Enlèvement par le client

View File

@ -334,10 +334,10 @@ class Livraison extends CommonObject
if ($user->rights->expedition->livraison->valider)
{
if (! empty($conf->global->LIVRAISON_ADDON))
if (! empty($conf->global->LIVRAISON_ADDON_NUMBER))
{
// Definition du nom de module de numerotation de commande
$modName = $conf->global->LIVRAISON_ADDON;
$modName = $conf->global->LIVRAISON_ADDON_NUMBER;
if (is_readable(DOL_DOCUMENT_ROOT .'/core/modules/livraison/'.$modName.'.php'))
{