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

This commit is contained in:
Laurent Destailleur 2011-10-29 17:47:30 +02:00
commit d183265702
164 changed files with 3763 additions and 650 deletions

View File

@ -1,14 +0,0 @@
index.php
*.htaccess
*.settings
*.buildpath
*.project
*.cache
*.log
*.DS_Store
document
documents
DEBIAN
install.lock
*.patch
default.properties

View File

@ -22,6 +22,7 @@ For users:
- New: Can export into Excel 2007 format.
- New: Add hidden option CASHDESK_FORCE_STOCK_ON_BILL
- New: Can search on part of barcode into POS module.
- New: Cheques into cheques receipts are ordered by operation date.
- Fix: Can use POS module with several concurrent users.
For developers:

View File

@ -1,19 +0,0 @@
dolibarr-*.exe
dolibarr-*.tgz
dolibarr-*.zip
dolibarr-*.rpm
dolibarr-*.deb
makepack-google.conf
module_google-*.tgz
module_pibarcode-1.0.tgz
*.exe
*.tgz
*.torrent
*.zip
version-phpsane.txt
makepack-phpsane.conf
html
*.deb
*.dsc
*.tar.gz
*.changes

View File

@ -1,3 +0,0 @@
*.db
ca_dolibarr.key
doliwamptest.iss

View File

@ -1 +0,0 @@
spec

View File

@ -1 +0,0 @@
Thumbs.db

View File

@ -1,2 +0,0 @@
out.*
socpeople*

View File

@ -1 +0,0 @@
example*.pdf

View File

@ -1 +0,0 @@
Thumbs.db

View File

@ -1 +0,0 @@
*.db

View File

@ -1,10 +0,0 @@
google
.htaccess
.DS_Store
.documents
dolibarr_mail
demo_pwc
phpsane
test.php
custom
custom2

View File

@ -1 +0,0 @@
google.php

View File

@ -170,7 +170,7 @@ if ($action == 'classin')
llxHeader();
$html = new Form($db);
$form = new Form($db);
/*
* Action create
@ -191,17 +191,17 @@ if ($action == 'create')
print "<tr>";
print '<td width="25%" class="fieldrequired">'.$langs->trans("Type").'</td><td>';
print $html->select_type_fees(GETPOST("type"),'type',1);
print $form->select_type_fees(GETPOST("type"),'type',1);
print '</td></tr>';
print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("Person").'</td><td>';
print $html->select_users(GETPOST("fk_user"),'fk_user',1);
print $form->select_users(GETPOST("fk_user"),'fk_user',1);
print '</td></tr>';
print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
print $html->select_date($datec?$datec:-1,'','','','','add',1,1);
print $form->select_date($datec?$datec:-1,'','','','','add',1,1);
print '</td></tr>';
// Km
@ -210,7 +210,7 @@ if ($action == 'create')
// Company
print "<tr>";
print '<td>'.$langs->trans("CompanyVisited").'</td><td>';
print $html->select_societes(GETPOST("socid"),'socid','',1);
print $form->select_societes(GETPOST("socid"),'socid','',1);
print '</td></tr>';
// Public note
@ -272,18 +272,18 @@ else if ($id)
// Type
print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("Type").'</td><td>';
print $html->select_type_fees($_POST["type"]?$_POST["type"]:$object->type,'type',0);
print $form->select_type_fees($_POST["type"]?$_POST["type"]:$object->type,'type',0);
print '</td></tr>';
// Who
print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("Person").'</td><td>';
print $html->select_users($_POST["fk_user"]?$_POST["fk_user"]:$object->fk_user,'fk_user',0);
print $form->select_users($_POST["fk_user"]?$_POST["fk_user"]:$object->fk_user,'fk_user',0);
print '</td></tr>';
// Date
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
print $html->select_date($object->date,'','','','','update');
print $form->select_date($object->date,'','','','','update');
print '</td></tr>';
// Km
@ -294,7 +294,7 @@ else if ($id)
// Where
print "<tr>";
print '<td>'.$langs->trans("CompanyVisited").'</td><td>';
print $html->select_societes($soc->id,'socid','',1);
print $form->select_societes($soc->id,'socid','',1);
print '</td></tr>';
// Public note
@ -329,24 +329,19 @@ else if ($id)
*/
if ($action == 'delete')
{
$ret=$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete");
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete");
if ($ret == 'html') print '<br>';
}
$soc = new Societe($db);
if ($object->socid) $soc->fetch($object->socid);
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && $user->rights->deplacement->creer)
{
include(DOL_DOCUMENT_ROOT.'/core/tpl/ajaxeditinplace.tpl.php');
}
print '<table class="border" width="100%">';
// Ref
print "<tr>";
print '<td width="20%">'.$langs->trans("Ref").'</td><td>';
print $html->showrefnav($object,'id','',1,'rowid','ref','');
print $form->showrefnav($object,'id','',1,'rowid','ref','');
print '</td></tr>';
// Type
@ -361,12 +356,12 @@ else if ($id)
// Date
print '<tr><td>'.$langs->trans("Date").'</td><td>';
print dol_print_date($object->date,'day');
print $form->editInPlace($object->date, 'dated', $user->rights->deplacement->creer, 'datepicker');
print '</td></tr>';
// Km/Price
print '<tr><td>'.$langs->trans("FeesKilometersOrAmout").'</td>';
print '<td><div class="edit_numeric" id="km">'.$object->km.'</div></td></tr>';
print '<td>'.$form->editInPlace($object->km, 'km', $user->rights->deplacement->creer, 'numeric').'</td></tr>';
// Where
print '<tr><td>'.$langs->trans("CompanyVisited").'</td>';
@ -384,7 +379,7 @@ else if ($id)
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project');
print '</td>';
if ($action != 'classify')
if ($action != 'classify' && $user->rights->deplacement->creer)
{
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classify&amp;id='.$object->id.'">';
print img_edit($langs->trans('SetProject'),1);
@ -394,11 +389,11 @@ else if ($id)
print '</td><td colspan="3">';
if ($action == 'classify')
{
$html->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project,'projectid');
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project,'projectid');
}
else
{
$html->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project,'none');
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project,'none');
}
print '</td>';
print '</tr>';
@ -410,9 +405,7 @@ else if ($id)
// Public note
print '<tr><td valign="top">'.$langs->trans("NotePublic").'</td>';
print '<td valign="top" colspan="3">';
print '<div class="edit_area" id="note_public">';
print ($object->note_public ? dol_nl2br($object->note_public) : "&nbsp;");
print '</div>';
print $form->editInPlace($object->note_public, 'note_public', $user->rights->deplacement->creer, 'textarea');
print "</td></tr>";
// Private note
@ -420,9 +413,7 @@ else if ($id)
{
print '<tr><td valign="top">'.$langs->trans("NotePrivate").'</td>';
print '<td valign="top" colspan="3">';
print '<div class="edit_area" id="note">';
print ($object->note_private ? dol_nl2br($object->note_private) : "&nbsp;");
print '</div>';
print $form->editInPlace($object->note_private, 'note', $user->rights->deplacement->creer, 'textarea');
print "</td></tr>";
}

View File

@ -0,0 +1,595 @@
<?php
/* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compta/localtax/class/localtax.class.php
* \ingroup tax
* \author Laurent Destailleur
*/
require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
/**
* \class Localtax
* \brief Put here description of your class
*/
class localtax extends CommonObject
{
var $id;
var $ref;
var $tms;
var $datep;
var $datev;
var $amount;
var $label;
var $note;
var $fk_bank;
var $fk_user_creat;
var $fk_user_modif;
/**
* Constructor
*
* @param DoliDB $DB Database handler
*/
function __construct($DB)
{
$this->db = $DB;
}
/**
* Create in database
*
* @param User $user User that create
* @return int <0 if KO, >0 if OK
*/
function create($user)
{
global $conf, $langs;
// Clean parameters
$this->amount=trim($this->amount);
$this->label=trim($this->label);
$this->note=trim($this->note);
$this->fk_bank=trim($this->fk_bank);
$this->fk_user_creat=trim($this->fk_user_creat);
$this->fk_user_modif=trim($this->fk_user_modif);
// Insert request
$sql = "INSERT INTO ".MAIN_DB_PREFIX."localtax(";
$sql.= "tms,";
$sql.= "datep,";
$sql.= "datev,";
$sql.= "amount,";
$sql.= "label,";
$sql.= "note,";
$sql.= "fk_bank,";
$sql.= "fk_user_creat,";
$sql.= "fk_user_modif";
$sql.= ") VALUES (";
$sql.= " ".$this->db->idate($this->tms).",";
$sql.= " ".$this->db->idate($this->datep).",";
$sql.= " ".$this->db->idate($this->datev).",";
$sql.= " '".$this->amount."',";
$sql.= " '".$this->label."',";
$sql.= " '".$this->note."',";
$sql.= " ".($this->fk_bank <= 0 ? "NULL" : "'".$this->fk_bank."'").",";
$sql.= " '".$this->fk_user_creat."',";
$sql.= " '".$this->fk_user_modif."'";
$sql.= ")";
dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."localtax");
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('LOCALTAX_CREATE',$this,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers
return $this->id;
}
else
{
$this->error="Error ".$this->db->lasterror();
dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR);
return -1;
}
}
/**
* Update database
*
* @param User $user User that modify
* @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK
*/
function update($user=0, $notrigger=0)
{
global $conf, $langs;
// Clean parameters
$this->amount=trim($this->amount);
$this->label=trim($this->label);
$this->note=trim($this->note);
$this->fk_bank=trim($this->fk_bank);
$this->fk_user_creat=trim($this->fk_user_creat);
$this->fk_user_modif=trim($this->fk_user_modif);
// Update request
$sql = "UPDATE ".MAIN_DB_PREFIX."localtax SET";
$sql.= " tms=".$this->db->idate($this->tms).",";
$sql.= " datep=".$this->db->idate($this->datep).",";
$sql.= " datev=".$this->db->idate($this->datev).",";
$sql.= " amount='".$this->amount."',";
$sql.= " label='".$this->db->escape($this->label)."',";
$sql.= " note='".$this->db->escape($this->note)."',";
$sql.= " fk_bank='".$this->fk_bank."',";
$sql.= " fk_user_creat='".$this->fk_user_creat."',";
$sql.= " fk_user_modif='".$this->fk_user_modif."'";
$sql.= " WHERE rowid=".$this->id;
dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql)
{
$this->error="Error ".$this->db->lasterror();
dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR);
return -1;
}
if (! $notrigger)
{
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('LOCALTAX_MODIFY',$this,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers
}
return 1;
}
/**
* Load object in memory from database
*
* @param int $id Object id
* @return int <0 if KO, >0 if OK
*/
function fetch($id)
{
global $langs;
$sql = "SELECT";
$sql.= " t.rowid,";
$sql.= " t.tms,";
$sql.= " t.datep,";
$sql.= " t.datev,";
$sql.= " t.amount,";
$sql.= " t.label,";
$sql.= " t.note,";
$sql.= " t.fk_bank,";
$sql.= " t.fk_user_creat,";
$sql.= " t.fk_user_modif,";
$sql.= " b.fk_account,";
$sql.= " b.fk_type,";
$sql.= " b.rappro";
$sql.= " FROM ".MAIN_DB_PREFIX."localtax as t";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON t.fk_bank = b.rowid";
$sql.= " WHERE t.rowid = ".$id;
dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
if ($this->db->num_rows($resql))
{
$obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid;
$this->ref = $obj->rowid;
$this->tms = $this->db->jdate($obj->tms);
$this->datep = $this->db->jdate($obj->datep);
$this->datev = $this->db->jdate($obj->datev);
$this->amount = $obj->amount;
$this->label = $obj->label;
$this->note = $obj->note;
$this->fk_bank = $obj->fk_bank;
$this->fk_user_creat = $obj->fk_user_creat;
$this->fk_user_modif = $obj->fk_user_modif;
$this->fk_account = $obj->fk_account;
$this->fk_type = $obj->fk_type;
$this->rappro = $obj->rappro;
}
$this->db->free($resql);
return 1;
}
else
{
$this->error="Error ".$this->db->lasterror();
dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
return -1;
}
}
/**
* Delete object in database
*
* @param User $user User that delete
* @return int <0 if KO, >0 if OK
*/
function delete($user)
{
global $conf, $langs;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."localtax";
$sql.= " WHERE rowid=".$this->id;
dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql)
{
$this->error="Error ".$this->db->lasterror();
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);
return -1;
}
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('LOCALTAX_DELETE',$this,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers
return 1;
}
/**
* Initialise an instance with random values.
* Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/
function initAsSpecimen()
{
$this->id=0;
$this->tms='';
$this->datep='';
$this->datev='';
$this->amount='';
$this->label='';
$this->note='';
$this->fk_bank='';
$this->fk_user_creat='';
$this->fk_user_modif='';
}
/**
* Hum la fonction s'appelle 'Solde' elle doit a mon avis calcluer le solde de localtax, non ?
*
*/
function solde($year = 0)
{
$reglee = $this->localtax_sum_reglee($year);
$payee = $this->localtax_sum_payee($year);
$collectee = $this->localtax_sum_collectee($year);
$solde = $reglee - ($collectee - $payee);
return $solde;
}
/**
* Total de la localtax des factures emises par la societe.
*
*/
function localtax_sum_collectee($year = 0)
{
$sql = "SELECT sum(f.localtax) as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1";
if ($year)
{
$sql .= " AND f.datef >= '$year-01-01' AND f.datef <= '$year-12-31' ";
}
$result = $this->db->query($sql);
if ($result)
{
if ($this->db->num_rows($result))
{
$obj = $this->db->fetch_object($result);
return $obj->amount;
}
else
{
return 0;
}
$this->db->free($result);
}
else
{
print $this->db->error();
return -1;
}
}
/**
* localtax payed
*
*/
function localtax_sum_payee($year = 0)
{
$sql = "SELECT sum(f.total_localtax) as total_localtax";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
if ($year)
{
$sql .= " WHERE f.datef >= '$year-01-01' AND f.datef <= '$year-12-31' ";
}
$result = $this->db->query($sql);
if ($result)
{
if ($this->db->num_rows($result))
{
$obj = $this->db->fetch_object($result);
return $obj->total_localtax;
}
else
{
return 0;
}
$this->db->free();
}
else
{
print $this->db->error();
return -1;
}
}
/**
* localtax payed
* Total de la localtax payed
*
*/
function localtax_sum_reglee($year = 0)
{
$sql = "SELECT sum(f.amount) as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."localtax as f";
if ($year)
{
$sql .= " WHERE f.datev >= '$year-01-01' AND f.datev <= '$year-12-31' ";
}
$result = $this->db->query($sql);
if ($result)
{
if ($this->db->num_rows($result))
{
$obj = $this->db->fetch_object($result);
return $obj->amount;
}
else
{
return 0;
}
$this->db->free();
}
else
{
print $this->db->error();
return -1;
}
}
/**
* Add a payment of localtax
*
* @param User $user Object user that insert
* @return int <0 if KO, rowid in localtax table if OK
*/
function addPayment($user)
{
global $conf,$langs;
$this->db->begin();
// Check parameters
$this->amount=price2num($this->amount);
if (! $this->label)
{
$this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label"));
return -3;
}
if ($this->amount <= 0)
{
$this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
return -4;
}
if ($conf->banque->enabled && (empty($this->accountid) || $this->accountid <= 0))
{
$this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Account"));
return -5;
}
if ($conf->banque->enabled && (empty($this->paymenttype) || $this->paymenttype <= 0))
{
$this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode"));
return -5;
}
// Insertion dans table des paiement localtax
$sql = "INSERT INTO ".MAIN_DB_PREFIX."localtax (datep, datev, amount";
if ($this->note) $sql.=", note";
if ($this->label) $sql.=", label";
$sql.= ", fk_user_creat, fk_bank";
$sql.= ") ";
$sql.= " VALUES ('".$this->db->idate($this->datep)."',";
$sql.= "'".$this->db->idate($this->datev)."'," . $this->amount;
if ($this->note) $sql.=", '".$this->db->escape($this->note)."'";
if ($this->label) $sql.=", '".$this->db->escape($this->label)."'";
$sql.=", '".$user->id."', NULL";
$sql.= ")";
dol_syslog(get_class($this)."::addPayment sql=".$sql);
$result = $this->db->query($sql);
if ($result)
{
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."localtax"); // TODO devrait s'appeler paiementlocaltax
if ($this->id > 0)
{
$ok=1;
if ($conf->banque->enabled)
{
// Insertion dans llx_bank
require_once(DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php');
$acc = new Account($this->db);
$result=$acc->fetch($this->accountid);
if ($result <= 0) dol_print_error($db);
$bank_line_id = $acc->addline($this->datep, $this->paymenttype, $this->label, -abs($this->amount), '', '', $user);
// Mise a jour fk_bank dans llx_localtax. On connait ainsi la ligne de localtax qui a g<>n<EFBFBD>r<EFBFBD> l'<27>criture bancaire
if ($bank_line_id > 0)
{
$this->update_fk_bank($bank_line_id);
}
else
{
$this->error=$acc->error;
$ok=0;
}
// Mise a jour liens
$result=$acc->add_url_line($bank_line_id, $this->id, DOL_URL_ROOT.'/compta/localtax/fiche.php?id=', "(VATPayment)", "payment_vat");
if ($result < 0)
{
$this->error=$acc->error;
$ok=0;
}
}
if ($ok)
{
$this->db->commit();
return $this->id;
}
else
{
$this->db->rollback();
return -3;
}
}
else
{
$this->error=$this->db->error();
$this->db->rollback();
return -2;
}
}
else
{
$this->error=$this->db->error();
$this->db->rollback();
return -1;
}
}
/**
* Update the link betwen localtax payment and the line into llx_bank
*
* @param int $id Id bank account
* @return int <0 if KO, >0 if OK
*/
function update_fk_bank($id)
{
$sql = 'UPDATE llx_localtax set fk_bank = '.$id;
$sql.= ' WHERE rowid = '.$this->id;
$result = $this->db->query($sql);
if ($result)
{
return 1;
}
else
{
dol_print_error($this->db);
return -1;
}
}
/**
* Returns clickable name
*
* @param int $withpicto 0=Link, 1=Picto into link, 2=Picto
* @param string $option Sur quoi pointe le lien
* @return string Chaine avec URL
*/
function getNomUrl($withpicto=0, $option='')
{
global $langs;
$result='';
$lien = '<a href="'.DOL_URL_ROOT.'/compta/localtax/fiche.php?id='.$this->id.'">';
$lienfin='</a>';
$picto='payment';
$label=$langs->trans("ShowVatPayment").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
return $result;
}
}
?>

View File

@ -0,0 +1,299 @@
<?php
/* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compta/localtax/clients.php
* \ingroup tax
* \brief Third parties localtax report
*/
require('../../main.inc.php');
require_once(DOL_DOCUMENT_ROOT."/core/lib/report.lib.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/tax.lib.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
require_once(DOL_DOCUMENT_ROOT."/compta/localtax/class/localtax.class.php");
$langs->load("bills");
$langs->load("compta");
$langs->load("companies");
$langs->load("products");
// Date range
$year=GETPOST("year");
if (empty($year))
{
$year_current = strftime("%Y",dol_now());
$year_start = $year_current;
} else {
$year_current = $year;
$year_start = $year;
}
$date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]);
$date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]);
// Quarter
if (empty($date_start) || empty($date_end)) // We define date_start and date_end
{
$q=GETPOST("q");
if (empty($q))
{
if (isset($_REQUEST["month"])) { $date_start=dol_get_first_day($year_start,$_REQUEST["month"],false); $date_end=dol_get_last_day($year_start,$_REQUEST["month"],false); }
else
{
$month_current = strftime("%m",dol_now());
if ($month_current >= 10) $q=4;
elseif ($month_current >= 7) $q=3;
elseif ($month_current >= 4) $q=2;
else $q=1;
}
}
if ($q==1) { $date_start=dol_get_first_day($year_start,1,false); $date_end=dol_get_last_day($year_start,3,false); }
if ($q==2) { $date_start=dol_get_first_day($year_start,4,false); $date_end=dol_get_last_day($year_start,6,false); }
if ($q==3) { $date_start=dol_get_first_day($year_start,7,false); $date_end=dol_get_last_day($year_start,9,false); }
if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); }
}
$min = GETPOST("min");
if (empty($min)) $min = 0;
// Define modetax (0 or 1)
// 0=normal, 1=option vat for services is on debit
$modetax = $conf->global->TAX_MODE;
if (isset($_REQUEST["modetax"])) $modetax=$_REQUEST["modetax"];
// Security check
$socid = GETPOST("socid");
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'tax', '', '', 'charges');
/*
* View
*/
$html=new Form($db);
$company_static=new Societe($db);
$morequerystring='';
$listofparams=array('date_startmonth','date_startyear','date_startday','date_endmonth','date_endyear','date_endday');
foreach($listofparams as $param)
{
if (GETPOST($param)!='') $morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param);
}
llxHeader('','','','',0,0,'','',$morequerystring);
$fsearch.='<br>';
$fsearch.=' <input type="hidden" name="year" value="'.$year.'">';
$fsearch.=' <input type="hidden" name="modetax" value="'.$modetax.'">';
$fsearch.=' '.$langs->trans("SalesTurnover").' '.$langs->trans("Minimum").': ';
$fsearch.=' <input type="text" name="min" id="min" value="'.$min.'" size="6">';
// Affiche en-tete du rapport
if ($modetax==1) // Calculate on invoice for goods and services
{
$nom=$langs->transcountry("LT2ReportByCustomersInInputOutputMode",$mysoc->pays_code);
$period=$html->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$html->select_date($date_end,'date_end',0,0,0,'',1,0,1);
$description=$langs->trans("RulesVATDue");
if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
$description.=$fsearch;
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
$builddate=time();
$elementcust=$langs->trans("CustomersInvoices");
$productcust=$langs->trans("Description");
$amountcust=$langs->trans("AmountHT");
$elementsup=$langs->trans("SuppliersInvoices");
$productsup=$langs->trans("Description");
$amountsup=$langs->trans("AmountHT");
}
if ($modetax==0) // Invoice for goods, payment for services
{
$nom=$langs->transcountry("LT2ReportByCustomersInInputOutputMode",$mysoc->pays_code);
$period=$html->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$html->select_date($date_end,'date_end',0,0,0,'',1,0,1);
$description=$langs->trans("RulesVATIn");
if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
$description.=$fsearch;
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
$builddate=time();
$elementcust=$langs->trans("CustomersInvoices");
$productcust=$langs->trans("Description");
$amountcust=$langs->trans("AmountHT");
$elementsup=$langs->trans("SuppliersInvoices");
$productsup=$langs->trans("Description");
$amountsup=$langs->trans("AmountHT");
}
report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink);
$vatcust=$langs->transcountry("LT2",$mysoc->pays_code);
$vatsup=$langs->transcountry("LT2",$mysoc->pays_code);
// IRPF that the customer has retained me
print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">";
print '<td align="left">'.$langs->trans("Num")."</td>";
print '<td align="left">'.$langs->trans("Customer")."</td>";
print "<td>".$langs->transcountry("ProfId1",$mysoc->pays_code)."</td>";
print "<td align=\"right\">".$langs->trans("TotalHT")."</td>";
print "<td align=\"right\">".$vatcust."</td>";
print "</tr>\n";
$coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'sell');
if (is_array($coll_list))
{
$var=true;
$total = 0; $totalamount = 0;
$i = 1;
foreach($coll_list as $coll)
{
if(($min == 0 or ($min > 0 && $coll->amount > $min)) && $coll->localtax2>0)
{
$var=!$var;
$intra = str_replace($find,$replace,$coll->tva_intra);
if(empty($intra))
{
if($coll->assuj == '1')
{
$intra = $langs->trans('Unknown');
}
else
{
$intra = '';
}
}
print "<tr ".$bc[$var].">";
print "<td nowrap>".$i."</td>";
$company_static->id=$coll->socid;
$company_static->nom=$coll->nom;
print '<td nowrap>'.$company_static->getNomUrl(1).'</td>';
$find = array(' ','.');
$replace = array('','');
print "<td nowrap>".$intra."</td>";
print "<td nowrap align=\"right\">".price($coll->amount)."</td>";
print "<td nowrap align=\"right\">".price($coll->localtax2)."</td>";
$totalamount = $totalamount + $coll->amount;
$total = $total + $coll->localtax2;
print "</tr>\n";
$i++;
}
}
$x_coll_sum = $total;
print '<tr class="liste_total"><td align="right" colspan="3">'.$langs->trans("Total").':</td>';
print '<td nowrap align="right">'.price($totalamount).'</td>';
print '<td nowrap align="right">'.price($total).'</td>';
print '</tr>';
}
else
{
$langs->load("errors");
if ($coll_list == -1)
print '<tr><td colspan="5">'.$langs->trans("ErrorNoAccountancyModuleLoaded").'</td></tr>';
else if ($coll_list == -2)
print '<tr><td colspan="5">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>';
else
print '<tr><td colspan="5">'.$langs->trans("Error").'</td></tr>';
}
// IRPF I retained my supplier
print "<tr class=\"liste_titre\">";
print '<td align="left">'.$langs->trans("Num")."</td>";
print '<td align="left">'.$langs->trans("Supplier")."</td>";
print "<td>".$langs->transcountry("ProfId1",$mysoc->pays_code)."</td>";
print "<td align=\"right\">".$langs->trans("TotalHT")."</td>";
print "<td align=\"right\">".$vatsup."</td>";
print "</tr>\n";
$company_static=new Societe($db);
$coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'buy');
if (is_array($coll_list))
{
$var=true;
$total = 0; $totalamount = 0;
$i = 1;
foreach($coll_list as $coll)
{
if(($min == 0 or ($min > 0 && $coll->amount > $min)) && $coll->localtax2>0)
{
$var=!$var;
$intra = str_replace($find,$replace,$coll->tva_intra);
if(empty($intra))
{
if($coll->assuj == '1')
{
$intra = $langs->trans('Unknown');
}
else
{
$intra = '';
}
}
print "<tr $bc[$var]>";
print "<td nowrap>".$i."</td>";
$company_static->id=$coll->socid;
$company_static->nom=$coll->nom;
print '<td nowrap>'.$company_static->getNomUrl(1).'</td>';
$find = array(' ','.');
$replace = array('','');
print "<td nowrap>".$intra."</td>";
print "<td nowrap align=\"right\">".price($coll->amount)."</td>";
print "<td nowrap align=\"right\">".price($coll->localtax2)."</td>";
$totalamount = $totalamount + $coll->amount;
$total = $total + $coll->localtax2;
print "</tr>\n";
$i++;
}
}
$x_paye_sum = $total;
print '<tr class="liste_total"><td align="right" colspan="3">'.$langs->trans("Total").':</td>';
print '<td nowrap align="right">'.price($totalamount).'</td>';
print '<td nowrap align="right">'.price($total).'</td>';
print '</tr>';
print '</table>';
// Total to pay
print '<br><br>';
print '<table class="noborder" width="100%">';
$diff = $x_paye_sum;
print '<tr class="liste_total">';
print '<td class="liste_total" colspan="4">'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').'</td>';
print '<td class="liste_total" nowrap="nowrap" align="right"><b>'.price(price2num($diff,'MT'))."</b></td>\n";
print "</tr>\n";
}
else
{
$langs->load("errors");
if ($coll_list == -1)
print '<tr><td colspan="5">'.$langs->trans("ErrorNoAccountancyModuleLoaded").'</td></tr>';
else if ($coll_list == -2)
print '<tr><td colspan="5">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>';
else
print '<tr><td colspan="5">'.$langs->trans("Error").'</td></tr>';
}
print '</table>';
$db->close();
llxFooter();
?>

View File

@ -0,0 +1,266 @@
<?php
/* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compta/localtax/fiche.php
* \ingroup tax
* \brief Page of IRPF payments
*/
require('../../main.inc.php');
require_once(DOL_DOCUMENT_ROOT."/compta/localtax/class/localtax.class.php");
require_once(DOL_DOCUMENT_ROOT."/compta/bank/class/account.class.php");
$langs->load("compta");
$langs->load("banks");
$langs->load("bills");
$id=$_REQUEST["id"];
$mesg = '';
// Security check
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'tax', '', '', 'charges');
/*
* Actions
*/
//add payment of localtax
if ($_POST["action"] == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
{
$localtax = new localtax($db);
$db->begin();
$datev=dol_mktime(12,0,0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]);
$datep=dol_mktime(12,0,0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]);
$localtax->accountid=$_POST["accountid"];
$localtax->paymenttype=$_POST["paiementtype"];
$localtax->datev=$datev;
$localtax->datep=$datep;
$localtax->amount=$_POST["amount"];
$localtax->label=$_POST["label"];
$ret=$localtax->addPayment($user);
if ($ret > 0)
{
$db->commit();
Header("Location: reglement.php");
exit;
}
else
{
$db->rollback();
$mesg='<div class="error">'.$localtax->error.'</div>';
$_GET["action"]="create";
}
}
//delete payment of localtax
if ($_GET["action"] == 'delete')
{
$localtax = new localtax($db);
$result=$localtax->fetch($_GET['id']);
if ($localtax->rappro == 0)
{
$db->begin();
$ret=$localtax->delete($user);
if ($ret > 0)
{
if ($localtax->fk_bank)
{
$accountline=new AccountLine($db);
$result=$accountline->fetch($localtax->fk_bank);
$result=$accountline->delete($user);
}
if ($result > 0)
{
$db->commit();
header("Location: ".DOL_URL_ROOT.'/compta/localtax/reglement.php');
exit;
}
else
{
$localtax->error=$accountline->error;
$db->rollback();
$mesg='<div class="error">'.$localtax->error.'</div>';
}
}
else
{
$db->rollback();
$mesg='<div class="error">'.$localtax->error.'</div>';
}
}
else
{
$mesg='<div class="error">Error try do delete a line linked to a conciliated bank transaction</div>';
}
}
/*
* View
*/
llxHeader();
$html = new Form($db);
if ($id)
{
$vatpayment = new localtax($db);
$result = $vatpayment->fetch($id);
if ($result <= 0)
{
dol_print_error($db);
exit;
}
}
if ($_GET["action"] == 'create')
{
print "<form name='add' action=\"fiche.php\" method=\"post\">\n";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
print_fiche_titre($langs->transcountry("newLT2Payment",$mysoc->pays_code));
if ($mesg) print $mesg;
print '<table class="border" width="100%">';
print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("DatePayment").'</td><td>';
print $html->select_date($datep,"datep",'','','','add');
print '</td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("DateValue").'</td><td>';
print $html->select_date($datev,"datev",'','','','add');
print '</td></tr>';
// Label
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input name="label" size="40" value="'.($_POST["label"]?$_POST["label"]:$langs->transcountry("LT2Payment",$mysoc->pays_code)).'"></td></tr>';
// Amount
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.$_POST["amount"].'"></td></tr>';
if ($conf->banque->enabled)
{
print '<tr><td class="fieldrequired">'.$langs->trans("Account").'</td><td>';
$html->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant
print '</td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
$html->select_types_paiements($_POST["paiementtype"], "paiementtype");
print "</td>\n";
print "</tr>";
}
print '</table>';
print "<br>";
print '<center><input type="submit" class="button" value="'.$langs->trans("Save").'"> &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
print '</form>';
}
/* ************************************************************************** */
/* */
/* Barre d'action */
/* */
/* ************************************************************************** */
if ($id)
{
if ($mesg) print $mesg;
$h = 0;
$head[$h][0] = DOL_URL_ROOT.'/compta/localtax/fiche.php?id='.$vatpayment->id;
$head[$h][1] = $langs->trans('Card');
$head[$h][2] = 'card';
$h++;
dol_fiche_head($head, 'card', $langs->trans("VATPayment"), 0, 'payment');
print '<table class="border" width="100%">';
print "<tr>";
print '<td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $vatpayment->ref;
print '</td></tr>';
print "<tr>";
print '<td>'.$langs->trans("DatePayment").'</td><td colspan="3">';
print dol_print_date($vatpayment->datep,'day');
print '</td></tr>';
print '<tr><td>'.$langs->trans("DateValue").'</td><td colspan="3">';
print dol_print_date($vatpayment->datev,'day');
print '</td></tr>';
print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="3">'.price($vatpayment->amount).'</td></tr>';
if ($conf->banque->enabled)
{
if ($vatpayment->fk_account > 0)
{
$bankline=new AccountLine($db);
$bankline->fetch($vatpayment->fk_bank);
print '<tr>';
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
print '<td colspan="3">';
print $bankline->getNomUrl(1,0,'showall');
print '</td>';
print '</tr>';
}
}
print '</table>';
print '</div>';
/*
* Boutons d'actions
*/
print "<div class=\"tabsAction\">\n";
if ($vatpayment->rappro == 0)
print '<a class="butActionDelete" href="fiche.php?id='.$vatpayment->id.'&action=delete">'.$langs->trans("Delete").'</a>';
else
print '<a class="butActionRefused" href="#" title="'.$langs->trans("LinkedToAConcialitedTransaction").'">'.$langs->trans("Delete").'</a>';
print "</div>";
}
$db->close();
llxFooter();
?>

View File

@ -0,0 +1,219 @@
<?php
/* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compta/localtax/index.php
* \ingroup tax
* \brief Index page of IRPF reports
*/
require('../../main.inc.php');
require_once(DOL_DOCUMENT_ROOT."/core/lib/tax.lib.php");
require_once(DOL_DOCUMENT_ROOT."/compta/tva/class/tva.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
$langs->load("other");
$year=$_GET["year"];
if ($year == 0 )
{
$year_current = strftime("%Y",time());
$year_start = $year_current;
} else {
$year_current = $year;
$year_start = $year;
}
// Security check
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'tax', '', '', 'charges');
// Define modetax (0 or 1)
// 0=normal, 1=option vat for services is on debit
$modetax = $conf->global->TAX_MODE;
if (isset($_GET["modetax"])) $modetax=$_GET["modetax"];
function pt ($db, $sql, $date)
{
global $conf, $bc,$langs;
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$i = 0;
$total = 0;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td nowrap="nowrap" width="60%">'.$date.'</td>';
print '<td align="right">'.$langs->trans("Amount").'</td>';
print '<td>&nbsp;</td>'."\n";
print "</tr>\n";
$var=True;
while ($i < $num)
{
$obj = $db->fetch_object($result);
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td nowrap="nowrap">'.$obj->dm."</td>\n";
$total = $total + $obj->mm;
print '<td nowrap="nowrap" align="right">'.price($obj->mm)."</td><td >&nbsp;</td>\n";
print "</tr>\n";
$i++;
}
print '<tr class="liste_total"><td align="right">'.$langs->trans("Total")." :</td><td nowrap=\"nowrap\" align=\"right\"><b>".price($total)."</b></td><td>&nbsp;</td></tr>";
print "</table>";
$db->free($result);
}
else {
dolibar_print_error($db);
}
}
/*
* View
*/
llxHeader();
$tva = new Tva($db);
$textprevyear="<a href=\"index.php?year=" . ($year_current-1) . "\">".img_previous()."</a>";
$textnextyear=" <a href=\"index.php?year=" . ($year_current+1) . "\">".img_next()."</a>";
print_fiche_titre($langs->transcountry("LT2",$mysoc->pays_code),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear");
print $langs->trans("VATReportBuildWithOptionDefinedInModule").'<br>';
print '('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')<br>';
print '<br>';
print '<table width="100%" class="nobordernopadding">';
print '<tr><td>';
print_titre($langs->transcountry("LT2Summary",$mysoc->pays_code));
print '</td><td width="5">&nbsp;</td><td>';
print_titre($langs->transcountry("LT2Paid",$mysoc->pays_code));
print '</td></tr>';
print '<tr><td width="50%" valign="top">';
print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">";
print "<td width=\"30%\">".$langs->trans("Year")." $y</td>";
print "<td align=\"right\">".$langs->transcountry("LT2Customer",$mysoc->pays_code)."</td>";
print "<td align=\"right\">".$langs->transcountry("LT2Supplier",$mysoc->pays_code)."</td>";
print "<td align=\"right\">".$langs->trans("TotalToPay")."</td>";
print "<td>&nbsp;</td>\n";
print "</tr>\n";
$y = $year_current ;
$var=True;
$total=0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0;
$i=0;
for ($m = 1 ; $m < 13 ; $m++ )
{
$coll_listsell = vat_by_date($db, $y, 0, 0, 0, $modetax, 'sell', $m);
$coll_listbuy = vat_by_date($db, $y, 0, 0, 0, $modetax, 'buy', $m);
if (! is_array($coll_listbuy) && $coll_listbuy == -1)
{
$langs->load("errors");
print '<tr><td colspan="5">'.$langs->trans("ErrorNoAccountancyModuleLoaded").'</td></tr>';
break;
}
if (! is_array($coll_listbuy) && $coll_listbuy == -2)
{
print '<tr><td colspan="5">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>';
break;
}
$var=!$var;
print "<tr $bc[$var]>";
print '<td nowrap>'.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").'</td>';
$x_coll = 0;
foreach($coll_listsell as $vatrate=>$val)
{
$x_coll+=$val['localtax2'];
}
$subtotalcoll = $subtotalcoll + $x_coll;
print "<td nowrap align=\"right\">".price($x_coll)."</td>";
$x_paye = 0;
foreach($coll_listbuy as $vatrate=>$val)
{
$x_paye+=$val['localtax2'];
}
$subtotalpaye = $subtotalpaye + $x_paye;
print "<td nowrap align=\"right\">".price($x_paye)."</td>";
$diff = $x_coll - $x_paye;
$total = $total + $diff;
$subtotal = $subtotal + $diff;
print "<td nowrap align=\"right\">".price($diff)."</td>\n";
print "<td>&nbsp;</td>\n";
print "</tr>\n";
$i++;
if ($i > 2) {
print '<tr class="liste_total">';
print '<td align="right">'.$langs->trans("SubTotal").':</td>';
print '<td nowrap="nowrap" align="right">'.price($subtotalcoll).'</td>';
print '<td nowrap="nowrap" align="right">'.price($subtotalpaye).'</td>';
print '<td nowrap="nowrap" align="right">'.price($subtotalpaye).'</td>';
print '<td>&nbsp;</td></tr>';
$i = 0;
$subtotalcoll=0; $subtotalpaye=0; $subtotal=0;
}
}
print '<tr class="liste_total"><td align="right" colspan="3">'.$langs->trans("TotalToPay").':</td><td nowrap align="right">'.price($total).'</td>';
print "<td>&nbsp;</td>\n";
print '</tr>';
print '</table>';
print '</td><td>&nbsp;</td><td valign="top" width="50%">';
/*
* Payed
*/
$sql = "SELECT SUM(amount) as mm, date_format(f.datev,'%Y-%m') as dm";
$sql.= " FROM ".MAIN_DB_PREFIX."localtax as f";
$sql.= " WHERE f.entity = ".$conf->entity;
$sql.= " AND f.datev >= '".$db->idate(dol_get_first_day($y,1,false))."'";
$sql.= " AND f.datev <= '".$db->idate(dol_get_last_day($y,12,false))."'";
$sql.= " GROUP BY dm ASC";
pt($db, $sql,$langs->trans("Year")." $y");
print "</td></tr></table>";
print '</td></tr>';
print '</table>';
$db->close();
llxFooter();
?>

View File

@ -0,0 +1,97 @@
<?php
/* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compta/localtax/reglement.php
* \ingroup tax
* \brief List of IRPF payments
*/
require('../../main.inc.php');
require_once(DOL_DOCUMENT_ROOT."/compta/localtax/class/localtax.class.php");
$langs->load("compta");
$langs->load("compta");
// Security check
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'tax', '', '', 'charges');
/*
* View
*/
llxHeader();
$localtax_static = new localtax($db);
print_fiche_titre($langs->transcountry("LT2Payments",$mysoc->pays_code));
$sql = "SELECT rowid, amount, label, f.datev as dm";
$sql.= " FROM ".MAIN_DB_PREFIX."localtax as f ";
$sql.= " WHERE f.entity = ".$conf->entity;
$sql.= " ORDER BY dm DESC";
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$i = 0;
$total = 0 ;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td nowrap align="left">'.$langs->trans("Ref").'</td>';
print "<td>".$langs->trans("Label")."</td>";
print '<td nowrap align="left">'.$langs->trans("DatePayment").'</td>';
print "<td align=\"right\">".$langs->trans("PayedByThisPayment")."</td>";
print "</tr>\n";
$var=1;
while ($i < $num)
{
$obj = $db->fetch_object($result);
$var=!$var;
print "<tr $bc[$var]>";
$localtax_static->id=$obj->rowid;
$localtax_static->ref=$obj->rowid;
print "<td>".$localtax_static->getNomUrl(1)."</td>\n";
print "<td>".dol_trunc($obj->label,40)."</td>\n";
print '<td align="left">'.dol_print_date($db->jdate($obj->dm),'day')."</td>\n";
$total = $total + $obj->amount;
print "<td align=\"right\">".price($obj->amount)."</td>";
print "</tr>\n";
$i++;
}
print '<tr class="liste_total"><td colspan="3">'.$langs->trans("Total").'</td>';
print "<td align=\"right\"><b>".price($total)."</b></td></tr>";
print "</table>";
$db->free($result);
}
else
{
dol_print_error($db);
}
$db->close();
llxFooter();
?>

View File

@ -56,9 +56,9 @@ class RemiseCheque extends CommonObject
/**
* Load record
*
* @param id Id record
* @param ref Ref record
* @return int <0 if KO, > 0 if OK
* @param int $id Id record
* @param string $ref Ref record
* @return int <0 if KO, > 0 if OK
*/
function fetch($id,$ref='')
{
@ -72,7 +72,7 @@ class RemiseCheque extends CommonObject
$sql.= " WHERE bc.entity = ".$conf->entity;
if ($id) $sql.= " AND bc.rowid = ".$id;
if ($ref) $sql.= " AND bc.number = '".$this->db->escape($ref)."'";
dol_syslog("RemiseCheque::fetch sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
@ -397,10 +397,14 @@ class RemiseCheque extends CommonObject
$num=0;
// We use +0 to convert varchar to number
$sql = "SELECT MAX(number+0)";
// We use +0 to convert varchar to number for mysql, use ::integer for postgres.
// We must found a generic solution (Use a $db->toint function ?)
$sql = "SELECT ";
if ($this->db->type == 'pgsql') $sql.="MAX(number::integer)";
else $sql.="MAX(number+0)";
$sql.= " FROM ".MAIN_DB_PREFIX."bordereau_cheque";
$sql.= " WHERE entity = ".$conf->entity;
$sql.= " AND number not like '(%'";
dol_syslog("Remisecheque::getNextNumber sql=".$sql);
$resql = $this->db->query($sql);
@ -499,14 +503,14 @@ class RemiseCheque extends CommonObject
$sql.= " AND b.fk_bordereau = bc.rowid";
$sql.= " AND bc.rowid = ".$this->id;
$sql.= " AND bc.entity = ".$conf->entity;
$sql.= " ORDER BY b.emetteur ASC, b.rowid ASC;";
$sql.= " ORDER BY b.dateo ASC, b.rowid ASC";
dol_syslog("RemiseCheque::generatePdf sql=".$sql, LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
$i = 0;
while ( $objp = $this->db->fetch_object($result) )
while ($objp = $this->db->fetch_object($result))
{
$docmodel->lines[$i]->bank_chq = $objp->banque;
$docmodel->lines[$i]->emetteur_chq = $objp->emetteur;
@ -527,7 +531,7 @@ class RemiseCheque extends CommonObject
// We save charset_output to restore it because write_file can change it if needed for
// output format that does not support UTF8.
$sav_charset_output=$outputlangs->charset_output;
$sav_charseSupprimert_output=$outputlangs->charset_output;
$result=$docmodel->write_file($conf->banque->dir_output.'/bordereau', $this->number, $outputlangs);
if ($result > 0)
{

View File

@ -46,11 +46,11 @@ $result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque','','',$fieldid
$mesg='';
$sortfield=isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"];
$sortorder=isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"];
$sortfield=GETPOST("sortfield");
$sortorder=GETPOST("sortorder");
$page=$_GET["page"];
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="b.emetteur";
if (! $sortfield) $sortfield="b.dateo,b.rowid";
if ($page < 0) { $page = 0 ; }
$limit = $conf->liste_limit;
$offset = $limit * $page ;
@ -309,15 +309,15 @@ if ($action == 'new')
print '<tr><td>'.$langs->trans("BankAccount").'</td><td>';
print $html->select_comptes($filteraccountid,'accountid',0,'courant <> 2',1);
print '</td></tr>';
print '<tr><td colspan="2" align="center">';
print '</table>';
print '<center>';
print '<input type="submit" class="button" name="filter" value="'.dol_escape_htmltag($langs->trans("ToFilter")).'">';
if ($filterdate || $filteraccountid > 0)
{
print ' &nbsp; ';
print '<input type="submit" class="button" name="removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
}
print '</td></tr>';
print '</table>';
print '</center>';
//print '</fieldset>';
print '</form>';
print '<br>';
@ -522,12 +522,12 @@ else
$param="&amp;id=".$remisecheque->id;
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Cheque"),'','','','','width="30"');
print_liste_field_titre($langs->trans("DateChequeReceived"),$_SERVER["PHP_SELF"],"b.dateo,b.rowid", "",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Numero"),$_SERVER["PHP_SELF"],"b.num_chq", "",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("CheckTransmitter"),$_SERVER["PHP_SELF"],"b.emetteur", "",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Bank"),$_SERVER["PHP_SELF"],"b.banque", "",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"b.amount", "",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("LineRecord"),$_SERVER["PHP_SELF"],"b.rowid", "",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateChequeReceived"),$_SERVER["PHP_SELF"],"b.dateo", "",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre('','','');
print "</tr>\n";
$i=1;
@ -539,6 +539,7 @@ else
print "<tr $bc[$var]>";
print '<td align="center">'.$i.'</td>';
print '<td align="center">'.dol_print_date($db->jdate($objp->date),'day').'</td>'; // Date operation
print '<td align="center">'.($objp->num_chq?$objp->num_chq:'&nbsp;').'</td>';
print '<td>'.dol_trunc($objp->emetteur,24).'</td>';
print '<td>'.dol_trunc($objp->banque,24).'</td>';
@ -554,7 +555,6 @@ else
print '&nbsp;';
}
print '</td>';
print '<td align="center">'.dol_print_date($db->jdate($objp->date),'day').'</td>';
if($remisecheque->statut == 0)
{
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?id='.$remisecheque->id.'&amp;action=remove&amp;lineid='.$objp->rowid.'">'.img_delete().'</a></td>';
@ -593,12 +593,12 @@ if ($user->societe_id == 0 && count($accounts) == 1 && $action == 'new' && $user
if ($user->societe_id == 0 && $remisecheque->statut == 0 && $remisecheque->id && $user->rights->banque->cheque)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$remisecheque->id.'&amp;action=valide">'.$langs->trans('Valid').'</a>';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$remisecheque->id.'&amp;action=valide&amp;sortfield='.$sortfield.'&amp;sortorder='.$sortorder.'">'.$langs->trans('Valid').'</a>';
}
if ($user->societe_id == 0 && $remisecheque->id && $user->rights->banque->cheque)
{
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$remisecheque->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>';
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$remisecheque->id.'&amp;action=delete&amp;sortfield='.$sortfield.'&amp;sortorder='.$sortorder.'">'.$langs->trans('Delete').'</a>';
}
print '</div>';

View File

@ -1,4 +0,0 @@
conf.php*.sav
*.php
conf.php.mysql
conf.php.postgres

View File

@ -48,12 +48,15 @@ if((isset($_GET['field']) && ! empty($_GET['field']))
$table_element = GETPOST('table_element');
$field = GETPOST('field');
$fk_element = GETPOST('fk_element');
$type = GETPOST('type');
if ($element == 'fichinter') $element = 'ficheinter';
if ($user->rights->$element->lire || $user->rights->$element->read)
{
$object = new GenericObject($db);
$ret=$object->getValueFrom($table_element, $fk_element, $field);
echo $ret;
$value=$object->getValueFrom($table_element, $fk_element, $field);
echo $value;
}
else
{

View File

@ -37,7 +37,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/genericobject.class.php");
top_httphead();
//print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n";
//var_dump($_POST);
//print_r($_POST);
// Load original field value
if((isset($_POST['field']) && ! empty($_POST['field']))
@ -51,23 +51,54 @@ if((isset($_POST['field']) && ! empty($_POST['field']))
$fk_element = GETPOST('fk_element');
$value = GETPOST('value');
$type = GETPOST('type');
$timestamp = GETPOST('timestamp');
$format='text';
$return=array();
$error=0;
if ($element == 'fichinter') $element = 'ficheinter';
if ($user->rights->$element->creer || $user->rights->$element->write)
{
$object = new GenericObject($db);
// Clean parameters
$value = trim($value);
$newvalue = trim($value);
if ($type == 'numeric')
{
$value = price2num($value);
$newvalue = price2num($newvalue);
// Check parameters
if (! is_numeric($value)) $value = 0;
if (! is_numeric($newvalue))
{
$error++;
$return['error'] = $langs->trans('ErrorBadValue');
}
}
else if ($type == 'datepicker')
{
$format = 'date';
$newvalue = ($timestamp / 1000);
}
$ret=$object->setValueFrom($table_element, $fk_element, $field, $value);
if ($ret > 0) echo (! empty($value) ? dol_nl2br($value) : '&nbsp;');
if (! $error)
{
$ret=$object->setValueFrom($table_element, $fk_element, $field, $newvalue, $format);
if ($ret > 0)
{
if ($type == 'numeric') $value = price($newvalue);
else if ($type == 'textarea') $value = dol_nl2br($newvalue);
$return['value'] = $value;
}
else
{
$return['error'] = $object->error;
}
}
echo json_encode($return);
}
else
{

View File

@ -622,25 +622,31 @@ abstract class CommonObject
* @param int $id Object id
* @param string $field Field to update
* @param mixte $value New value
* @param string $format Data format
* @return int <0 if KO, >0 if OK
*/
function setValueFrom($table, $id, $field, $value)
function setValueFrom($table, $id, $field, $value, $format='text')
{
global $conf;
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX.$table." SET ";
$sql.= $field." = '".$this->db->escape($value)."'";
if ($format == 'text') $sql.= $field." = '".$this->db->escape($value)."'";
else if ($format == 'date') $sql.= $field." = '".$this->db->idate($value)."'";
$sql.= " WHERE rowid = ".$id;
dol_syslog(get_class($this)."::setValueFrom sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
$this->db->commit();
return 1;
}
else
{
dol_print_error($this->db);
$this->error=$this->db->lasterror();
$this->db->rollback();
return -1;
}
}

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2006 Marc Barilley/Ocebo <marc@ocebo.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerker@telenet.be>
@ -141,6 +141,43 @@ class Form
}
return $ret;
}
/**
* Output edit in place form
*
* @param string $value Value to show/edit
* @param string $htmlname DIV ID (field name)
* @param int $condition Condition to edit
* @param string $area Type of edit
* @return string HTML edit in place
*/
function editInPlace($value, $htmlname, $condition, $type='textarea')
{
global $conf;
$out='';
// Check parameters
if ($type == 'textarea') $value = dol_nl2br($value);
else if ($type == 'numeric') $value = price($value);
else if ($type == 'datepicker') $value = dol_print_date($value, 'day');
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && $condition)
{
// Use for timestamp format
if ($type == 'datepicker') $out.= '<input id="timeStamp" type="hidden"/>';
$out.= '<div class="edit_'.$type.'" id="'.$htmlname.'">';
$out.= $value;
$out.= '</div>';
}
else
{
$out = $value;
}
return $out;
}
/**
* Show a text and picto with tooltip on text or picto

View File

@ -0,0 +1,14 @@
// Copyright (C) 2011 Regis Houssin <regis@dolibarr.fr>
//
// Script javascript that contains functions for datepicker default options
//
// \file htdocs/core/js/jnotify.js
// \brief File that include javascript functions for datepicker default options
$(document).ready(function() {
$.datepicker.setDefaults({
altField: '#timeStamp',
altFormat: '@' // Gives a timestamp dateformat
});
});

View File

@ -0,0 +1,128 @@
// Copyright (C) 2011 Regis Houssin <regis@dolibarr.fr>
//
// Script javascript that contains functions for edit in place
//
// \file htdocs/core/js/editinplace.js
// \brief File that include javascript functions for edit in place
$(document).ready(function() {
var element = $('#element').html();
var table_element = $('#table_element').html();
var fk_element = $('#fk_element').html();
$('.edit_textarea').editable(urlSaveInPlace, {
type : 'textarea',
rows : 4,
id : 'field',
tooltip : tooltipInPlace,
placeholder : placeholderInPlace,
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
loadurl : urlLoadInPlace,
loaddata : {
type: 'textarea',
element: element,
table_element: table_element,
fk_element: fk_element
},
submitdata : {
type: 'textarea',
element: element,
table_element: table_element,
fk_element: fk_element
},
callback : function(result, settings) {
var obj = $.parseJSON(result);
if (obj.error) {
$(this).html(this.revert);
$.jnotify(obj.error, "error", true);
} else {
$(this).html(obj.value);
}
}
});
$('.edit_text').editable(urlSaveInPlace, {
type : 'text',
id : 'field',
width : 300,
tooltip : tooltipInPlace,
placeholder : placeholderInPlace,
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
submitdata : {
type: 'text',
element: element,
table_element: table_element,
fk_element: fk_element
},
callback : function(result, settings) {
var obj = $.parseJSON(result);
if (obj.error) {
$(this).html(this.revert);
$.jnotify(obj.error, "error", true);
} else {
$(this).html(obj.value);
}
}
});
$('.edit_numeric').editable(urlSaveInPlace, {
type : 'text',
id : 'field',
width : 100,
tooltip : tooltipInPlace,
placeholder : placeholderInPlace,
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
submitdata : {
type: 'numeric',
element: element,
table_element: table_element,
fk_element: fk_element
},
callback : function(result, settings) {
var obj = $.parseJSON(result);
if (obj.error) {
$(this).html(this.revert);
$.jnotify(obj.error, "error", true);
} else {
$(this).html(obj.value);
}
}
});
$('.edit_datepicker').editable(urlSaveInPlace, {
type : 'datepicker',
id : 'field',
onblur : 'ignore',
tooltip : tooltipInPlace,
placeholder : placeholderInPlace,
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
submitdata : function(value, settings) {
return {
type: 'datepicker',
element: element,
table_element: table_element,
fk_element: fk_element,
timestamp: $('#timeStamp').val()
};
},
callback : function(result, settings) {
var obj = $.parseJSON(result);
if (obj.error) {
$(this).html(this.revert);
$.jnotify(obj.error, "error", true);
} else {
$(this).html(obj.value);
}
}
});
});

26
htdocs/core/js/jnotify.js Normal file
View File

@ -0,0 +1,26 @@
// Copyright (C) 2011 Regis Houssin <regis@dolibarr.fr>
//
// Script javascript that contains functions for jnotify default options
//
// \file htdocs/core/js/jnotify.js
// \brief File that include javascript functions for jnotify default options
$(document).ready(function() {
$.jnotify.setup({
delay: 3000 // the default time to show each notification (in milliseconds)
, sticky: false // determines if the message should be considered "sticky" (user must manually close notification)
, closeLabel: "&times;" // the HTML to use for the "Close" link
, showClose: true // determines if the "Close" link should be shown if notification is also sticky
, fadeSpeed: 1000 // the speed to fade messages out (in milliseconds)
, slideSpeed: 250 // the speed used to slide messages out (in milliseconds)
, classContainer: "jnotify-container"
, classNotification: "jnotify-notification"
, classBackground: "jnotify-background"
, classClose: "jnotify-close"
, classMessage: "jnotify-message"
, init: null // callback that occurs when the main jnotify container is created
, create: null // callback that occurs when when the note is created (occurs just before appearing in DOM)
, beforeRemove: null // callback that occurs when before the notification starts to fade away
});
});

View File

@ -585,6 +585,14 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p
$out.="</div>\n";
if (! $notab) $out.="\n".'<div class="tabBar">'."\n";
// Parameters for edit in place
if (! empty($GLOBALS['object']))
{
$out.='<div id="element" class="hidden">'.$GLOBALS['object']->element.'</div>'."\n";
$out.='<div id="table_element" class="hidden">'.$GLOBALS['object']->table_element.'</div>'."\n";
$out.='<div id="fk_element" class="hidden">'.$GLOBALS['object']->id.'</div>'."\n";
}
return $out;
}
@ -3955,21 +3963,6 @@ function get_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepemb
jQuery.jnotify("'.dol_escape_js($out).'",
"'.($style=="ok" ? 3000 : $style).'",
'.($style=="ok" ? "false" : "true").',
{
closeLabel: "&times;" // the HTML to use for the "Close" link
, showClose: true // determines if the "Close" link should be shown if notification is also sticky
, fadeSpeed: 1000 // the speed to fade messages out (in milliseconds)
, slideSpeed: 250 // the speed used to slide messages out (in milliseconds)
, classContainer: "jnotify-container"
, classNotification: "jnotify-notification"
, classBackground: "jnotify-background"
, classClose: "jnotify-close"
, classMessage: "jnotify-message"
, init: null // callback that occurs when the main jnotify container is created
, create: null // callback that occurs when when the note is created (occurs just before
// appearing in DOM)
, beforeRemove: null // callback that occurs when before the notification starts to fade away
},
{ remove: function (){} } );
});
</script>';
@ -4236,6 +4229,16 @@ function dol_eval($s)
eval($s);
}
/**
* Return if var element is ok
*
* @param string $element Variable to check
* @return boolean Return true of variable is not empty
*/
function dol_validElement($element)
{
return (trim($element) != '');
}
/**
* Return img flag of country for a language code or country code

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.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

View File

@ -275,7 +275,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
{
$mc = new ActionsMulticompany($db);
$select_entity=$mc->select_entities($lastentity, 'tabindex="3"');
$select_entity=$mc->select_entities($lastentity, 'tabindex="3"', 1);
}
}

View File

@ -49,6 +49,8 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction
$invoicedettable='facturedet';
$fk_facture='fk_facture';
$total_tva='total_tva';
$total_localtax1='total_localtax1';
$total_localtax2='total_localtax2';
}
if ($direction == 'buy')
{
@ -56,6 +58,8 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction
$invoicedettable='facture_fourn_det';
$fk_facture='fk_facture_fourn';
$total_tva='tva';
$total_localtax1='total_localtax1';
$total_localtax2='total_localtax2';
}
// Define sql request
@ -74,8 +78,10 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction
}
if ($conf->global->MAIN_MODULE_COMPTABILITE)
{
$sql = "SELECT s.rowid as socid, s.nom as nom, s.tva_intra as tva_intra, s.tva_assuj as assuj,";
$sql.= " sum(fd.total_ht) as amount, sum(fd.".$total_tva.") as tva";
$sql = "SELECT s.rowid as socid, s.nom as nom, s.siren as tva_intra, s.tva_assuj as assuj,";
$sql.= " sum(fd.total_ht) as amount, sum(fd.".$total_tva.") as tva,";
$sql.= " sum(fd.".$total_localtax1.") as localtax1,";
$sql.= " sum(fd.".$total_localtax2.") as localtax2";
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
$sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as fd,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
@ -195,6 +201,8 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
$fk_facture2='fk_facture';
$fk_payment='fk_paiement';
$total_tva='total_tva';
$total_localtax1='total_localtax1';
$total_localtax2='total_localtax2';
$paymenttable='paiement';
$paymentfacturetable='paiement_facture';
}
@ -206,6 +214,8 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
$fk_facture2='fk_facturefourn';
$fk_payment='fk_paiementfourn';
$total_tva='tva';
$total_localtax1='total_localtax1';
$total_localtax2='total_localtax2';
$paymenttable='paiementfourn';
$paymentfacturetable='paiementfourn_facturefourn';
}
@ -229,6 +239,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
{
// Count on delivery date (use invoice date as delivery is unknown)
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
$sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, ";
$sql.= " d.date_start as date_start, d.date_end as date_end,";
$sql.= " f.facnumber as facnum, f.type, f.total_ttc as ftotal_ttc,";
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,";
@ -275,6 +286,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
{
// Count on delivery date (use invoice date as delivery is unknown)
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
$sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, ";
$sql.= " d.date_start as date_start, d.date_end as date_end,";
$sql.= " f.facnumber as facnum, f.type, f.total_ttc as ftotal_ttc,";
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,";
@ -331,12 +343,16 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
{
if (! isset($list[$assoc['rate']]['totalht'])) $list[$assoc['rate']]['totalht']=0;
if (! isset($list[$assoc['rate']]['vat'])) $list[$assoc['rate']]['vat']=0;
if (! isset($list[$assoc['rate']]['locatax1'])) $list[$assoc['rate']]['localtax1']=0;
if (! isset($list[$assoc['rate']]['locatax2'])) $list[$assoc['rate']]['localtax2']=0;
if ($assoc['rowid'] != $oldrowid) // Si rupture sur d.rowid
{
$oldrowid=$assoc['rowid'];
$list[$assoc['rate']]['totalht'] += $assoc['total_ht'];
$list[$assoc['rate']]['vat'] += $assoc['total_vat'];
$list[$assoc['rate']]['localtax1'] += $assoc['total_localtax1'];
$list[$assoc['rate']]['localtax2'] += $assoc['total_localtax2'];
}
$list[$assoc['rate']]['dtotal_ttc'][] = $assoc['total_ttc'];
$list[$assoc['rate']]['dtype'][] = $assoc['dtype'];
@ -351,6 +367,8 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
$list[$assoc['rate']]['totalht_list'][] = $assoc['total_ht'];
$list[$assoc['rate']]['vat_list'][] = $assoc['total_vat'];
$list[$assoc['rate']]['localtax1_list'][] = $assoc['total_localtax1'];
$list[$assoc['rate']]['localtax2_list'][] = $assoc['total_localtax2'];
$list[$assoc['rate']]['pid'][] = $assoc['pid'];
$list[$assoc['rate']]['pref'][] = $assoc['pref'];
@ -390,6 +408,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
{
// Count on invoice date
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
$sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, ";
$sql.= " d.date_start as date_start, d.date_end as date_end,";
$sql.= " f.facnumber as facnum, f.type, f.total_ttc as ftotal_ttc,";
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,";
@ -437,6 +456,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
{
// Count on payments date
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
$sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, ";
$sql.= " d.date_start as date_start, d.date_end as date_end,";
$sql.= " f.facnumber as facnum, f.type, f.total_ttc as ftotal_ttc,";
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,";
@ -491,12 +511,16 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
{
if (! isset($list[$assoc['rate']]['totalht'])) $list[$assoc['rate']]['totalht']=0;
if (! isset($list[$assoc['rate']]['vat'])) $list[$assoc['rate']]['vat']=0;
if (! isset($list[$assoc['rate']]['locatax1'])) $list[$assoc['rate']]['localtax1']=0;
if (! isset($list[$assoc['rate']]['locatax2'])) $list[$assoc['rate']]['localtax2']=0;
if ($assoc['rowid'] != $oldrowid) // Si rupture sur d.rowid
{
$oldrowid=$assoc['rowid'];
$list[$assoc['rate']]['totalht'] += $assoc['total_ht'];
$list[$assoc['rate']]['vat'] += $assoc['total_vat'];
$list[$assoc['rate']]['localtax1'] += $assoc['total_localtax1'];
$list[$assoc['rate']]['localtax2'] += $assoc['total_localtax2'];
}
$list[$assoc['rate']]['dtotal_ttc'][] = $assoc['total_ttc'];
$list[$assoc['rate']]['dtype'][] = $assoc['dtype'];
@ -511,6 +535,8 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
$list[$assoc['rate']]['totalht_list'][] = $assoc['total_ht'];
$list[$assoc['rate']]['vat_list'][] = $assoc['total_vat'];
$list[$assoc['rate']]['localtax1_list'][] = $assoc['total_localtax1'];
$list[$assoc['rate']]['localtax2_list'][] = $assoc['total_localtax2'];
$list[$assoc['rate']]['pid'][] = $assoc['pid'];
$list[$assoc['rate']]['pref'][] = $assoc['pref'];

View File

@ -941,7 +941,20 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/tva/reglement.php?leftmenu=tax_vat",$langs->trans("Payments"),2,$user->rights->tax->charges->lire);
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire);
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire);
global $mysoc;
//Local Taxes
if($mysoc->pays_code=='ES' && $mysoc->localtax2_assuj=="1")
{
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/localtax/index.php?leftmenu=tax_vat&amp;mainmenu=accountancy",$langs->transcountry("LT2",$mysoc->pays_code),1,$user->rights->tax->charges->lire);
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/localtax/fiche.php?leftmenu=tax_vat&action=create",$langs->trans("NewPayment"),2,$user->rights->tax->charges->creer);
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/localtax/reglement.php?leftmenu=tax_vat",$langs->trans("Payments"),2,$user->rights->tax->charges->lire);
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire);
//if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire);
}
}
}
// Compta simple

View File

@ -1,2 +0,0 @@
modGoogle.class.php
modPHPSane.class.php

View File

@ -39,7 +39,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
var $emetteur; // Objet societe qui emet
/**
* \brief Constructeur
* Constructor
*
* @param DoliDB $db Database handler
*/
function BordereauChequeBlochet($db)
{
@ -76,6 +78,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
/**
* Fonction generant le rapport sur le disque
*
* @param _dir Directory
* @param number Number
* @param outputlangs Lang output object

View File

@ -1,2 +0,0 @@
mailinglist_chatsderace.modules.php
mailinglist_chiensderace.modules.php

View File

@ -1,93 +0,0 @@
<?php
/* Copyright (C) 2011 Regis Houssin <regis@dolibarr.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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
?>
<!-- BEGIN PHP TEMPLATE FOR JQUERY -->
<script>
$(document).ready(function() {
$(document).ready(function() {
$('.edit_area').editable('<?php echo DOL_URL_ROOT.'/core/ajax/saveinplace.php'; ?>', {
type : 'textarea',
rows : 4,
id : 'field',
tooltip : '<?php echo $langs->trans('ClickToEdit'); ?>',
cancel : '<?php echo $langs->trans('Cancel'); ?>',
submit : '<?php echo $langs->trans('Ok'); ?>',
indicator : '<img src="<?php echo DOL_URL_ROOT."/theme/".$conf->theme."/img/working.gif"; ?>">',
loadurl : '<?php echo DOL_URL_ROOT.'/core/ajax/loadinplace.php'; ?>',
loaddata : {
type: 'textarea',
element: "<?php echo $object->element; ?>",
table_element: "<?php echo $object->table_element; ?>",
fk_element: "<?php echo $object->id; ?>"
},
submitdata : {
type: 'textarea',
element: "<?php echo $object->element; ?>",
table_element: "<?php echo $object->table_element; ?>",
fk_element: "<?php echo $object->id; ?>"
}
});
$('.edit_text').editable('<?php echo DOL_URL_ROOT.'/core/ajax/saveinplace.php'; ?>', {
type : 'text',
id : 'field',
width : 300,
tooltip : '<?php echo $langs->trans('ClickToEdit'); ?>',
cancel : '<?php echo $langs->trans('Cancel'); ?>',
submit : '<?php echo $langs->trans('Ok'); ?>',
indicator : '<img src="<?php echo DOL_URL_ROOT."/theme/".$conf->theme."/img/working.gif"; ?>">',
loadurl : '<?php echo DOL_URL_ROOT.'/core/ajax/loadinplace.php'; ?>',
loaddata : {
type: 'text',
element: "<?php echo $object->element; ?>",
table_element: "<?php echo $object->table_element; ?>",
fk_element: "<?php echo $object->id; ?>"
},
submitdata : {
type: 'text',
element: "<?php echo $object->element; ?>",
table_element: "<?php echo $object->table_element; ?>",
fk_element: "<?php echo $object->id; ?>"
}
});
$('.edit_numeric').editable('<?php echo DOL_URL_ROOT.'/core/ajax/saveinplace.php'; ?>', {
type : 'text',
id : 'field',
width : 100,
tooltip : '<?php echo $langs->trans('ClickToEdit'); ?>',
cancel : '<?php echo $langs->trans('Cancel'); ?>',
submit : '<?php echo $langs->trans('Ok'); ?>',
indicator : '<img src="<?php echo DOL_URL_ROOT."/theme/".$conf->theme."/img/working.gif"; ?>">',
loadurl : '<?php echo DOL_URL_ROOT.'/core/ajax/loadinplace.php'; ?>',
loaddata : {
type: 'numeric',
element: "<?php echo $object->element; ?>",
table_element: "<?php echo $object->table_element; ?>",
fk_element: "<?php echo $object->id; ?>"
},
submitdata : {
type: 'numeric',
element: "<?php echo $object->element; ?>",
table_element: "<?php echo $object->table_element; ?>",
fk_element: "<?php echo $object->id; ?>"
}
});
});
});
</script>
<!-- END PHP TEMPLATE FOR JQUERY -->

View File

@ -80,21 +80,22 @@ class Fichinter extends CommonObject
/**
* Create a intervention into data base
* Create an intervention into data base
*
* @return int <0 if KO, >0 if OK
*/
function create()
{
global $conf;
dol_syslog("Fichinter.class::create ref=".$this->ref);
dol_syslog(get_class($this)."::create ref=".$this->ref);
// Check parameters
if (! is_numeric($this->duree)) { $this->duree = 0; }
if ($this->socid <= 0)
{
$this->error='ErrorBadParameterForFunc';
dol_syslog("Fichinter::create ".$this->error,LOG_ERR);
dol_syslog(get_class($this)."::create ".$this->error,LOG_ERR);
return -1;
}
// on verifie si la ref n'est pas utilisee
@ -106,14 +107,14 @@ class Fichinter extends CommonObject
if ($result > 0)
{
$this->error='ErrorRefAlreadyExists';
dol_syslog("Fichinter::create ".$this->error,LOG_WARNING);
dol_syslog(get_class($this)."::create ".$this->error,LOG_WARNING);
$this->db->rollback();
return -3;
}
else if ($result < 0)
{
$this->error=$this->db->error();
dol_syslog("Fichinter::create ".$this->error,LOG_ERR);
dol_syslog(get_class($this)."::create ".$this->error,LOG_ERR);
$this->db->rollback();
return -2;
}
@ -133,6 +134,8 @@ class Fichinter extends CommonObject
$sql.= ", model_pdf";
$sql.= ", fk_projet";
$sql.= ", fk_statut";
$sql.= ", note_private";
$sql.= ", note_public";
$sql.= ") ";
$sql.= " VALUES (";
$sql.= $this->socid;
@ -144,9 +147,11 @@ class Fichinter extends CommonObject
$sql.= ", '".$this->modelpdf."'";
$sql.= ", ".($this->fk_project ? $this->fk_project : 0);
$sql.= ", ".$this->statut;
$sql.= ", ".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null");
$sql.= ", ".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null");
$sql.= ")";
dol_syslog("Fichinter::create sql=".$sql);
dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
$result=$this->db->query($sql);
if ($result)
{
@ -157,7 +162,7 @@ class Fichinter extends CommonObject
else
{
$this->error=$this->db->error();
dol_syslog("Fichinter::create ".$this->error,LOG_ERR);
dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
@ -165,41 +170,45 @@ class Fichinter extends CommonObject
}
/**
* Update a intervention
* Update an intervention
*
* @return int <0 if KO, >0 if OK
*/
function update($user)
function update()
{
global $conf;
if (! is_numeric($this->duree)) { $this->duree = 0; }
if (! dol_strlen($this->fk_project)) { $this->fk_project = 0; }
/*
* Insertion dans la base
*/
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter SET ";
$sql.= ", description = '".$this->db->escape($this->description)."'";
$sql.= ", duree = ".$this->duree;
$sql.= ", fk_projet = ".$this->fk_project;
$sql.= ", note_private = ".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null");
$sql.= ", note_public = ".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null");
$sql.= " WHERE rowid = ".$this->id;
$sql.= " AND entity = ".$conf->entity;
dol_syslog("Fichinter::update sql=".$sql);
if (! $this->db->query($sql))
dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
if ($this->db->query($sql))
{
$this->db->commit();
return 1;
}
else
{
$this->error=$this->db->error();
dol_syslog("Fichinter::update error ".$this->error,LOG_ERR);
dol_syslog(get_class($this)."::update error ".$this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
return 1;
}
/**
* Fetch a intervention
* @param rowid Id of intervention
* @param ref Ref of intervention
*
* @param int $id Id of intervention
* @param string $ref Ref of intervention
* @return int <0 if ko, >0 if ok
*/
function fetch($rowid,$ref='')
@ -213,7 +222,7 @@ class Fichinter extends CommonObject
if ($ref) $sql.= " WHERE f.ref='".$ref."'";
else $sql.= " WHERE f.rowid=".$rowid;
dol_syslog("Fichinter::fetch sql=".$sql);
dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
@ -252,7 +261,7 @@ class Fichinter extends CommonObject
else
{
$this->error=$this->db->error();
dol_syslog("Fichinter::fetch ".$this->error,LOG_ERR);
dol_syslog(get_class($this)."::fetch ".$this->error,LOG_ERR);
return -1;
}
}

View File

@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* 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
@ -43,43 +43,25 @@ if (! empty($conf->global->FICHEINTER_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."
$langs->load("companies");
$langs->load("interventions");
$id=GETPOST('id');
$action=GETPOST("action");
$mesg=GETPOST("msg");
// Load object if defined
$fichinterid=0;
$object = new Fichinter($db);
if ($id > 0 || ! empty($_GET["ref"]))
{
$result=$object->fetch($id,$_GET["ref"]);
if (! $result > 0)
{
dol_print_error($db);
exit;
}
$fichinterid=$object->id;
}
$id = GETPOST('id');
$ref = GETPOST('ref');
$socid = GETPOST('socid');
$action = GETPOST("action");
$confirm = GETPOST("confirm");
$mesg = GETPOST("msg");
// Security check
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter');
$result = restrictedArea($user, 'ficheinter', $id, 'fichinter');
$object = new Fichinter($db);
/*
* Actions
*/
if ($action != 'create' && $action != 'add' && $action != 'classifybilled' && ! ($_REQUEST["id"] > 0) && empty($_REQUEST["ref"]))
if ($action == 'confirm_validate' && $confirm == 'yes')
{
Header("Location: ".DOL_URL_ROOT.'/fichinter/list.php');
exit;
}
if ($action == 'confirm_validate' && $_REQUEST['confirm'] == 'yes')
{
$object = new Fichinter($db);
$object->fetch($id);
$object->fetch_thirdparty();
@ -106,9 +88,8 @@ if ($action == 'confirm_validate' && $_REQUEST['confirm'] == 'yes')
}
}
if ($action == 'confirm_modify' && $_REQUEST['confirm'] == 'yes')
if ($action == 'confirm_modify' && $confirm == 'yes')
{
$object = new Fichinter($db);
$object->fetch($id);
$object->fetch_thirdparty();
@ -135,17 +116,17 @@ if ($action == 'confirm_modify' && $_REQUEST['confirm'] == 'yes')
}
}
if ($_POST["action"] == 'add')
if ($action == 'add')
{
$object = new Fichinter($db);
$object->socid = $_POST["socid"];
$object->duree = $_POST["duree"];
$object->fk_project = $_POST["projectid"];
$object->author = $user->id;
$object->description = $_POST["description"];
$object->ref = $_POST["ref"];
$object->modelpdf = $_POST["model"];
$object->socid = $socid;
$object->duree = $_POST["duree"];
$object->fk_project = $_POST["projectid"];
$object->author = $user->id;
$object->description = $_POST["description"];
$object->ref = $ref;
$object->modelpdf = $_POST["model"];
$object->note_private = $_POST["note_private"];
$object->note_public = $_POST["note_public"];
if ($object->socid > 0)
{
@ -153,14 +134,12 @@ if ($_POST["action"] == 'add')
if ($result > 0)
{
$id=$result; // Force raffraichissement sur fiche venant d'etre cree
$fichinterid=$result;
}
else
{
$langs->load("errors");
$mesg='<div class="error">'.$langs->trans($object->error).'</div>';
$action = 'create';
$_GET["socid"] = $_POST["socid"];
}
}
else
@ -170,18 +149,17 @@ if ($_POST["action"] == 'add')
}
}
if ($_POST["action"] == 'update')
if ($action == 'update')
{
$object = new Fichinter($db);
$object->fetch($id);
$object->socid = $_POST["socid"];
$object->fk_project = $_POST["projectid"];
$object->author = $user->id;
$object->description = $_POST["description"];
$object->ref = $_POST["ref"];
$object->socid = $socid;
$object->fk_project = $_POST["projectid"];
$object->author = $user->id;
$object->description = $_POST["description"];
$object->ref = $ref;
$object->update($user);
$object->update();
}
/*
@ -189,7 +167,6 @@ if ($_POST["action"] == 'update')
*/
if ($action == 'builddoc') // En get ou en post
{
$object = new Fichinter($db);
$object->fetch($id);
$object->fetch_thirdparty();
$object->fetch_lines();
@ -220,17 +197,15 @@ if ($action == 'builddoc') // En get ou en post
// Set into a project
if ($action == 'classin')
{
$object = new Fichinter($db);
$object->fetch($id);
$result=$object->setProject($_POST['projectid']);
if ($result < 0) dol_print_error($db,$object->error);
}
if ($action == 'confirm_delete' && $_REQUEST['confirm'] == 'yes')
if ($action == 'confirm_delete' && $confirm == 'yes')
{
if ($user->rights->ficheinter->supprimer)
{
$object = new Fichinter($db);
$object->fetch($id);
$object->delete($user);
}
@ -240,7 +215,6 @@ if ($action == 'confirm_delete' && $_REQUEST['confirm'] == 'yes')
if ($action == 'setdescription')
{
$object = new Fichinter($db);
$object->fetch($id);
$result=$object->set_description($user,$_POST['description']);
if ($result < 0) dol_print_error($db,$object->error);
@ -263,8 +237,7 @@ if ($action == "addline" && $user->rights->ficheinter->creer)
{
$db->begin();
$object = new Fichinter($db);
$ret=$object->fetch($_POST['fichinterid']);
$ret=$object->fetch($id);
$object->fetch_thirdparty();
$desc=$_POST['np_desc'];
@ -272,7 +245,7 @@ if ($action == "addline" && $user->rights->ficheinter->creer)
$duration = ConvertTime2Seconds($_POST['durationhour'],$_POST['durationmin']);
$result=$object->addline(
$_POST['fichinterid'],
$id,
$desc,
$date_intervention,
$duration
@ -294,7 +267,7 @@ if ($action == "addline" && $user->rights->ficheinter->creer)
$db->commit();
fichinter_create($db, $object, $object->modelpdf, $outputlangs);
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$_POST['fichinterid']);
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
}
else
@ -308,12 +281,11 @@ if ($action == "addline" && $user->rights->ficheinter->creer)
// Classify Billed
if ($action == 'classifybilled')
{
$object = new Fichinter($db);
$object->fetch($id);
$result=$object->setBilled();
if ($result > 0)
{
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$_POST['fichinterid']);
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
}
else
@ -325,31 +297,30 @@ if ($action == 'classifybilled')
/*
* Mise a jour d'une ligne d'intervention
*/
if ($action == 'updateligne' && $user->rights->ficheinter->creer && $_POST["save"] == $langs->trans("Save"))
if ($action == 'updateline' && $user->rights->ficheinter->creer && $_POST["save"] == $langs->trans("Save"))
{
$fichinterline = new FichinterLigne($db);
if ($fichinterline->fetch($_POST['ligne']) <= 0)
$objectline = new FichinterLigne($db);
if ($objectline->fetch($_POST['line_id']) <= 0)
{
dol_print_error($db);
exit;
}
$object = new Fichinter($db);
if ($object->fetch($fichinterline->fk_fichinter) <= 0)
if ($object->fetch($objectline->fk_fichinter) <= 0)
{
dol_print_error($db);
exit;
}
$object->fetch_thirdparty();
$desc=$_POST['np_desc'];
$date_intervention = dol_mktime($_POST["dihour"], $_POST["dimin"], 0, $_POST["dimonth"], $_POST["diday"], $_POST["diyear"]);
$duration = ConvertTime2Seconds($_POST['durationhour'],$_POST['durationmin']);
$desc = $_POST['np_desc'];
$date_inter = dol_mktime($_POST["dihour"], $_POST["dimin"], 0, $_POST["dimonth"], $_POST["diday"], $_POST["diyear"]);
$duration = ConvertTime2Seconds($_POST['durationhour'],$_POST['durationmin']);
$fichinterline->datei=$date_intervention;
$fichinterline->desc=$desc;
$fichinterline->duration=$duration;
$result = $fichinterline->update();
$objectline->datei = $date_inter;
$objectline->desc = $desc;
$objectline->duration = $duration;
$result = $objectline->update();
if ($result < 0)
{
dol_print_error($db);
@ -368,34 +339,26 @@ if ($action == 'updateligne' && $user->rights->ficheinter->creer && $_POST["save
}
fichinter_create($db, $object, $object->modelpdf, $outputlangs);
unset($_POST['dihour']);
unset($_POST['dimin']);
unset($_POST['dimonth']);
$dateintervention='';
unset($_POST['np_desc']);
unset($_POST['durationhour']);
unset($_POST['durationmin']);
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$_POST['fichinterid']);
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
}
/*
* Supprime une ligne d'intervention AVEC confirmation
*/
if ($action == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes')
if ($action == 'confirm_deleteline' && $confirm == 'yes')
{
if ($user->rights->ficheinter->creer)
{
$fichinterline = new FichinterLigne($db);
if ($fichinterline->fetch($_GET['ligne']) <= 0)
$objectline = new FichinterLigne($db);
if ($objectline->fetch($_GET['line_id']) <= 0)
{
dol_print_error($db);
exit;
}
$result=$fichinterline->deleteline();
$object = new Fichinter($db);
if ($object->fetch($fichinterline->fk_fichinter) <= 0)
$result=$objectline->deleteline();
if ($object->fetch($objectline->fk_fichinter) <= 0)
{
dol_print_error($db);
exit;
@ -413,7 +376,7 @@ if ($action == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes')
}
fichinter_create($db, $object, $object->modelpdf, $outputlangs);
}
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
}
@ -423,10 +386,9 @@ if ($action == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes')
if ($action == 'up' && $user->rights->ficheinter->creer)
{
$object = new Fichinter($db);
$object->fetch($id);
$object->fetch_thirdparty();
$object->line_up($_GET['rowid']);
$object->line_up($_GET['line_id']);
// Define output language
$outputlangs = $langs;
@ -439,16 +401,15 @@ if ($action == 'up' && $user->rights->ficheinter->creer)
$outputlangs->setDefaultLang($newlang);
}
fichinter_create($db, $object, $object->modelpdf, $outputlangs);
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.$_GET['rowid']);
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.$_GET['line_id']);
exit;
}
if ($action == 'down' && $user->rights->ficheinter->creer)
{
$object = new Fichinter($db);
$object->fetch($id);
$object->fetch_thirdparty();
$object->line_down($_GET['rowid']);
$object->line_down($_GET['line_id']);
// Define output language
$outputlangs = $langs;
@ -461,7 +422,7 @@ if ($action == 'down' && $user->rights->ficheinter->creer)
$outputlangs->setDefaultLang($newlang);
}
fichinter_create($db, $object, $object->modelpdf, $outputlangs);
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.$_GET['rowid']);
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.$_GET['line_id']);
exit;
}
@ -505,11 +466,10 @@ if ($action == 'send' && ! $_POST['cancel'] && (empty($conf->global->MAIN_USE_AD
{
$langs->load('mails');
$object = new Fichinter($db);
if ( $object->fetch($_POST['fichinter_id']) )
if ($object->fetch($id) > 0)
{
$ficheinterref = dol_sanitizeFileName($object->ref);
$file = $conf->ficheinter->dir_output . '/' . $ficheinterref . '/' . $ficheinterref . '.pdf';
$objectref = dol_sanitizeFileName($object->ref);
$file = $conf->ficheinter->dir_output . '/' . $objectref . '/' . $objectref . '.pdf';
if (is_readable($file))
{
@ -540,11 +500,11 @@ if ($action == 'send' && ! $_POST['cancel'] && (empty($conf->global->MAIN_USE_AD
{
$langs->load("commercial");
$from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>';
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
$message = $_POST['message'];
$sendtocc = $_POST['sendtocc'];
$deliveryreceipt = $_POST['deliveryreceipt'];
$from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>';
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
$message = $_POST['message'];
$sendtocc = $_POST['sendtocc'];
$deliveryreceipt = $_POST['deliveryreceipt'];
if ($action == 'send')
{
@ -592,7 +552,7 @@ if ($action == 'send' && ! $_POST['cancel'] && (empty($conf->global->MAIN_USE_AD
$object->actionmsg = $actionmsg;
$object->actionmsg2 = $actionmsg2;
$object->fk_element = $object->id;
$object->elementtype = $object->element;
$object->elementtype = $object->element;
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
@ -659,7 +619,7 @@ if ($action == 'send' && ! $_POST['cancel'] && (empty($conf->global->MAIN_USE_AD
* View
*/
$html = new Form($db);
$form = new Form($db);
$formfile = new FormFile($db);
llxHeader();
@ -671,11 +631,7 @@ if ($action == 'create')
* Creation d'une nouvelle fiche d'intervention
*/
$societe=new Societe($db);
if ($_GET["socid"] > 0)
{
$societe->fetch($_GET["socid"]);
}
$soc=new Societe($db);
print_fiche_titre($langs->trans("AddIntervention"));
@ -687,31 +643,37 @@ if ($action == 'create')
exit;
}
$ficheinter = new Fichinter($db);
$ficheinter->date = time();
if ($fichinterid) $result=$ficheinter->fetch($fichinterid);
$object->date = dol_now();
$obj = $conf->global->FICHEINTER_ADDON;
$obj = "mod_".$obj;
$modFicheinter = new $obj;
$numpr = $modFicheinter->getNextValue($societe,$ficheinter);
$numpr = $modFicheinter->getNextValue($soc, $object);
if ($_GET["socid"] > 0)
if ($socid > 0)
{
$soc->fetch($socid);
print '<form name="fichinter" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="border" width="100%">';
print '<input type="hidden" name="socid" value='.$_GET["socid"].'>';
print '<tr><td class="fieldrequired">'.$langs->trans("Thirdparty").'</td><td>'.$societe->getNomUrl(1).'</td></tr>';
print '<input type="hidden" name="socid" value='.$soc->id.'>';
print '<tr><td class="fieldrequired">'.$langs->trans("ThirdParty").'</td><td>'.$soc->getNomUrl(1).'</td></tr>';
print '<input type="hidden" name="action" value="add">';
// Ref
print '<tr><td class="fieldrequired">'.$langs->trans("Ref").'</td>';
print '<td><input name="ref" value="'.$numpr.'"></td></tr>'."\n";
// Description (must be a textarea and not html must be allowed (used in list view)
print '<tr><td valign="top">'.$langs->trans("Description").'</td>';
print '<td>';
print '<textarea name="description" cols="80" rows="'.ROWS_3.'"></textarea>';
print '</td></tr>';
// Project
if ($conf->projet->enabled)
@ -719,10 +681,10 @@ if ($action == 'create')
$langs->load("project");
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td>';
$numprojet=select_projects($societe->id,$_POST["projectid"],'projectid');
$numprojet=select_projects($soc->id,$_POST["projectid"],'projectid');
if ($numprojet==0)
{
print ' &nbsp; <a href="../projet/fiche.php?socid='.$societe->id.'&action=create">'.$langs->trans("AddProject").'</a>';
print ' &nbsp; <a href="'.DOL_DOCUMENT_ROOT.'/projet/fiche.php?socid='.$soc->id.'&action=create">'.$langs->trans("AddProject").'</a>';
}
print '</td></tr>';
}
@ -732,14 +694,25 @@ if ($action == 'create')
print '<td>'.$langs->trans("DefaultModel").'</td>';
print '<td colspan="2">';
$liste=ModelePDFFicheinter::liste_modeles($db);
print $html->selectarray('model',$liste,$conf->global->FICHEINTER_ADDON_PDF);
print $form->selectarray('model',$liste,$conf->global->FICHEINTER_ADDON_PDF);
print "</td></tr>";
// Description (must be a textarea and not html must be allowed (used in list view)
print '<tr><td valign="top">'.$langs->trans("Description").'</td>';
print '<td>';
print '<textarea name="description" wrap="soft" cols="80" rows="'.ROWS_3.'"></textarea>';
// Public note
print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePublic').'</td>';
print '<td valign="top" colspan="2">';
print '<textarea name="note_public" cols="80" rows="'.ROWS_3.'"></textarea>';
print '</td></tr>';
// Private note
if (! $user->societe_id)
{
print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePrivate').'</td>';
print '<td valign="top" colspan="2">';
print '<textarea name="note_private" cols="80" rows="'.ROWS_3.'"></textarea>';
print '</td></tr>';
}
print '</table>';
@ -751,10 +724,10 @@ if ($action == 'create')
}
else
{
print '<form name="fichinter" action="'.$_SERVER['PHP_SELF'].'" method="GET">';
print '<form name="fichinter" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
print '<table class="border" width="100%">';
print '<tr><td class="fieldrequired">'.$langs->trans("Thirdparty").'</td><td>';
$html->select_societes('','socid','',1,1);
print '<tr><td class="fieldrequired">'.$langs->trans("ThirdParty").'</td><td>';
$form->select_societes('','socid','',1,1);
print '</td></tr>';
print '</table>';
@ -767,20 +740,20 @@ if ($action == 'create')
}
}
elseif ($fichinterid)
else if ($id > 0 || ! empty($ref))
{
/*
* Affichage en mode visu
*/
$object->fetch($id, $ref);
$object->fetch_thirdparty();
$societe=new Societe($db);
$societe->fetch($object->socid);
$soc=new Societe($db);
$soc->fetch($object->socid);
dol_htmloutput_mesg($mesg);
$head = fichinter_prepare_head($object);
dol_fiche_head($head, 'card', $langs->trans("InterventionCard"), 0, 'intervention');
@ -788,28 +761,28 @@ elseif ($fichinterid)
// Confirmation de la suppression de la fiche d'intervention
if ($action == 'delete')
{
$ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete','',0,1);
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete','',0,1);
if ($ret == 'html') print '<br>';
}
// Confirmation validation
if ($action == 'validate')
{
$ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $langs->trans('ConfirmValidateIntervention'), 'confirm_validate','',0,1);
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $langs->trans('ConfirmValidateIntervention'), 'confirm_validate','',0,1);
if ($ret == 'html') print '<br>';
}
// Confirmation de la validation de la fiche d'intervention
if ($action == 'modify')
{
$ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify','',0,1);
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify','',0,1);
if ($ret == 'html') print '<br>';
}
// Confirmation de la suppression d'une ligne d'intervention
if ($action == 'ask_deleteline')
{
$ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&ligne='.$_GET["ligne"], $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline','',0,1);
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&line_id='.$_GET["line_id"], $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline','',0,1);
if ($ret == 'html') print '<br>';
}
@ -817,7 +790,7 @@ elseif ($fichinterid)
// Ref
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>';
print $html->showrefnav($object,'ref','',1,'ref','ref');
print $form->showrefnav($object,'ref','',1,'ref','ref');
print '</td></tr>';
// Third party
@ -825,31 +798,38 @@ elseif ($fichinterid)
// Duration
print '<tr><td>'.$langs->trans("TotalDuration").'</td>';
//print $object->duree.'-'.$conf->global->MAIN_DURATION_OF_WORKDAY;
print '<td>'.ConvertSecondToTime($object->duree,'all',$conf->global->MAIN_DURATION_OF_WORKDAY).'</td>';
//print '<td>'.ConvertSecondToTime(90000,'all',$conf->global->MAIN_DURATION_OF_WORKDAY).'</td>';
print '</tr>';
// Description (must be a textarea and not html must be allowed (used in list view)
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Description');
print '</td>';
if ($action != 'editdescription' && $object->statut == 0) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdescription&amp;id='.$object->id.'">'.img_edit($langs->trans('Modify'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'editdescription')
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE))
{
print '<form name="editdescription" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="setdescription">';
print '<textarea name="description" wrap="soft" cols="70" rows="'.ROWS_3.'">'.dol_htmlentitiesbr_decode($object->description).'</textarea><br>';
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
print $langs->trans('Description');
print '</td><td colspan="3">';
print $form->editInPlace($object->description, 'description', $user->rights->ficheinter->creer && $object->statut == 0, 'textarea');
}
else
{
print dol_nl2br($object->description);
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Description');
print '</td>';
if ($action != 'editdescription' && $object->statut == 0) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdescription&amp;id='.$object->id.'">'.img_edit($langs->trans('Modify'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'editdescription')
{
print '<form name="editdescription" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="setdescription">';
print '<textarea name="description" wrap="soft" cols="70" rows="'.ROWS_3.'">'.dol_htmlentitiesbr_decode($object->description).'</textarea><br>';
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
}
else
{
print dol_nl2br($object->description);
}
}
print '</td>';
print '</tr>';
@ -874,11 +854,11 @@ elseif ($fichinterid)
print '</td><td colspan="3">';
if ($action == 'classify')
{
$html->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project,'projectid');
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project,'projectid');
}
else
{
$html->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project,'none');
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project,'none');
}
print '</td>';
print '</tr>';
@ -886,6 +866,21 @@ elseif ($fichinterid)
// Statut
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
// Public note
print '<tr><td valign="top">'.$langs->trans("NotePublic").'</td>';
print '<td valign="top" colspan="3">';
print $form->editInPlace($object->note_public, 'note_public', $user->rights->ficheinter->creer, 'textarea');
print "</td></tr>";
// Private note
if (! $user->societe_id)
{
print '<tr><td valign="top">'.$langs->trans("NotePrivate").'</td>';
print '<td valign="top" colspan="3">';
print $form->editInPlace($object->note_private, 'note_private', $user->rights->ficheinter->creer, 'textarea');
print "</td></tr>";
}
print "</table>";
@ -895,7 +890,7 @@ elseif ($fichinterid)
$sql = 'SELECT ft.rowid, ft.description, ft.fk_fichinter, ft.duree, ft.rang,';
$sql.= ' ft.date as date_intervention';
$sql.= ' FROM '.MAIN_DB_PREFIX.'fichinterdet as ft';
$sql.= ' WHERE ft.fk_fichinter = '.$fichinterid;
$sql.= ' WHERE ft.fk_fichinter = '.$object->id;
$sql.= ' ORDER BY ft.rang ASC, ft.rowid';
$resql = $db->query($sql);
@ -922,7 +917,7 @@ elseif ($fichinterid)
$var=!$var;
// Ligne en mode visu
if ($action != 'editline' || $_GET['ligne'] != $objp->rowid)
if ($action != 'editline' || $_GET['line_id'] != $objp->rowid)
{
print '<tr '.$bc[$var].'>';
print '<td>';
@ -942,12 +937,12 @@ elseif ($fichinterid)
if ($object->statut == 0 && $user->rights->ficheinter->creer)
{
print '<td align="center">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=editline&amp;ligne='.$objp->rowid.'#'.$objp->rowid.'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=editline&amp;line_id='.$objp->rowid.'#'.$objp->rowid.'">';
print img_edit();
print '</a>';
print '</td>';
print '<td align="center">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=ask_deleteline&amp;ligne='.$objp->rowid.'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=ask_deleteline&amp;line_id='.$objp->rowid.'">';
print img_delete();
print '</a></td>';
if ($num > 1)
@ -955,13 +950,13 @@ elseif ($fichinterid)
print '<td align="center">';
if ($i > 0)
{
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=up&amp;rowid='.$objp->rowid.'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=up&amp;line_id='.$objp->rowid.'">';
print img_up();
print '</a>';
}
if ($i < $num-1)
{
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=down&amp;rowid='.$objp->rowid.'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=down&amp;line_id='.$objp->rowid.'">';
print img_down();
print '</a>';
}
@ -977,13 +972,13 @@ elseif ($fichinterid)
}
// Ligne en mode update
if ($object->statut == 0 && $action == 'editline' && $user->rights->ficheinter->creer && $_GET["ligne"] == $objp->rowid)
if ($object->statut == 0 && $action == 'editline' && $user->rights->ficheinter->creer && $_GET["line_id"] == $objp->rowid)
{
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.$objp->rowid.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="updateligne">';
print '<input type="hidden" name="fichinterid" value="'.$object->id.'">';
print '<input type="hidden" name="ligne" value="'.$_GET["ligne"].'">';
print '<input type="hidden" name="action" value="updateline">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<input type="hidden" name="line_id" value="'.$_GET["line_id"].'">';
print '<tr '.$bc[$var].'>';
print '<td>';
print '<a name="'.$objp->rowid.'"></a>'; // ancre pour retourner sur la ligne
@ -996,12 +991,12 @@ elseif ($fichinterid)
// Date d'intervention
print '<td align="center" nowrap="nowrap">';
$html->select_date($db->jdate($objp->date_intervention),'di',1,1,0,"date_intervention");
$form->select_date($db->jdate($objp->date_intervention),'di',1,1,0,"date_intervention");
print '</td>';
// Duration
print '<td align="right">';
$html->select_duration('duration',$objp->duree);
$form->select_duration('duration',$objp->duree);
print '</td>';
print '<td align="center" colspan="5" valign="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
@ -1036,7 +1031,7 @@ elseif ($fichinterid)
// Ajout ligne d'intervention
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'#add" name="addinter" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="fichinterid" value="'.$object->id.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<input type="hidden" name="action" value="addline">';
$var=false;
@ -1054,12 +1049,12 @@ elseif ($fichinterid)
$timearray=dol_getdate(mktime());
if (empty($_POST['diday'])) $timewithnohour=dol_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']);
else $timewithnohour=dol_mktime($_POST['dihour'],$_POST['dimin'],$_POST['disec'],$_POST['dimonth'],$_POST['diday'],$_POST['diyear']);
$html->select_date($timewithnohour,'di',1,1,0,"addinter");
$form->select_date($timewithnohour,'di',1,1,0,"addinter");
print '</td>';
// Duration
print '<td align="right">';
$html->select_duration('duration',(empty($_POST["durationhour"]) && empty($_POST["durationmin"]))?3600:(60*60*$_POST["durationhour"]+60*$_POST["durationmin"]));
$form->select_duration('duration',(empty($_POST["durationhour"]) && empty($_POST["durationmin"]))?3600:(60*60*$_POST["durationhour"]+60*$_POST["durationmin"]));
print '</td>';
print '<td align="center" valign="middle" colspan="4"><input type="submit" class="button" value="'.$langs->trans('Add').'" name="addline"></td>';
@ -1107,8 +1102,8 @@ elseif ($fichinterid)
// Send
if ($object->statut > 0)
{
$ficheinterref = dol_sanitizeFileName($object->ref);
$file = $conf->ficheinter->dir_output . '/'.$ficheinterref.'/'.$ficheinterref.'.pdf';
$objectref = dol_sanitizeFileName($object->ref);
$file = $conf->ficheinter->dir_output . '/'.$objectref.'/'.$objectref.'.pdf';
if (file_exists($file))
{
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->ficheinter->ficheinter_advance->send)
@ -1168,7 +1163,7 @@ elseif ($fichinterid)
$var=true;
//print "<br>\n";
$somethingshown=$formfile->show_documents('ficheinter',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$societe->default_lang);
$somethingshown=$formfile->show_documents('ficheinter',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
/*
* Linked object block
@ -1223,7 +1218,7 @@ elseif ($fichinterid)
$formmail->param['action']='send';
$formmail->param['models']='fichinter_send';
$formmail->param['fichinter_id']=$object->id;
$formmail->param['returnurl']=DOL_URL_ROOT.'/fichinter/fiche.php?id='.$object->id;
$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
// Init list of files
if (! empty($_REQUEST["mode"]) && $_REQUEST["mode"]=='init')

View File

@ -1,5 +0,0 @@
jpgraph2
phpsane
php_excelreader
.DS_Store
ckfinder

View File

@ -0,0 +1,10 @@
http://github.com/jquery/jquery-ui
add "js" directory in language directory
eg: /langs/fr_FR/js/
move datepicker language file
eg: /langs/fr_FR/js/jquery.ui.datepicker-fr.js
and rename the file
eg: /langs/fr_FR/js/jquery.ui.datepicker.js

View File

@ -0,0 +1,23 @@
/* Afrikaans initialisation for the jQuery UI date picker plugin. */
/* Written by Renier Pretorius. */
jQuery(function($){
$.datepicker.regional['af'] = {
closeText: 'Selekteer',
prevText: 'Vorige',
nextText: 'Volgende',
currentText: 'Vandag',
monthNames: ['Januarie','Februarie','Maart','April','Mei','Junie',
'Julie','Augustus','September','Oktober','November','Desember'],
monthNamesShort: ['Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun',
'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'],
dayNames: ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'],
dayNamesShort: ['Son', 'Maa', 'Din', 'Woe', 'Don', 'Vry', 'Sat'],
dayNamesMin: ['So','Ma','Di','Wo','Do','Vr','Sa'],
weekHeader: 'Wk',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['af']);
});

View File

@ -0,0 +1,23 @@
/* Algerian Arabic Translation for jQuery UI date picker plugin. (can be used for Tunisia)*/
/* Mohamed Cherif BOUCHELAGHEM -- cherifbouchelaghem@yahoo.fr */
jQuery(function($){
$.datepicker.regional['ar-DZ'] = {
closeText: 'إغلاق',
prevText: '&#x3C;السابق',
nextText: 'التالي&#x3E;',
currentText: 'اليوم',
monthNames: ['جانفي', 'فيفري', 'مارس', 'أفريل', 'ماي', 'جوان',
'جويلية', 'أوت', 'سبتمبر','أكتوبر', 'نوفمبر', 'ديسمبر'],
monthNamesShort: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
dayNames: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
dayNamesShort: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
dayNamesMin: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
weekHeader: 'أسبوع',
dateFormat: 'dd/mm/yy',
firstDay: 6,
isRTL: true,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['ar-DZ']);
});

View File

@ -0,0 +1,23 @@
/* Arabic Translation for jQuery UI date picker plugin. */
/* Khaled Alhourani -- me@khaledalhourani.com */
/* NOTE: monthNames are the original months names and they are the Arabic names, not the new months name فبراير - يناير and there isn't any Arabic roots for these months */
jQuery(function($){
$.datepicker.regional['ar'] = {
closeText: 'إغلاق',
prevText: '&#x3C;السابق',
nextText: 'التالي&#x3E;',
currentText: 'اليوم',
monthNames: ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'مايو', 'حزيران',
'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'],
monthNamesShort: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
dayNames: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
dayNamesShort: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
dayNamesMin: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
weekHeader: 'أسبوع',
dateFormat: 'dd/mm/yy',
firstDay: 6,
isRTL: true,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['ar']);
});

View File

@ -0,0 +1,23 @@
/* Azerbaijani (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Jamil Najafov (necefov33@gmail.com). */
jQuery(function($) {
$.datepicker.regional['az'] = {
closeText: 'Bağla',
prevText: '&#x3C;Geri',
nextText: 'İrəli&#x3E;',
currentText: 'Bugün',
monthNames: ['Yanvar','Fevral','Mart','Aprel','May','İyun',
'İyul','Avqust','Sentyabr','Oktyabr','Noyabr','Dekabr'],
monthNamesShort: ['Yan','Fev','Mar','Apr','May','İyun',
'İyul','Avq','Sen','Okt','Noy','Dek'],
dayNames: ['Bazar','Bazar ertəsi','Çərşənbə axşamı','Çərşənbə','Cümə axşamı','Cümə','Şənbə'],
dayNamesShort: ['B','Be','Ça','Ç','Ca','C','Ş'],
dayNamesMin: ['B','B','Ç','С','Ç','C','Ş'],
weekHeader: 'Hf',
dateFormat: 'dd.mm.yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['az']);
});

View File

@ -0,0 +1,24 @@
/* Bulgarian initialisation for the jQuery UI date picker plugin. */
/* Written by Stoyan Kyosev (http://svest.org). */
jQuery(function($){
$.datepicker.regional['bg'] = {
closeText: 'затвори',
prevText: '&#x3C;назад',
nextText: 'напред&#x3E;',
nextBigText: '&#x3E;&#x3E;',
currentText: 'днес',
monthNames: ['Януари','Февруари','Март','Април','Май','Юни',
'Юли','Август','Септември','Октомври','Ноември','Декември'],
monthNamesShort: ['Яну','Фев','Мар','Апр','Май','Юни',
'Юли','Авг','Сеп','Окт','Нов','Дек'],
dayNames: ['Неделя','Понеделник','Вторник','Сряда','Четвъртък','Петък','Събота'],
dayNamesShort: ['Нед','Пон','Вто','Сря','Чет','Пет','Съб'],
dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Съ'],
weekHeader: 'Wk',
dateFormat: 'dd.mm.yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['bg']);
});

View File

@ -0,0 +1,23 @@
/* Bosnian i18n for the jQuery UI date picker plugin. */
/* Written by Kenan Konjo. */
jQuery(function($){
$.datepicker.regional['bs'] = {
closeText: 'Zatvori',
prevText: '&#x3C;',
nextText: '&#x3E;',
currentText: 'Danas',
monthNames: ['Januar','Februar','Mart','April','Maj','Juni',
'Juli','August','Septembar','Oktobar','Novembar','Decembar'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
'Jul','Aug','Sep','Okt','Nov','Dec'],
dayNames: ['Nedelja','Ponedeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'],
dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'],
dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
weekHeader: 'Wk',
dateFormat: 'dd.mm.yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['bs']);
});

View File

@ -0,0 +1,23 @@
/* Czech initialisation for the jQuery UI date picker plugin. */
/* Written by Tomas Muller (tomas@tomas-muller.net). */
jQuery(function($){
$.datepicker.regional['cs'] = {
closeText: 'Zavřít',
prevText: '&#x3C;Dříve',
nextText: 'Později&#x3E;',
currentText: 'Nyní',
monthNames: ['leden','únor','březen','duben','květen','červen',
'červenec','srpen','září','říjen','listopad','prosinec'],
monthNamesShort: ['led','úno','bře','dub','kvě','čer',
'čvc','srp','zář','říj','lis','pro'],
dayNames: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'],
dayNamesShort: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'],
dayNamesMin: ['ne','po','út','st','čt','pá','so'],
weekHeader: 'Týd',
dateFormat: 'dd.mm.yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['cs']);
});

View File

@ -0,0 +1,23 @@
/* Esperanto initialisation for the jQuery UI date picker plugin. */
/* Written by Olivier M. (olivierweb@ifrance.com). */
jQuery(function($){
$.datepicker.regional['eo'] = {
closeText: 'Fermi',
prevText: '&#x3C;Anta',
nextText: 'Sekv&#x3E;',
currentText: 'Nuna',
monthNames: ['Januaro','Februaro','Marto','Aprilo','Majo','Junio',
'Julio','Aŭgusto','Septembro','Oktobro','Novembro','Decembro'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
'Jul','Aŭg','Sep','Okt','Nov','Dec'],
dayNames: ['Dimanĉo','Lundo','Mardo','Merkredo','Ĵaŭdo','Vendredo','Sabato'],
dayNamesShort: ['Dim','Lun','Mar','Mer','Ĵaŭ','Ven','Sab'],
dayNamesMin: ['Di','Lu','Ma','Me','Ĵa','Ve','Sa'],
weekHeader: 'Sb',
dateFormat: 'dd/mm/yy',
firstDay: 0,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['eo']);
});

View File

@ -0,0 +1,23 @@
/* Estonian initialisation for the jQuery UI date picker plugin. */
/* Written by Mart Sõmermaa (mrts.pydev at gmail com). */
jQuery(function($){
$.datepicker.regional['et'] = {
closeText: 'Sulge',
prevText: 'Eelnev',
nextText: 'Järgnev',
currentText: 'Täna',
monthNames: ['Jaanuar','Veebruar','Märts','Aprill','Mai','Juuni',
'Juuli','August','September','Oktoober','November','Detsember'],
monthNamesShort: ['Jaan', 'Veebr', 'Märts', 'Apr', 'Mai', 'Juuni',
'Juuli', 'Aug', 'Sept', 'Okt', 'Nov', 'Dets'],
dayNames: ['Pühapäev', 'Esmaspäev', 'Teisipäev', 'Kolmapäev', 'Neljapäev', 'Reede', 'Laupäev'],
dayNamesShort: ['Pühap', 'Esmasp', 'Teisip', 'Kolmap', 'Neljap', 'Reede', 'Laup'],
dayNamesMin: ['P','E','T','K','N','R','L'],
weekHeader: 'Sm',
dateFormat: 'dd.mm.yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['et']);
});

View File

@ -0,0 +1,23 @@
/* Euskarako oinarria 'UI date picker' jquery-ko extentsioarentzat */
/* Karrikas-ek itzulia (karrikas@karrikas.com) */
jQuery(function($){
$.datepicker.regional['eu'] = {
closeText: 'Egina',
prevText: '&#x3C;Aur',
nextText: 'Hur&#x3E;',
currentText: 'Gaur',
monthNames: ['Urtarrila','Otsaila','Martxoa','Apirila','Maiatza','Ekaina',
'Uztaila','Abuztua','Iraila','Urria','Azaroa','Abendua'],
monthNamesShort: ['Urt','Ots','Mar','Api','Mai','Eka',
'Uzt','Abu','Ira','Urr','Aza','Abe'],
dayNames: ['Igandea','Astelehena','Asteartea','Asteazkena','Osteguna','Ostirala','Larunbata'],
dayNamesShort: ['Iga','Ast','Ast','Ast','Ost','Ost','Lar'],
dayNamesMin: ['Ig','As','As','As','Os','Os','La'],
weekHeader: 'Wk',
dateFormat: 'yy/mm/dd',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['eu']);
});

View File

@ -0,0 +1,23 @@
/* Faroese initialisation for the jQuery UI date picker plugin */
/* Written by Sverri Mohr Olsen, sverrimo@gmail.com */
jQuery(function($){
$.datepicker.regional['fo'] = {
closeText: 'Lat aftur',
prevText: '&#x3C;Fyrra',
nextText: 'Næsta&#x3E;',
currentText: 'Í dag',
monthNames: ['Januar','Februar','Mars','Apríl','Mei','Juni',
'Juli','August','September','Oktober','November','Desember'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun',
'Jul','Aug','Sep','Okt','Nov','Des'],
dayNames: ['Sunnudagur','Mánadagur','Týsdagur','Mikudagur','Hósdagur','Fríggjadagur','Leyardagur'],
dayNamesShort: ['Sun','Mán','Týs','Mik','Hós','Frí','Ley'],
dayNamesMin: ['Su','Má','Tý','Mi','Hó','Fr','Le'],
weekHeader: 'Vk',
dateFormat: 'dd-mm-yy',
firstDay: 0,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['fo']);
});

View File

@ -0,0 +1,23 @@
/* Galician localization for 'UI date picker' jQuery extension. */
/* Translated by Jorge Barreiro <yortx.barry@gmail.com>. */
jQuery(function($){
$.datepicker.regional['gl'] = {
closeText: 'Pechar',
prevText: '&#x3C;Ant',
nextText: 'Seg&#x3E;',
currentText: 'Hoxe',
monthNames: ['Xaneiro','Febreiro','Marzo','Abril','Maio','Xuño',
'Xullo','Agosto','Setembro','Outubro','Novembro','Decembro'],
monthNamesShort: ['Xan','Feb','Mar','Abr','Mai','Xuñ',
'Xul','Ago','Set','Out','Nov','Dec'],
dayNames: ['Domingo','Luns','Martes','M&#xE9;rcores','Xoves','Venres','S&#xE1;bado'],
dayNamesShort: ['Dom','Lun','Mar','M&#xE9;r','Xov','Ven','S&#xE1;b'],
dayNamesMin: ['Do','Lu','Ma','M&#xE9;','Xo','Ve','S&#xE1;'],
weekHeader: 'Sm',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['gl']);
});

View File

@ -0,0 +1,23 @@
/* Hebrew initialisation for the UI Datepicker extension. */
/* Written by Amir Hardon (ahardon at gmail dot com). */
jQuery(function($){
$.datepicker.regional['he'] = {
closeText: 'סגור',
prevText: '&#x3C;הקודם',
nextText: 'הבא&#x3E;',
currentText: 'היום',
monthNames: ['ינואר','פברואר','מרץ','אפריל','מאי','יוני',
'יולי','אוגוסט','ספטמבר','אוקטובר','נובמבר','דצמבר'],
monthNamesShort: ['1','2','3','4','5','6',
'7','8','9','10','11','12'],
dayNames: ['ראשון','שני','שלישי','רביעי','חמישי','שישי','שבת'],
dayNamesShort: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
dayNamesMin: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
weekHeader: 'Wk',
dateFormat: 'dd/mm/yy',
firstDay: 0,
isRTL: true,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['he']);
});

View File

@ -0,0 +1,23 @@
/* Croatian i18n for the jQuery UI date picker plugin. */
/* Written by Vjekoslav Nesek. */
jQuery(function($){
$.datepicker.regional['hr'] = {
closeText: 'Zatvori',
prevText: '&#x3C;',
nextText: '&#x3E;',
currentText: 'Danas',
monthNames: ['Siječanj','Veljača','Ožujak','Travanj','Svibanj','Lipanj',
'Srpanj','Kolovoz','Rujan','Listopad','Studeni','Prosinac'],
monthNamesShort: ['Sij','Velj','Ožu','Tra','Svi','Lip',
'Srp','Kol','Ruj','Lis','Stu','Pro'],
dayNames: ['Nedjelja','Ponedjeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'],
dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'],
dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
weekHeader: 'Tje',
dateFormat: 'dd.mm.yy.',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['hr']);
});

View File

@ -0,0 +1,23 @@
/* Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Levon Zakaryan (levon.zakaryan@gmail.com)*/
jQuery(function($){
$.datepicker.regional['hy'] = {
closeText: 'Փակել',
prevText: '&#x3C;Նախ.',
nextText: 'Հաջ.&#x3E;',
currentText: 'Այսօր',
monthNames: ['Հունվար','Փետրվար','Մարտ','Ապրիլ','Մայիս','Հունիս',
'Հուլիս','Օգոստոս','Սեպտեմբեր','Հոկտեմբեր','Նոյեմբեր','Դեկտեմբեր'],
monthNamesShort: ['Հունվ','Փետր','Մարտ','Ապր','Մայիս','Հունիս',
'Հուլ','Օգս','Սեպ','Հոկ','Նոյ','Դեկ'],
dayNames: ['կիրակի','եկուշաբթի','երեքշաբթի','չորեքշաբթի','հինգշաբթի','ուրբաթ','շաբաթ'],
dayNamesShort: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'],
dayNamesMin: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'],
weekHeader: 'ՇԲՏ',
dateFormat: 'dd.mm.yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['hy']);
});

View File

@ -0,0 +1,23 @@
/* Indonesian initialisation for the jQuery UI date picker plugin. */
/* Written by Deden Fathurahman (dedenf@gmail.com). */
jQuery(function($){
$.datepicker.regional['id'] = {
closeText: 'Tutup',
prevText: '&#x3C;mundur',
nextText: 'maju&#x3E;',
currentText: 'hari ini',
monthNames: ['Januari','Februari','Maret','April','Mei','Juni',
'Juli','Agustus','September','Oktober','Nopember','Desember'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun',
'Jul','Agus','Sep','Okt','Nop','Des'],
dayNames: ['Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'],
dayNamesShort: ['Min','Sen','Sel','Rab','kam','Jum','Sab'],
dayNamesMin: ['Mg','Sn','Sl','Rb','Km','jm','Sb'],
weekHeader: 'Mg',
dateFormat: 'dd/mm/yy',
firstDay: 0,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['id']);
});

View File

@ -0,0 +1,23 @@
/* Korean initialisation for the jQuery calendar extension. */
/* Written by DaeKwon Kang (ncrash.dk@gmail.com). */
jQuery(function($){
$.datepicker.regional['ko'] = {
closeText: '닫기',
prevText: '이전달',
nextText: '다음달',
currentText: '오늘',
monthNames: ['1월(JAN)','2월(FEB)','3월(MAR)','4월(APR)','5월(MAY)','6월(JUN)',
'7월(JUL)','8월(AUG)','9월(SEP)','10월(OCT)','11월(NOV)','12월(DEC)'],
monthNamesShort: ['1월(JAN)','2월(FEB)','3월(MAR)','4월(APR)','5월(MAY)','6월(JUN)',
'7월(JUL)','8월(AUG)','9월(SEP)','10월(OCT)','11월(NOV)','12월(DEC)'],
dayNames: ['일','월','화','수','목','금','토'],
dayNamesShort: ['일','월','화','수','목','금','토'],
dayNamesMin: ['일','월','화','수','목','금','토'],
weekHeader: 'Wk',
dateFormat: 'yy-mm-dd',
firstDay: 0,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: '년'};
$.datepicker.setDefaults($.datepicker.regional['ko']);
});

View File

@ -0,0 +1,23 @@
/* Kazakh (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Dmitriy Karasyov (dmitriy.karasyov@gmail.com). */
jQuery(function($){
$.datepicker.regional['kz'] = {
closeText: 'Жабу',
prevText: '&#x3C;Алдыңғы',
nextText: 'Келесі&#x3E;',
currentText: 'Бүгін',
monthNames: ['Қаңтар','Ақпан','Наурыз','Сәуір','Мамыр','Маусым',
'Шілде','Тамыз','Қыркүйек','Қазан','Қараша','Желтоқсан'],
monthNamesShort: ['Қаң','Ақп','Нау','Сәу','Мам','Мау',
'Шіл','Там','Қыр','Қаз','Қар','Жел'],
dayNames: ['Жексенбі','Дүйсенбі','Сейсенбі','Сәрсенбі','Бейсенбі','Жұма','Сенбі'],
dayNamesShort: ['жкс','дсн','ссн','срс','бсн','жма','снб'],
dayNamesMin: ['Жк','Дс','Сс','Ср','Бс','Жм','Сн'],
weekHeader: 'Не',
dateFormat: 'dd.mm.yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['kz']);
});

View File

@ -0,0 +1,23 @@
/* Lithuanian (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* @author Arturas Paleicikas <arturas@avalon.lt> */
jQuery(function($){
$.datepicker.regional['lt'] = {
closeText: 'Uždaryti',
prevText: '&#x3C;Atgal',
nextText: 'Pirmyn&#x3E;',
currentText: 'Šiandien',
monthNames: ['Sausis','Vasaris','Kovas','Balandis','Gegužė','Birželis',
'Liepa','Rugpjūtis','Rugsėjis','Spalis','Lapkritis','Gruodis'],
monthNamesShort: ['Sau','Vas','Kov','Bal','Geg','Bir',
'Lie','Rugp','Rugs','Spa','Lap','Gru'],
dayNames: ['sekmadienis','pirmadienis','antradienis','trečiadienis','ketvirtadienis','penktadienis','šeštadienis'],
dayNamesShort: ['sek','pir','ant','tre','ket','pen','šeš'],
dayNamesMin: ['Se','Pr','An','Tr','Ke','Pe','Še'],
weekHeader: 'Wk',
dateFormat: 'yy-mm-dd',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['lt']);
});

View File

@ -0,0 +1,23 @@
/* Latvian (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* @author Arturas Paleicikas <arturas.paleicikas@metasite.net> */
jQuery(function($){
$.datepicker.regional['lv'] = {
closeText: 'Aizvērt',
prevText: 'Iepr',
nextText: 'Nāka',
currentText: 'Šodien',
monthNames: ['Janvāris','Februāris','Marts','Aprīlis','Maijs','Jūnijs',
'Jūlijs','Augusts','Septembris','Oktobris','Novembris','Decembris'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jūn',
'Jūl','Aug','Sep','Okt','Nov','Dec'],
dayNames: ['svētdiena','pirmdiena','otrdiena','trešdiena','ceturtdiena','piektdiena','sestdiena'],
dayNamesShort: ['svt','prm','otr','tre','ctr','pkt','sst'],
dayNamesMin: ['Sv','Pr','Ot','Tr','Ct','Pk','Ss'],
weekHeader: 'Nav',
dateFormat: 'dd-mm-yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['lv']);
});

View File

@ -0,0 +1,23 @@
/* Malayalam (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Saji Nediyanchath (saji89@gmail.com). */
jQuery(function($){
$.datepicker.regional['ml'] = {
closeText: 'ശരി',
prevText: 'മുന്നത്തെ',
nextText: 'അടുത്തത് ',
currentText: 'ഇന്ന്',
monthNames: ['ജനുവരി','ഫെബ്രുവരി','മാര്‍ച്ച്','ഏപ്രില്‍','മേയ്','ജൂണ്‍',
'ജൂലൈ','ആഗസ്റ്റ്','സെപ്റ്റംബര്‍','ഒക്ടോബര്‍','നവംബര്‍','ഡിസംബര്‍'],
monthNamesShort: ['ജനു', 'ഫെബ്', 'മാര്‍', 'ഏപ്രി', 'മേയ്', 'ജൂണ്‍',
'ജൂലാ', 'ആഗ', 'സെപ്', 'ഒക്ടോ', 'നവം', 'ഡിസ'],
dayNames: ['ഞായര്‍', 'തിങ്കള്‍', 'ചൊവ്വ', 'ബുധന്‍', 'വ്യാഴം', 'വെള്ളി', 'ശനി'],
dayNamesShort: ['ഞായ', 'തിങ്ക', 'ചൊവ്വ', 'ബുധ', 'വ്യാഴം', 'വെള്ളി', 'ശനി'],
dayNamesMin: ['ഞാ','തി','ചൊ','ബു','വ്യാ','വെ','ശ'],
weekHeader: 'ആ',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['ml']);
});

View File

@ -0,0 +1,23 @@
/* Malaysian initialisation for the jQuery UI date picker plugin. */
/* Written by Mohd Nawawi Mohamad Jamili (nawawi@ronggeng.net). */
jQuery(function($){
$.datepicker.regional['ms'] = {
closeText: 'Tutup',
prevText: '&#x3C;Sebelum',
nextText: 'Selepas&#x3E;',
currentText: 'hari ini',
monthNames: ['Januari','Februari','Mac','April','Mei','Jun',
'Julai','Ogos','September','Oktober','November','Disember'],
monthNamesShort: ['Jan','Feb','Mac','Apr','Mei','Jun',
'Jul','Ogo','Sep','Okt','Nov','Dis'],
dayNames: ['Ahad','Isnin','Selasa','Rabu','Khamis','Jumaat','Sabtu'],
dayNamesShort: ['Aha','Isn','Sel','Rab','kha','Jum','Sab'],
dayNamesMin: ['Ah','Is','Se','Ra','Kh','Ju','Sa'],
weekHeader: 'Mg',
dateFormat: 'dd/mm/yy',
firstDay: 0,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['ms']);
});

View File

@ -0,0 +1,21 @@
/* Romansh initialisation for the jQuery UI date picker plugin. */
/* Written by Yvonne Gienal (yvonne.gienal@educa.ch). */
jQuery(function($){
$.datepicker.regional['rm'] = {
closeText: 'Serrar',
prevText: '&#x3C;Suandant',
nextText: 'Precedent&#x3E;',
currentText: 'Actual',
monthNames: ['Schaner','Favrer','Mars','Avrigl','Matg','Zercladur', 'Fanadur','Avust','Settember','October','November','December'],
monthNamesShort: ['Scha','Fev','Mar','Avr','Matg','Zer', 'Fan','Avu','Sett','Oct','Nov','Dec'],
dayNames: ['Dumengia','Glindesdi','Mardi','Mesemna','Gievgia','Venderdi','Sonda'],
dayNamesShort: ['Dum','Gli','Mar','Mes','Gie','Ven','Som'],
dayNamesMin: ['Du','Gl','Ma','Me','Gi','Ve','So'],
weekHeader: 'emna',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['rm']);
});

View File

@ -0,0 +1,23 @@
/* Slovak initialisation for the jQuery UI date picker plugin. */
/* Written by Vojtech Rinik (vojto@hmm.sk). */
jQuery(function($){
$.datepicker.regional['sk'] = {
closeText: 'Zavrieť',
prevText: '&#x3C;Predchádzajúci',
nextText: 'Nasledujúci&#x3E;',
currentText: 'Dnes',
monthNames: ['Január','Február','Marec','Apríl','Máj','Jún',
'Júl','August','September','Október','November','December'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún',
'Júl','Aug','Sep','Okt','Nov','Dec'],
dayNames: ['Nedeľa','Pondelok','Utorok','Streda','Štvrtok','Piatok','Sobota'],
dayNamesShort: ['Ned','Pon','Uto','Str','Štv','Pia','Sob'],
dayNamesMin: ['Ne','Po','Ut','St','Št','Pia','So'],
weekHeader: 'Ty',
dateFormat: 'dd.mm.yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['sk']);
});

View File

@ -0,0 +1,23 @@
/* Albanian initialisation for the jQuery UI date picker plugin. */
/* Written by Flakron Bytyqi (flakron@gmail.com). */
jQuery(function($){
$.datepicker.regional['sq'] = {
closeText: 'mbylle',
prevText: '&#x3C;mbrapa',
nextText: 'Përpara&#x3E;',
currentText: 'sot',
monthNames: ['Janar','Shkurt','Mars','Prill','Maj','Qershor',
'Korrik','Gusht','Shtator','Tetor','Nëntor','Dhjetor'],
monthNamesShort: ['Jan','Shk','Mar','Pri','Maj','Qer',
'Kor','Gus','Sht','Tet','Nën','Dhj'],
dayNames: ['E Diel','E Hënë','E Martë','E Mërkurë','E Enjte','E Premte','E Shtune'],
dayNamesShort: ['Di','Hë','Ma','Më','En','Pr','Sh'],
dayNamesMin: ['Di','Hë','Ma','Më','En','Pr','Sh'],
weekHeader: 'Ja',
dateFormat: 'dd.mm.yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['sq']);
});

View File

@ -0,0 +1,23 @@
/* Serbian i18n for the jQuery UI date picker plugin. */
/* Written by Dejan Dimić. */
jQuery(function($){
$.datepicker.regional['sr-SR'] = {
closeText: 'Zatvori',
prevText: '&#x3C;',
nextText: '&#x3E;',
currentText: 'Danas',
monthNames: ['Januar','Februar','Mart','April','Maj','Jun',
'Jul','Avgust','Septembar','Oktobar','Novembar','Decembar'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
'Jul','Avg','Sep','Okt','Nov','Dec'],
dayNames: ['Nedelja','Ponedeljak','Utorak','Sreda','Četvrtak','Petak','Subota'],
dayNamesShort: ['Ned','Pon','Uto','Sre','Čet','Pet','Sub'],
dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
weekHeader: 'Sed',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['sr-SR']);
});

View File

@ -0,0 +1,23 @@
/* Serbian i18n for the jQuery UI date picker plugin. */
/* Written by Dejan Dimić. */
jQuery(function($){
$.datepicker.regional['sr'] = {
closeText: 'Затвори',
prevText: '&#x3C;',
nextText: '&#x3E;',
currentText: 'Данас',
monthNames: ['Јануар','Фебруар','Март','Април','Мај','Јун',
'Јул','Август','Септембар','Октобар','Новембар','Децембар'],
monthNamesShort: ['Јан','Феб','Мар','Апр','Мај','Јун',
'Јул','Авг','Сеп','Окт','Нов','Дец'],
dayNames: ['Недеља','Понедељак','Уторак','Среда','Четвртак','Петак','Субота'],
dayNamesShort: ['Нед','Пон','Уто','Сре','Чет','Пет','Суб'],
dayNamesMin: ['Не','По','Ут','Ср','Че','Пе','Су'],
weekHeader: 'Сед',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['sr']);
});

View File

@ -0,0 +1,23 @@
/* Tamil (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by S A Sureshkumar (saskumar@live.com). */
jQuery(function($){
$.datepicker.regional['ta'] = {
closeText: 'மூடு',
prevText: 'முன்னையது',
nextText: 'அடுத்தது',
currentText: 'இன்று',
monthNames: ['தை','மாசி','பங்குனி','சித்திரை','வைகாசி','ஆனி',
'ஆடி','ஆவணி','புரட்டாசி','ஐப்பசி','கார்த்திகை','மார்கழி'],
monthNamesShort: ['தை','மாசி','பங்','சித்','வைகா','ஆனி',
'ஆடி','ஆவ','புர','ஐப்','கார்','மார்'],
dayNames: ['ஞாயிற்றுக்கிழமை','திங்கட்கிழமை','செவ்வாய்க்கிழமை','புதன்கிழமை','வியாழக்கிழமை','வெள்ளிக்கிழமை','சனிக்கிழமை'],
dayNamesShort: ['ஞாயிறு','திங்கள்','செவ்வாய்','புதன்','வியாழன்','வெள்ளி','சனி'],
dayNamesMin: ['ஞா','தி','செ','பு','வி','வெ','ச'],
weekHeader: 'Не',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['ta']);
});

View File

@ -0,0 +1,23 @@
/* Thai initialisation for the jQuery UI date picker plugin. */
/* Written by pipo (pipo@sixhead.com). */
jQuery(function($){
$.datepicker.regional['th'] = {
closeText: 'ปิด',
prevText: '&#xAB;&#xA0;ย้อน',
nextText: 'ถัดไป&#xA0;&#xBB;',
currentText: 'วันนี้',
monthNames: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน',
'กรกฎาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'],
monthNamesShort: ['ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.',
'ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.'],
dayNames: ['อาทิตย์','จันทร์','อังคาร','พุธ','พฤหัสบดี','ศุกร์','เสาร์'],
dayNamesShort: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'],
dayNamesMin: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'],
weekHeader: 'Wk',
dateFormat: 'dd/mm/yy',
firstDay: 0,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['th']);
});

View File

@ -0,0 +1,23 @@
/* Tajiki (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Abdurahmon Saidov (saidovab@gmail.com). */
jQuery(function($){
$.datepicker.regional['tj'] = {
closeText: 'Идома',
prevText: '&#x3c;Қафо',
nextText: 'Пеш&#x3e;',
currentText: 'Имрӯз',
monthNames: ['Январ','Феврал','Март','Апрел','Май','Июн',
'Июл','Август','Сентябр','Октябр','Ноябр','Декабр'],
monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
'Июл','Авг','Сен','Окт','Ноя','Дек'],
dayNames: ['якшанбе','душанбе','сешанбе','чоршанбе','панҷшанбе','ҷумъа','шанбе'],
dayNamesShort: ['якш','душ','сеш','чор','пан','ҷум','шан'],
dayNamesMin: ['Як','Дш','Сш','Чш','Пш','Ҷм','Шн'],
weekHeader: 'Хф',
dateFormat: 'dd.mm.yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['tj']);
});

View File

@ -0,0 +1,23 @@
/* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Maxim Drogobitskiy (maxdao@gmail.com). */
jQuery(function($){
$.datepicker.regional['uk'] = {
closeText: 'Закрити',
prevText: '&#x3C;',
nextText: '&#x3E;',
currentText: 'Сьогодні',
monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень',
'Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'],
monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер',
'Лип','Сер','Вер','Жов','Лис','Гру'],
dayNames: ['неділя','понеділок','вівторок','середа','четвер','п’ятниця','субота'],
dayNamesShort: ['нед','пнд','вів','срд','чтв','птн','сбт'],
dayNamesMin: ['Нд','Пн','Вт','Ср','Чт','Пт','Сб'],
weekHeader: 'Не',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['uk']);
});

View File

@ -0,0 +1,23 @@
/* Vietnamese initialisation for the jQuery UI date picker plugin. */
/* Translated by Le Thanh Huy (lthanhhuy@cit.ctu.edu.vn). */
jQuery(function($){
$.datepicker.regional['vi'] = {
closeText: 'Đóng',
prevText: '&#x3C;Trước',
nextText: 'Tiếp&#x3E;',
currentText: 'Hôm nay',
monthNames: ['Tháng Một', 'Tháng Hai', 'Tháng Ba', 'Tháng Tư', 'Tháng Năm', 'Tháng Sáu',
'Tháng Bảy', 'Tháng Tám', 'Tháng Chín', 'Tháng Mười', 'Tháng Mười Một', 'Tháng Mười Hai'],
monthNamesShort: ['Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6',
'Tháng 7', 'Tháng 8', 'Tháng 9', 'Tháng 10', 'Tháng 11', 'Tháng 12'],
dayNames: ['Chủ Nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'],
dayNamesShort: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
dayNamesMin: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
weekHeader: 'Tu',
dateFormat: 'dd/mm/yy',
firstDay: 0,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['vi']);
});

View File

@ -0,0 +1,23 @@
/* Chinese initialisation for the jQuery UI date picker plugin. */
/* Written by SCCY (samuelcychan@gmail.com). */
jQuery(function($){
$.datepicker.regional['zh-HK'] = {
closeText: '關閉',
prevText: '&#x3C;上月',
nextText: '下月&#x3E;',
currentText: '今天',
monthNames: ['一月','二月','三月','四月','五月','六月',
'七月','八月','九月','十月','十一月','十二月'],
monthNamesShort: ['一','二','三','四','五','六',
'七','八','九','十','十一','十二'],
dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
dayNamesMin: ['日','一','二','三','四','五','六'],
weekHeader: '周',
dateFormat: 'dd-mm-yy',
firstDay: 0,
isRTL: false,
showMonthAfterYear: true,
yearSuffix: '年'};
$.datepicker.setDefaults($.datepicker.regional['zh-HK']);
});

View File

@ -0,0 +1,23 @@
/* Chinese initialisation for the jQuery UI date picker plugin. */
/* Written by Ressol (ressol@gmail.com). */
jQuery(function($){
$.datepicker.regional['zh-TW'] = {
closeText: '關閉',
prevText: '&#x3C;上月',
nextText: '下月&#x3E;',
currentText: '今天',
monthNames: ['一月','二月','三月','四月','五月','六月',
'七月','八月','九月','十月','十一月','十二月'],
monthNamesShort: ['一','二','三','四','五','六',
'七','八','九','十','十一','十二'],
dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
dayNamesMin: ['日','一','二','三','四','五','六'],
weekHeader: '周',
dateFormat: 'yy/mm/dd',
firstDay: 1,
isRTL: false,
showMonthAfterYear: true,
yearSuffix: '年'};
$.datepicker.setDefaults($.datepicker.regional['zh-TW']);
});

View File

@ -1 +0,0 @@
examples

View File

@ -1,2 +0,0 @@
aaa.txt
demos

View File

@ -0,0 +1,17 @@
/* Create an inline datepicker which leverages the
jQuery UI datepicker
*/
$.editable.addInputType('datepicker', {
element: function(settings, original) {
var input = $('<input />');
input.datepicker({
onSelect: function(dateText, inst) {
$(this).parents("form").submit();
}
});
$(this).append(input);
return (input);
}
});

View File

@ -1 +0,0 @@
samples

View File

@ -1 +0,0 @@
install.forced.php

View File

@ -69,3 +69,17 @@ DROP TABLE IF EXISTS llx_pos_tmp;
ALTER TABLE llx_deplacement ADD COLUMN fk_user_modif integer AFTER fk_user_author;
CREATE TABLE IF NOT EXISTS `llx_localtax` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`datep` date DEFAULT NULL,
`datev` date DEFAULT NULL,
`amount` double NOT NULL DEFAULT '0',
`label` varchar(255) DEFAULT NULL,
`entity` int(11) NOT NULL DEFAULT '1',
`note` text,
`fk_bank` int(11) DEFAULT NULL,
`fk_user_creat` int(11) DEFAULT NULL,
`fk_user_modif` int(11) DEFAULT NULL,
PRIMARY KEY (`rowid`)
) ENGINE=InnoDB;

View File

@ -0,0 +1,42 @@
-- ===================================================================
-- Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
-- Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
--
-- 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 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- ===================================================================
create table llx_localtax
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
datep date, -- date of payment
datev date, -- date of value
amount real NOT NULL DEFAULT 0,
label varchar(255),
entity integer DEFAULT 1 NOT NULL,
note text,
fk_bank integer,
fk_user_creat integer,
fk_user_modif integer
)ENGINE=innodb;
--
-- List of codes for the field entity
--
-- 1 : first company vat
-- 2 : second company vat
-- 3 : etc...
--

View File

@ -1,2 +1,7 @@
Order deny,allow
Deny from all
<FilesMatch "\.(js)$">
Order deny,allow
Allow from all
</FilesMatch>

View File

@ -1 +0,0 @@
google.lang

View File

@ -234,7 +234,10 @@ GlobalDiscount=Descompte fixe
CreditNote=Abonament
CreditNotes=Abonaments
AddDiscount=Crear descompte fix
AddRelativeDiscount=Crear descompte relatiu
EditRelativeDiscount=Editar descompte relatiu
AddGlobalDiscount=Crear descompte fixe
EditGlobalDiscounts=Editar descompte fixe
AddCreditNote=Crear factura de pagament
Deposit=Bestreta
Deposits=Bestretes
@ -277,7 +280,7 @@ TotalOfTwoDiscountMustEqualsOriginal=La suma de l'import dels 2 nous descomptes
ConfirmRemoveDiscount=Esteu segur de voler eliminar aquest descompte?
RelatedBill=Factura associada
RelatedBills=Factures associades
# PaymentConditions==
# PaymentConditions
PaymentConditionShortRECEP=A la recepció
PaymentConditionRECEP=A la recepció de la factura
PaymentConditionShort30D=30 dies
@ -288,7 +291,7 @@ PaymentConditionShort60D=60 dies
PaymentCondition60D=Pagament als 60 dies
PaymentConditionShort60DENDMONTH=60 dies a fi de mes
PaymentCondition60DENDMONTH=Pagament als 60 dies a fi de mes
# PaymentType==
# PaymentType
PaymentTypeVIR=Transferència bancària
PaymentTypeShortVIR=Transferència
PaymentTypePRE=Domiciliació bancària
@ -379,4 +382,4 @@ PDFCrabeDescription=Model de factura complet (model recomanat per defecte)
# oursin PDF Model
PDFOursinDescription=Model de factura complet (model alternatiu)
# NumRef Modules
TerreNumRefModelDesc1=Retorna el nombre sota el format %syymm-nnnn per a les factures i %syymm-nnnn per als abonaments on yy és l'any, mm. el mes i nnnn un comptador seqüencial sense ruptura i sense permanència a 0
TerreNumRefModelDesc1=Retorna el nombre sota el format %syymm-nnnn per a les factures i %syymm-nnnn per als abonaments on yy és l'any, mm. el mes i nnnn un comptador seqüencial sense ruptura i sense permanència a 0

View File

@ -0,0 +1,23 @@
/* Inicialització en català per a l'extenció 'calendar' per jQuery. */
/* Writers: (joan.leon@gmail.com). */
jQuery(function($){
$.datepicker.regional['ca'] = {
closeText: 'Tancar',
prevText: '&#x3C;Ant',
nextText: 'Seg&#x3E;',
currentText: 'Avui',
monthNames: ['Gener','Febrer','Mar&#xE7;','Abril','Maig','Juny',
'Juliol','Agost','Setembre','Octubre','Novembre','Desembre'],
monthNamesShort: ['Gen','Feb','Mar','Abr','Mai','Jun',
'Jul','Ago','Set','Oct','Nov','Des'],
dayNames: ['Diumenge','Dilluns','Dimarts','Dimecres','Dijous','Divendres','Dissabte'],
dayNamesShort: ['Dug','Dln','Dmt','Dmc','Djs','Dvn','Dsb'],
dayNamesMin: ['Dg','Dl','Dt','Dc','Dj','Dv','Ds'],
weekHeader: 'Sm',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['ca']);
});

View File

@ -296,6 +296,8 @@ IncludedVAT=IVA inclòs
HT=Sense IVA
TTC=IVA inclòs
VAT=IVA
LT1ES=RE
LT2ES=IRPF
VATRate=Taxa IVA
Average=Mitja
Sum=Suma
@ -598,6 +600,7 @@ NewAttribute=Nou atribut
AttributeCode=Codi atribut
OptionalFieldsSetup=Configuració dels atributs opcionals
CreateDraft=Crea esborrany
ClickToEdit=Clic per a editar
# Week day
Monday=Dilluns

View File

@ -0,0 +1,23 @@
/* Danish initialisation for the jQuery UI date picker plugin. */
/* Written by Jan Christensen ( deletestuff@gmail.com). */
jQuery(function($){
$.datepicker.regional['da'] = {
closeText: 'Luk',
prevText: '&#x3C;Forrige',
nextText: 'Næste&#x3E;',
currentText: 'Idag',
monthNames: ['Januar','Februar','Marts','April','Maj','Juni',
'Juli','August','September','Oktober','November','December'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
'Jul','Aug','Sep','Okt','Nov','Dec'],
dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'],
dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'],
dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'],
weekHeader: 'Uge',
dateFormat: 'dd-mm-yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['da']);
});

View File

@ -0,0 +1,23 @@
/* German initialisation for the jQuery UI date picker plugin. */
/* Written by Milian Wolff (mail@milianw.de). */
jQuery(function($){
$.datepicker.regional['de'] = {
closeText: 'schließen',
prevText: '&#x3C;zurück',
nextText: 'Vor&#x3E;',
currentText: 'heute',
monthNames: ['Januar','Februar','März','April','Mai','Juni',
'Juli','August','September','Oktober','November','Dezember'],
monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
'Jul','Aug','Sep','Okt','Nov','Dez'],
dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
weekHeader: 'Wo',
dateFormat: 'dd.mm.yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['de']);
});

View File

@ -0,0 +1,23 @@
/* Greek (el) initialisation for the jQuery UI date picker plugin. */
/* Written by Alex Cicovic (http://www.alexcicovic.com) */
jQuery(function($){
$.datepicker.regional['el'] = {
closeText: 'Κλείσιμο',
prevText: 'Προηγούμενος',
nextText: 'Επόμενος',
currentText: 'Τρέχων Μήνας',
monthNames: ['Ιανουάριος','Φεβρουάριος','Μάρτιος','Απρίλιος','Μάιος','Ιούνιος',
'Ιούλιος','Αύγουστος','Σεπτέμβριος','Οκτώβριος','Νοέμβριος','Δεκέμβριος'],
monthNamesShort: ['Ιαν','Φεβ','Μαρ','Απρ','Μαι','Ιουν',
'Ιουλ','Αυγ','Σεπ','Οκτ','Νοε','Δεκ'],
dayNames: ['Κυριακή','Δευτέρα','Τρίτη','Τετάρτη','Πέμπτη','Παρασκευή','Σάββατο'],
dayNamesShort: ['Κυρ','Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ'],
dayNamesMin: ['Κυ','Δε','Τρ','Τε','Πε','Πα','Σα'],
weekHeader: 'Εβδ',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['el']);
});

View File

@ -1 +0,0 @@
google.lang

View File

@ -0,0 +1,23 @@
/* English/Australia initialisation for the jQuery UI date picker plugin. */
/* Based on the en-GB initialisation. */
jQuery(function($){
$.datepicker.regional['en-AU'] = {
closeText: 'Done',
prevText: 'Prev',
nextText: 'Next',
currentText: 'Today',
monthNames: ['January','February','March','April','May','June',
'July','August','September','October','November','December'],
monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],
weekHeader: 'Wk',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['en-AU']);
});

View File

@ -0,0 +1,23 @@
/* English/UK initialisation for the jQuery UI date picker plugin. */
/* Written by Stuart. */
jQuery(function($){
$.datepicker.regional['en-GB'] = {
closeText: 'Done',
prevText: 'Prev',
nextText: 'Next',
currentText: 'Today',
monthNames: ['January','February','March','April','May','June',
'July','August','September','October','November','December'],
monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],
weekHeader: 'Wk',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['en-GB']);
});

View File

@ -1 +0,0 @@
google.lang

View File

@ -1 +0,0 @@
google.lang

View File

@ -0,0 +1,23 @@
/* English/New Zealand initialisation for the jQuery UI date picker plugin. */
/* Based on the en-GB initialisation. */
jQuery(function($){
$.datepicker.regional['en-NZ'] = {
closeText: 'Done',
prevText: 'Prev',
nextText: 'Next',
currentText: 'Today',
monthNames: ['January','February','March','April','May','June',
'July','August','September','October','November','December'],
monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],
weekHeader: 'Wk',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['en-NZ']);
});

View File

@ -1 +0,0 @@
google.lang

View File

@ -37,7 +37,11 @@ VATToPay=VAT sells
VATReceived=VAT received
VATToCollect=VAT purchases
VATSummary=VAT Balance
LT2SummaryES=IRPF Balance
VATPaid=VAT paid
LT2PaidES=IRPF Paid
LT2CustomerES=IRPF sales
LT2SupplierES=IRPF purchases
VATCollected=VAT collected
ToPay=To pay
ToGet=To get back
@ -63,6 +67,9 @@ ListOfCustomerPayments=List of customer payments
ListOfSupplierPayments=List of supplier payments
DatePayment=Payment date
NewVATPayment=New VAT payment
newLT2PaymentES=New IRPF payment
LT2PaymentES=IRPF Payment
LT2PaymentsES=IRPF Payments
VATPayment=VAT Payment
VATPayments=VAT Payments
SocialContributionsPayments=Social contributions payments
@ -104,6 +111,7 @@ RulesResultDue=- Amounts shown are with all taxes included<br>- It includes outs
RulesResultInOut=- Amounts shown are with all taxes included<br>- It includes the real payments made on invoices, expenses and VAT. <br>- It is based on the payment dates of the invoices, expenses anf VAT.<br>
RulesCADue=- It includes the client's due invoices (except deposit invoices) whether they are paid or not. <br>- It is based on the validation date of these invoices. <br>
RulesCAIn=- It includes all the effective payments of invoices received from clients.<br>- It is based on the payment date of these invoices<br>
LT2ReportByCustomersInInputOutputModeES=Report by third party IRPF
VATReportByCustomersInInputOutputMode=Report by the customer VAT collected and paid (VAT receipt)
VATReportByCustomersInDueDebtMode=Report by the customer VAT collected and paid (VAT rate)
VATReportByQuartersInInputOutputMode=Report by rate of the VAT collected and paid (VAT receipt)

View File

@ -298,6 +298,8 @@ IncludedVAT=Included tax
HT=Net of tax
TTC=Inc. tax
VAT=Sales tax
LT1ES=RE
LT2ES=IRPF
VATRate=Tax Rate
Average=Average
Sum=Sum
@ -601,6 +603,7 @@ AttributeCode=Attribute code
OptionalFieldsSetup=Extra attributes setup
URLPhoto=Url of photo/logo
CreateDraft=Create draft
ClickToEdit=Click to edit
# Week day
Monday=Monday

View File

@ -1 +0,0 @@
google.lang

Some files were not shown because too many files have changed in this diff Show More