Merge branch 'develop_dolibarr' into develop

This commit is contained in:
Peter Fontaine
2013-10-14 22:37:20 +02:00
46 changed files with 474 additions and 112 deletions

View File

@@ -41,18 +41,18 @@ For users:
- New: A more responsive desgin for statistic box of home page.
- Qual: Implement same rule for return value of all command line scripts (0 when success, <>0 if error).
- New: [ task #1005 ] Adapting to Spanish legislation bill numbering
- New: [ task #1011 ] Now supplier order and invoice deal with payment terms and mode
- New: [ task #1014 ] Add option to recursivly add parent category
- New: [ task #1016 ] Can define a specific numbering for deposits
- New: [ task #918 ] Stock replenishment
- Fix: [ bug #992 ] Proforma invoices don't have a separated numeric count
- New : Add pdf link into supplier invoice list and supplier order list
- New : Genrate auto the PDF for supplier invoice
- New : Add category into filter webservice thirdparty method getListOfThirdParties
- New : Allow to define margin or mark rate during quoting, ordering, invoicing
- New : User permissions on margin module
- New : Add ref supplier into muscadet model
- New : Add ability to copy contact address to clipboard
- New: [ task #1011 ] Now supplier order and invoice deal with payment terms and mode.
- New: [ task #1014 ] Add option to recursivly add parent category.
- New: [ task #1016 ] Can define a specific numbering for deposits.
- New: [ task #918 ] Stock replenishment.
- Fix: [ bug #992 ] Proforma invoices don't have a separated numeric count.
- New : Add pdf link into supplier invoice list and supplier order list.
- New : Genrate auto the PDF for supplier invoice.
- New : Add category into filter webservice thirdparty method getListOfThirdParties.
- New : Allow to define margin or mark rate during quoting, ordering, invoicing.
- New : User permissions on margin module.
- New : Add ref supplier into muscadet model/
- New : Add ability to copy contact address to clipboard.
- New: Can use tag {mm} before {yy} even when there is a reset into numbering masks.
- New: [ task #1060 ] Register fields localtax(1|2)_type into details tables.
- New: [ task #923 ] Localtax support for ODT templates.
@@ -61,7 +61,8 @@ For users:
- New: Can send an email from thirdparty card.
- New: Can cancel holidays that were previously validated.
- Fix: [bug #1022] correct margin calculation for credit notes.
- New: Can choose contact on event (action com) creation, and filtred by thirdparty
- New: Can choose contact on event (action com) creation, and filtred by thirdparty.
- New: Add hidden option MAIN_FORCE_DEFAULT_STATE_ID.
For translators:
- Qual: Normalized sort order of all languages files with english reference files.

View File

@@ -0,0 +1 @@
http://en.wikipedia.org/wiki/VAT_identification_number

View File

@@ -57,6 +57,14 @@ if ($user->societe_id > 0)
$socid = $user->societe_id;
}
$object=new Facture($db);
// Load object
if ($facid > 0)
{
$ret=$object->fetch($facid);
}
// Initialize technical object to manage hooks of paiements. Note that conf->hooks_modules contains array array
$hookmanager = new HookManager($db);
$hookmanager->initHooks(array('paiementcard'));

View File

@@ -55,7 +55,7 @@ if ($action == 'builddoc')
$rap = new pdf_paiement($db);
$outputlangs = $langs;
if (! empty(GETPOST('lang_id')))
if (GETPOST('lang_id'))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang(GETPOST('lang_id'));

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
@@ -464,7 +464,7 @@ abstract class CommonObject
$sql.= " WHERE tc.element='".$this->element."'";
if ($activeonly == 1)
$sql.= " AND tc.active=1"; // only the active type
if (! empty($source)) $sql.= " AND tc.source='".$source."'";
$sql.= " ORDER by tc.".$order;
@@ -1112,9 +1112,9 @@ abstract class CommonObject
$row = $this->db->fetch_row($resql);
$rows[] = $row[0]; // Add parent line into array rows
$childrens = $this->getChildrenOfLine($row[0]);
if (! empty($children))
if (! empty($childrens))
{
foreach($children as $child)
foreach($childrens as $child)
{
array_push($rows, $child);
}
@@ -2621,7 +2621,7 @@ abstract class CommonObject
}
}
/* This is to show add lines */

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-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* 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>
@@ -800,7 +800,7 @@ class Form
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
if ($conf->global->SOCIETE_ADD_REF_IN_LIST) {
if (($obj->client) && (!empty($obj->code_client))) {
$label = $obj->code_client. ' - ';
@@ -814,7 +814,7 @@ class Form
{
$label=$obj->nom;
}
if ($showtype)
{
if ($obj->client || $obj->fournisseur) $label.=' (';
@@ -2484,9 +2484,9 @@ class Form
/**
* Show a confirmation HTML form or AJAX popup.
* Easiest way to use this is with useajax=1.
* If you use useajax='xxx', you must also add jquery code to trigger opening of box (with correct parameters)
* just after calling this method. For example:
* Easiest way to use this is with useajax=1.
* If you use useajax='xxx', you must also add jquery code to trigger opening of box (with correct parameters)
* just after calling this method. For example:
* print '<script type="text/javascript">'."\n";
* print 'jQuery(document).ready(function() {'."\n";
* print 'jQuery(".xxxlink").click(function(e) { jQuery("#aparamid").val(jQuery(this).attr("rel")); jQuery("#dialog-confirm-xxx").dialog("open"); return false; });'."\n";
@@ -2587,9 +2587,9 @@ class Form
$more.='</table>'."\n";
}
// JQUI method dialog is broken with jmobile, we use standard HTML.
// JQUI method dialog is broken with jmobile, we use standard HTML.
// Note: When using dol_use_jmobile, you must also check code for button use a GET url with action=xxx and output the confirm code only when action=xxx
if (! empty($conf->dol_use_jmobile)) $useajax=0;
if (! empty($conf->dol_use_jmobile)) $useajax=0;
if ($useajax && $conf->use_javascript_ajax)
{
@@ -3376,7 +3376,7 @@ class Form
// Disabled if seller is not subject to VAT
$disabled=false; $title='';
if (is_object($societe_vendeuse) && $societe_vendeuse->id == $mysoc->id && $societe_vendeuse->tva_assuj == "0")
if (is_object($societe_vendeuse) && $societe_vendeuse->id == $mysoc->id && $societe_vendeuse->tva_assuj == "0")
{
$title=' title="'.$langs->trans('VATIsNotUsed').'"';
$disabled=true;

View File

@@ -203,7 +203,7 @@ class FormCompany
* un code donnee mais dans ce cas, le champ pays differe).
* Ainsi les liens avec les departements se font sur un departement independemment de son nom.
*
* @param string $selected Code state preselected
* @param string $selected Code state preselected (mus be state id)
* @param string $country_codeid Country code or id: 0=list for all countries, otherwise country code or country rowid to show
* @param string $htmlname Id of department
* @return string String with HTML select
@@ -257,7 +257,8 @@ class FormCompany
}
}
if ($selected > 0 && $selected == $obj->rowid)
if ((! empty($selected) && $selected == $obj->rowid)
|| (empty($selected) && ! empty($conf->global->MAIN_FORCE_DEFAULT_STATE_ID) && $conf->global->MAIN_FORCE_DEFAULT_STATE_ID == $obj->rowid))
{
$out.= '<option value="'.$obj->rowid.'" selected="selected">';
}

View File

@@ -106,11 +106,12 @@ class Translate
// Array force long code from first part, even if long code is defined
$longforshort=array('ar'=>'ar_SA');
if (isset($longforshort[strtolower($langpart[0])])) $srclang=$longforshort[strtolower($langpart[0])];
else {
else if (! is_numeric($langpart[1])) { // Second part YY may be a numeric with some Chrome browser
$srclang=strtolower($langpart[0])."_".strtoupper($langpart[1]);
$longforlong=array('no_nb'=>'nb_NO');
if (isset($longforlong[strtolower($srclang)])) $srclang=$longforlong[strtolower($srclang)];
}
else $srclang=strtolower($langpart[0])."_".strtoupper($langpart[0]);
}
else { // If it's for a codetouse that is a short code xx
// Array to convert short lang code into long code.
@@ -787,11 +788,11 @@ class Translate
function get_translations_for_substitutions() {
$substitutionarray = array();
foreach($this->tab_translate as $code => $label) {
$substitutionarray['lang_'.$code] = $label;
}
return $substitutionarray;
}
}

View File

@@ -54,14 +54,16 @@ function dol_json_encode($elements)
//var_dump($num);
// determine type
if (is_numeric(key($elements)))
if (is_numeric(key($elements)) && key($elements) == 0)
{
// indexed (list)
$keysofelements=array_keys($elements); // Elements array mus have key that does not start with 0 and end with num-1, so we will use this later.
$output = '[';
for ($i = 0, $last = ($num - 1); isset($elements[$i]); ++$i)
for ($i = 0, $last = ($num - 1); $i < $num; $i++)
{
if (is_array($elements[$i]) || is_object($elements[$i])) $output.= json_encode($elements[$i]);
else $output .= _val($elements[$i]);
if (! isset($elements[$keysofelements[$i]])) continue;
if (is_array($elements[$keysofelements[$i]]) || is_object($elements[$keysofelements[$i]])) $output.= json_encode($elements[$keysofelements[$i]]);
else $output .= _val($elements[$keysofelements[$i]]);
if ($i !== $last) $output.= ',';
}
$output.= ']';

View File

@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
/* Copyright (C) 2010-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
@@ -65,7 +65,7 @@
{
if ($line->fk_product > 0) {
echo $form->textwithtooltip($text,$description,3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):''));
echo $form->textwithtooltip($text,$description,3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):''));
// Show range
echo get_date_range($line->date_start, $line->date_end);
@@ -78,14 +78,14 @@
} else {
if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow');
if ($type==1) $text = img_object($langs->trans('Service'),'service');
else $text = img_object($langs->trans('Product'),'product');
if (! empty($line->label)) {
$text.= ' <strong>'.$line->label.'</strong>';
echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):''));
echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):''));
} else {
if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow');
echo $text.' '.dol_htmlentitiesbr($line->description);
}

View File

@@ -51,9 +51,9 @@ $langs->load('propal');
$origin = GETPOST('origin','alpha')?GETPOST('origin','alpha'):'expedition'; // Example: commande, propal
$origin_id = GETPOST('id','int')?GETPOST('id','int'):'';
$id = $origin_id;
if (empty($origin_id)) $origin_id = GETPOST('origin_id','int'); // Id of order or propal
if (empty($origin_id)) $origin_id = GETPOST('object_id','int'); // Id of order or propal
$id = $origin_id;
$ref=GETPOST('ref','alpha');
// Security check
@@ -70,11 +70,6 @@ $hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty(
$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0));
$object = new Expedition($db);
// Load object
if ($id > 0 || ! empty($ref))
{
$ret=$object->fetch($id, $ref);
}
// Load object
if ($id > 0 || ! empty($ref))
@@ -95,8 +90,6 @@ if ($action == 'add')
{
$error=0;
$object = new Expedition($db);
$db->begin();
$object->note = GETPOST('note','alpha');

View File

@@ -301,3 +301,12 @@ ALTER TABLE llx_facture_fourn MODIFY COLUMN fk_cond_reglement integer NULL;
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (9,'COMPANY_SENTBYMAIL','Mails sent from third party card','Executed when you send email from third party card','societe',1);
create table llx_contrat_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@@ -0,0 +1,20 @@
-- ===================================================================
-- Copyright (C) 2013 Charles-Fr BENKE <charles.fr@benke.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 3 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/>.
--
-- ===================================================================
ALTER TABLE llx_contrat_extrafields ADD INDEX idx_contrat_extrafields (fk_object);

View File

@@ -0,0 +1,25 @@
-- ========================================================================
-- Copyright (C) 2013 Charles-Fr BENKE <charles.fr@benke.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 3 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_contrat_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@@ -104,7 +104,7 @@ ProfId3=Professional ID 3
ProfId4=Professional ID 4
ProfId5=Professional ID 5
ProfId6=Professional ID 6
ProfId1AR=Проф. Id едно (CUIT / Cuil)
ProfId1AR=Проф. Id едно (CUIL)
ProfId2AR=Проф. Id 2 (Revenu зверове)
ProfId3AR=-
ProfId4AR=-

View File

@@ -104,7 +104,7 @@ ProfId3=Professional ID 3
ProfId4=Professional ID 4
ProfId5=Professionel ID 5
# ProfId6=Professional ID 6
ProfId1AR=Prof Id 1 (CUIT / Cuil)
ProfId1AR=Prof Id 1 (CUIL)
ProfId2AR=Prof Id 2 (revenu Bestier)
ProfId3AR=-
ProfId4AR=-

View File

@@ -301,7 +301,7 @@ ProfId1NL=KVK nummer
ProfId2NL=-
ProfId3NL=-
ProfId4NL=-
ProfId1AR=Prof Id 1 (CUIT / Cuil)
ProfId1AR=Prof Id 1 (CUIL)
ProfId2AR=Prof Id 2 (Revenu Bestien)
ProfId3AR=-
ProfId4AR=-

View File

@@ -104,7 +104,7 @@ ProfId3=Professional ID 3
ProfId4=Professional ID 4
ProfId5=Professional ID 5
ProfId6=Professional ID 6
ProfId1AR=Prof Id 1 (CUIT / Cuil)
ProfId1AR=Prof Id 1 (CUIL)
ProfId2AR=Prof Id 2 (Revenu Bestien)
ProfId3AR=-
ProfId4AR=-

View File

@@ -127,6 +127,7 @@ ErrorDateMustBeBeforeToday=The date can not be greater than today
ErrorPaymentModeDefinedToWithoutSetup=A payment mode was set to type %s but setup of module Invoice was not completed to define information to show for this payment mode.
ErrorPHPNeedModule=Error, your PHP must have module <b>%s</b> installed to use this feature.
ErrorOpenIDSetupNotComplete=You setup Dolibarr config file to allow OpenID authentication, but URL of OpenID service is not defined into constant %s
ErrorWarehouseMustDiffers=Source and target warehouses must differs
# Warnings
WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined

View File

@@ -22,6 +22,7 @@ Language_es_AR=Spanish (Argentina)
Language_es_HN=Spanish (Honduras)
Language_es_MX=Spanish (Mexico)
Language_es_PY=Spanish (Paraguay)
Language_es_PE=Spanish (Peru)
Language_es_PR=Spanish (Puerto Rico)
Language_et_EE=Estonian
Language_fa_IR=Persian

View File

@@ -105,3 +105,6 @@ ReplenishmentOrdersDesc=This is list of all opened supplier orders
Replenishments=Replenishments
NbOfProductBeforePeriod=Quantity of product %s in stock before selected period (< %s)
NbOfProductAfterPeriod=Quantity of product %s in stock after selected period (> %s)
MassStockMovement=Mass stock movement
SelectProductInAndOutWareHouse=Select a product, a quantity, a source warehouse and a target warehouse, then click "Add". Once this is done for all required movements, click onto "Record Tranferts".
RecordMovement=Record transfert

View File

@@ -1,3 +1,6 @@
# Dolibarr language file - es_AR - companies
CHARSET=UTF-8
CompanyHasCreditNote=Este cliente tiene <b>%s %s</b> notas de crédito/anticipos disponibles
VATIntra=CUIT
VATIntraShort=CUIT
VATIntraVeryShort=CUIT

View File

@@ -21,6 +21,8 @@ Language_es_ES=Español
Language_es_AR=Español (Argentina)
Language_es_HN=Español (Honduras)
Language_es_MX=Español (México)
Language_es_PY=Español (Paraguay)
Language_es_PE=Español (Perú)
Language_es_PR=Español (Puerto Rico)
Language_et_EE=Estonio
Language_fa_IR=Persa
@@ -29,6 +31,7 @@ Language_fr_BE=Francés (Bélgica)
Language_fr_CA=Francés (Canadá)
Language_fr_CH=Francés (Suiza)
Language_fr_FR=Francés
Language_fr_NC=Francés (Nueva Caledonia)
Language_he_IL=Hebreo
Language_hu_HU=Húngaro
Language_is_IS=Islandés

View File

@@ -1,4 +1,7 @@
# Dolibarr language file - es_HN - companies
CHARSET=UTF-8
VATIsUsed=Sujeto a ISV
VATIsNotUsed=No sujeto a ISV
VATIsNotUsed=No sujeto a ISV
VATIntra=RTN
VATIntraShort=RTN
VATIntraVeryShort=RTN

View File

@@ -2,4 +2,7 @@
CHARSET=UTF-8
State=Estado
Town=Municipio
CompanyHasCreditNote=Este cliente tiene <b>%s %s</b> notas de crédito/anticipos disponibles
CompanyHasCreditNote=Este cliente tiene <b>%s %s</b> notas de crédito/anticipos disponibles
VATIntra=RFC
VATIntraShort=RFC
VATIntraVeryShort=RFC

View File

@@ -1,4 +1,7 @@
# Dolibarr language file - es_PU - companies
CHARSET=UTF-8
VATIsUsed=Sujeto a IGV
VATIsNotUsed=No sujeto a IGV
VATIsNotUsed=No sujeto a IGV
VATIntra=RUC
VATIntraShort=RUC
VATIntraVeryShort=RUC

View File

@@ -104,7 +104,7 @@ ProfId3=Professional ID 3
ProfId4=Professional ID 4
ProfId5=Professional ID 5
# ProfId6=Professional ID 6
ProfId1AR=Prof Id 1 (CUIT / Cuil)
ProfId1AR=Prof Id 1 (CUIL)
ProfId2AR=Prof Id 2 (Revenu brutes)
ProfId3AR=-
ProfId4AR=-

View File

@@ -104,7 +104,7 @@ ProfId3=Professional-tunnuksen 3
ProfId4=Professional-tunnuksen 4
ProfId5=Ammatillinen tunnus 5
# ProfId6=Professional ID 6
ProfId1AR=Prof Id 1 (CUIT / Cuil)
ProfId1AR=Prof Id 1 (CUIL)
ProfId2AR=Prof Id 2 (revenu brutes)
ProfId3AR=-
ProfId4AR=-

View File

@@ -127,6 +127,7 @@ ErrorDateMustBeBeforeToday=La date ne peut pas être supérieure à aujourd'hui
ErrorPaymentModeDefinedToWithoutSetup=Un mode de paiement a été défini de type %s mais la configuration du module Facture n'a pas été complété pour définir les informations afficher pour ce mode de paiment.
ErrorPHPNeedModule=Erreur, votre PHP doit avoir le module <b>%s</b> installé pour utiliser cette fonctionnalité.
ErrorOpenIDSetupNotComplete=Vous avez configuré Dolibarr pour accepter l'authentication OpenID, mais l'URL du service OpenID n'est pas défini dans la constante %s
ErrorWarehouseMustDiffers=Les entrepôts source et destination doivent être différents
# Warnings
WarningMandatorySetupNotComplete=Les informations de configuration obligatoire doivent être renseignées

View File

@@ -22,6 +22,7 @@ Language_es_AR=Espagnol (Argentine)
Language_es_HN=Espagnol (Honduras)
Language_es_MX=Espagnol (Mexique)
Language_es_PY=Espagnol (Paraguay)
Language_es_PE=Espagnol (Peru)
Language_es_PR=Espagnol (Puerto Rico)
Language_et_EE=Estonien
Language_fa_IR=Perse

View File

@@ -105,3 +105,6 @@ ReplenishmentOrdersDesc=Voici la liste des commandes fournisseurs en cours
Replenishments=Réapprovisionnement
NbOfProductBeforePeriod=Quantité du produit <b>%s</b> en stock avant la période sélectionnée (< <b>%s</b>)
NbOfProductAfterPeriod=Quantité du produit <b>%s</b> en stock après la période sélectionnée (> <b>%s</b>)
MassStockMovement=Mouvement de stock en masse
SelectProductInAndOutWareHouse=Sélectionner un produit, une quantité à transférer, un entrepôt source et destination et cliquer sur ajouter. Une fois tous les mouvements enregistrés, cliquer sur "Enregistrer transferts".
RecordMovement=Enregistrer transferts

View File

@@ -104,7 +104,7 @@ ProfId3=Szakmai ID 3
ProfId4=Szakmai ID 4
ProfId5=Szakmai ID 5
# ProfId6=Professional ID 6
ProfId1AR=Prof ID 1 (CUIT / CUIL)
ProfId1AR=Prof ID 1 (CUIL)
ProfId2AR=Prof ID 2 (revenu barmok)
ProfId3AR=-
ProfId4AR=-

View File

@@ -104,7 +104,7 @@ ProfId3=Professional ID 3
ProfId4=Professional ID 4
ProfId5=Professional ID 5
# ProfId6=Professional ID 6
ProfId1AR=Prof Id 1 (CUIT / CUIL)
ProfId1AR=Prof Id 1 (CUIL)
ProfId2AR=Prof Id 2 (Revenu brutes)
ProfId3AR=-
ProfId4AR=-

View File

@@ -104,7 +104,7 @@ ProfId3=Professional ID 3
ProfId4=Professional ID 4
ProfId5=Profesjonell ID 5
# ProfId6=Professional ID 6
ProfId1AR=Prof Id 1 (CUIT / Cuil)
ProfId1AR=Prof Id 1 (CUIL)
ProfId2AR=Prof ID 2 (inntekter på brutes)
ProfId3AR=-
ProfId4AR=-

View File

@@ -104,7 +104,7 @@ ProfId3=Professioneel ID 3
ProfId4=Professioneel ID 4
ProfId5=Professionele ID 5
# ProfId6=Professional ID 6
ProfId1AR=Prof Id 1 (Cuit / Cuil)
ProfId1AR=Prof Id 1 (CUIL)
ProfId2AR=Prof Id 2 (Revenu woestelingen)
ProfId3AR=-
ProfId4AR=-

View File

@@ -104,7 +104,7 @@ ProfId3=Profesjonalne ID 3
ProfId4=Profesjonalne ID 4
ProfId5=Profesjonalny ID 5
# ProfId6=Professional ID 6
ProfId1AR=Prof Id 1 (CUIT / Cuil)
ProfId1AR=Prof Id 1 (CUIL)
ProfId2AR=Id Prof 2 (bydlęta Revenu)
ProfId3AR=-
ProfId4AR=-

View File

@@ -104,7 +104,7 @@ ProfId3=ID profesional 3
ProfId4=ID profesional 4
ProfId5=Professional ID 5
# ProfId6=Professional ID 6
ProfId1AR=Prof Id 1 (CUIT / CUIL)
ProfId1AR=Prof Id 1 (CUIL)
ProfId2AR=Id Prof 2 (brutos Revenu)
ProfId3AR=-
ProfId4AR=-
@@ -224,9 +224,9 @@ ProfId3RU=Prof Id 3 (KPP)
ProfId4RU=Prof Id 4 (OKPO)
ProfId5RU=-
# ProfId6RU=-
VATIntra=IVA Intracomunitário
VATIntraShort=IVA Intracomunitário Mínimo
VATIntraVeryShort=IVA Intracomunitário Nulo
VATIntra=CNPJ
VATIntraShort=CNPJ
VATIntraVeryShort=CNPJ
VATIntraSyntaxIsValid=Sintaxe Válida
VATIntraValueIsValid=Valor Válido
ProspectCustomer=Cliente Potencial/Cliente

View File

@@ -104,7 +104,7 @@ ProfId3=Professional ID 3
ProfId4=Professional ID 4
ProfId5=Professional ID 5
ProfId6=Profesional ID 6
ProfId1AR=Id-ul prof. 1 (CUIT / Cuil)
ProfId1AR=Id-ul prof. 1 (CUIL)
ProfId2AR=Id-ul prof. 2 (Venituri brute)
ProfId3AR=-
ProfId4AR=-

View File

@@ -104,7 +104,7 @@ ProfId3=Профессиональный ID 3
ProfId4=Профессиональный ID 4
ProfId5=Профессиональный ID 5
# ProfId6=Professional ID 6
ProfId1AR=Проф Id 1 (CUIT / Cuil)
ProfId1AR=Проф Id 1 (CUIL)
ProfId2AR=Проф Id 2 (Revenu скоты)
ProfId3AR=-
ProfId4AR=-

View File

@@ -104,7 +104,7 @@ ProfId3=Professionella ID 3
ProfId4=Professionella ID 4
ProfId5=Professionell ID 5
# ProfId6=Professional ID 6
ProfId1AR=Prof Id 1 (CUIT / Cuil)
ProfId1AR=Prof Id 1 (CUIL)
ProfId2AR=Prof Id 2 (Revenu sällar)
ProfId3AR=-
ProfId4AR=-

View File

@@ -104,7 +104,7 @@ ProfId3=Profesyonel ID 3
ProfId4=Profesyonel ID 4
ProfId5=Profesyonel ID 5
ProfId6=Professional ID 6
ProfId1AR=Prof Id 1 (CUIT / Cuil)
ProfId1AR=Prof Id 1 (CUIL)
ProfId2AR=Prof Id 2 (revenu canavarlar)
ProfId3AR=-
ProfId4AR=-

View File

@@ -0,0 +1,247 @@
<?php
/* Copyright (C) 2013 Laurent Destaileur <ely@users.sourceforge.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (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/product/stock/massstockmove.php
* \ingroup stock
* \brief This page allows to select several products, then incoming warehouse and
* outgoing warehouse and create all stock movements for this.
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$langs->load("products");
$langs->load("stocks");
$langs->load("orders");
// Security check
if ($user->societe_id) {
$socid = $user->societe_id;
}
$result=restrictedArea($user,'produit|service');
//checks if a product has been ordered
$action = GETPOST('action','alpha');
$id_product = GETPOST('productid', 'productid');
$id_sw = GETPOST('id_sw', 'id_sw');
$id_tw = GETPOST('id_tw', 'id_tw');
$qty = GETPOST('qty');
$idline = GETPOST('idline');
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
if (!$sortfield) {
$sortfield = 'p.ref';
}
if (!$sortorder) {
$sortorder = 'ASC';
}
$limit = $conf->liste_limit;
$offset = $limit * $page ;
$listofdata=array();
if (! empty($_SESSION['massstockmove'])) $listofdata=dol_json_decode($_SESSION['massstockmove'],true);
/*
* Actions
*/
if ($action == 'addline')
{
if (! ($id_product > 0))
{
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Product")),'errors');
}
if (! $qty)
{
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Qty")),'errors');
}
if (! ($id_sw > 0))
{
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("WarehouseSource")),'errors');
}
if (! ($id_tw > 0))
{
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("WarehouseTarget")),'errors');
}
if ($id_sw > 0 && $id_tw == $id_sw)
{
$error++;
$langs->load("errors");
setEventMessage($langs->trans("ErrorWarehouseMustDiffers"),'errors');
}
if (! $error)
{
$id=count($listofdata);
$listofdata[$id]=array('id'=>$id, 'id_product'=>$id_product, 'qty'=>$qty, 'id_sw'=>$id_sw, 'id_tw'=>$id_tw);
$_SESSION['massstockmove']=dol_json_encode($listofdata);
}
}
if ($action == 'delline' && $idline != '')
{
if (! empty($listofdata[$idline])) unset($listofdata[$idline]);
var_dump($listofdata);
var_dump(dol_json_encode($listofdata)); exit;
if (count($listofdata) > 0) $_SESSION['massstockmove']=dol_json_encode($listofdata);
else unset($_SESSION['massstockmove']);
}
if ($action == 'createmovement' && isset($_POST['valid']))
{
}
/*
* View
*/
$form=new Form($db);
$formproduct=new FormProduct($db);
$productstatic = new Product($db);
$warehousestatics = new Entrepot($db);
$warehousestatict = new Entrepot($db);
$title = $langs->trans('MassMovement');
llxHeader('', $title, $helpurl, '');
print_fiche_titre($langs->trans("MassStockMovement")).'<br><br>';
print $langs->trans("SelectProductInAndOutWareHouse").'<br>';
// Form to add a line
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formulaire">';
print '<input type="hidden" name="token" value="' .$_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="addline">';
print '<table class="liste" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans('Product'),$_SERVER["PHP_SELF"],'',$param,'','',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Qty'),$_SERVER["PHP_SELF"],'',$param,'','align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('WarehouseSource'),$_SERVER["PHP_SELF"],'',$param,'','align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('WarehouseTarget'),$_SERVER["PHP_SELF"],'',$param,'','align="center"',$sortfield,$sortorder);
print_liste_field_titre('');
print '</tr>';
print '<tr>';
// Product
print '<td>';
$filtertype=0;
if (! empty($conf->global->STOCK_SUPPORTS_SERVICES)) $filtertype='';
print $form->select_produits($id_product,'productid',$filtertype);
print '</td>';
// Qty
print '<td align="center"><input type="input" size="4" class="flat" name="qty" value="'.$qty.'"></td>';
// In warehouse
print '<td align="center">';
print $formproduct->selectWarehouses($id_sw,'id_sw','',1);
print '</td>';
// Out warehouse
print '<td align="center">';
print $formproduct->selectWarehouses($id_tw,'id_tw','',1);
print '</td>';
// Button to add line
print '<td align="right"><input type="submit" class="button" name="addline" value="'.dol_escape_htmltag($langs->trans("Add")).'"></td>';
print '</tr>';
print '</table>';
print '</form>';
print '<br>';
// List movement prepared
print '<table class="liste" width="100%">';
// Lignes des titres
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans('ProductRef'),$_SERVER["PHP_SELF"],'p.ref',$param,'','',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('ProductLabel'),$_SERVER["PHP_SELF"],'p.label',$param,'','',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Qty'),$_SERVER["PHP_SELF"],'',$param,'','align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('WarehouseSource'),$_SERVER["PHP_SELF"],'',$param,'','align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('WarehouseTarget'),$_SERVER["PHP_SELF"],'',$param,'','align="right"',$sortfield,$sortorder);
print_liste_field_titre('');
print '</tr>';
$var=false;
foreach($listofdata as $key => $val)
{
$var=!$var;
$productstatic->fetch($val['id_product']);
$warehousestatics->fetch($val['id_sw']);
$warehousestatict->fetch($val['id_tw']);
print '<tr '.$bc[$var].'>';
print '<td>'.$productstatic->getNomUrl(1).'</td>';
print '<td>';
$oldref=$productstatic->ref;
$productstatic->ref=$productstatic->label;
print $productstatic->getNomUrl(1);
$productstatic->ref=$oldref;
print '</td>';
print '<td align="right">'.$val['qty'].'</td>';
print '<td align="right">';
print $warehousestatics->getNomUrl(1);
print '</td>';
print '<td align="right">';
print $warehousestatict->getNomUrl(1);
print '</td>';
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=delline&idline='.$val['id'].'">'.img_delete($langs->trans("Remove")).'</a></td>';
print '</tr>';
}
print '</table>';
// Generate
$value=$langs->trans("RecordMovement");
print '<div class="center"><input class="button" type="submit" name="valid" value="'.$value.'"></div>';
print '</form>';
llxFooter();
$db->close();
?>

View File

@@ -460,14 +460,14 @@ if ($resql)
print '</form>';
$arrayofuniqueproduct=array();
$var=True;
while ($i < min($num,$conf->liste_limit))
{
$objp = $db->fetch_object($resql);
$arrayofuniqueproduct[$objp->rowid]=$objp->produit;
$var=!$var;
print "<tr ".$bc[$var].">";
// Id movement
@@ -517,7 +517,7 @@ if ($resql)
if (count($arrayofuniqueproduct) == 1)
{
$productidselected=0;
foreach ($arrayofuniqueproduct as $key => $val)
foreach ($arrayofuniqueproduct as $key => $val)
{
$productidselected=$key;
$productlabelselected=$val;
@@ -533,16 +533,16 @@ if ($resql)
//print '<td class="liste_total" colspan="6" align="right">';
print ': '.$balancebefore;
print "<br>\n";
//print '</td></tr>';
//print '</td></tr>';
//print '<tr class="total"><td class="liste_total">';
print $langs->trans("NbOfProductAfterPeriod", $productlabelselected, dol_print_date($dateafter,'day','gmt'));
//print '</td>';
//print '<td class="liste_total" colspan="6" align="right">';
print ': '.$balanceafter;
print "<br>\n";
//print '</td></tr>';
//print '</td></tr>';
}
}
else

View File

@@ -18,7 +18,7 @@
/**
* \file htdocs/product/stock/replenish.php
* \ingroup produit
* \ingroup stock
* \brief Page to list stocks to replenish
*/
@@ -75,8 +75,7 @@ if (isset($_POST['button_removefilter']) || isset($_POST['valid']))
$salert = '';
}
//orders creation
//TODO: could go in the lib
// Create orders
if ($action == 'order' && isset($_POST['valid']))
{
$linecount = GETPOST('linecount', 'int');
@@ -240,7 +239,7 @@ $i = 0;
$helpurl = 'EN:Module_Stocks_En|FR:Module_Stock|';
$helpurl .= 'ES:M&oacute;dulo_Stocks';
llxHeader('', $title, $helpurl, $title);
llxHeader('', $title, $helpurl, '');
$head = array();
$head[0][0] = DOL_URL_ROOT.'/product/stock/replenish.php';
@@ -285,7 +284,7 @@ if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha')) {
);
}
print '<form action="replenish.php" method="post" name="formulaire">'.
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formulaire">'.
'<input type="hidden" name="token" value="' .$_SESSION['newtoken'] . '">'.
'<input type="hidden" name="sortfield" value="' . $sortfield . '">'.
'<input type="hidden" name="sortorder" value="' . $sortorder . '">'.
@@ -304,7 +303,7 @@ print '<tr class="liste_titre">'.
'<td><input type="checkbox" onClick="toggle(this)" /></td>';
print_liste_field_titre(
$langs->trans('Ref'),
'replenish.php',
$_SERVER["PHP_SELF"],
'p.ref',
$param,
'',
@@ -314,7 +313,7 @@ print_liste_field_titre(
);
print_liste_field_titre(
$langs->trans('Label'),
'replenish.php',
$_SERVER["PHP_SELF"],
'p.label',
$param,
'',
@@ -326,7 +325,7 @@ if (!empty($conf->service->enabled) && $type == 1)
{
print_liste_field_titre(
$langs->trans('Duration'),
'replenish.php',
$_SERVER["PHP_SELF"],
'p.duration',
$param,
'',
@@ -337,7 +336,7 @@ if (!empty($conf->service->enabled) && $type == 1)
}
print_liste_field_titre(
$langs->trans('DesiredStock'),
'replenish.php',
$_SERVER["PHP_SELF"],
'p.desiredstock',
$param,
'',
@@ -355,7 +354,7 @@ else
}
print_liste_field_titre(
$stocklabel,
'replenish.php',
$_SERVER["PHP_SELF"],
'stock_physique',
$param,
'',
@@ -365,7 +364,7 @@ print_liste_field_titre(
);
print_liste_field_titre(
$langs->trans('Ordered'),
'replenish.php',
$_SERVER["PHP_SELF"],
'',
$param,
'',
@@ -375,7 +374,7 @@ print_liste_field_titre(
);
print_liste_field_titre(
$langs->trans('StockToBuy'),
'replenish.php',
$_SERVER["PHP_SELF"],
'',
$param,
'',
@@ -385,7 +384,7 @@ print_liste_field_titre(
);
print_liste_field_titre(
$langs->trans('Supplier'),
'replenish.php',
$_SERVER["PHP_SELF"],
'',
$param,
'',
@@ -427,7 +426,7 @@ while ($i < min($num, $limit))
{
$objp = $db->fetch_object($resql);
if ($conf->global->STOCK_SUPPORTS_SERVICES || $objp->fk_product_type == 0)
if (! empty($conf->global->STOCK_SUPPORTS_SERVICES) || $objp->fk_product_type == 0)
{
// Multilangs
if (! empty($conf->global->MAIN_MULTILANGS))
@@ -541,14 +540,14 @@ while ($i < min($num, $limit))
}
$i++;
}
$value = $langs->trans("CreateOrders");
print '</table>'.
'</div>'.
'<table width="100%">'.
'<tr><td align="center">'.
'<input class="button" type="submit" name="valid" value="' . $value . '">'.
'</td></tr></table>'.
'</form>';
$value=$langs->trans("CreateOrders");
print '<div class="center"><input class="button" type="submit" name="valid" value="'.$value.'"></div>';
print '</form>';
if ($num > $conf->liste_limit)
{
@@ -591,6 +590,10 @@ if ($num > $conf->liste_limit)
$db->free($resql);
dol_fiche_end();
// TODO Replace this with jquery
print '
<script type="text/javascript">
function toggle(source)

View File

@@ -18,9 +18,10 @@
/**
* \file htdocs/product/stock/replenishorders.php
* \ingroup produit
* \ingroup stock
* \brief Page to list replenishment orders
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
@@ -37,10 +38,18 @@ $langs->load("orders");
if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'produit|service');
/*
* View
*/
$helpurl = 'EN:Module_Stocks_En|FR:Module_Stock|';
$helpurl .= 'ES:M&oacute;dulo_Stocks';
$texte = $langs->trans('ReplenishmentOrders');
llxHeader('', $texte, $helpurl, $texte);
llxHeader('', $texte, $helpurl, '');
$head = array();
$head[0][0] = DOL_URL_ROOT.'/product/stock/replenish.php';
$head[0][1] = $langs->trans('Status');
@@ -150,7 +159,7 @@ if ($resql)
print_barre_liste(
'',
$page,
'replenishorders.php',
$_SERVER["PHP_SELF"],
'',
$sortfield,
$sortorder,
@@ -159,7 +168,7 @@ if ($resql)
0,
''
);
print '<form action="replenishorders.php" method="GET">'.
print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">'.
'<table class="noborder" width="100%">'.
'<tr class="liste_titre">';
print_liste_field_titre(
@@ -308,6 +317,8 @@ if ($resql)
'</form>';
$db->free($resql);
dol_fiche_end();
}
else
{
@@ -315,4 +326,6 @@ else
}
llxFooter();
$db->close();
?>

View File

@@ -130,22 +130,35 @@ class JsonLibTest extends PHPUnit_Framework_TestCase
$this->savlangs=$langs;
$this->savdb=$db;
// Do a test with an array starting with 0
$arraytotest=array(0=>array('key'=>1,'value'=>'PRODREF','label'=>'Product ref with é and special chars \\ \' "'));
$arrayencodedexpected='[{"key":1,"value":"PRODREF","label":"Product ref with \u00e9 and special chars \\\\ \' \""}]';
$encoded=json_encode($arraytotest);
//var_dump($encoded);
$this->assertEquals('[{"key":1,"value":"PRODREF","label":"Product ref with \u00e9 and special chars \\\\ \' \""}]',$encoded);
$this->assertEquals($arrayencodedexpected,$encoded);
$decoded=json_decode($encoded,true);
//var_dump($decoded);
$this->assertEquals($arraytotest,$decoded);
$this->assertEquals($arraytotest,$decoded,'test for json_xxx');
$encoded=dol_json_encode($arraytotest);
//var_dump($encoded);
$this->assertEquals('[{"key":1,"value":"PRODREF","label":"Product ref with \u00e9 and special chars \\\\ \' \""}]',$encoded);
$this->assertEquals($arrayencodedexpected,$encoded);
$decoded=dol_json_decode($encoded,true);
//var_dump($decoded);
$this->assertEquals($arraytotest,$decoded);
$this->assertEquals($arraytotest,$decoded,'test for dol_json_xxx');
// Same test but array start with 2 instead of 0
$arraytotest=array(2=>array('key'=>1,'value'=>'PRODREF','label'=>'Product ref with é and special chars \\ \' "'));
$arrayencodedexpected='{"2":{"key":1,"value":"PRODREF","label":"Product ref with \u00e9 and special chars \\\\ \' \""}}';
$encoded=json_encode($arraytotest);
$this->assertEquals($arrayencodedexpected,$encoded);
$decoded=json_decode($encoded,true);
$this->assertEquals($arraytotest,$decoded,'test for json_xxx');
$encoded=dol_json_encode($arraytotest);
$this->assertEquals($arrayencodedexpected,$encoded);
$decoded=dol_json_decode($encoded,true);
$this->assertEquals($arraytotest,$decoded,'test for dol_json_xxx');
// Test with object
$now=gmmktime(12,0,0,1,1,1970);
$objecttotest=new stdClass();
$objecttotest->property1='abc';